]> icculus.org git repositories - divverent/nexuiz.git/blob - misc/buildfiles/copystrip/strip
build scripts: debug infos are kept in an extra zip file
[divverent/nexuiz.git] / misc / buildfiles / copystrip / strip
1 #!/bin/sh
2 #THIS-IS-COPYSTRIP
3
4 # locate original 'strip' utility
5
6 stripfile=$1
7
8 p=$PATH
9 while [ -n "$p" ]; do
10         item=${p%%:*}/strip
11         if [ -x "$item" ]; then
12                 case "`sed -n 2p "$item"`" in
13                         \#THIS-IS-COPYSTRIP)
14                                 echo >&2 "Found myself in $item"
15                                 ;;
16                         *)
17                                 echo >&2 "Using $item..."
18                                 cp "$stripfile" "$stripfile-withdebug"
19                                 exec "$item" "$stripfile"
20                                 ;;
21                 esac
22         fi
23         case "$p" in
24                 *:*)
25                         p=${p#*:}
26                         ;;
27                 *)
28                         echo >&2 "No strip found in PATH."
29                         exit 1
30                         ;;
31         esac
32 done