~awn-core/awn/trunk-rewrite

« back to all changes in this revision

Viewing changes to shave/shave-libtool.in

  • Committer: Mark Lee
  • Date: 2009-03-02 06:50:31 UTC
  • Revision ID: bzr@lazymalevolence.com-20090302065031-lvvzkqyq12x2oaqg
Build system: Add shave support (generates much less verbose autotools output).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
# the real libtool to use
 
15
LIBTOOL="$1"
 
16
shift
 
17
 
 
18
# if 1, don't print anything, the underlaying wrapper will do it
 
19
pass_though=0
 
20
 
 
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
 
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
 
40
done
 
41
 
 
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
 
47
    ;;
 
48
link)
 
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
    ;;
 
56
esac
 
57
 
 
58
lt_unmangle "$lt_output"
 
59
output=$last_result
 
60
 
 
61
if test -z $V; then
 
62
    if test $pass_though -eq 0; then
 
63
        echo "$Q$output"
 
64
    fi
 
65
    $LIBTOOL --silent $preserved_args
 
66
else
 
67
    echo $LIBTOOL $preserved_args
 
68
    $LIBTOOL $preserved_args
 
69
fi