[demo] Updated adg-demo to use named pairs where possible
[adg.git] / shave-libtool.in
blob1f3a720c1714ce0a853ad7847c9f2eb0cde68bd7
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 real libtool to use
15 LIBTOOL="$1"
16 shift
18 # if 1, don't print anything, the underlaying wrapper will do it
19 pass_though=0
21 # scan the arguments, keep the right ones for libtool, and discover the mode
22 preserved_args=
23 while test "$#" -gt 0; do
24 opt="$1"
25 shift
27 case $opt in
28 --mode=*)
29 mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
30 preserved_args="$preserved_args $opt"
32 -o)
33 lt_output="$1"
34 preserved_args="$preserved_args $opt"
37 preserved_args="$preserved_args $opt"
39 esac
40 done
42 case "$mode" in
43 compile)
44 # shave will be called and print the actual CC/CXX/LINK line
45 preserved_args="$preserved_args --shave-mode=$mode"
46 pass_though=1
48 link)
49 preserved_args="$preserved_args --shave-mode=$mode"
50 Q=" LINK "
53 # let's u
54 # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
56 esac
58 lt_unmangle "$lt_output"
59 output=$last_result
61 if test -z $V; then
62 if test $pass_though -eq 0; then
63 echo "$Q$output"
65 $LIBTOOL --silent $preserved_args
66 else
67 echo $LIBTOOL $preserved_args
68 $LIBTOOL $preserved_args