3
# Copyright (c) 2009, Damien Lespiau <damien.lespiau@gmail.com>
5
# Permission is hereby granted, free of charge, to any person
6
# obtaining a copy of this software and associated documentation
7
# files (the "Software"), to deal in the Software without
8
# restriction, including without limitation the rights to use,
9
# copy, modify, merge, publish, distribute, sublicense, and/or sell
10
# copies of the Software, and to permit persons to whom the
11
# Software is furnished to do so, subject to the following
14
# The above copyright notice and this permission notice shall be
15
# included in all copies or substantial portions of the Software.
17
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
# OTHER DEALINGS IN THE SOFTWARE.
28
if test -z "$SED" ; then
34
last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
37
# the real libtool to use
41
# if 1, don't print anything, the underlaying wrapper will do it
44
# scan the arguments, keep the right ones for libtool, and discover the mode
47
# have we seen the --tag option of libtool in the command line ?
50
while test "$#" -gt 0; do
56
mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
57
preserved_args="$preserved_args $opt"
61
preserved_args="$preserved_args $opt"
65
preserved_args="$preserved_args $opt"
68
preserved_args="$preserved_args $opt"
75
# shave will be called and print the actual CC/CXX/LINK line
76
preserved_args="$preserved_args --shave-mode=$mode"
80
preserved_args="$preserved_args --shave-mode=$mode"
85
# echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
89
lt_unmangle "$lt_output"
92
# automake does not add a --tag switch to its libtool invocation when
93
# assembling a .s file and rely on libtool to infer the right action based
94
# on the compiler name. As shave is using CC to hook a wrapper, libtool gets
95
# confused. Let's detect these cases and add a --tag=CC option.
97
if test $tag_seen -eq 0 -a x"$mode" = xcompile; then
102
if test $pass_though -eq 0; then
105
$LIBTOOL --silent $tag $preserved_args
107
echo $LIBTOOL $tag $preserved_args
108
$LIBTOOL $tag $preserved_args