Build GObject introspection data for clutter-gtk
[clutter-gtk] / build / autotools / shave-libtool.in
1 #!/bin/sh
2
3 # we need sed
4 SED=@SED@
5 if test -z "$SED" ; then
6 SED=sed
7 fi
8
9 lt_unmangle ()
10 {
11    last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
12 }
13
14 tempval=`echo $1 | sed s/\'//g`
15 if test "x$tempval" = "x$SHELL"; then
16    shift
17 fi
18 tempval=`echo $1 | sed s/\'//g`
19 LIBTOOL="$tempval"
20 shift
21
22 # if 1, don't print anything, the underlaying wrapper will do it
23 pass_though=0
24
25 # scan the arguments, keep the right ones for libtool, and discover the mode
26 preserved_args=
27 while test "$#" -gt 0; do
28     opt="$1"
29     shift
30
31     case $opt in
32     --mode=*)
33         mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
34         preserved_args="$preserved_args $opt"
35         ;;
36     -o)
37         lt_output="$1"
38         preserved_args="$preserved_args $opt"
39         ;;
40     *)
41         preserved_args="$preserved_args $opt"
42         ;;
43       esac
44 done
45
46 case "$mode" in
47 compile)
48     # shave will be called and print the actual CC/CXX/LINK line
49     preserved_args="$preserved_args --shave-mode=$mode"
50     pass_though=1
51     ;;
52 link)
53     preserved_args="$preserved_args --shave-mode=$mode"
54     Q="  LINK  "
55     ;;
56 *)
57     # let's u
58     # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
59     ;;
60 esac
61
62 lt_unmangle "$lt_output"
63 output=$last_result
64
65 if test -z $V; then
66     if test $pass_though -eq 0; then
67         echo "$Q$output"
68     fi
69     $LIBTOOL --silent $preserved_args
70 else
71     echo $LIBTOOL $preserved_args
72     $LIBTOOL $preserved_args
73 fi