root/trunk/rubberband/shave-libtool.in

Revision 287, 1.3 KB (checked in by ath, 3 years ago)

Merge shave support and update the usual autotools stuff.

Line 
1#!/bin/sh
2
3# we need sed
4SED=@SED@
5if test -z "$SED" ; then
6SED=sed
7fi
8
9lt_unmangle ()
10{
11   last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
12}
13
14# the real libtool to use
15LIBTOOL="$1"
16shift
17
18# if 1, don't print anything, the underlaying wrapper will do it
19pass_though=0
20
21# scan the arguments, keep the right ones for libtool, and discover the mode
22preserved_args=
23while test "$#" -gt 0; do
24    opt="$1"
25    shift
26
27    case $opt in
28    --mode=*)
29        mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
30        preserved_args="$preserved_args $opt"
31        ;;
32    -o)
33        lt_output="$1"
34        preserved_args="$preserved_args $opt"
35        ;;
36    *)
37        preserved_args="$preserved_args $opt"
38        ;;
39      esac
40done
41
42case "$mode" in
43compile)
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
47    ;;
48link)
49    preserved_args="$preserved_args --shave-mode=$mode"
50    Q="  LINK  "
51    ;;
52*)
53    # let's u
54    # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
55    ;;
56esac
57
58lt_unmangle "$lt_output"
59output=$last_result
60
61if test -z $V; then
62    if test $pass_though -eq 0; then
63        echo "$Q$output"
64    fi
65    $LIBTOOL --silent $preserved_args
66else
67    echo $LIBTOOL $preserved_args
68    $LIBTOOL $preserved_args
69fi
Note: See TracBrowser for help on using the browser.