root/trunk/rubberband/shave.in

Revision 287, 1.2 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 tool to wrap (cc, cxx, ar, ranlib, ..)
15tool="$1"
16shift
17
18# the reel tool (to call)
19REEL_TOOL="$1"
20shift
21
22pass_through=0
23preserved_args=
24while test "$#" -gt 0; do
25    opt="$1"
26    shift
27
28    case $opt in
29    --shave-mode=*)
30        mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
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
42# mode=link is handled in the libtool wrapper
43case "$mode,$tool" in
44link,*)
45    pass_through=1
46    ;;
47*,cxx)
48    Q="  CXX   "
49    ;;
50*,cc)
51    Q="  CC    "
52    ;;
53*,fc)
54    Q="  FC    "
55    ;;
56*,f77)
57    Q="  F77   "
58    ;;
59*,objc)
60    Q="  OBJC   "
61    ;;
62*,*)
63    # should not happen
64    Q="  CC    "
65    ;;
66esac
67
68lt_unmangle "$lt_output"
69output=$last_result
70
71if test -z $V; then
72    if test $pass_through -eq 0; then
73        echo "$Q$output"
74    fi
75    $REEL_TOOL $preserved_args
76else
77    echo $REEL_TOOL $preserved_args
78    $REEL_TOOL $preserved_args
79fi
Note: See TracBrowser for help on using the browser.