1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5
# 2007, 2008 Free Software Foundation, Inc.
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8
# This program is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 2 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
# General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
# As a special exception to the GNU General Public License, if you
23
# distribute this file as part of a program that contains a
24
# configuration script generated by Autoconf, you may include it under
25
# the same distribution terms that you use for the rest of that program.
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30
# is ksh but when the shell is invoked as "sh" and the current value of
31
# the _XPG environment variable is not equal to 1 (one), the special
32
# positional parameter $0, within a function call, is the name of the
36
# The name of this program:
37
progname=`echo "$progpath" | $SED $basename`
47
TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
49
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
50
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
53
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
54
# is contrary to our usage. Disable this feature.
55
alias -g '${1+"$@"}'='"$@"'
58
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
60
BIN_SH=xpg4; export BIN_SH # for Tru64
61
DUALCASE=1; export DUALCASE # for MKS sh
63
# Check that we have a working $echo.
64
if test "X$1" = X--no-reexec; then
65
# Discard the --no-reexec flag, and continue.
67
elif test "X$1" = X--fallback-echo; then
68
# Avoid inline document here, it may be left over
70
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
71
# Yippee, $echo works!
74
# Restart under the correct shell, and then maybe $echo will work.
75
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
78
if test "X$1" = X--fallback-echo; then
79
# used as fallback echo
88
help="Try \`$progname --help' for more information."
89
magic="%%%MAGIC variable%%%"
94
# Sed substitution that helps us do robust quoting. It backslashifies
95
# metacharacters that are still active within double-quoted strings.
96
Xsed="${SED}"' -e 1s/^X//'
97
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
98
# test EBCDIC or ASCII
99
case `echo X|tr X '\101'` in
100
A) # ASCII based system
101
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
103
NL2SP='tr \015\012 \040\040'
105
*) # EBCDIC based system
107
NL2SP='tr \r\n \100\100'
112
# Only set LANG and LC_ALL to C if already set.
113
# These must not be set unconditionally because not all systems understand
114
# e.g. LANG=C (notably SCO).
115
# We save the old values to restore during execute mode.
117
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
119
eval "if test \"\${$lt_var+set}\" = set; then
120
save_$lt_var=\$$lt_var
121
lt_env=\"$lt_var=\$$lt_var \$lt_env\"
127
if test -n "$lt_env"; then
131
# Make sure IFS has a sensible default
136
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
137
$echo "$modename: not configured to build any kind of library" 1>&2
138
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
153
lo2o="s/\\.lo\$/.${objext}/"
154
o2lo="s/\\.${objext}\$/.lo/"
158
#####################################
159
# Shell function definitions:
160
# This seems to be the best place for them
162
# func_mktempdir [string]
163
# Make a temporary directory that won't clash with other running
164
# libtool processes, and avoids race conditions if possible. If
165
# given, STRING is the basename for that directory.
168
my_template="${TMPDIR-/tmp}/${1-$progname}"
170
if test "$run" = ":"; then
171
# Return a directory name, but don't create it in dry-run mode
172
my_tmpdir="${my_template}-$$"
175
# If mktemp works, use that first and foremost
176
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
178
if test ! -d "$my_tmpdir"; then
179
# Failing that, at least try and use $RANDOM to avoid a race
180
my_tmpdir="${my_template}-${RANDOM-0}$$"
182
save_mktempdir_umask=`umask`
185
umask $save_mktempdir_umask
188
# If we're not in dry-run mode, bomb out on failure
189
test -d "$my_tmpdir" || {
190
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
195
$echo "X$my_tmpdir" | $Xsed
199
# func_win32_libid arg
200
# return the library type of file 'arg'
202
# Need a lot of goo to handle *both* DLLs and import libs
203
# Has to be a shell function in order to 'eat' the argument
204
# that is supplied when $file_magic_command is called.
207
win32_libid_type="unknown"
208
win32_fileres=`file -L $1 2>/dev/null`
209
case $win32_fileres in
210
*ar\ archive\ import\ library*) # definitely import
211
win32_libid_type="x86 archive import"
213
*ar\ archive*) # could be an import, or static
214
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
215
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
216
win32_nmres=`eval $NM -f posix -A $1 | \
225
import*) win32_libid_type="x86 archive import";;
226
*) win32_libid_type="x86 archive static";;
231
win32_libid_type="x86 DLL"
233
*executable*) # but shell scripts are "executable" too...
234
case $win32_fileres in
235
*MS\ Windows\ PE\ Intel*)
236
win32_libid_type="x86 DLL"
241
$echo $win32_libid_type
246
# Infer tagged configuration to use if any are available and
247
# if one wasn't chosen via the "--tag" command line option.
248
# Only attempt this if the compiler in the base compile
249
# command doesn't match the default compiler.
250
# arg is usually of the form 'gcc ...'
253
if test -n "$available_tags" && test -z "$tagname"; then
257
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
261
CC_quoted="$CC_quoted $arg"
264
# Blanks in the command may have been stripped by the calling shell,
265
# but not from the CC environment variable when configure was run.
266
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
267
# Blanks at the start of $base_compile will cause this to fail
268
# if we don't check for them as well.
270
for z in $available_tags; do
271
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
272
# Evaluate the configuration.
273
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
276
# Double-quote args containing other shell metacharacters.
278
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
282
CC_quoted="$CC_quoted $arg"
284
# user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
285
trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
286
# and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
287
extendcc=${host}-${CC}
288
# and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
289
# (Gentoo-specific hack because we always export $CHOST)
290
mungedcc=${CHOST-${host}}-${trimedcc}
292
"cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
293
"gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
296
"$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
297
"$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
298
"$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
299
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
300
# The compiler in the base compile command matches
301
# the one in the tagged configuration.
302
# Assume this is the tagged configuration we want.
309
# If $tagname still isn't set, then no tagged configuration
310
# was found and let the user know that the "--tag" command
311
# line option must be used.
312
if test -z "$tagname"; then
313
$echo "$modename: unable to infer tagged configuration"
314
$echo "$modename: specify a tag with \`--tag'" 1>&2
317
# $echo "$modename: using $tagname tagged configuration"
325
# func_extract_an_archive dir oldlib
326
func_extract_an_archive ()
328
f_ex_an_ar_dir="$1"; shift
329
f_ex_an_ar_oldlib="$1"
331
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
332
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
333
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
336
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
341
# func_extract_archives gentop oldlib ...
342
func_extract_archives ()
344
my_gentop="$1"; shift
352
$show "${rm}r $my_gentop"
353
$run ${rm}r "$my_gentop"
354
$show "$mkdir $my_gentop"
355
$run $mkdir "$my_gentop"
357
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
361
for my_xlib in $my_oldlibs; do
362
# Extract the objects.
364
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
365
*) my_xabs=`pwd`"/$my_xlib" ;;
367
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
370
case " $extracted_archives " in
372
extracted_serial=`expr $extracted_serial + 1`
373
my_xlib_u=lt$extracted_serial-$my_xlib ;;
377
extracted_archives="$extracted_archives $my_xlib_u"
378
my_xdir="$my_gentop/$my_xlib_u"
380
$show "${rm}r $my_xdir"
381
$run ${rm}r "$my_xdir"
382
$show "$mkdir $my_xdir"
383
$run $mkdir "$my_xdir"
385
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
390
$show "Extracting $my_xabs"
391
# Do not bother doing anything if just a dry run
392
if test -z "$run"; then
393
darwin_orig_dir=`pwd`
394
cd $my_xdir || exit $?
395
darwin_archive=$my_xabs
397
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
398
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
399
if test -n "$darwin_arches"; then
400
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
402
$show "$darwin_base_archive has multiple architectures $darwin_arches"
403
for darwin_arch in $darwin_arches ; do
404
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
405
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
406
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
407
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
409
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
410
done # $darwin_arches
411
## Okay now we have a bunch of thin objects, gotta fatten them up :)
412
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
415
for darwin_file in $darwin_filelist; do
416
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
417
lipo -create -output "$darwin_file" $darwin_files
418
done # $darwin_filelist
420
cd "$darwin_orig_dir"
422
cd "$darwin_orig_dir"
423
func_extract_an_archive "$my_xdir" "$my_xabs"
428
func_extract_an_archive "$my_xdir" "$my_xabs"
431
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
433
func_extract_archives_result="$my_oldobjs"
435
# End of Shell function definitions
436
#####################################
439
eval std_shrext=\"$shrext_cmds\"
443
# Parse our command line options once, thoroughly.
444
while test "$#" -gt 0
450
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
454
# If the previous option needs an argument, assign it.
455
if test -n "$prev"; then
458
execute_dlfiles="$execute_dlfiles $arg"
462
preserve_args="${preserve_args}=$arg"
464
# Check whether tagname contains only valid characters
467
$echo "$progname: invalid tag name: $tagname" 1>&2
474
# Don't test for the "default" C tag, as we know, it's there, but
475
# not specially marked.
478
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
479
taglist="$taglist $tagname"
480
# Evaluate the configuration.
481
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
483
$echo "$progname: ignoring unknown tag $tagname" 1>&2
498
# Have we seen a non-optional argument yet?
506
$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
508
Copyright (C) 2008 Free Software Foundation, Inc.
509
This is free software; see the source for copying conditions. There is NO
510
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
515
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
516
# Now print the configurations for the tags.
517
for tagname in $taglist; do
518
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
524
$echo "$progname: enabling shell trace mode"
526
preserve_args="$preserve_args $arg"
535
if test "$build_libtool_libs" = yes; then
536
$echo "enable shared libraries"
538
$echo "disable shared libraries"
540
if test "$build_old_libs" = yes; then
541
$echo "enable static libraries"
543
$echo "disable static libraries"
548
--finish) mode="finish" ;;
550
--mode) prevopt="--mode" prev=mode ;;
551
--mode=*) mode="$optarg" ;;
553
--preserve-dup-deps) duplicate_deps="yes" ;;
557
preserve_args="$preserve_args $arg"
563
preserve_args="$preserve_args --tag"
566
set tag "$optarg" ${1+"$@"}
569
preserve_args="$preserve_args --tag"
578
$echo "$modename: unrecognized option \`$arg'" 1>&2
590
if test -n "$prevopt"; then
591
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
596
case $disable_libs in
600
build_libtool_libs=no
604
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
608
# If this variable is set in any of the actions, the command in it
609
# will be execed at the end. This prevents here-documents from being
610
# left over by shells.
613
if test -z "$show_help"; then
615
# Infer the operation mode.
616
if test -z "$mode"; then
617
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
618
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
620
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
632
*db | *dbx | *strace | *truss)
642
# If we have no mode, but dlfiles were specified, then do execute mode.
643
test -n "$execute_dlfiles" && mode=execute
645
# Just use the default operation mode.
646
if test -z "$mode"; then
647
if test -n "$nonopt"; then
648
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
650
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
657
# Only execute mode is allowed to have -dlopen flags.
658
if test -n "$execute_dlfiles" && test "$mode" != execute; then
659
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
664
# Change the help message to a mode-specific one.
666
help="Try \`$modename --help --mode=$mode' for more information."
668
# These modes are in order of execution frequency so that they run quickly.
670
# libtool compile mode
672
modename="$modename: compile"
673
# Get the compilation command and the source file.
675
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
686
# do not "continue". Instead, add this to base_compile
698
# Accept any command-line options.
701
if test -n "$libobj" ; then
702
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
709
-static | -prefer-pic | -prefer-non-pic)
720
arg_mode=arg # the next one goes into the "base_compile" arg list
721
continue # The current "srcfile" will either be retained or
722
;; # replaced later. I would guess that would be a bug.
725
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
727
save_ifs="$IFS"; IFS=','
731
# Double-quote args containing other shell metacharacters.
732
# Many Bourne shells cannot handle close brackets correctly
733
# in scan sets, so we specify it separately.
735
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
739
lastarg="$lastarg $arg"
742
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
744
# Add the arguments to base_compile.
745
base_compile="$base_compile $lastarg"
750
# Accept the current argument as the source file.
751
# The previous "srcfile" becomes the current argument.
758
esac # case $arg_mode
760
# Aesthetically quote the previous argument.
761
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
764
# Double-quote args containing other shell metacharacters.
765
# Many Bourne shells cannot handle close brackets correctly
766
# in scan sets, and some SunOS ksh mistreat backslash-escaping
767
# in scan sets (worked around with variable expansion),
768
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
769
# at all, so we specify them separately.
770
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
771
lastarg="\"$lastarg\""
775
base_compile="$base_compile $lastarg"
780
$echo "$modename: you must specify an argument for -Xcompile"
784
$echo "$modename: you must specify a target with \`-o'" 1>&2
788
# Get the name of the library object.
789
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
793
# Recognize several different file suffixes.
794
# If the user specifies -o file.o, it is replaced with file.lo
804
*.class) xform=class ;;
807
*.[fF][09]?) xform=[fF][09]. ;;
809
*.java) xform=java ;;
814
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
817
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
819
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
824
func_infer_tag $base_compile
826
for arg in $later; do
845
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
847
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
848
qlibobj="\"$qlibobj\"" ;;
850
test "X$libobj" != "X$qlibobj" \
851
&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
852
&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
853
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
854
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
855
if test "X$xdir" = "X$obj"; then
860
lobj=${xdir}$objdir/$objname
862
if test -z "$base_compile"; then
863
$echo "$modename: you must specify a compilation command" 1>&2
868
# Delete any leftover library objects.
869
if test "$build_old_libs" = yes; then
870
removelist="$obj $lobj $libobj ${libobj}T"
872
removelist="$lobj $libobj ${libobj}T"
876
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
878
# On Cygwin there's no "real" PIC flag so we must build both object types
880
cygwin* | mingw* | pw32* | os2*)
884
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
885
# non-PIC code in shared libraries is not supported
889
# Calculate the filename of the output object if compiler does
890
# not support -o with -c
891
if test "$compiler_c_o" = no; then
892
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
893
lockfile="$output_obj.lock"
894
removelist="$removelist $output_obj $lockfile"
895
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
902
# Lock this critical section if it is needed
903
# We use this script file to make the link, it avoids creating a new file
904
if test "$need_locks" = yes; then
905
until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
906
$show "Waiting for $lockfile to be removed"
909
elif test "$need_locks" = warn; then
910
if test -f "$lockfile"; then
912
*** ERROR, $lockfile exists and contains:
913
`cat $lockfile 2>/dev/null`
915
This indicates that another process is trying to use the same
916
temporary object file, and libtool could not work around it because
917
your compiler does not support \`-c' and \`-o' together. If you
918
repeat this compilation, it may succeed, by chance, but you had better
919
avoid parallel builds (make -j) in this platform, or get a better
925
$echo "$srcfile" > "$lockfile"
928
if test -n "$fix_srcfile_path"; then
929
eval srcfile=\"$fix_srcfile_path\"
931
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
933
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
934
qsrcfile="\"$qsrcfile\"" ;;
937
$run $rm "$libobj" "${libobj}T"
939
# Create a libtool object file (analogous to a ".la" file),
940
# but don't create it if we're doing a dry run.
941
test -z "$run" && cat > ${libobj}T <<EOF
942
# $libobj - a libtool object file
943
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
945
# Please DO NOT delete this file!
946
# It is necessary for linking the library.
948
# Name of the PIC object.
951
# Only build a PIC object if we are building libtool libraries.
952
if test "$build_libtool_libs" = yes; then
953
# Without this assignment, base_compile gets emptied.
954
fbsd_hideous_sh_bug=$base_compile
956
if test "$pic_mode" != no; then
957
command="$base_compile $qsrcfile $pic_flag"
959
# Don't build PIC code
960
command="$base_compile $qsrcfile"
963
if test ! -d "${xdir}$objdir"; then
964
$show "$mkdir ${xdir}$objdir"
965
$run $mkdir ${xdir}$objdir
967
if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
972
if test -z "$output_obj"; then
973
# Place PIC objects in $objdir
974
command="$command -o $lobj"
977
$run $rm "$lobj" "$output_obj"
980
if $run eval $lt_env "$command"; then :
982
test -n "$output_obj" && $run $rm $removelist
986
if test "$need_locks" = warn &&
987
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
989
*** ERROR, $lockfile contains:
990
`cat $lockfile 2>/dev/null`
992
but it should contain:
995
This indicates that another process is trying to use the same
996
temporary object file, and libtool could not work around it because
997
your compiler does not support \`-c' and \`-o' together. If you
998
repeat this compilation, it may succeed, by chance, but you had better
999
avoid parallel builds (make -j) in this platform, or get a better
1002
$run $rm $removelist
1006
# Just move the object if needed, then go on to compile the next one
1007
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1008
$show "$mv $output_obj $lobj"
1009
if $run $mv $output_obj $lobj; then :
1012
$run $rm $removelist
1017
# Append the name of the PIC object to the libtool object file.
1018
test -z "$run" && cat >> ${libobj}T <<EOF
1019
pic_object='$objdir/$objname'
1023
# Allow error messages only from the first compilation.
1024
if test "$suppress_opt" = yes; then
1025
suppress_output=' >/dev/null 2>&1'
1028
# No PIC object so indicate it doesn't exist in the libtool
1030
test -z "$run" && cat >> ${libobj}T <<EOF
1036
# Only build a position-dependent object if we build old libraries.
1037
if test "$build_old_libs" = yes; then
1038
if test "$pic_mode" != yes; then
1039
# Don't build PIC code
1040
command="$base_compile $qsrcfile"
1042
command="$base_compile $qsrcfile $pic_flag"
1044
if test "$compiler_c_o" = yes; then
1045
command="$command -o $obj"
1048
# Suppress compiler output if we already did a PIC compilation.
1049
command="$command$suppress_output"
1050
$run $rm "$obj" "$output_obj"
1052
if $run eval $lt_env "$command"; then :
1054
$run $rm $removelist
1058
if test "$need_locks" = warn &&
1059
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1061
*** ERROR, $lockfile contains:
1062
`cat $lockfile 2>/dev/null`
1064
but it should contain:
1067
This indicates that another process is trying to use the same
1068
temporary object file, and libtool could not work around it because
1069
your compiler does not support \`-c' and \`-o' together. If you
1070
repeat this compilation, it may succeed, by chance, but you had better
1071
avoid parallel builds (make -j) in this platform, or get a better
1074
$run $rm $removelist
1078
# Just move the object if needed
1079
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1080
$show "$mv $output_obj $obj"
1081
if $run $mv $output_obj $obj; then :
1084
$run $rm $removelist
1089
# Append the name of the non-PIC object the libtool object file.
1090
# Only append if the libtool object file exists.
1091
test -z "$run" && cat >> ${libobj}T <<EOF
1092
# Name of the non-PIC object.
1093
non_pic_object='$objname'
1097
# Append the name of the non-PIC object the libtool object file.
1098
# Only append if the libtool object file exists.
1099
test -z "$run" && cat >> ${libobj}T <<EOF
1100
# Name of the non-PIC object.
1106
$run $mv "${libobj}T" "${libobj}"
1108
# Unlock the critical section if it was locked
1109
if test "$need_locks" != no; then
1110
$run $rm "$lockfile"
1118
modename="$modename: link"
1120
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1121
# It is impossible to link a dll without this setting, and
1122
# we shouldn't force the makefile maintainer to figure out
1123
# which system we are compiling for in order to pass an extra
1124
# flag for every libtool invocation.
1125
# allow_undefined=no
1127
# FIXME: Unfortunately, there are problems with the above when trying
1128
# to make a dll which has undefined symbols, in which case not
1129
# even a static library is built. For now, we need to specify
1130
# -no-undefined on the libtool link line when we can be certain
1131
# that all symbols are satisfied, otherwise we get a static library.
1138
libtool_args="$nonopt"
1139
base_compile="$nonopt $@"
1140
compile_command="$nonopt"
1141
finalize_command="$nonopt"
1154
lib_search_path=`pwd`
1163
export_symbols_regex=
1171
notinst_path= # paths that contain not-installed libtool libraries
1172
precious_files_regex=
1173
prefer_static_libs=no
1185
single_module="${wl}-single_module"
1187
func_infer_tag $base_compile
1189
# We need to know -static, to get the right output filenames.
1193
-all-static | -static | -static-libtool-libs)
1196
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1197
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1199
if test -n "$link_static_flag"; then
1200
dlopen_self=$dlopen_self_static
1202
prefer_static_libs=yes
1205
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1206
dlopen_self=$dlopen_self_static
1208
prefer_static_libs=built
1210
-static-libtool-libs)
1211
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1212
dlopen_self=$dlopen_self_static
1214
prefer_static_libs=yes
1217
build_libtool_libs=no
1224
# See if our shared archives depend on static archives.
1225
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1227
# Go through the arguments, transforming them on the way.
1228
while test "$#" -gt 0; do
1232
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1233
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1237
libtool_args="$libtool_args $qarg"
1239
# If the previous option needs an argument, assign it.
1240
if test -n "$prev"; then
1243
compile_command="$compile_command @OUTPUT@"
1244
finalize_command="$finalize_command @OUTPUT@"
1250
if test "$preload" = no; then
1251
# Add the symbol object into the linking commands.
1252
compile_command="$compile_command @SYMFILE@"
1253
finalize_command="$finalize_command @SYMFILE@"
1257
*.la | *.lo) ;; # We handle these cases below.
1259
if test "$dlself" = no; then
1267
if test "$prev" = dlprefiles; then
1269
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1279
if test "$prev" = dlfiles; then
1280
dlfiles="$dlfiles $arg"
1282
dlprefiles="$dlprefiles $arg"
1290
export_symbols="$arg"
1291
if test ! -f "$arg"; then
1292
$echo "$modename: symbol file \`$arg' does not exist"
1299
export_symbols_regex="$arg"
1304
inst_prefix_dir="$arg"
1309
precious_files_regex="$arg"
1319
if test -f "$arg"; then
1322
for fil in `cat $save_arg`
1324
# moreargs="$moreargs $fil"
1326
# A libtool-controlled object.
1328
# Check to see that this really is a libtool object.
1329
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1334
# If there is no directory component, then add one.
1336
*/* | *\\*) . $arg ;;
1340
if test -z "$pic_object" || \
1341
test -z "$non_pic_object" ||
1342
test "$pic_object" = none && \
1343
test "$non_pic_object" = none; then
1344
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1348
# Extract subdirectory from the argument.
1349
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1350
if test "X$xdir" = "X$arg"; then
1356
if test "$pic_object" != none; then
1357
# Prepend the subdirectory the object is found in.
1358
pic_object="$xdir$pic_object"
1360
if test "$prev" = dlfiles; then
1361
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1362
dlfiles="$dlfiles $pic_object"
1366
# If libtool objects are unsupported, then we need to preload.
1371
# CHECK ME: I think I busted this. -Ossama
1372
if test "$prev" = dlprefiles; then
1373
# Preload the old-style object.
1374
dlprefiles="$dlprefiles $pic_object"
1379
libobjs="$libobjs $pic_object"
1384
if test "$non_pic_object" != none; then
1385
# Prepend the subdirectory the object is found in.
1386
non_pic_object="$xdir$non_pic_object"
1388
# A standard non-PIC object
1389
non_pic_objects="$non_pic_objects $non_pic_object"
1390
if test -z "$pic_object" || test "$pic_object" = none ; then
1391
arg="$non_pic_object"
1394
# If the PIC object exists, use it instead.
1395
# $xdir was prepended to $pic_object above.
1396
non_pic_object="$pic_object"
1397
non_pic_objects="$non_pic_objects $non_pic_object"
1400
# Only an error if not doing a dry-run.
1401
if test -z "$run"; then
1402
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1407
# Extract subdirectory from the argument.
1408
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1409
if test "X$xdir" = "X$arg"; then
1415
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1416
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1417
libobjs="$libobjs $pic_object"
1418
non_pic_objects="$non_pic_objects $non_pic_object"
1423
$echo "$modename: link input file \`$save_arg' does not exist"
1431
# We need an absolute path.
1433
[\\/]* | [A-Za-z]:[\\/]*) ;;
1435
$echo "$modename: only absolute run-paths are allowed" 1>&2
1439
if test "$prev" = rpath; then
1442
*) rpath="$rpath $arg" ;;
1447
*) xrpath="$xrpath $arg" ;;
1454
compiler_flags="$compiler_flags $qarg"
1456
compile_command="$compile_command $qarg"
1457
finalize_command="$finalize_command $qarg"
1461
linker_flags="$linker_flags $qarg"
1462
compiler_flags="$compiler_flags $wl$qarg"
1464
compile_command="$compile_command $wl$qarg"
1465
finalize_command="$finalize_command $wl$qarg"
1469
linker_flags="$linker_flags $qarg"
1470
compiler_flags="$compiler_flags $qarg"
1472
compile_command="$compile_command $qarg"
1473
finalize_command="$finalize_command $qarg"
1481
darwin_framework|darwin_framework_skip)
1482
test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1483
compile_command="$compile_command $arg"
1484
finalize_command="$finalize_command $arg"
1489
eval "$prev=\"\$arg\""
1494
fi # test -n "$prev"
1500
if test -n "$link_static_flag"; then
1501
compile_command="$compile_command $link_static_flag"
1502
finalize_command="$finalize_command $link_static_flag"
1508
# FIXME: remove this flag sometime in the future.
1509
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1533
-export-symbols | -export-symbols-regex)
1534
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1535
$echo "$modename: more than one -exported-symbols argument is not allowed"
1538
if test "X$arg" = "X-export-symbols"; then
1546
-framework|-arch|-isysroot)
1548
*" ${arg} ${1} "* | *" ${arg} ${1} "*)
1549
prev=darwin_framework_skip ;;
1550
*) compiler_flags="$compiler_flags $arg"
1551
prev=darwin_framework ;;
1553
compile_command="$compile_command $arg"
1554
finalize_command="$finalize_command $arg"
1563
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1564
# so, if we see these flags be careful not to treat them like -L
1566
case $with_gcc/$host in
1567
no/*-*-irix* | /*-*-irix*)
1568
compile_command="$compile_command $arg"
1569
finalize_command="$finalize_command $arg"
1576
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1577
# We need an absolute path.
1579
[\\/]* | [A-Za-z]:[\\/]*) ;;
1581
absdir=`cd "$dir" && pwd`
1582
if test -z "$absdir"; then
1583
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1585
notinst_path="$notinst_path $dir"
1593
deplibs="$deplibs -L$dir"
1594
lib_search_path="$lib_search_path $dir"
1598
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1599
testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1600
case :$dllsearchpath: in
1602
*) dllsearchpath="$dllsearchpath:$dir";;
1604
case :$dllsearchpath: in
1605
*":$testbindir:"*) ;;
1606
*) dllsearchpath="$dllsearchpath:$testbindir";;
1614
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1616
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1617
# These systems don't actually have a C or math library (as such)
1621
# These systems don't actually have a C library (as such)
1622
test "X$arg" = "X-lc" && continue
1624
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1625
# Do not include libc due to us having libc/libc_r.
1626
test "X$arg" = "X-lc" && continue
1628
*-*-rhapsody* | *-*-darwin1.[012])
1629
# Rhapsody C and math libraries are in the System framework
1630
deplibs="$deplibs -framework System"
1633
*-*-sco3.2v5* | *-*-sco5v6*)
1634
# Causes problems with __ctype
1635
test "X$arg" = "X-lc" && continue
1637
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1638
# Compiler inserts libc in the correct place for threads to work
1639
test "X$arg" = "X-lc" && continue
1642
elif test "X$arg" = "X-lc_r"; then
1644
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1645
# Do not include libc_r directly, use -pthread flag.
1650
deplibs="$deplibs $arg"
1654
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1655
# classes, name mangling, and exception handling.
1657
compile_command="$compile_command $arg"
1658
compiler_flags="$compiler_flags $arg"
1659
finalize_command="$finalize_command $arg"
1664
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1665
compiler_flags="$compiler_flags $arg"
1666
compile_command="$compile_command $arg"
1667
finalize_command="$finalize_command $arg"
1672
single_module="${wl}-multi_module"
1681
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1682
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1683
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1684
# +DA*, +DD* enable 64-bit mode on the HP compiler
1685
# -q* pass through compiler args for the IBM compiler
1686
# -m* pass through architecture-specific compiler args for GCC
1687
# -m*, -t[45]*, -txscale* pass through architecture-specific
1688
# compiler args for GCC
1689
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1690
# -F/path gives path to uninstalled frameworks, gcc on darwin
1691
# @file GCC response files
1692
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
1693
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
1695
# Unknown arguments in both finalize_command and compile_command need
1696
# to be aesthetically quoted because they are evaled later.
1697
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1699
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1703
compile_command="$compile_command $arg"
1704
finalize_command="$finalize_command $arg"
1705
compiler_flags="$compiler_flags $arg"
1721
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
1722
# The PATH hackery in wrapper scripts is required on Windows
1723
# and Darwin in order for the loader to find any dlls it needs.
1724
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1725
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1728
*) no_install=yes ;;
1745
-precious-files-regex)
1766
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1767
# We need an absolute path.
1769
[\\/]* | [A-Za-z]:[\\/]*) ;;
1771
$echo "$modename: only absolute run-paths are allowed" 1>&2
1777
*) xrpath="$xrpath $dir" ;;
1782
-static | -static-libtool-libs)
1783
# The effects of -static are defined in a previous loop.
1784
# We used to do the same as -all-static on platforms that
1785
# didn't have a PIC flag, but the assumption that the effects
1786
# would be equivalent was wrong. It would break on at least
1787
# Digital Unix and AIX.
1807
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1809
save_ifs="$IFS"; IFS=','
1810
for flag in $args; do
1813
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1818
compiler_flags="$compiler_flags $flag"
1821
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1825
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1827
save_ifs="$IFS"; IFS=','
1828
for flag in $args; do
1831
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1836
compiler_flags="$compiler_flags $wl$flag"
1837
linker_flags="$linker_flags $flag"
1840
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1858
# Some other compiler flag.
1860
# Unknown arguments in both finalize_command and compile_command need
1861
# to be aesthetically quoted because they are evaled later.
1862
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1864
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1871
# A standard object.
1876
# A libtool-controlled object.
1878
# Check to see that this really is a libtool object.
1879
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1884
# If there is no directory component, then add one.
1886
*/* | *\\*) . $arg ;;
1890
if test -z "$pic_object" || \
1891
test -z "$non_pic_object" ||
1892
test "$pic_object" = none && \
1893
test "$non_pic_object" = none; then
1894
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1898
# Extract subdirectory from the argument.
1899
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1900
if test "X$xdir" = "X$arg"; then
1906
if test "$pic_object" != none; then
1907
# Prepend the subdirectory the object is found in.
1908
pic_object="$xdir$pic_object"
1910
if test "$prev" = dlfiles; then
1911
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1912
dlfiles="$dlfiles $pic_object"
1916
# If libtool objects are unsupported, then we need to preload.
1921
# CHECK ME: I think I busted this. -Ossama
1922
if test "$prev" = dlprefiles; then
1923
# Preload the old-style object.
1924
dlprefiles="$dlprefiles $pic_object"
1929
libobjs="$libobjs $pic_object"
1934
if test "$non_pic_object" != none; then
1935
# Prepend the subdirectory the object is found in.
1936
non_pic_object="$xdir$non_pic_object"
1938
# A standard non-PIC object
1939
non_pic_objects="$non_pic_objects $non_pic_object"
1940
if test -z "$pic_object" || test "$pic_object" = none ; then
1941
arg="$non_pic_object"
1944
# If the PIC object exists, use it instead.
1945
# $xdir was prepended to $pic_object above.
1946
non_pic_object="$pic_object"
1947
non_pic_objects="$non_pic_objects $non_pic_object"
1950
# Only an error if not doing a dry-run.
1951
if test -z "$run"; then
1952
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1957
# Extract subdirectory from the argument.
1958
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1959
if test "X$xdir" = "X$arg"; then
1965
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1966
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1967
libobjs="$libobjs $pic_object"
1968
non_pic_objects="$non_pic_objects $non_pic_object"
1975
deplibs="$deplibs $arg"
1976
old_deplibs="$old_deplibs $arg"
1981
# A libtool-controlled library.
1983
if test "$prev" = dlfiles; then
1984
# This library was specified with -dlopen.
1985
dlfiles="$dlfiles $arg"
1987
elif test "$prev" = dlprefiles; then
1988
# The library was specified with -dlpreopen.
1989
dlprefiles="$dlprefiles $arg"
1992
deplibs="$deplibs $arg"
1997
# Some other compiler argument.
1999
# Unknown arguments in both finalize_command and compile_command need
2000
# to be aesthetically quoted because they are evaled later.
2001
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2003
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2010
# Now actually substitute the argument into the commands.
2011
if test -n "$arg"; then
2012
compile_command="$compile_command $arg"
2013
finalize_command="$finalize_command $arg"
2015
done # argument parsing loop
2017
if test -n "$prev"; then
2018
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2023
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2024
eval arg=\"$export_dynamic_flag_spec\"
2025
compile_command="$compile_command $arg"
2026
finalize_command="$finalize_command $arg"
2030
# calculate the name of the file, without its directory
2031
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2032
libobjs_save="$libobjs"
2034
if test -n "$shlibpath_var"; then
2035
# get the directories listed in $shlibpath_var
2036
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2040
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2041
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2043
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2044
if test "X$output_objdir" = "X$output"; then
2045
output_objdir="$objdir"
2047
output_objdir="$output_objdir/$objdir"
2049
# Create the object directory.
2050
if test ! -d "$output_objdir"; then
2051
$show "$mkdir $output_objdir"
2052
$run $mkdir $output_objdir
2054
if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2059
# Determine the type of output
2062
$echo "$modename: you must specify an output file" 1>&2
2066
*.$libext) linkmode=oldlib ;;
2067
*.lo | *.$objext) linkmode=obj ;;
2068
*.la) linkmode=lib ;;
2069
*) linkmode=prog ;; # Anything else should be a program.
2073
*cygwin* | *mingw* | *pw32*)
2074
# don't eliminate duplications in $postdeps and $predeps
2075
duplicate_compiler_generated_deps=yes
2078
duplicate_compiler_generated_deps=$duplicate_deps
2084
# Find all interdependent deplibs by searching for libraries
2085
# that are linked more than once (e.g. -la -lb -la)
2086
for deplib in $deplibs; do
2087
if test "X$duplicate_deps" = "Xyes" ; then
2089
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2092
libs="$libs $deplib"
2095
if test "$linkmode" = lib; then
2096
libs="$predeps $libs $compiler_lib_search_path $postdeps"
2098
# Compute libraries that are listed more than once in $predeps
2099
# $postdeps and mark them as special (i.e., whose duplicates are
2100
# not to be eliminated).
2102
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2103
for pre_post_dep in $predeps $postdeps; do
2104
case "$pre_post_deps " in
2105
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2107
pre_post_deps="$pre_post_deps $pre_post_dep"
2116
need_relink=no # whether we're linking any uninstalled libtool libraries
2117
notinst_deplibs= # not-installed libtool libraries
2121
for file in $dlfiles $dlprefiles; do
2125
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2137
passes="conv scan dlopen dlpreopen link"
2142
for pass in $passes; do
2143
if test "$linkmode,$pass" = "lib,link" ||
2144
test "$linkmode,$pass" = "prog,scan"; then
2148
if test "$linkmode" = prog; then
2150
dlopen) libs="$dlfiles" ;;
2151
dlpreopen) libs="$dlprefiles" ;;
2152
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2155
if test "$pass" = dlopen; then
2156
# Collect dlpreopened libraries
2157
save_deplibs="$deplibs"
2160
for deplib in $libs; do
2164
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2165
if test "$linkmode,$pass" = "prog,link"; then
2166
compile_deplibs="$deplib $compile_deplibs"
2167
finalize_deplibs="$deplib $finalize_deplibs"
2169
compiler_flags="$compiler_flags $deplib"
2174
if test "$linkmode" != lib && test "$linkmode" != prog; then
2175
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2178
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2179
if test "$linkmode" = lib; then
2180
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2182
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2184
for searchdir in $searchdirs; do
2185
for search_ext in .la $std_shrext .so .a; do
2186
# Search the libtool library
2187
lib="$searchdir/lib${name}${search_ext}"
2188
if test -f "$lib"; then
2189
if test "$search_ext" = ".la"; then
2198
if test "$found" != yes; then
2199
# deplib doesn't seem to be a libtool library
2200
if test "$linkmode,$pass" = "prog,link"; then
2201
compile_deplibs="$deplib $compile_deplibs"
2202
finalize_deplibs="$deplib $finalize_deplibs"
2204
deplibs="$deplib $deplibs"
2205
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2208
else # deplib is a libtool library
2209
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2210
# We need to do some special things here, and not later.
2211
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2212
case " $predeps $postdeps " in
2214
if (${SED} -e '2q' $lib |
2215
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2219
*/* | *\\*) . $lib ;;
2222
for l in $old_library $library_names; do
2225
if test "X$ll" = "X$old_library" ; then # only static version available
2227
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2228
test "X$ladir" = "X$lib" && ladir="."
2229
lib=$ladir/$old_library
2230
if test "$linkmode,$pass" = "prog,link"; then
2231
compile_deplibs="$deplib $compile_deplibs"
2232
finalize_deplibs="$deplib $finalize_deplibs"
2234
deplibs="$deplib $deplibs"
2235
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2249
deplibs="$deplib $deplibs"
2250
test "$pass" = conv && continue
2251
newdependency_libs="$deplib $newdependency_libs"
2252
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2255
if test "$pass" = conv; then
2256
deplibs="$deplib $deplibs"
2259
if test "$pass" = scan; then
2260
deplibs="$deplib $deplibs"
2262
compile_deplibs="$deplib $compile_deplibs"
2263
finalize_deplibs="$deplib $finalize_deplibs"
2265
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2268
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2274
if test "$pass" = link; then
2275
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2276
# Make sure the xrpath contains only unique directories.
2279
*) xrpath="$xrpath $dir" ;;
2282
deplibs="$deplib $deplibs"
2285
*.la) lib="$deplib" ;;
2287
if test "$pass" = conv; then
2288
deplibs="$deplib $deplibs"
2294
case $deplibs_check_method in
2296
set dummy $deplibs_check_method
2297
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2298
if eval $echo \"$deplib\" 2>/dev/null \
2300
| $EGREP "$match_pattern_regex" > /dev/null; then
2308
if test "$valid_a_lib" != yes; then
2310
$echo "*** Warning: Trying to link with static lib archive $deplib."
2311
$echo "*** I have the capability to make that library automatically link in when"
2312
$echo "*** you link to this library. But I can only do this if you have a"
2313
$echo "*** shared version of the library, which you do not appear to have"
2314
$echo "*** because the file extensions .$libext of this argument makes me believe"
2315
$echo "*** that it is just a static archive that I should not used here."
2318
$echo "*** Warning: Linking the shared library $output against the"
2319
$echo "*** static library $deplib is not portable!"
2320
deplibs="$deplib $deplibs"
2325
if test "$pass" != link; then
2326
deplibs="$deplib $deplibs"
2328
compile_deplibs="$deplib $compile_deplibs"
2329
finalize_deplibs="$deplib $finalize_deplibs"
2336
if test "$pass" = conv; then
2337
deplibs="$deplib $deplibs"
2338
elif test "$linkmode" = prog; then
2339
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2340
# If there is no dlopen support or we're linking statically,
2341
# we need to preload.
2342
newdlprefiles="$newdlprefiles $deplib"
2343
compile_deplibs="$deplib $compile_deplibs"
2344
finalize_deplibs="$deplib $finalize_deplibs"
2346
newdlfiles="$newdlfiles $deplib"
2356
if test "$found" = yes || test -f "$lib"; then :
2358
$echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2362
# Check to see that this really is a libtool archive.
2363
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2365
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2369
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2370
test "X$ladir" = "X$lib" && ladir="."
2378
# If the library was installed with an old release of libtool,
2379
# it will not redefine variables installed, or shouldnotlink
2387
*/* | *\\*) . $lib ;;
2391
if test "$linkmode,$pass" = "lib,link" ||
2392
test "$linkmode,$pass" = "prog,scan" ||
2393
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2394
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2395
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2398
if test "$pass" = conv; then
2399
# Only check for convenience libraries
2400
deplibs="$lib $deplibs"
2401
if test -z "$libdir"; then
2402
if test -z "$old_library"; then
2403
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2406
# It is a libtool convenience library, so add in its objects.
2407
convenience="$convenience $ladir/$objdir/$old_library"
2408
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2410
for deplib in $dependency_libs; do
2411
deplibs="$deplib $deplibs"
2412
if test "X$duplicate_deps" = "Xyes" ; then
2413
case "$tmp_libs " in
2414
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2417
tmp_libs="$tmp_libs $deplib"
2419
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2420
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2427
# Get the name of the library we link against.
2429
for l in $old_library $library_names; do
2432
if test -z "$linklib"; then
2433
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2437
# This library was specified with -dlopen.
2438
if test "$pass" = dlopen; then
2439
if test -z "$libdir"; then
2440
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2443
if test -z "$dlname" ||
2444
test "$dlopen_support" != yes ||
2445
test "$build_libtool_libs" = no; then
2446
# If there is no dlname, no dlopen support or we're linking
2447
# statically, we need to preload. We also need to preload any
2448
# dependent libraries so libltdl's deplib preloader doesn't
2449
# bomb out in the load deplibs phase.
2450
dlprefiles="$dlprefiles $lib $dependency_libs"
2452
newdlfiles="$newdlfiles $lib"
2457
# We need an absolute path.
2459
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2461
abs_ladir=`cd "$ladir" && pwd`
2462
if test -z "$abs_ladir"; then
2463
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2464
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2469
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2471
# Find the relevant object directory and library name.
2472
if test "X$installed" = Xyes; then
2473
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2474
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2482
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2484
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2487
# Remove this search path later
2488
notinst_path="$notinst_path $abs_ladir"
2490
dir="$ladir/$objdir"
2491
absdir="$abs_ladir/$objdir"
2492
# Remove this search path later
2493
notinst_path="$notinst_path $abs_ladir"
2495
fi # $installed = yes
2496
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2498
# This library was specified with -dlpreopen.
2499
if test "$pass" = dlpreopen; then
2500
if test -z "$libdir"; then
2501
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2504
# Prefer using a static library (so that no silly _DYNAMIC symbols
2505
# are required to link).
2506
if test -n "$old_library"; then
2507
newdlprefiles="$newdlprefiles $dir/$old_library"
2508
# Otherwise, use the dlname, so that lt_dlopen finds it.
2509
elif test -n "$dlname"; then
2510
newdlprefiles="$newdlprefiles $dir/$dlname"
2512
newdlprefiles="$newdlprefiles $dir/$linklib"
2514
fi # $pass = dlpreopen
2516
if test -z "$libdir"; then
2517
# Link the convenience library
2518
if test "$linkmode" = lib; then
2519
deplibs="$dir/$old_library $deplibs"
2520
elif test "$linkmode,$pass" = "prog,link"; then
2521
compile_deplibs="$dir/$old_library $compile_deplibs"
2522
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2524
deplibs="$lib $deplibs" # used for prog,scan pass
2530
if test "$linkmode" = prog && test "$pass" != link; then
2531
newlib_search_path="$newlib_search_path $ladir"
2532
deplibs="$lib $deplibs"
2535
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2536
test "$build_libtool_libs" = no; then
2541
for deplib in $dependency_libs; do
2543
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2545
# Need to link against all dependency_libs?
2546
if test "$linkalldeplibs" = yes; then
2547
deplibs="$deplib $deplibs"
2549
# Need to hardcode shared library paths
2550
# or/and link against static libraries
2551
newdependency_libs="$deplib $newdependency_libs"
2553
if test "X$duplicate_deps" = "Xyes" ; then
2554
case "$tmp_libs " in
2555
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2558
tmp_libs="$tmp_libs $deplib"
2561
fi # $linkmode = prog...
2563
if test "$linkmode,$pass" = "prog,link"; then
2564
if test -n "$library_names" &&
2565
{ { test "$prefer_static_libs" = no ||
2566
test "$prefer_static_libs,$installed" = "built,yes"; } ||
2567
test -z "$old_library"; }; then
2568
# We need to hardcode the library path
2569
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2570
# Make sure the rpath contains only unique directories.
2571
case "$temp_rpath " in
2574
*) temp_rpath="$temp_rpath $absdir" ;;
2578
# Hardcode the library path.
2579
# Skip directories that are in the system default run-time
2581
case " $sys_lib_dlsearch_path " in
2584
case "$compile_rpath " in
2586
*) compile_rpath="$compile_rpath $absdir"
2590
case " $sys_lib_dlsearch_path " in
2593
case "$finalize_rpath " in
2595
*) finalize_rpath="$finalize_rpath $libdir"
2599
fi # $linkmode,$pass = prog,link...
2601
if test "$alldeplibs" = yes &&
2602
{ test "$deplibs_check_method" = pass_all ||
2603
{ test "$build_libtool_libs" = yes &&
2604
test -n "$library_names"; }; }; then
2605
# We only need to search for static libraries
2610
link_static=no # Whether the deplib will be linked statically
2611
use_static_libs=$prefer_static_libs
2612
if test "$use_static_libs" = built && test "$installed" = yes ; then
2615
if test -n "$library_names" &&
2616
{ test "$use_static_libs" = no || test -z "$old_library"; }; then
2617
if test "$installed" = no; then
2618
notinst_deplibs="$notinst_deplibs $lib"
2621
# This is a shared library
2623
# Warn about portability, can't link against -module's on
2624
# some systems (darwin)
2625
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2627
if test "$linkmode" = prog; then
2628
$echo "*** Warning: Linking the executable $output against the loadable module"
2630
$echo "*** Warning: Linking the shared library $output against the loadable module"
2632
$echo "*** $linklib is not portable!"
2634
if test "$linkmode" = lib &&
2635
test "$hardcode_into_libs" = yes; then
2636
# Hardcode the library path.
2637
# Skip directories that are in the system default run-time
2639
case " $sys_lib_dlsearch_path " in
2642
case "$compile_rpath " in
2644
*) compile_rpath="$compile_rpath $absdir"
2648
case " $sys_lib_dlsearch_path " in
2651
case "$finalize_rpath " in
2653
*) finalize_rpath="$finalize_rpath $libdir"
2659
if test -n "$old_archive_from_expsyms_cmds"; then
2660
# figure out the soname
2661
set dummy $library_names
2664
libname=`eval \\$echo \"$libname_spec\"`
2665
# use dlname if we got it. it's perfectly good, no?
2666
if test -n "$dlname"; then
2668
elif test -n "$soname_spec"; then
2672
major=`expr $current - $age`
2676
eval soname=\"$soname_spec\"
2681
# Make a new name for the extract_expsyms_cmds to use
2683
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2684
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2686
# If the library has no export list, then create one now
2687
if test -f "$output_objdir/$soname-def"; then :
2689
$show "extracting exported symbol list from \`$soname'"
2690
save_ifs="$IFS"; IFS='~'
2691
cmds=$extract_expsyms_cmds
2692
for cmd in $cmds; do
2696
$run eval "$cmd" || exit $?
2702
if test -f "$output_objdir/$newlib"; then :; else
2703
$show "generating import library for \`$soname'"
2704
save_ifs="$IFS"; IFS='~'
2705
cmds=$old_archive_from_expsyms_cmds
2706
for cmd in $cmds; do
2710
$run eval "$cmd" || exit $?
2714
# make sure the library variables are pointing to the new library
2717
fi # test -n "$old_archive_from_expsyms_cmds"
2719
if test "$linkmode" = prog || test "$mode" != relink; then
2724
case $hardcode_action in
2725
immediate | unsupported)
2726
if test "$hardcode_direct" = no; then
2729
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2730
*-*-sysv4*uw2*) add_dir="-L$dir" ;;
2731
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2732
*-*-unixware7*) add_dir="-L$dir" ;;
2734
# if the lib is a module then we can not link against
2735
# it, someone is ignoring the new warnings I added
2736
if /usr/bin/file -L $add 2> /dev/null |
2737
$EGREP ": [^:]* bundle" >/dev/null ; then
2738
$echo "** Warning, lib $linklib is a module, not a shared library"
2739
if test -z "$old_library" ; then
2741
$echo "** And there doesn't seem to be a static archive available"
2742
$echo "** The link will probably fail, sorry"
2744
add="$dir/$old_library"
2748
elif test "$hardcode_minus_L" = no; then
2750
*-*-sunos*) add_shlibpath="$dir" ;;
2754
elif test "$hardcode_shlibpath_var" = no; then
2755
add_shlibpath="$dir"
2762
if test "$hardcode_direct" = yes; then
2764
elif test "$hardcode_minus_L" = yes; then
2766
# Try looking first in the location we're being installed to.
2767
if test -n "$inst_prefix_dir"; then
2770
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2775
elif test "$hardcode_shlibpath_var" = yes; then
2776
add_shlibpath="$dir"
2785
if test "$lib_linked" != yes; then
2786
$echo "$modename: configuration error: unsupported hardcode properties"
2790
if test -n "$add_shlibpath"; then
2791
case :$compile_shlibpath: in
2792
*":$add_shlibpath:"*) ;;
2793
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2796
if test "$linkmode" = prog; then
2797
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2798
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2800
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2801
test -n "$add" && deplibs="$add $deplibs"
2802
if test "$hardcode_direct" != yes && \
2803
test "$hardcode_minus_L" != yes && \
2804
test "$hardcode_shlibpath_var" = yes; then
2805
case :$finalize_shlibpath: in
2807
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2813
if test "$linkmode" = prog || test "$mode" = relink; then
2817
# Finalize command for both is simple: just hardcode it.
2818
if test "$hardcode_direct" = yes; then
2819
add="$libdir/$linklib"
2820
elif test "$hardcode_minus_L" = yes; then
2823
elif test "$hardcode_shlibpath_var" = yes; then
2824
case :$finalize_shlibpath: in
2826
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2829
elif test "$hardcode_automatic" = yes; then
2830
if test -n "$inst_prefix_dir" &&
2831
test -f "$inst_prefix_dir$libdir/$linklib" ; then
2832
add="$inst_prefix_dir$libdir/$linklib"
2834
add="$libdir/$linklib"
2837
# We cannot seem to hardcode it, guess we'll fake it.
2839
# Try looking first in the location we're being installed to.
2840
if test -n "$inst_prefix_dir"; then
2843
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2850
if test "$linkmode" = prog; then
2851
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2852
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2854
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2855
test -n "$add" && deplibs="$add $deplibs"
2858
elif test "$linkmode" = prog; then
2859
# Here we assume that one of hardcode_direct or hardcode_minus_L
2860
# is not unsupported. This is valid on all known static and
2862
if test "$hardcode_direct" != unsupported; then
2863
test -n "$old_library" && linklib="$old_library"
2864
compile_deplibs="$dir/$linklib $compile_deplibs"
2865
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2867
compile_deplibs="-l$name -L$dir $compile_deplibs"
2868
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2870
elif test "$build_libtool_libs" = yes; then
2871
# Not a shared library
2872
if test "$deplibs_check_method" != pass_all; then
2873
# We're trying link a shared library against a static one
2874
# but the system doesn't support it.
2876
# Just print a warning and add the library to dependency_libs so
2877
# that the program can be linked against the static library.
2879
$echo "*** Warning: This system can not link to static lib archive $lib."
2880
$echo "*** I have the capability to make that library automatically link in when"
2881
$echo "*** you link to this library. But I can only do this if you have a"
2882
$echo "*** shared version of the library, which you do not appear to have."
2883
if test "$module" = yes; then
2884
$echo "*** But as you try to build a module library, libtool will still create "
2885
$echo "*** a static module, that should work as long as the dlopening application"
2886
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2887
if test -z "$global_symbol_pipe"; then
2889
$echo "*** However, this would only work if libtool was able to extract symbol"
2890
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2891
$echo "*** not find such a program. So, this module is probably useless."
2892
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2894
if test "$build_old_libs" = no; then
2895
build_libtool_libs=module
2898
build_libtool_libs=no
2902
deplibs="$dir/$old_library $deplibs"
2905
fi # link shared/static library?
2907
if test "$linkmode" = lib; then
2908
if test -n "$dependency_libs" &&
2909
{ test "$hardcode_into_libs" != yes ||
2910
test "$build_old_libs" = yes ||
2911
test "$link_static" = yes; }; then
2912
# Extract -R from dependency_libs
2914
for libdir in $dependency_libs; do
2916
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2918
*" $temp_xrpath "*) ;;
2919
*) xrpath="$xrpath $temp_xrpath";;
2921
*) temp_deplibs="$temp_deplibs $libdir";;
2924
dependency_libs="$temp_deplibs"
2927
newlib_search_path="$newlib_search_path $absdir"
2928
# Link against this library
2929
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2930
# ... and its dependency_libs
2932
for deplib in $dependency_libs; do
2933
newdependency_libs="$deplib $newdependency_libs"
2934
if test "X$duplicate_deps" = "Xyes" ; then
2935
case "$tmp_libs " in
2936
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2939
tmp_libs="$tmp_libs $deplib"
2942
if test "$link_all_deplibs" != no; then
2943
# Add the search paths of all dependency libraries
2944
for deplib in $dependency_libs; do
2946
-L*) path="$deplib" ;;
2948
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2949
test "X$dir" = "X$deplib" && dir="."
2950
# We need an absolute path.
2952
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2954
absdir=`cd "$dir" && pwd`
2955
if test -z "$absdir"; then
2956
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2961
if grep "^installed=no" $deplib > /dev/null; then
2962
path="$absdir/$objdir"
2964
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2965
if test -z "$libdir"; then
2966
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2969
if test "$absdir" != "$libdir"; then
2970
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2977
# we do not want to link against static libs,
2978
# but need to link against shared
2979
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2980
eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2981
if test -n "$deplibrary_names" ; then
2982
for tmp in $deplibrary_names ; do
2985
if test -f "$deplibdir/$depdepl" ; then
2986
depdepl="$deplibdir/$depdepl"
2987
elif test -f "$path/$depdepl" ; then
2988
depdepl="$path/$depdepl"
2990
# Can't find it, oh well...
2993
# do not add paths which are already there
2994
case " $newlib_search_path " in
2996
*) newlib_search_path="$newlib_search_path $path";;
3009
# Again, we only want to link against shared libraries
3010
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3011
for tmp in $newlib_search_path ; do
3012
if test -f "$tmp/lib$tmp_libs.dylib" ; then
3013
eval depdepl="$tmp/lib$tmp_libs.dylib"
3024
case " $deplibs " in
3026
*) deplibs="$path $deplibs" ;;
3028
case " $deplibs " in
3030
*) deplibs="$depdepl $deplibs" ;;
3033
fi # link_all_deplibs != no
3035
done # for deplib in $libs
3036
dependency_libs="$newdependency_libs"
3037
if test "$pass" = dlpreopen; then
3038
# Link the dlpreopened libraries before other libraries
3039
for deplib in $save_deplibs; do
3040
deplibs="$deplib $deplibs"
3043
if test "$pass" != dlopen; then
3044
if test "$pass" != conv; then
3045
# Make sure lib_search_path contains only unique directories.
3047
for dir in $newlib_search_path; do
3048
case "$lib_search_path " in
3050
*) lib_search_path="$lib_search_path $dir" ;;
3056
if test "$linkmode,$pass" != "prog,link"; then
3059
vars="compile_deplibs finalize_deplibs"
3061
for var in $vars dependency_libs; do
3062
# Add libraries to $var in reverse order
3063
eval tmp_libs=\"\$$var\"
3065
for deplib in $tmp_libs; do
3066
# FIXME: Pedantically, this is the right thing to do, so
3067
# that some nasty dependency loop isn't accidentally
3069
#new_libs="$deplib $new_libs"
3070
# Pragmatically, this seems to cause very few problems in
3073
-L*) new_libs="$deplib $new_libs" ;;
3076
# And here is the reason: when a library appears more
3077
# than once as an explicit dependence of a library, or
3078
# is implicitly linked in more than once by the
3079
# compiler, it is considered special, and multiple
3080
# occurrences thereof are not removed. Compare this
3081
# with having the same library being listed as a
3082
# dependency of multiple other libraries: in this case,
3083
# we know (pedantically, we assume) the library does not
3084
# need to be listed more than once, so we keep only the
3085
# last copy. This is not always right, but it is rare
3086
# enough that we require users that really mean to play
3087
# such unportable linking tricks to link the library
3088
# using -Wl,-lname, so that libtool does not consider it
3089
# for duplicate removal.
3090
case " $specialdeplibs " in
3091
*" $deplib "*) new_libs="$deplib $new_libs" ;;
3093
case " $new_libs " in
3095
*) new_libs="$deplib $new_libs" ;;
3103
for deplib in $new_libs; do
3106
case " $tmp_libs " in
3108
*) tmp_libs="$tmp_libs $deplib" ;;
3111
*) tmp_libs="$tmp_libs $deplib" ;;
3114
eval $var=\"$tmp_libs\"
3117
# Last step: remove runtime libs from dependency_libs
3118
# (they stay in deplibs)
3120
for i in $dependency_libs ; do
3121
case " $predeps $postdeps $compiler_lib_search_path " in
3126
if test -n "$i" ; then
3127
tmp_libs="$tmp_libs $i"
3130
dependency_libs=$tmp_libs
3132
if test "$linkmode" = prog; then
3133
dlfiles="$newdlfiles"
3134
dlprefiles="$newdlprefiles"
3141
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3144
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3145
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3148
if test -n "$rpath"; then
3149
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3152
if test -n "$xrpath"; then
3153
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3156
if test -n "$vinfo"; then
3157
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3160
if test -n "$release"; then
3161
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3164
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3165
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3168
# Now set the variables for building old libraries.
3169
build_libtool_libs=no
3171
objs="$objs$old_deplibs"
3175
# Make sure we only generate libraries of the form `libNAME.la'.
3178
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3179
eval shared_ext=\"$shrext_cmds\"
3180
eval libname=\"$libname_spec\"
3183
if test "$module" = no; then
3184
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3188
if test "$need_lib_prefix" != no; then
3189
# Add the "lib" prefix for modules if required
3190
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3191
eval shared_ext=\"$shrext_cmds\"
3192
eval libname=\"$libname_spec\"
3194
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3199
if test -n "$objs"; then
3200
if test "$deplibs_check_method" != pass_all; then
3201
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3205
$echo "*** Warning: Linking the shared library $output against the non-libtool"
3206
$echo "*** objects $objs is not portable!"
3207
libobjs="$libobjs $objs"
3211
if test "$dlself" != no; then
3212
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3216
if test "$#" -gt 2; then
3217
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3222
if test -z "$rpath"; then
3223
if test "$build_libtool_libs" = yes; then
3224
# Building a libtool convenience library.
3225
# Some compilers have problems with a `.al' extension so
3226
# convenience libraries should have the same extension an
3227
# archive normally would.
3228
oldlibs="$output_objdir/$libname.$libext $oldlibs"
3229
build_libtool_libs=convenience
3233
if test -n "$vinfo"; then
3234
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3237
if test -n "$release"; then
3238
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3242
# Parse the version information argument.
3243
save_ifs="$IFS"; IFS=':'
3244
set dummy $vinfo 0 0 0
3247
if test -n "$8"; then
3248
$echo "$modename: too many parameters to \`-version-info'" 1>&2
3253
# convert absolute version numbers to libtool ages
3254
# this retains compatibility with .la files and attempts
3255
# to make the code below a bit more comprehensible
3257
case $vinfo_number in
3261
number_revision="$4"
3263
# There are really only two kinds -- those that
3264
# use the current revision as the major version
3265
# and those that subtract age and use age as
3266
# a minor version. But, then there is irix
3267
# which has an extra 1 added just for fun
3269
case $version_type in
3270
darwin|linux|osf|windows|none)
3271
current=`expr $number_major + $number_minor`
3273
revision="$number_revision"
3275
freebsd-aout|freebsd-elf|sunos)
3276
current="$number_major"
3277
revision="$number_minor"
3281
current=`expr $number_major + $number_minor`
3283
revision="$number_minor"
3284
lt_irix_increment=no
3295
# Check that each of the things are valid numbers.
3297
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3299
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3300
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3306
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3308
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3309
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3315
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3317
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3318
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3323
if test "$age" -gt "$current"; then
3324
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3325
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3329
# Calculate the version variables.
3333
case $version_type in
3337
# Like Linux, but with the current version available in
3338
# verstring for coding it into the library header
3339
major=.`expr $current - $age`
3340
versuffix="$major.$age.$revision"
3341
# Darwin ld doesn't like 0 for these options...
3342
minor_current=`expr $current + 1`
3343
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3344
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3349
versuffix=".$current.$revision";
3354
versuffix=".$current";
3358
if test "X$lt_irix_increment" = "Xno"; then
3359
major=`expr $current - $age`
3361
major=`expr $current - $age + 1`
3363
case $version_type in
3364
nonstopux) verstring_prefix=nonstopux ;;
3365
*) verstring_prefix=sgi ;;
3367
verstring="$verstring_prefix$major.$revision"
3369
# Add in all the interfaces that we are compatible with.
3371
while test "$loop" -ne 0; do
3372
iface=`expr $revision - $loop`
3373
loop=`expr $loop - 1`
3374
verstring="$verstring_prefix$major.$iface:$verstring"
3377
# Before this point, $major must not contain `.'.
3379
versuffix="$major.$revision"
3383
major=.`expr $current - $age`
3384
versuffix="$major.$age.$revision"
3388
major=.`expr $current - $age`
3389
versuffix=".$current.$age.$revision"
3390
verstring="$current.$age.$revision"
3392
# Add in all the interfaces that we are compatible with.
3394
while test "$loop" -ne 0; do
3395
iface=`expr $current - $loop`
3396
loop=`expr $loop - 1`
3397
verstring="$verstring:${iface}.0"
3400
# Make executables depend on our current version.
3401
verstring="$verstring:${current}.0"
3406
versuffix=".$current.$revision"
3410
# Use '-' rather than '.', since we only want one
3411
# extension on DOS 8.3 filesystems.
3412
major=`expr $current - $age`
3417
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3418
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3423
# Clear the version info if we defaulted, and they specified a release.
3424
if test -z "$vinfo" && test -n "$release"; then
3426
case $version_type in
3428
# we can't check for "0.0" in archive_cmds due to quoting
3429
# problems, so we reset it completely
3436
if test "$need_version" = no; then
3443
# Remove version info from name if versioning should be avoided
3444
if test "$avoid_version" = yes && test "$need_version" = no; then
3450
# Check to see if the archive will have undefined symbols.
3451
if test "$allow_undefined" = yes; then
3452
if test "$allow_undefined_flag" = unsupported; then
3453
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3454
build_libtool_libs=no
3458
# Don't allow undefined symbols.
3459
allow_undefined_flag="$no_undefined_flag"
3463
if test "$mode" != relink; then
3464
# Remove our outputs, but don't remove object files since they
3465
# may have been created when compiling PIC objects.
3467
tempremovelist=`$echo "$output_objdir/*"`
3468
for p in $tempremovelist; do
3472
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3473
if test "X$precious_files_regex" != "X"; then
3474
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3479
removelist="$removelist $p"
3484
if test -n "$removelist"; then
3485
$show "${rm}r $removelist"
3486
$run ${rm}r $removelist
3490
# Now set the variables for building old libraries.
3491
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3492
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3494
# Transform .lo files to .o files.
3495
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3498
# Eliminate all temporary directories.
3499
#for path in $notinst_path; do
3500
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3501
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3502
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3505
if test -n "$xrpath"; then
3506
# If the user specified any rpath flags, then add them.
3508
for libdir in $xrpath; do
3509
temp_xrpath="$temp_xrpath -R$libdir"
3510
case "$finalize_rpath " in
3512
*) finalize_rpath="$finalize_rpath $libdir" ;;
3515
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3516
dependency_libs="$temp_xrpath $dependency_libs"
3520
# Make sure dlfiles contains only unique files that won't be dlpreopened
3521
old_dlfiles="$dlfiles"
3523
for lib in $old_dlfiles; do
3524
case " $dlprefiles $dlfiles " in
3526
*) dlfiles="$dlfiles $lib" ;;
3530
# Make sure dlprefiles contains only unique files
3531
old_dlprefiles="$dlprefiles"
3533
for lib in $old_dlprefiles; do
3534
case "$dlprefiles " in
3536
*) dlprefiles="$dlprefiles $lib" ;;
3540
if test "$build_libtool_libs" = yes; then
3541
if test -n "$rpath"; then
3543
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3544
# these systems don't actually have a c library (as such)!
3546
*-*-rhapsody* | *-*-darwin1.[012])
3547
# Rhapsody C library is in the System framework
3548
deplibs="$deplibs -framework System"
3551
# Don't link with libc until the a.out ld.so is fixed.
3553
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3554
# Do not include libc due to us having libc/libc_r.
3556
*-*-sco3.2v5* | *-*-sco5v6*)
3557
# Causes problems with __ctype
3559
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3560
# Compiler inserts libc in the correct place for threads to work
3563
# Add libc to deplibs on all other systems if necessary.
3564
if test "$build_libtool_need_lc" = "yes"; then
3565
deplibs="$deplibs -lc"
3571
# Transform deplibs into only deplibs that can be linked in shared.
3573
libname_save=$libname
3574
release_save=$release
3575
versuffix_save=$versuffix
3577
# I'm not sure if I'm treating the release correctly. I think
3578
# release should show up in the -l (ie -lgmp5) so we don't want to
3579
# add it in twice. Is that correct?
3585
case $deplibs_check_method in
3587
# Don't check for shared/static. Everything works.
3588
# This might be a little naive. We might want to check
3589
# whether the library exists or not. But this is on
3590
# osf3 & osf4 and I'm not really sure... Just
3591
# implementing what was already the behavior.
3595
# This code stresses the "libraries are programs" paradigm to its
3596
# limits. Maybe even breaks it. We compile a program, linking it
3597
# against the deplibs as a proxy for the library. Then we can check
3598
# whether they linked in statically or dynamically with ldd.
3600
cat > conftest.c <<EOF
3601
int main() { return 0; }
3604
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3605
ldd_output=`ldd conftest`
3606
for i in $deplibs; do
3607
name=`expr $i : '-l\(.*\)'`
3608
# If $name is empty we are operating on a -L argument.
3609
if test "$name" != "" && test "$name" != "0"; then
3610
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3611
case " $predeps $postdeps " in
3613
newdeplibs="$newdeplibs $i"
3618
if test -n "$i" ; then
3619
libname=`eval \\$echo \"$libname_spec\"`
3620
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3621
set dummy $deplib_matches
3623
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3624
newdeplibs="$newdeplibs $i"
3628
$echo "*** Warning: dynamic linker does not accept needed library $i."
3629
$echo "*** I have the capability to make that library automatically link in when"
3630
$echo "*** you link to this library. But I can only do this if you have a"
3631
$echo "*** shared version of the library, which I believe you do not have"
3632
$echo "*** because a test_compile did reveal that the linker did not use it for"
3633
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3637
newdeplibs="$newdeplibs $i"
3641
# Error occurred in the first compile. Let's try to salvage
3642
# the situation: Compile a separate program for each library.
3643
for i in $deplibs; do
3644
name=`expr $i : '-l\(.*\)'`
3645
# If $name is empty we are operating on a -L argument.
3646
if test "$name" != "" && test "$name" != "0"; then
3648
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3649
ldd_output=`ldd conftest`
3650
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3651
case " $predeps $postdeps " in
3653
newdeplibs="$newdeplibs $i"
3658
if test -n "$i" ; then
3659
libname=`eval \\$echo \"$libname_spec\"`
3660
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3661
set dummy $deplib_matches
3663
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3664
newdeplibs="$newdeplibs $i"
3668
$echo "*** Warning: dynamic linker does not accept needed library $i."
3669
$echo "*** I have the capability to make that library automatically link in when"
3670
$echo "*** you link to this library. But I can only do this if you have a"
3671
$echo "*** shared version of the library, which you do not appear to have"
3672
$echo "*** because a test_compile did reveal that the linker did not use this one"
3673
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3679
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3680
$echo "*** make it link in! You will probably need to install it or some"
3681
$echo "*** library that it depends on before this library will be fully"
3682
$echo "*** functional. Installing it before continuing would be even better."
3685
newdeplibs="$newdeplibs $i"
3691
set dummy $deplibs_check_method
3692
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3693
for a_deplib in $deplibs; do
3694
name=`expr $a_deplib : '-l\(.*\)'`
3695
# If $name is empty we are operating on a -L argument.
3696
if test "$name" != "" && test "$name" != "0"; then
3697
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3698
case " $predeps $postdeps " in
3700
newdeplibs="$newdeplibs $a_deplib"
3705
if test -n "$a_deplib" ; then
3706
libname=`eval \\$echo \"$libname_spec\"`
3707
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3708
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3709
for potent_lib in $potential_libs; do
3710
# Follow soft links.
3711
if ls -lLd "$potent_lib" 2>/dev/null \
3712
| grep " -> " >/dev/null; then
3715
# The statement above tries to avoid entering an
3716
# endless loop below, in case of cyclic links.
3717
# We might still enter an endless loop, since a link
3718
# loop can be closed while we follow links,
3720
potlib="$potent_lib"
3721
while test -h "$potlib" 2>/dev/null; do
3722
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3724
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3725
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3728
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3730
| $EGREP "$file_magic_regex" > /dev/null; then
3731
newdeplibs="$newdeplibs $a_deplib"
3738
if test -n "$a_deplib" ; then
3741
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3742
$echo "*** I have the capability to make that library automatically link in when"
3743
$echo "*** you link to this library. But I can only do this if you have a"
3744
$echo "*** shared version of the library, which you do not appear to have"
3745
$echo "*** because I did check the linker path looking for a file starting"
3746
if test -z "$potlib" ; then
3747
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3749
$echo "*** with $libname and none of the candidates passed a file format test"
3750
$echo "*** using a file magic. Last file checked: $potlib"
3754
# Add a -L argument.
3755
newdeplibs="$newdeplibs $a_deplib"
3757
done # Gone through all deplibs.
3760
set dummy $deplibs_check_method
3761
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3762
for a_deplib in $deplibs; do
3763
name=`expr $a_deplib : '-l\(.*\)'`
3764
# If $name is empty we are operating on a -L argument.
3765
if test -n "$name" && test "$name" != "0"; then
3766
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3767
case " $predeps $postdeps " in
3769
newdeplibs="$newdeplibs $a_deplib"
3774
if test -n "$a_deplib" ; then
3775
libname=`eval \\$echo \"$libname_spec\"`
3776
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3777
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3778
for potent_lib in $potential_libs; do
3779
potlib="$potent_lib" # see symlink-check above in file_magic test
3780
if eval $echo \"$potent_lib\" 2>/dev/null \
3782
| $EGREP "$match_pattern_regex" > /dev/null; then
3783
newdeplibs="$newdeplibs $a_deplib"
3790
if test -n "$a_deplib" ; then
3793
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3794
$echo "*** I have the capability to make that library automatically link in when"
3795
$echo "*** you link to this library. But I can only do this if you have a"
3796
$echo "*** shared version of the library, which you do not appear to have"
3797
$echo "*** because I did check the linker path looking for a file starting"
3798
if test -z "$potlib" ; then
3799
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3801
$echo "*** with $libname and none of the candidates passed a file format test"
3802
$echo "*** using a regex pattern. Last file checked: $potlib"
3806
# Add a -L argument.
3807
newdeplibs="$newdeplibs $a_deplib"
3809
done # Gone through all deplibs.
3813
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3814
-e 's/ -[LR][^ ]*//g'`
3815
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3816
for i in $predeps $postdeps ; do
3817
# can't use Xsed below, because $i might contain '/'
3818
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3821
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3822
| grep . >/dev/null; then
3824
if test "X$deplibs_check_method" = "Xnone"; then
3825
$echo "*** Warning: inter-library dependencies are not supported in this platform."
3827
$echo "*** Warning: inter-library dependencies are not known to be supported."
3829
$echo "*** All declared inter-library dependencies are being dropped."
3834
versuffix=$versuffix_save
3836
release=$release_save
3837
libname=$libname_save
3841
*-*-rhapsody* | *-*-darwin1.[012])
3842
# On Rhapsody replace the C library is the System framework
3843
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3847
if test "$droppeddeps" = yes; then
3848
if test "$module" = yes; then
3850
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3851
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3852
$echo "*** a static module, that should work as long as the dlopening"
3853
$echo "*** application is linked with the -dlopen flag."
3854
if test -z "$global_symbol_pipe"; then
3856
$echo "*** However, this would only work if libtool was able to extract symbol"
3857
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3858
$echo "*** not find such a program. So, this module is probably useless."
3859
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3861
if test "$build_old_libs" = no; then
3862
oldlibs="$output_objdir/$libname.$libext"
3863
build_libtool_libs=module
3866
build_libtool_libs=no
3869
$echo "*** The inter-library dependencies that have been dropped here will be"
3870
$echo "*** automatically added whenever a program is linked with this library"
3871
$echo "*** or is declared to -dlopen it."
3873
if test "$allow_undefined" = no; then
3875
$echo "*** Since this library must not contain undefined symbols,"
3876
$echo "*** because either the platform does not support them or"
3877
$echo "*** it was explicitly requested with -no-undefined,"
3878
$echo "*** libtool will only create a static version of it."
3879
if test "$build_old_libs" = no; then
3880
oldlibs="$output_objdir/$libname.$libext"
3881
build_libtool_libs=module
3884
build_libtool_libs=no
3889
# Done checking deplibs!
3894
# move library search paths that coincide with paths to not yet
3895
# installed libraries to the beginning of the library search list
3897
for path in $notinst_path; do
3898
case " $new_libs " in
3899
*" -L$path/$objdir "*) ;;
3901
case " $deplibs " in
3902
*" -L$path/$objdir "*)
3903
new_libs="$new_libs -L$path/$objdir" ;;
3908
for deplib in $deplibs; do
3911
case " $new_libs " in
3913
*) new_libs="$new_libs $deplib" ;;
3916
*) new_libs="$new_libs $deplib" ;;
3922
# All the library-specific variables (install_libdir is set above).
3927
# Test again, we may have decided not to build it any more
3928
if test "$build_libtool_libs" = yes; then
3929
if test "$hardcode_into_libs" = yes; then
3930
# Hardcode the library paths
3933
rpath="$finalize_rpath"
3934
test "$mode" != relink && rpath="$compile_rpath$rpath"
3935
for libdir in $rpath; do
3936
if test -n "$hardcode_libdir_flag_spec"; then
3937
if test -n "$hardcode_libdir_separator"; then
3938
if test -z "$hardcode_libdirs"; then
3939
hardcode_libdirs="$libdir"
3941
# Just accumulate the unique libdirs.
3942
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3943
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3946
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3951
eval flag=\"$hardcode_libdir_flag_spec\"
3952
dep_rpath="$dep_rpath $flag"
3954
elif test -n "$runpath_var"; then
3955
case "$perm_rpath " in
3957
*) perm_rpath="$perm_rpath $libdir" ;;
3961
# Substitute the hardcoded libdirs into the rpath.
3962
if test -n "$hardcode_libdir_separator" &&
3963
test -n "$hardcode_libdirs"; then
3964
libdir="$hardcode_libdirs"
3965
if test -n "$hardcode_libdir_flag_spec_ld"; then
3966
case $archive_cmds in
3967
*\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
3968
*) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
3971
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3974
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3975
# We should set the runpath_var.
3977
for dir in $perm_rpath; do
3980
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3982
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3985
shlibpath="$finalize_shlibpath"
3986
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3987
if test -n "$shlibpath"; then
3988
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3991
# Get the real and link names of the library.
3992
eval shared_ext=\"$shrext_cmds\"
3993
eval library_names=\"$library_names_spec\"
3994
set dummy $library_names
3998
if test -n "$soname_spec"; then
3999
eval soname=\"$soname_spec\"
4003
if test -z "$dlname"; then
4007
lib="$output_objdir/$realname"
4011
linknames="$linknames $link"
4014
# Use standard objects if they are pic
4015
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4017
# Prepare the list of exported symbols
4018
if test -z "$export_symbols"; then
4019
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4020
$show "generating symbol list for \`$libname.la'"
4021
export_symbols="$output_objdir/$libname.exp"
4022
$run $rm $export_symbols
4023
cmds=$export_symbols_cmds
4024
save_ifs="$IFS"; IFS='~'
4025
for cmd in $cmds; do
4028
if len=`expr "X$cmd" : ".*"` &&
4029
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4031
$run eval "$cmd" || exit $?
4032
skipped_export=false
4034
# The command line is too long to execute in one step.
4035
$show "using reloadable object file for export list..."
4037
# Break out early, otherwise skipped_export may be
4038
# set to false by a later but shorter cmd.
4043
if test -n "$export_symbols_regex"; then
4044
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4045
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4046
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
4047
$run eval '$mv "${export_symbols}T" "$export_symbols"'
4052
if test -n "$export_symbols" && test -n "$include_expsyms"; then
4053
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4057
for test_deplib in $deplibs; do
4058
case " $convenience " in
4059
*" $test_deplib "*) ;;
4061
tmp_deplibs="$tmp_deplibs $test_deplib"
4065
deplibs="$tmp_deplibs"
4067
if test -n "$convenience"; then
4068
if test -n "$whole_archive_flag_spec"; then
4069
save_libobjs=$libobjs
4070
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4072
gentop="$output_objdir/${outputname}x"
4073
generated="$generated $gentop"
4075
func_extract_archives $gentop $convenience
4076
libobjs="$libobjs $func_extract_archives_result"
4080
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4081
eval flag=\"$thread_safe_flag_spec\"
4082
linker_flags="$linker_flags $flag"
4085
# Make a backup of the uninstalled library when relinking
4086
if test "$mode" = relink; then
4087
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4090
# Do each of the archive commands.
4091
if test "$module" = yes && test -n "$module_cmds" ; then
4092
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4093
eval test_cmds=\"$module_expsym_cmds\"
4094
cmds=$module_expsym_cmds
4096
eval test_cmds=\"$module_cmds\"
4100
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4101
eval test_cmds=\"$archive_expsym_cmds\"
4102
cmds=$archive_expsym_cmds
4104
eval test_cmds=\"$archive_cmds\"
4109
if test "X$skipped_export" != "X:" &&
4110
len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4111
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4114
# The command line is too long to link in one step, link piecewise.
4115
$echo "creating reloadable object files..."
4117
# Save the value of $output and $libobjs because we want to
4118
# use them later. If we have whole_archive_flag_spec, we
4119
# want to use save_libobjs as it was before
4120
# whole_archive_flag_spec was expanded, because we can't
4121
# assume the linker understands whole_archive_flag_spec.
4122
# This may have to be revisited, in case too many
4123
# convenience libraries get linked in and end up exceeding
4125
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4126
save_libobjs=$libobjs
4129
output_la=`$echo "X$output" | $Xsed -e "$basename"`
4131
# Clear the reloadable object creation command queue and
4132
# initialize k to one.
4139
output=$output_objdir/$output_la-${k}.$objext
4140
# Loop over the list of objects to be linked.
4141
for obj in $save_libobjs
4143
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4144
if test "X$objlist" = X ||
4145
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4146
test "$len" -le "$max_cmd_len"; }; then
4147
objlist="$objlist $obj"
4149
# The command $test_cmds is almost too long, add a
4150
# command to the queue.
4151
if test "$k" -eq 1 ; then
4152
# The first file doesn't have a previous command to add.
4153
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4155
# All subsequent reloadable object files will link in
4156
# the last one created.
4157
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4159
last_robj=$output_objdir/$output_la-${k}.$objext
4161
output=$output_objdir/$output_la-${k}.$objext
4166
# Handle the remaining objects by creating one last
4167
# reloadable object file. All subsequent reloadable object
4168
# files will link in the last one created.
4169
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4170
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4172
if ${skipped_export-false}; then
4173
$show "generating symbol list for \`$libname.la'"
4174
export_symbols="$output_objdir/$libname.exp"
4175
$run $rm $export_symbols
4177
# Append the command to create the export file.
4178
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4181
# Set up a command to remove the reloadable object files
4182
# after they are used.
4184
while test "$i" -lt "$k"
4187
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4190
$echo "creating a temporary reloadable object file: $output"
4192
# Loop through the commands generated above and execute them.
4193
save_ifs="$IFS"; IFS='~'
4194
for cmd in $concat_cmds; do
4197
$run eval "$cmd" || exit $?
4202
# Restore the value of output.
4205
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4206
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4208
# Expand the library linking commands again to reset the
4209
# value of $libobjs for piecewise linking.
4211
# Do each of the archive commands.
4212
if test "$module" = yes && test -n "$module_cmds" ; then
4213
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4214
cmds=$module_expsym_cmds
4219
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4220
cmds=$archive_expsym_cmds
4226
# Append the command to remove the reloadable object files
4227
# to the just-reset $cmds.
4228
eval cmds=\"\$cmds~\$rm $delfiles\"
4230
save_ifs="$IFS"; IFS='~'
4231
for cmd in $cmds; do
4235
$run eval "$cmd" || {
4238
# Restore the uninstalled library and exit
4239
if test "$mode" = relink; then
4240
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4248
# Restore the uninstalled library and exit
4249
if test "$mode" = relink; then
4250
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4252
if test -n "$convenience"; then
4253
if test -z "$whole_archive_flag_spec"; then
4254
$show "${rm}r $gentop"
4255
$run ${rm}r "$gentop"
4262
# Create links to the real library.
4263
for linkname in $linknames; do
4264
if test "$realname" != "$linkname"; then
4265
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4266
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4270
# If -module or -export-dynamic was specified, set the dlname.
4271
if test "$module" = yes || test "$export_dynamic" = yes; then
4272
# On all known operating systems, these are identical.
4281
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
4284
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4285
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4288
if test -n "$rpath"; then
4289
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4292
if test -n "$xrpath"; then
4293
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4296
if test -n "$vinfo"; then
4297
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4300
if test -n "$release"; then
4301
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4306
if test -n "$objs$old_deplibs"; then
4307
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4311
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4319
# Delete the old objects.
4320
$run $rm $obj $libobj
4322
# Objects from convenience libraries. This assumes
4323
# single-version convenience libraries. Whenever we create
4324
# different ones for PIC/non-PIC, this we'll have to duplicate
4328
# reload_cmds runs $LD directly, so let us get rid of
4329
# -Wl from whole_archive_flag_spec and hope we can get by with
4330
# turning comma into space..
4333
if test -n "$convenience"; then
4334
if test -n "$whole_archive_flag_spec"; then
4335
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4336
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4338
gentop="$output_objdir/${obj}x"
4339
generated="$generated $gentop"
4341
func_extract_archives $gentop $convenience
4342
reload_conv_objs="$reload_objs $func_extract_archives_result"
4346
# Create the old-style object.
4347
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
4351
save_ifs="$IFS"; IFS='~'
4352
for cmd in $cmds; do
4356
$run eval "$cmd" || exit $?
4360
# Exit if we aren't doing a library object file.
4361
if test -z "$libobj"; then
4362
if test -n "$gentop"; then
4363
$show "${rm}r $gentop"
4370
if test "$build_libtool_libs" != yes; then
4371
if test -n "$gentop"; then
4372
$show "${rm}r $gentop"
4376
# Create an invalid libtool object if no PIC, so that we don't
4377
# accidentally link it into a program.
4378
# $show "echo timestamp > $libobj"
4379
# $run eval "echo timestamp > $libobj" || exit $?
4383
if test -n "$pic_flag" || test "$pic_mode" != default; then
4384
# Only do commands if we really have different PIC objects.
4385
reload_objs="$libobjs $reload_conv_objs"
4388
save_ifs="$IFS"; IFS='~'
4389
for cmd in $cmds; do
4393
$run eval "$cmd" || exit $?
4398
if test -n "$gentop"; then
4399
$show "${rm}r $gentop"
4408
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4410
if test -n "$vinfo"; then
4411
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4414
if test -n "$release"; then
4415
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4418
if test "$preload" = yes; then
4419
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4420
test "$dlopen_self_static" = unknown; then
4421
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4426
*-*-rhapsody* | *-*-darwin1.[012])
4427
# On Rhapsody replace the C library is the System framework
4428
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4429
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4435
# Don't allow lazy linking, it breaks C++ global constructors
4436
if test "$tagname" = CXX ; then
4437
compile_command="$compile_command ${wl}-bind_at_load"
4438
finalize_command="$finalize_command ${wl}-bind_at_load"
4444
# move library search paths that coincide with paths to not yet
4445
# installed libraries to the beginning of the library search list
4447
for path in $notinst_path; do
4448
case " $new_libs " in
4449
*" -L$path/$objdir "*) ;;
4451
case " $compile_deplibs " in
4452
*" -L$path/$objdir "*)
4453
new_libs="$new_libs -L$path/$objdir" ;;
4458
for deplib in $compile_deplibs; do
4461
case " $new_libs " in
4463
*) new_libs="$new_libs $deplib" ;;
4466
*) new_libs="$new_libs $deplib" ;;
4469
compile_deplibs="$new_libs"
4472
compile_command="$compile_command $compile_deplibs"
4473
finalize_command="$finalize_command $finalize_deplibs"
4475
if test -n "$rpath$xrpath"; then
4476
# If the user specified any rpath flags, then add them.
4477
for libdir in $rpath $xrpath; do
4478
# This is the magic to use -rpath.
4479
case "$finalize_rpath " in
4481
*) finalize_rpath="$finalize_rpath $libdir" ;;
4486
# Now hardcode the library paths
4489
for libdir in $compile_rpath $finalize_rpath; do
4490
if test -n "$hardcode_libdir_flag_spec"; then
4491
if test -n "$hardcode_libdir_separator"; then
4492
if test -z "$hardcode_libdirs"; then
4493
hardcode_libdirs="$libdir"
4495
# Just accumulate the unique libdirs.
4496
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4497
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4500
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4505
eval flag=\"$hardcode_libdir_flag_spec\"
4506
rpath="$rpath $flag"
4508
elif test -n "$runpath_var"; then
4509
case "$perm_rpath " in
4511
*) perm_rpath="$perm_rpath $libdir" ;;
4515
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4516
testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4517
case :$dllsearchpath: in
4519
*) dllsearchpath="$dllsearchpath:$libdir";;
4521
case :$dllsearchpath: in
4522
*":$testbindir:"*) ;;
4523
*) dllsearchpath="$dllsearchpath:$testbindir";;
4528
# Substitute the hardcoded libdirs into the rpath.
4529
if test -n "$hardcode_libdir_separator" &&
4530
test -n "$hardcode_libdirs"; then
4531
libdir="$hardcode_libdirs"
4532
eval rpath=\" $hardcode_libdir_flag_spec\"
4534
compile_rpath="$rpath"
4538
for libdir in $finalize_rpath; do
4539
if test -n "$hardcode_libdir_flag_spec"; then
4540
if test -n "$hardcode_libdir_separator"; then
4541
if test -z "$hardcode_libdirs"; then
4542
hardcode_libdirs="$libdir"
4544
# Just accumulate the unique libdirs.
4545
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4546
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4549
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4554
eval flag=\"$hardcode_libdir_flag_spec\"
4555
rpath="$rpath $flag"
4557
elif test -n "$runpath_var"; then
4558
case "$finalize_perm_rpath " in
4560
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4564
# Substitute the hardcoded libdirs into the rpath.
4565
if test -n "$hardcode_libdir_separator" &&
4566
test -n "$hardcode_libdirs"; then
4567
libdir="$hardcode_libdirs"
4568
eval rpath=\" $hardcode_libdir_flag_spec\"
4570
finalize_rpath="$rpath"
4572
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4573
# Transform all the library objects into standard objects.
4574
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4575
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4579
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4580
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4581
dlsyms="${outputname}S.c"
4583
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4587
if test -n "$dlsyms"; then
4591
# Discover the nlist of each of the dlfiles.
4592
nlist="$output_objdir/${outputname}.nm"
4594
$show "$rm $nlist ${nlist}S ${nlist}T"
4595
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4597
# Parse the name list into a source file.
4598
$show "creating $output_objdir/$dlsyms"
4600
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4601
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4602
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4608
/* Prevent the only kind of declaration conflicts we can make. */
4609
#define lt_preloaded_symbols some_other_symbol
4611
/* External symbol declarations for the compiler. */\
4614
if test "$dlself" = yes; then
4615
$show "generating symbol list for \`$output'"
4617
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4619
# Add our own program objects to the symbol list.
4620
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4621
for arg in $progfiles; do
4622
$show "extracting global C symbols from \`$arg'"
4623
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4626
if test -n "$exclude_expsyms"; then
4627
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4628
$run eval '$mv "$nlist"T "$nlist"'
4631
if test -n "$export_symbols_regex"; then
4632
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4633
$run eval '$mv "$nlist"T "$nlist"'
4636
# Prepare the list of exported symbols
4637
if test -z "$export_symbols"; then
4638
export_symbols="$output_objdir/$outputname.exp"
4639
$run $rm $export_symbols
4640
$run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4642
*cygwin* | *mingw* )
4643
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4644
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4648
$run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4649
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4650
$run eval 'mv "$nlist"T "$nlist"'
4652
*cygwin* | *mingw* )
4653
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4654
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4660
for arg in $dlprefiles; do
4661
$show "extracting global C symbols from \`$arg'"
4662
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4663
$run eval '$echo ": $name " >> "$nlist"'
4664
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4667
if test -z "$run"; then
4668
# Make sure we have at least an empty file.
4669
test -f "$nlist" || : > "$nlist"
4671
if test -n "$exclude_expsyms"; then
4672
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4673
$mv "$nlist"T "$nlist"
4676
# Try sorting and uniquifying the output.
4677
if grep -v "^: " < "$nlist" |
4678
if sort -k 3 </dev/null >/dev/null 2>&1; then
4683
uniq > "$nlist"S; then
4686
grep -v "^: " < "$nlist" > "$nlist"S
4689
if test -f "$nlist"S; then
4690
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4692
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
4695
$echo >> "$output_objdir/$dlsyms" "\
4697
#undef lt_preloaded_symbols
4699
#if defined (__STDC__) && __STDC__
4700
# define lt_ptr void *
4702
# define lt_ptr char *
4706
/* The mapping between symbol names and symbols. */
4710
*cygwin* | *mingw* )
4711
$echo >> "$output_objdir/$dlsyms" "\
4712
/* DATA imports from DLLs on WIN32 can't be const, because
4713
runtime relocations are performed -- see ld's documentation
4719
$echo >> "$output_objdir/$dlsyms" "\
4726
$echo >> "$output_objdir/$dlsyms" "\
4730
lt_preloaded_symbols[] =
4734
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4736
$echo >> "$output_objdir/$dlsyms" "\
4740
/* This works around a problem in FreeBSD linker */
4741
#ifdef FREEBSD_WORKAROUND
4742
static const void *lt_preloaded_setup() {
4743
return lt_preloaded_symbols;
4753
pic_flag_for_symtable=
4755
# compiling the symbol table file with pic_flag works around
4756
# a FreeBSD bug that causes programs to crash when -lm is
4757
# linked before any other PIC object. But we must not use
4758
# pic_flag when linking with -static. The problem exists in
4759
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4760
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4761
case "$compile_command " in
4763
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4766
case "$compile_command " in
4768
*) pic_flag_for_symtable=" $pic_flag";;
4772
# Now compile the dynamic symbol file.
4773
$show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4774
$run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4776
# Clean up the generated files.
4777
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4778
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4780
# Transform the symbol file into the correct name.
4782
*cygwin* | *mingw* )
4783
if test -f "$output_objdir/${outputname}.def" ; then
4784
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4785
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4787
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4788
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4792
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4793
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4798
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4803
# We keep going just in case the user didn't refer to
4804
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4805
# really was required.
4807
# Nullify the symbol file.
4808
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4809
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4812
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4813
# Replace the output file specification.
4814
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4815
link_command="$compile_command$compile_rpath"
4817
# We have no uninstalled library dependencies, so finalize right now.
4818
$show "$link_command"
4819
$run eval "$link_command"
4822
# Delete the generated files.
4823
if test -n "$dlsyms"; then
4824
$show "$rm $output_objdir/${outputname}S.${objext}"
4825
$run $rm "$output_objdir/${outputname}S.${objext}"
4831
if test -n "$shlibpath_var"; then
4832
# We should set the shlibpath_var
4834
for dir in $temp_rpath; do
4836
[\\/]* | [A-Za-z]:[\\/]*)
4841
# Relative path: add a thisdir entry.
4842
rpath="$rpath\$thisdir/$dir:"
4849
if test -n "$compile_shlibpath$finalize_shlibpath"; then
4850
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4852
if test -n "$finalize_shlibpath"; then
4853
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4858
if test -n "$runpath_var"; then
4859
if test -n "$perm_rpath"; then
4860
# We should set the runpath_var.
4862
for dir in $perm_rpath; do
4865
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4867
if test -n "$finalize_perm_rpath"; then
4868
# We should set the runpath_var.
4870
for dir in $finalize_perm_rpath; do
4873
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4877
if test "$no_install" = yes; then
4878
# We don't need to create a wrapper script.
4879
link_command="$compile_var$compile_command$compile_rpath"
4880
# Replace the output file specification.
4881
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4882
# Delete the old output file.
4884
# Link the executable and exit
4885
$show "$link_command"
4886
$run eval "$link_command" || exit $?
4890
if test "$hardcode_action" = relink; then
4891
# Fast installation is not supported
4892
link_command="$compile_var$compile_command$compile_rpath"
4893
relink_command="$finalize_var$finalize_command$finalize_rpath"
4895
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4896
$echo "$modename: \`$output' will be relinked during installation" 1>&2
4898
if test "$fast_install" != no; then
4899
link_command="$finalize_var$compile_command$finalize_rpath"
4900
if test "$fast_install" = yes; then
4901
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4903
# fast_install is set to needless
4907
link_command="$compile_var$compile_command$compile_rpath"
4908
relink_command="$finalize_var$finalize_command$finalize_rpath"
4912
# Replace the output file specification.
4913
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4915
# Delete the old output files.
4916
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4918
$show "$link_command"
4919
$run eval "$link_command" || exit $?
4921
# Now create the wrapper script.
4922
$show "creating $output"
4924
# Quote the relink command for shipping.
4925
if test -n "$relink_command"; then
4926
# Preserve any variables that may affect compiler behavior
4927
for var in $variables_saved_for_relink; do
4928
if eval test -z \"\${$var+set}\"; then
4929
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4930
elif eval var_value=\$$var; test -z "$var_value"; then
4931
relink_command="$var=; export $var; $relink_command"
4933
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4934
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4937
relink_command="(cd `pwd`; $relink_command)"
4938
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
4941
# Quote $echo for shipping.
4942
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4944
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4945
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4947
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4949
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4952
# Only actually do things if our run command is non-null.
4953
if test -z "$run"; then
4954
# win32 will think the script is a binary if it has
4955
# a .exe suffix, so we strip it off here.
4957
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4959
# test for cygwin because mv fails w/o .exe extensions
4963
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4967
*cygwin* | *mingw* )
4968
output_name=`basename $output`
4969
output_path=`dirname $output`
4970
cwrappersource="$output_path/$objdir/lt-$output_name.c"
4971
cwrapper="$output_path/$output_name.exe"
4972
$rm $cwrappersource $cwrapper
4973
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4975
cat > $cwrappersource <<EOF
4977
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4978
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4980
The $output program cannot be directly executed until all the libtool
4981
libraries that it depends on are installed.
4983
This wrapper executable should never be moved out of the build directory.
4984
If it is, it will not operate correctly.
4986
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4987
but could eventually absorb all of the scripts functionality and
4988
exec $objdir/$outputname directly.
4991
cat >> $cwrappersource<<"EOF"
5000
#include <sys/stat.h>
5002
#if defined(PATH_MAX)
5003
# define LT_PATHMAX PATH_MAX
5004
#elif defined(MAXPATHLEN)
5005
# define LT_PATHMAX MAXPATHLEN
5007
# define LT_PATHMAX 1024
5010
#ifndef DIR_SEPARATOR
5011
# define DIR_SEPARATOR '/'
5012
# define PATH_SEPARATOR ':'
5015
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5017
# define HAVE_DOS_BASED_FILE_SYSTEM
5018
# ifndef DIR_SEPARATOR_2
5019
# define DIR_SEPARATOR_2 '\\'
5021
# ifndef PATH_SEPARATOR_2
5022
# define PATH_SEPARATOR_2 ';'
5026
#ifndef DIR_SEPARATOR_2
5027
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5028
#else /* DIR_SEPARATOR_2 */
5029
# define IS_DIR_SEPARATOR(ch) \
5030
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5031
#endif /* DIR_SEPARATOR_2 */
5033
#ifndef PATH_SEPARATOR_2
5034
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5035
#else /* PATH_SEPARATOR_2 */
5036
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5037
#endif /* PATH_SEPARATOR_2 */
5039
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5040
#define XFREE(stale) do { \
5041
if (stale) { free ((void *) stale); stale = 0; } \
5044
/* -DDEBUG is fairly common in CFLAGS. */
5046
#if defined DEBUGWRAPPER
5047
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5049
# define DEBUG(format, ...)
5052
const char *program_name = NULL;
5054
void * xmalloc (size_t num);
5055
char * xstrdup (const char *string);
5056
const char * base_name (const char *name);
5057
char * find_executable(const char *wrapper);
5058
int check_executable(const char *path);
5059
char * strendzap(char *str, const char *pat);
5060
void lt_fatal (const char *message, ...);
5063
main (int argc, char *argv[])
5068
program_name = (char *) xstrdup (base_name (argv[0]));
5069
DEBUG("(main) argv[0] : %s\n",argv[0]);
5070
DEBUG("(main) program_name : %s\n",program_name);
5071
newargz = XMALLOC(char *, argc+2);
5074
cat >> $cwrappersource <<EOF
5075
newargz[0] = (char *) xstrdup("$SHELL");
5078
cat >> $cwrappersource <<"EOF"
5079
newargz[1] = find_executable(argv[0]);
5080
if (newargz[1] == NULL)
5081
lt_fatal("Couldn't find %s", argv[0]);
5082
DEBUG("(main) found exe at : %s\n",newargz[1]);
5083
/* we know the script has the same name, without the .exe */
5084
/* so make sure newargz[1] doesn't end in .exe */
5085
strendzap(newargz[1],".exe");
5086
for (i = 1; i < argc; i++)
5087
newargz[i+1] = xstrdup(argv[i]);
5088
newargz[argc+1] = NULL;
5090
for (i=0; i<argc+1; i++)
5092
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5100
cat >> $cwrappersource <<EOF
5101
execv("$SHELL",(char const **)newargz);
5105
cat >> $cwrappersource <<EOF
5106
execv("$SHELL",newargz);
5111
cat >> $cwrappersource <<"EOF"
5116
xmalloc (size_t num)
5118
void * p = (void *) malloc (num);
5120
lt_fatal ("Memory exhausted");
5126
xstrdup (const char *string)
5128
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5133
base_name (const char *name)
5137
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5138
/* Skip over the disk name in MSDOS pathnames. */
5139
if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5143
for (base = name; *name; name++)
5144
if (IS_DIR_SEPARATOR (*name))
5150
check_executable(const char * path)
5154
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5155
if ((!path) || (!*path))
5158
if ((stat (path, &st) >= 0) &&
5160
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5161
#if defined (S_IXOTH)
5162
((st.st_mode & S_IXOTH) == S_IXOTH) ||
5164
#if defined (S_IXGRP)
5165
((st.st_mode & S_IXGRP) == S_IXGRP) ||
5167
((st.st_mode & S_IXUSR) == S_IXUSR))
5174
/* Searches for the full path of the wrapper. Returns
5175
newly allocated full path name if found, NULL otherwise */
5177
find_executable (const char* wrapper)
5182
/* static buffer for getcwd */
5183
char tmp[LT_PATHMAX + 1];
5187
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5189
if ((wrapper == NULL) || (*wrapper == '\0'))
5192
/* Absolute path? */
5193
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5194
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5196
concat_name = xstrdup (wrapper);
5197
if (check_executable(concat_name))
5204
if (IS_DIR_SEPARATOR (wrapper[0]))
5206
concat_name = xstrdup (wrapper);
5207
if (check_executable(concat_name))
5211
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5215
for (p = wrapper; *p; p++)
5223
/* no slashes; search PATH */
5224
const char* path = getenv ("PATH");
5227
for (p = path; *p; p = p_next)
5231
for (q = p; *q; q++)
5232
if (IS_PATH_SEPARATOR(*q))
5235
p_next = (*q == '\0' ? q : q + 1);
5238
/* empty path: current directory */
5239
if (getcwd (tmp, LT_PATHMAX) == NULL)
5240
lt_fatal ("getcwd failed");
5241
tmp_len = strlen(tmp);
5242
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5243
memcpy (concat_name, tmp, tmp_len);
5244
concat_name[tmp_len] = '/';
5245
strcpy (concat_name + tmp_len + 1, wrapper);
5249
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5250
memcpy (concat_name, p, p_len);
5251
concat_name[p_len] = '/';
5252
strcpy (concat_name + p_len + 1, wrapper);
5254
if (check_executable(concat_name))
5259
/* not found in PATH; assume curdir */
5261
/* Relative path | not found in path: prepend cwd */
5262
if (getcwd (tmp, LT_PATHMAX) == NULL)
5263
lt_fatal ("getcwd failed");
5264
tmp_len = strlen(tmp);
5265
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5266
memcpy (concat_name, tmp, tmp_len);
5267
concat_name[tmp_len] = '/';
5268
strcpy (concat_name + tmp_len + 1, wrapper);
5270
if (check_executable(concat_name))
5277
strendzap(char *str, const char *pat)
5281
assert(str != NULL);
5282
assert(pat != NULL);
5285
patlen = strlen(pat);
5289
str += len - patlen;
5290
if (strcmp(str, pat) == 0)
5297
lt_error_core (int exit_status, const char * mode,
5298
const char * message, va_list ap)
5300
fprintf (stderr, "%s: %s: ", program_name, mode);
5301
vfprintf (stderr, message, ap);
5302
fprintf (stderr, ".\n");
5304
if (exit_status >= 0)
5309
lt_fatal (const char *message, ...)
5312
va_start (ap, message);
5313
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5317
# we should really use a build-platform specific compiler
5318
# here, but OTOH, the wrappers (shell script and this C one)
5319
# are only useful if you want to execute the "real" binary.
5320
# Since the "real" binary is built for $host, then this
5321
# wrapper might as well be built for $host, too.
5322
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5326
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5331
# $output - temporary wrapper script for $objdir/$outputname
5332
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5334
# The $output program cannot be directly executed until all the libtool
5335
# libraries that it depends on are installed.
5337
# This wrapper script should never be moved out of the build directory.
5338
# If it is, it will not operate correctly.
5340
# Sed substitution that helps us do robust quoting. It backslashifies
5341
# metacharacters that are still active within double-quoted strings.
5342
Xsed='${SED} -e 1s/^X//'
5343
sed_quote_subst='$sed_quote_subst'
5345
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5346
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5349
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5350
# is contrary to our usage. Disable this feature.
5351
alias -g '\${1+\"\$@\"}'='\"\$@\"'
5352
setopt NO_GLOB_SUBST
5354
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5356
BIN_SH=xpg4; export BIN_SH # for Tru64
5357
DUALCASE=1; export DUALCASE # for MKS sh
5359
# The HP-UX ksh and POSIX shell print the target directory to stdout
5361
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5363
relink_command=\"$relink_command\"
5365
# This environment variable determines our operation mode.
5366
if test \"\$libtool_install_magic\" = \"$magic\"; then
5367
# install mode needs the following variable:
5368
notinst_deplibs='$notinst_deplibs'
5370
# When we are sourced in execute mode, \$file and \$echo are already set.
5371
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5374
# Make sure echo works.
5375
if test \"X\$1\" = X--no-reexec; then
5376
# Discard the --no-reexec flag, and continue.
5378
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5379
# Yippee, \$echo works!
5382
# Restart under the correct shell, and then maybe \$echo will work.
5383
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5389
# Find the directory that this script lives in.
5390
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5391
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5393
# Follow symbolic links until we get to the real thisdir.
5394
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5395
while test -n \"\$file\"; do
5396
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5398
# If there was a directory component, then change thisdir.
5399
if test \"x\$destdir\" != \"x\$file\"; then
5400
case \"\$destdir\" in
5401
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5402
*) thisdir=\"\$thisdir/\$destdir\" ;;
5406
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5407
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5410
# Try to get the absolute directory name.
5411
absdir=\`cd \"\$thisdir\" && pwd\`
5412
test -n \"\$absdir\" && thisdir=\"\$absdir\"
5415
if test "$fast_install" = yes; then
5417
program=lt-'$outputname'$exeext
5418
progdir=\"\$thisdir/$objdir\"
5420
if test ! -f \"\$progdir/\$program\" || \\
5421
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5422
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5424
file=\"\$\$-\$program\"
5426
if test ! -d \"\$progdir\"; then
5427
$mkdir \"\$progdir\"
5429
$rm \"\$progdir/\$file\"
5434
# relink executable if necessary
5435
if test -n \"\$relink_command\"; then
5436
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5438
$echo \"\$relink_command_output\" >&2
5439
$rm \"\$progdir/\$file\"
5444
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5445
{ $rm \"\$progdir/\$program\";
5446
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5447
$rm \"\$progdir/\$file\"
5451
program='$outputname'
5452
progdir=\"\$thisdir/$objdir\"
5458
if test -f \"\$progdir/\$program\"; then"
5460
# Export our shlibpath_var if we have one.
5461
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5463
# Add our own library path to $shlibpath_var
5464
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5466
# Some systems cannot cope with colon-terminated $shlibpath_var
5467
# The second colon is a workaround for a bug in BeOS R4 sed
5468
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5470
export $shlibpath_var
5474
# fixup the dll searchpath if we need to.
5475
if test -n "$dllsearchpath"; then
5477
# Add the dll search path components to the executable PATH
5478
PATH=$dllsearchpath:\$PATH
5483
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5484
# Run the actual program with our arguments.
5486
# Make sure env LD_LIBRARY_PATH does not mess us up
5487
if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5488
export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5492
# Backslashes separate directories on plain windows
5493
*-*-mingw | *-*-os2*)
5495
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5501
exec \"\$progdir/\$program\" \${1+\"\$@\"}
5506
\$echo \"\$0: cannot exec \$program \$*\"
5510
# The program doesn't exist.
5511
\$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5512
\$echo \"This script is just a wrapper for \$program.\" 1>&2
5513
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
5524
# See if we need to build an old-fashioned archive.
5525
for oldlib in $oldlibs; do
5527
if test "$build_libtool_libs" = convenience; then
5528
oldobjs="$libobjs_save"
5529
addlibs="$convenience"
5530
build_libtool_libs=no
5532
if test "$build_libtool_libs" = module; then
5533
oldobjs="$libobjs_save"
5534
build_libtool_libs=no
5536
oldobjs="$old_deplibs $non_pic_objects"
5538
addlibs="$old_convenience"
5541
if test -n "$addlibs"; then
5542
gentop="$output_objdir/${outputname}x"
5543
generated="$generated $gentop"
5545
func_extract_archives $gentop $addlibs
5546
oldobjs="$oldobjs $func_extract_archives_result"
5549
# Do each command in the archive commands.
5550
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5551
cmds=$old_archive_from_new_cmds
5553
# POSIX demands no paths to be encoded in archives. We have
5554
# to avoid creating archives with duplicate basenames if we
5555
# might have to extract them afterwards, e.g., when creating a
5556
# static archive out of a convenience library, or when linking
5557
# the entirety of a libtool archive into another (currently
5558
# not supported by libtool).
5559
if (for obj in $oldobjs
5561
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5562
done | sort | sort -uc >/dev/null 2>&1); then
5565
$echo "copying selected object files to avoid basename conflicts..."
5567
if test -z "$gentop"; then
5568
gentop="$output_objdir/${outputname}x"
5569
generated="$generated $gentop"
5571
$show "${rm}r $gentop"
5572
$run ${rm}r "$gentop"
5573
$show "$mkdir $gentop"
5574
$run $mkdir "$gentop"
5576
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5581
save_oldobjs=$oldobjs
5584
for obj in $save_oldobjs
5586
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5587
case " $oldobjs " in
5588
" ") oldobjs=$obj ;;
5591
# Make sure we don't pick an alternate name that also
5593
newobj=lt$counter-$objbase
5594
counter=`expr $counter + 1`
5595
case " $oldobjs " in
5596
*[\ /]"$newobj "*) ;;
5597
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5600
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5601
$run ln "$obj" "$gentop/$newobj" ||
5602
$run cp "$obj" "$gentop/$newobj"
5603
oldobjs="$oldobjs $gentop/$newobj"
5605
*) oldobjs="$oldobjs $obj" ;;
5610
eval cmds=\"$old_archive_cmds\"
5612
if len=`expr "X$cmds" : ".*"` &&
5613
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5614
cmds=$old_archive_cmds
5616
# the command line is too long to link in one step, link in parts
5617
$echo "using piecewise archive linking..."
5622
save_oldobjs=$oldobjs
5624
# Is there a better way of finding the last object in the list?
5625
for obj in $save_oldobjs
5629
for obj in $save_oldobjs
5631
oldobjs="$objlist $obj"
5632
objlist="$objlist $obj"
5633
eval test_cmds=\"$old_archive_cmds\"
5634
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5635
test "$len" -le "$max_cmd_len"; then
5638
# the above command should be used before it gets too long
5640
if test "$obj" = "$last_oldobj" ; then
5643
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5644
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5650
if test "X$oldobjs" = "X" ; then
5651
eval cmds=\"\$concat_cmds\"
5653
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5657
save_ifs="$IFS"; IFS='~'
5658
for cmd in $cmds; do
5662
$run eval "$cmd" || exit $?
5667
if test -n "$generated"; then
5668
$show "${rm}r$generated"
5669
$run ${rm}r$generated
5672
# Now create the libtool archive.
5676
test "$build_old_libs" = yes && old_library="$libname.$libext"
5677
$show "creating $output"
5679
# Preserve any variables that may affect compiler behavior
5680
for var in $variables_saved_for_relink; do
5681
if eval test -z \"\${$var+set}\"; then
5682
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5683
elif eval var_value=\$$var; test -z "$var_value"; then
5684
relink_command="$var=; export $var; $relink_command"
5686
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5687
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5690
# Quote the link command for shipping.
5691
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5692
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5693
if test "$hardcode_automatic" = yes ; then
5698
# Only create the output if not a dry run.
5699
if test -z "$run"; then
5700
for installed in no yes; do
5701
if test "$installed" = yes; then
5702
if test -z "$install_libdir"; then
5705
output="$output_objdir/$outputname"i
5706
# Replace all uninstalled libtool libraries with the installed ones
5708
for deplib in $dependency_libs; do
5711
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5712
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5713
if test -z "$libdir"; then
5714
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5717
newdependency_libs="$newdependency_libs $libdir/$name"
5719
*) newdependency_libs="$newdependency_libs $deplib" ;;
5722
dependency_libs="$newdependency_libs"
5724
for lib in $dlfiles; do
5725
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5726
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5727
if test -z "$libdir"; then
5728
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5731
newdlfiles="$newdlfiles $libdir/$name"
5733
dlfiles="$newdlfiles"
5735
for lib in $dlprefiles; do
5736
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5737
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5738
if test -z "$libdir"; then
5739
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5742
newdlprefiles="$newdlprefiles $libdir/$name"
5744
dlprefiles="$newdlprefiles"
5747
for lib in $dlfiles; do
5749
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5750
*) abs=`pwd`"/$lib" ;;
5752
newdlfiles="$newdlfiles $abs"
5754
dlfiles="$newdlfiles"
5756
for lib in $dlprefiles; do
5758
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5759
*) abs=`pwd`"/$lib" ;;
5761
newdlprefiles="$newdlprefiles $abs"
5763
dlprefiles="$newdlprefiles"
5766
# place dlname in correct position for cygwin
5768
case $host,$output,$installed,$module,$dlname in
5769
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5772
# $outputname - a libtool library file
5773
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5775
# Please DO NOT delete this file!
5776
# It is necessary for linking the library.
5778
# The name that we can dlopen(3).
5781
# Names of this library.
5782
library_names='$library_names'
5784
# The name of the static archive.
5785
old_library='$old_library'
5787
# Libraries that this one depends upon.
5788
dependency_libs='$dependency_libs'
5790
# Version information for $libname.
5795
# Is this an already installed library?
5796
installed=$installed
5798
# Should we warn about portability when linking against -modules?
5799
shouldnotlink=$module
5801
# Files to dlopen/dlpreopen
5803
dlpreopen='$dlprefiles'
5805
# Directory that this library needs to be installed in:
5806
libdir='$install_libdir'"
5807
if test "$installed" = no && test "$need_relink" = yes; then
5809
relink_command=\"$relink_command\""
5814
# Do a symbolic link so that the libtool archive can be found in
5815
# LD_LIBRARY_PATH before the program is installed.
5816
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5817
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5823
# libtool install mode
5825
modename="$modename: install"
5827
# There may be an optional sh(1) argument at the beginning of
5828
# install_prog (especially on Windows NT).
5829
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5830
# Allow the use of GNU shtool's install command.
5831
$echo "X$nonopt" | grep shtool > /dev/null; then
5832
# Aesthetically quote it.
5833
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5835
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5839
install_prog="$arg "
5847
# The real first argument should be the name of the installation program.
5848
# Aesthetically quote it.
5849
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5851
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5855
install_prog="$install_prog$arg"
5857
# We need to accept at least all the BSD install flags.
5867
if test -n "$dest"; then
5868
files="$files $dest"
5876
case " $install_prog " in
5881
-g | -m | -o) prev=$arg ;;
5889
# If the previous option needed an argument, then skip it.
5890
if test -n "$prev"; then
5899
# Aesthetically quote the argument.
5900
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5902
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5906
install_prog="$install_prog $arg"
5909
if test -z "$install_prog"; then
5910
$echo "$modename: you must specify an install program" 1>&2
5915
if test -n "$prev"; then
5916
$echo "$modename: the \`$prev' option requires an argument" 1>&2
5921
if test -z "$files"; then
5922
if test -z "$dest"; then
5923
$echo "$modename: no file or destination specified" 1>&2
5925
$echo "$modename: you must specify a destination" 1>&2
5931
# Strip any trailing slash from the destination.
5932
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5934
# Check to see that the destination is a directory.
5935
test -d "$dest" && isdir=yes
5936
if test "$isdir" = yes; then
5940
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5941
test "X$destdir" = "X$dest" && destdir=.
5942
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5944
# Not a directory, so check to see that there is only one file specified.
5946
if test "$#" -gt 2; then
5947
$echo "$modename: \`$dest' is not a directory" 1>&2
5953
[\\/]* | [A-Za-z]:[\\/]*) ;;
5955
for file in $files; do
5959
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5968
# This variable tells wrapper scripts just to set variables rather
5969
# than running their programs.
5970
libtool_install_magic="$magic"
5975
for file in $files; do
5977
# Do each installation.
5980
# Do the static libraries later.
5981
staticlibs="$staticlibs $file"
5985
# Check to see that this really is a libtool archive.
5986
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5988
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5996
# If there is no directory component, then add one.
5998
*/* | *\\*) . $file ;;
6002
# Add the libdir to current_libdirs if it is the destination.
6003
if test "X$destdir" = "X$libdir"; then
6004
case "$current_libdirs " in
6006
*) current_libdirs="$current_libdirs $libdir" ;;
6009
# Note the libdir as a future libdir.
6010
case "$future_libdirs " in
6012
*) future_libdirs="$future_libdirs $libdir" ;;
6016
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6017
test "X$dir" = "X$file/" && dir=
6020
if test -n "$relink_command"; then
6021
# Determine the prefix the user has applied to our future dir.
6022
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6024
# Don't allow the user to place us outside of our expected
6025
# location b/c this prevents finding dependent libraries that
6026
# are installed to the same prefix.
6027
# At present, this check doesn't affect windows .dll's that
6028
# are installed into $libdir/../bin (currently, that works fine)
6029
# but it's something to keep an eye on.
6030
if test "$inst_prefix_dir" = "$destdir"; then
6031
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6035
if test -n "$inst_prefix_dir"; then
6036
# Stick the inst_prefix_dir data into the link command.
6037
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6039
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6042
$echo "$modename: warning: relinking \`$file'" 1>&2
6043
$show "$relink_command"
6044
if $run eval "$relink_command"; then :
6046
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6051
# See the names of the shared library.
6052
set dummy $library_names
6053
if test -n "$2"; then
6059
test -n "$relink_command" && srcname="$realname"T
6061
# Install the shared library and build the symlinks.
6062
$show "$install_prog $dir/$srcname $destdir/$realname"
6063
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6064
if test -n "$stripme" && test -n "$striplib"; then
6065
$show "$striplib $destdir/$realname"
6066
$run eval "$striplib $destdir/$realname" || exit $?
6069
if test "$#" -gt 0; then
6070
# Delete the old symlinks, and create new ones.
6071
# Try `ln -sf' first, because the `ln' binary might depend on
6072
# the symlink we replace! Solaris /bin/ln does not understand -f,
6073
# so we also need to try rm && ln -s.
6076
if test "$linkname" != "$realname"; then
6077
$show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6078
$run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6083
# Do each command in the postinstall commands.
6084
lib="$destdir/$realname"
6085
cmds=$postinstall_cmds
6086
save_ifs="$IFS"; IFS='~'
6087
for cmd in $cmds; do
6091
$run eval "$cmd" || {
6094
# Restore the uninstalled library and exit
6095
if test "$mode" = relink; then
6096
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6105
# Install the pseudo-library for information purposes.
6106
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6107
instname="$dir/$name"i
6108
$show "$install_prog $instname $destdir/$name"
6109
$run eval "$install_prog $instname $destdir/$name" || exit $?
6111
# Maybe install the static library, too.
6112
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6116
# Install (i.e. copy) a libtool object.
6118
# Figure out destination file name, if it wasn't already specified.
6119
if test -n "$destname"; then
6120
destfile="$destdir/$destname"
6122
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6123
destfile="$destdir/$destfile"
6126
# Deduce the name of the destination old-style object file.
6129
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6132
staticdest="$destfile"
6136
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6142
# Install the libtool object if requested.
6143
if test -n "$destfile"; then
6144
$show "$install_prog $file $destfile"
6145
$run eval "$install_prog $file $destfile" || exit $?
6148
# Install the old object if enabled.
6149
if test "$build_old_libs" = yes; then
6150
# Deduce the name of the old-style object file.
6151
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6153
$show "$install_prog $staticobj $staticdest"
6154
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
6160
# Figure out destination file name, if it wasn't already specified.
6161
if test -n "$destname"; then
6162
destfile="$destdir/$destname"
6164
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6165
destfile="$destdir/$destfile"
6168
# If the file is missing, and there is a .exe on the end, strip it
6169
# because it is most likely a libtool script we actually want to
6174
if test ! -f "$file"; then
6175
file=`$echo $file|${SED} 's,.exe$,,'`
6181
# Do a test to see if this is really a libtool program.
6184
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6190
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6194
# Note that it is not necessary on cygwin/mingw to append a dot to
6195
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6196
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6197
# `FILE.' does not work on cygwin managed mounts.
6199
# If there is no directory component, then add one.
6201
*/* | *\\*) . ${wrapper} ;;
6202
*) . ./${wrapper} ;;
6205
# Check the variables that should have been set.
6206
if test -z "$notinst_deplibs"; then
6207
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6212
for lib in $notinst_deplibs; do
6213
# Check to see that each library is installed.
6215
if test -f "$lib"; then
6216
# If there is no directory component, then add one.
6218
*/* | *\\*) . $lib ;;
6222
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6223
if test -n "$libdir" && test ! -f "$libfile"; then
6224
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6230
# Note that it is not necessary on cygwin/mingw to append a dot to
6231
# foo even if both foo and FILE.exe exist: automatic-append-.exe
6232
# behavior happens only for exec(3), not for open(2)! Also, sourcing
6233
# `FILE.' does not work on cygwin managed mounts.
6235
# If there is no directory component, then add one.
6237
*/* | *\\*) . ${wrapper} ;;
6238
*) . ./${wrapper} ;;
6242
if test "$fast_install" = no && test -n "$relink_command"; then
6243
if test "$finalize" = yes && test -z "$run"; then
6244
tmpdir=`func_mktempdir`
6245
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6246
outputname="$tmpdir/$file"
6247
# Replace the output file specification.
6248
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6250
$show "$relink_command"
6251
if $run eval "$relink_command"; then :
6253
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6259
$echo "$modename: warning: cannot relink \`$file'" 1>&2
6262
# Install the binary that we compiled earlier.
6263
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6267
# remove .exe since cygwin /usr/bin/install will append another
6269
case $install_prog,$host in
6270
*/usr/bin/install*,*cygwin*)
6271
case $file:$destfile in
6276
destfile=$destfile.exe
6279
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6284
$show "$install_prog$stripme $file $destfile"
6285
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6286
test -n "$outputname" && ${rm}r "$tmpdir"
6291
for file in $staticlibs; do
6292
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6294
# Set up the ranlib parameters.
6295
oldlib="$destdir/$name"
6297
$show "$install_prog $file $oldlib"
6298
$run eval "$install_prog \$file \$oldlib" || exit $?
6300
if test -n "$stripme" && test -n "$old_striplib"; then
6301
$show "$old_striplib $oldlib"
6302
$run eval "$old_striplib $oldlib" || exit $?
6305
# Do each command in the postinstall commands.
6306
cmds=$old_postinstall_cmds
6307
save_ifs="$IFS"; IFS='~'
6308
for cmd in $cmds; do
6312
$run eval "$cmd" || exit $?
6317
if test -n "$future_libdirs"; then
6318
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6321
if test -n "$current_libdirs"; then
6322
# Maybe just do a dry run.
6323
test -n "$run" && current_libdirs=" -n$current_libdirs"
6324
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6330
# libtool finish mode
6332
modename="$modename: finish"
6336
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6339
libdirs="$libdirs $dir"
6342
for libdir in $libdirs; do
6343
if test -n "$finish_cmds"; then
6344
# Do each command in the finish commands.
6346
save_ifs="$IFS"; IFS='~'
6347
for cmd in $cmds; do
6351
$run eval "$cmd" || admincmds="$admincmds
6356
if test -n "$finish_eval"; then
6357
# Do the single finish_eval.
6358
eval cmds=\"$finish_eval\"
6359
$run eval "$cmds" || admincmds="$admincmds
6365
# Exit here if they wanted silent mode.
6366
test "$show" = : && exit $EXIT_SUCCESS
6368
$echo "X----------------------------------------------------------------------" | $Xsed
6369
$echo "Libraries have been installed in:"
6370
for libdir in $libdirs; do
6374
$echo "If you ever happen to want to link against installed libraries"
6375
$echo "in a given directory, LIBDIR, you must either use libtool, and"
6376
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6377
$echo "flag during linking and do at least one of the following:"
6378
if test -n "$shlibpath_var"; then
6379
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6380
$echo " during execution"
6382
if test -n "$runpath_var"; then
6383
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
6384
$echo " during linking"
6386
if test -n "$hardcode_libdir_flag_spec"; then
6388
eval flag=\"$hardcode_libdir_flag_spec\"
6390
$echo " - use the \`$flag' linker flag"
6392
if test -n "$admincmds"; then
6393
$echo " - have your system administrator run these commands:$admincmds"
6395
if test -f /etc/ld.so.conf; then
6396
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6399
$echo "See any operating system documentation about shared libraries for"
6400
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
6401
$echo "X----------------------------------------------------------------------" | $Xsed
6405
# libtool execute mode
6407
modename="$modename: execute"
6409
# The first argument is the command name.
6411
if test -z "$cmd"; then
6412
$echo "$modename: you must specify a COMMAND" 1>&2
6417
# Handle -dlopen flags immediately.
6418
for file in $execute_dlfiles; do
6419
if test ! -f "$file"; then
6420
$echo "$modename: \`$file' is not a file" 1>&2
6428
# Check to see that this really is a libtool archive.
6429
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6431
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6436
# Read the libtool library.
6440
# If there is no directory component, then add one.
6442
*/* | *\\*) . $file ;;
6446
# Skip this library if it cannot be dlopened.
6447
if test -z "$dlname"; then
6448
# Warn if it was a shared library.
6449
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6453
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6454
test "X$dir" = "X$file" && dir=.
6456
if test -f "$dir/$objdir/$dlname"; then
6459
if test ! -f "$dir/$dlname"; then
6460
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6467
# Just add the directory containing the .lo file.
6468
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6469
test "X$dir" = "X$file" && dir=.
6473
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6478
# Get the absolute pathname.
6479
absdir=`cd "$dir" && pwd`
6480
test -n "$absdir" && dir="$absdir"
6482
# Now add the directory to shlibpath_var.
6483
if eval "test -z \"\$$shlibpath_var\""; then
6484
eval "$shlibpath_var=\"\$dir\""
6486
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6490
# This variable tells wrapper scripts just to set shlibpath_var
6491
# rather than running their programs.
6492
libtool_execute_magic="$magic"
6494
# Check if any of the arguments is a wrapper script.
6501
# Do a test to see if this is really a libtool program.
6502
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6503
# If there is no directory component, then add one.
6505
*/* | *\\*) . $file ;;
6509
# Transform arg to wrapped name.
6510
file="$progdir/$program"
6514
# Quote arguments (to preserve shell metacharacters).
6515
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6516
args="$args \"$file\""
6519
if test -z "$run"; then
6520
if test -n "$shlibpath_var"; then
6521
# Export the shlibpath_var.
6522
eval "export $shlibpath_var"
6525
# Restore saved environment variables
6526
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6528
eval "if test \"\${save_$lt_var+set}\" = set; then
6529
$lt_var=\$save_$lt_var; export $lt_var
6533
# Now prepare to actually exec the command.
6534
exec_cmd="\$cmd$args"
6536
# Display what would be done.
6537
if test -n "$shlibpath_var"; then
6538
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6539
$echo "export $shlibpath_var"
6546
# libtool clean and uninstall mode
6548
modename="$modename: $mode"
6554
# This variable tells wrapper scripts just to set variables rather
6555
# than running their programs.
6556
libtool_install_magic="$magic"
6561
-f) rm="$rm $arg"; rmforce=yes ;;
6562
-*) rm="$rm $arg" ;;
6563
*) files="$files $arg" ;;
6567
if test -z "$rm"; then
6568
$echo "$modename: you must specify an RM program" 1>&2
6575
origobjdir="$objdir"
6576
for file in $files; do
6577
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6578
if test "X$dir" = "X$file"; then
6580
objdir="$origobjdir"
6582
objdir="$dir/$origobjdir"
6584
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6585
test "$mode" = uninstall && objdir="$dir"
6587
# Remember objdir for removal later, being careful to avoid duplicates
6588
if test "$mode" = clean; then
6591
*) rmdirs="$rmdirs $objdir" ;;
6595
# Don't error if the file doesn't exist and rm -f was used.
6596
if (test -L "$file") >/dev/null 2>&1 \
6597
|| (test -h "$file") >/dev/null 2>&1 \
6598
|| test -f "$file"; then
6600
elif test -d "$file"; then
6603
elif test "$rmforce" = yes; then
6611
# Possibly a libtool archive, so verify it.
6612
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6615
# Delete the libtool libraries and symlinks.
6616
for n in $library_names; do
6617
rmfiles="$rmfiles $objdir/$n"
6619
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6623
case " $library_names " in
6624
# " " in the beginning catches empty $dlname
6626
*) rmfiles="$rmfiles $objdir/$dlname" ;;
6628
test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6631
if test -n "$library_names"; then
6632
# Do each command in the postuninstall commands.
6633
cmds=$postuninstall_cmds
6634
save_ifs="$IFS"; IFS='~'
6635
for cmd in $cmds; do
6640
if test "$?" -ne 0 && test "$rmforce" != yes; then
6647
if test -n "$old_library"; then
6648
# Do each command in the old_postuninstall commands.
6649
cmds=$old_postuninstall_cmds
6650
save_ifs="$IFS"; IFS='~'
6651
for cmd in $cmds; do
6656
if test "$?" -ne 0 && test "$rmforce" != yes; then
6662
# FIXME: should reinstall the best remaining shared library.
6669
# Possibly a libtool object, so verify it.
6670
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6675
# Add PIC object to the list of files to remove.
6676
if test -n "$pic_object" \
6677
&& test "$pic_object" != none; then
6678
rmfiles="$rmfiles $dir/$pic_object"
6681
# Add non-PIC object to the list of files to remove.
6682
if test -n "$non_pic_object" \
6683
&& test "$non_pic_object" != none; then
6684
rmfiles="$rmfiles $dir/$non_pic_object"
6690
if test "$mode" = clean ; then
6694
file=`$echo $file|${SED} 's,.exe$,,'`
6695
noexename=`$echo $name|${SED} 's,.exe$,,'`
6696
# $file with .exe has already been added to rmfiles,
6697
# add $file without .exe
6698
rmfiles="$rmfiles $file"
6701
# Do a test to see if this is a libtool program.
6702
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6706
# note $name still contains .exe if it was in $file originally
6707
# as does the version of $file that was added into $rmfiles
6708
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6709
if test "$fast_install" = yes && test -n "$relink_command"; then
6710
rmfiles="$rmfiles $objdir/lt-$name"
6712
if test "X$noexename" != "X$name" ; then
6713
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6719
$show "$rm $rmfiles"
6720
$run $rm $rmfiles || exit_status=1
6722
objdir="$origobjdir"
6724
# Try to remove the ${objdir}s in the directories where we deleted files
6725
for dir in $rmdirs; do
6726
if test -d "$dir"; then
6728
$run rmdir $dir >/dev/null 2>&1
6736
$echo "$modename: you must specify a MODE" 1>&2
6737
$echo "$generic_help" 1>&2
6742
if test -z "$exec_cmd"; then
6743
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6744
$echo "$generic_help" 1>&2
6747
fi # test -z "$show_help"
6749
if test -n "$exec_cmd"; then
6754
# We need to display help for each of the modes.
6757
"Usage: $modename [OPTION]... [MODE-ARG]...
6759
Provide generalized library-building support services.
6761
--config show all configuration variables
6762
--debug enable verbose shell tracing
6763
-n, --dry-run display commands without modifying any files
6764
--features display basic configuration information and exit
6765
--finish same as \`--mode=finish'
6766
--help display this help message and exit
6767
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6768
--quiet same as \`--silent'
6769
--silent don't print informational messages
6770
--tag=TAG use configuration variables from tag TAG
6771
--version print version information
6773
MODE must be one of the following:
6775
clean remove files from the build directory
6776
compile compile a source file into a libtool object
6777
execute automatically set library path, then run a program
6778
finish complete the installation of libtool libraries
6779
install install libraries or executables
6780
link create a library or an executable
6781
uninstall remove libraries from an installed directory
6783
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6784
a more detailed description of MODE.
6786
Report bugs to <bug-libtool@gnu.org>."
6792
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6794
Remove files from the build directory.
6796
RM is the name of the program to use to delete files associated with each FILE
6797
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6800
If FILE is a libtool library, object or program, all the files associated
6801
with it are deleted. Otherwise, only FILE itself is deleted using RM."
6806
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6808
Compile a source file into a libtool library object.
6810
This mode accepts the following additional options:
6812
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
6813
-prefer-pic try to building PIC objects only
6814
-prefer-non-pic try to building non-PIC objects only
6815
-static always build a \`.o' file suitable for static linking
6817
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6818
from the given SOURCEFILE.
6820
The output file name is determined by removing the directory component from
6821
SOURCEFILE, then substituting the C source code suffix \`.c' with the
6822
library object suffix, \`.lo'."
6827
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6829
Automatically set library path, then run a program.
6831
This mode accepts the following additional options:
6833
-dlopen FILE add the directory containing FILE to the library path
6835
This mode sets the library path environment variable according to \`-dlopen'
6838
If any of the ARGS are libtool executable wrappers, then they are translated
6839
into their corresponding uninstalled binary, and any of their required library
6840
directories are added to the library path.
6842
Then, COMMAND is executed, with ARGS as arguments."
6847
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6849
Complete the installation of libtool libraries.
6851
Each LIBDIR is a directory that contains libtool libraries.
6853
The commands that this mode executes may require superuser privileges. Use
6854
the \`--dry-run' option if you just want to see what would be executed."
6859
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6861
Install executables or libraries.
6863
INSTALL-COMMAND is the installation command. The first component should be
6864
either the \`install' or \`cp' program.
6866
The rest of the components are interpreted as arguments to that command (only
6867
BSD-compatible install options are recognized)."
6872
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6874
Link object files or libraries together to form another library, or to
6875
create an executable program.
6877
LINK-COMMAND is a command using the C compiler that you would use to create
6878
a program from several object files.
6880
The following components of LINK-COMMAND are treated specially:
6882
-all-static do not do any dynamic linking at all
6883
-avoid-version do not add a version suffix if possible
6884
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6885
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6886
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6887
-export-symbols SYMFILE
6888
try to export only the symbols listed in SYMFILE
6889
-export-symbols-regex REGEX
6890
try to export only the symbols matching REGEX
6891
-LLIBDIR search LIBDIR for required installed libraries
6892
-lNAME OUTPUT-FILE requires the installed library libNAME
6893
-module build a library that can dlopened
6894
-no-fast-install disable the fast-install mode
6895
-no-install link a not-installable executable
6896
-no-undefined declare that a library does not refer to external symbols
6897
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6898
-objectlist FILE Use a list of object files found in FILE to specify objects
6899
-precious-files-regex REGEX
6900
don't remove output files matching REGEX
6901
-release RELEASE specify package release information
6902
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6903
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6904
-static do not do any dynamic linking of uninstalled libtool libraries
6905
-static-libtool-libs
6906
do not do any dynamic linking of libtool libraries
6907
-version-info CURRENT[:REVISION[:AGE]]
6908
specify library version info [each variable defaults to 0]
6910
All other options (arguments beginning with \`-') are ignored.
6912
Every other argument is treated as a filename. Files ending in \`.la' are
6913
treated as uninstalled libtool libraries, other files are standard or library
6916
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6917
only library objects (\`.lo' files) may be specified, and \`-rpath' is
6918
required, except when creating a convenience library.
6920
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6921
using \`ar' and \`ranlib', or on Windows using \`lib'.
6923
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6924
is created, otherwise an executable program is created."
6929
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6931
Remove libraries from an installation directory.
6933
RM is the name of the program to use to delete files associated with each FILE
6934
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6937
If FILE is a libtool library, all the files associated with it are deleted.
6938
Otherwise, only FILE itself is deleted using RM."
6942
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6949
$echo "Try \`$modename --help' for more information about other modes."
6953
# The TAGs below are defined such that we never get into a situation
6954
# in which we disable both kinds of libraries. Given conflicting
6955
# choices, we go for a static library, that is the most portable,
6956
# since we can't tell whether shared libraries were disabled because
6957
# the user asked for that or because the platform doesn't support
6958
# them. This is particularly important on AIX, because we don't
6959
# support having both static and shared libraries enabled at the same
6960
# time on that platform, so we default to a shared-only configuration.
6961
# If a disable-shared tag is given, we'll fallback to a static-only
6962
# configuration. But we'll never go from static-only to shared-only.
6964
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6966
# ### END LIBTOOL TAG CONFIG: disable-shared
6968
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6970
# ### END LIBTOOL TAG CONFIG: disable-static