Use pa_assert_se() when the containing code has side effects.
[pulseaudio-raopUDP/pulseaudio-raop-alac.git] / shave.in
blobdc46ec960694dff396ad7098c04c146aaec2d843
1 #!/bin/sh
3 # we need sed
4 SED=@SED@
5 if test -z "$SED" ; then
6 SED=sed
7 fi
9 lt_unmangle ()
11 last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_]\*_la-##'`
14 # the tool to wrap (cc, cxx, ar, ranlib, ..)
15 tool="$1"
16 shift
18 # the reel tool (to call)
19 REEL_TOOL="$1"
20 shift
22 pass_through=0
23 preserved_args=
24 while test "$#" -gt 0; do
25 opt="$1"
26 shift
28 case $opt in
29 --shave-mode=*)
30 mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
32 -o)
33 lt_output="$1"
34 preserved_args="$preserved_args $opt"
37 preserved_args="$preserved_args $opt"
39 esac
40 done
42 # mode=link is handled in the libtool wrapper
43 case "$mode,$tool" in
44 link,*)
45 pass_through=1
47 *,cxx)
48 Q=" CXX "
50 *,cc)
51 Q=" CC "
53 *,*)
54 # should not happen
55 Q=" CC "
57 esac
59 lt_unmangle "$lt_output"
60 output=$last_result
62 if test -z $V; then
63 if test $pass_through -eq 0; then
64 echo "$Q$output"
66 $REEL_TOOL $preserved_args
67 else
68 echo $REEL_TOOL $preserved_args
69 $REEL_TOOL $preserved_args