1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun ltconfig.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
27
# Check that we have a working $echo.
28
if test "X$1" = X--no-reexec; then
29
# Discard the --no-reexec flag, and continue.
31
elif test "X$1" = X--fallback-echo; then
32
# Avoid inline document here, it may be left over
34
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35
# Yippee, $echo works!
38
# Restart under the correct shell, and then maybe $echo will work.
39
exec $SHELL "$0" --no-reexec ${1+"$@"}
42
if test "X$1" = X--fallback-echo; then
43
# used as fallback echo
51
# The name of this program.
52
progname=`$echo "$0" | sed 's%^.*/%%'`
59
TIMESTAMP=" (1.641.2.206mm 2001/04/03 21:47:47)"
62
help="Try \`$progname --help' for more information."
63
magic="%%%MAGIC variable%%%"
68
# Sed substitution that helps us do robust quoting. It backslashifies
69
# metacharacters that are still active within double-quoted strings.
71
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
73
NL2SP='tr \015\012 \040\040'
76
# Only set LANG and LC_ALL to C if already set.
77
# These must not be set unconditionally because not all systems understand
78
# e.g. LANG=C (notably SCO).
79
# We save the old values to restore during execute mode.
80
if test "${LC_ALL+set}" = set; then
81
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
83
if test "${LANG+set}" = set; then
84
save_LANG="$LANG"; LANG=C; export LANG
87
if test "$LTCONFIG_VERSION" != "$VERSION"; then
88
echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
89
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
93
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
94
echo "$modename: not configured to build any kind of library" 1>&2
95
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
108
lo2o="s/\\.lo\$/.${objext}/"
109
o2lo="s/\\.${objext}\$/.lo/"
111
# Parse our command line options once, thoroughly.
118
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
122
# If the previous option needs an argument, assign it.
123
if test -n "$prev"; then
126
execute_dlfiles="$execute_dlfiles $arg"
131
# Check whether tagname contains only valid characters
134
echo "$progname: invalid tag name: $tagname" 1>&2
139
if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
140
taglist="$taglist $tagname"
141
# Evaluate the configuration.
142
eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
144
echo "$progname: ignoring unknown tag $tagname" 1>&2
157
# Have we seen a non-optional argument yet?
164
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
169
sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0"
170
# Now print the configurations for the tags.
171
for tagname in $taglist; do
172
sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
178
echo "$progname: enabling shell trace mode"
188
if test "$build_libtool_libs" = yes; then
189
echo "enable shared libraries"
191
echo "disable shared libraries"
193
if test "$build_old_libs" = yes; then
194
echo "enable static libraries"
196
echo "disable static libraries"
201
--finish) mode="finish" ;;
203
--mode) prevopt="--mode" prev=mode ;;
204
--mode=*) mode="$optarg" ;;
210
--tag) prevopt="--tag" prev=tag ;;
212
set tag "$optarg" ${1+"$@"}
223
$echo "$modename: unrecognized option \`$arg'" 1>&2
235
if test -n "$prevopt"; then
236
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
241
if test -z "$show_help"; then
243
# Infer the operation mode.
244
if test -z "$mode"; then
246
*cc | *++ | gcc* | *-gcc*)
258
*db | *dbx | *strace | *truss)
268
# If we have no mode, but dlfiles were specified, then do execute mode.
269
test -n "$execute_dlfiles" && mode=execute
271
# Just use the default operation mode.
272
if test -z "$mode"; then
273
if test -n "$nonopt"; then
274
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
276
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
283
# Only execute mode is allowed to have -dlopen flags.
284
if test -n "$execute_dlfiles" && test "$mode" != execute; then
285
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
290
# Change the help message to a mode-specific one.
292
help="Try \`$modename --help --mode=$mode' for more information."
294
# These modes are in order of execution frequency so that they run quickly.
296
# libtool compile mode
298
modename="$modename: compile"
299
# Get the compilation command and the source file.
312
# Aesthetically quote the previous argument.
314
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
317
# Double-quote args containing other shell metacharacters.
318
# Many Bourne shells cannot handle close brackets correctly
319
# in scan sets, so we specify it separately.
320
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
325
# Add the previous argument to base_compile.
326
if test -z "$base_compile"; then
327
base_compile="$lastarg"
329
base_compile="$base_compile $lastarg"
335
# Accept any command-line options.
338
if test "$user_target" != "no"; then
339
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
366
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
368
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
372
# Double-quote args containing other shell metacharacters.
373
# Many Bourne shells cannot handle close brackets correctly
374
# in scan sets, so we specify it separately.
376
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
380
lastarg="$lastarg $arg"
383
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
385
# Add the arguments to base_compile.
386
if test -z "$base_compile"; then
387
base_compile="$lastarg"
389
base_compile="$base_compile $lastarg"
397
# The next one is the -o target name
402
# We got the output file
409
# Accept the current argument as the source file.
413
# Aesthetically quote the previous argument.
415
# Backslashify any backslashes, double quotes, and dollar signs.
416
# These are the only characters that are still specially
417
# interpreted inside of double-quoted scrings.
418
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
420
# Double-quote args containing other shell metacharacters.
421
# Many Bourne shells cannot handle close brackets correctly
422
# in scan sets, so we specify it separately.
424
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
425
lastarg="\"$lastarg\""
429
# Add the previous argument to base_compile.
430
if test -z "$base_compile"; then
431
base_compile="$lastarg"
433
base_compile="$base_compile $lastarg"
441
# Get the name of the library object.
442
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
445
$echo "$modename: you must specify a target with \`-o'" 1>&2
450
# Recognize several different file suffixes.
451
# If the user specifies -o file.o, it is replaced with file.lo
460
*.class) xform=class ;;
465
*.java) xform=java ;;
468
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
471
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
473
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
478
# Infer tagged configuration to use if any are available and
479
# if one wasn't chosen via the "--tag" command line option.
480
# Only attempt this if the compiler in the base compile
481
# command doesn't match the default compiler.
482
if test -n "$available_tags" && test -z "$tagname"; then
483
case $base_compile in
485
# Blanks in the command may have been stripped by the calling shell,
486
# but not from the CC environment variable when ltconfig was run.
489
for z in $available_tags; do
490
if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
491
# Evaluate the configuration.
492
eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
493
case $base_compile in
495
# The compiler in the base compile command matches
496
# the one in the tagged configuration.
497
# Assume this is the tagged configuration we want.
508
# If $tagname still isn't set, then no tagged configuration
509
# was found and let the user know that the "--tag" command
510
# line option must be used.
511
if test -z "$tagname"; then
512
echo "$modename: unable to infer tagged configuration"
513
echo "$modename: specify a tag with \`--tag'" 1>&2
516
# echo "$modename: using $tagname tagged configuration"
522
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
523
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
524
if test "X$xdir" = "X$obj"; then
529
lobj=${xdir}$objdir/$objname
531
if test -z "$base_compile"; then
532
$echo "$modename: you must specify a compilation command" 1>&2
537
# Delete any leftover library objects.
538
if test "$build_old_libs" = yes; then
539
removelist="$obj $lobj $libobj ${libobj}T"
541
removelist="$lobj $libobj ${libobj}T"
545
trap "$run $rm $removelist; exit 1" 1 2 15
547
# On Cygwin there's no "real" PIC flag so we must build both object types
549
cygwin* | mingw* | pw32* | os2*)
553
if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
554
# non-PIC code in shared libraries is not supported
558
# Calculate the filename of the output object if compiler does
559
# not support -o with -c
560
if test "$compiler_c_o" = no; then
561
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
562
lockfile="$output_obj.lock"
563
removelist="$removelist $output_obj $lockfile"
564
trap "$run $rm $removelist; exit 1" 1 2 15
571
# Lock this critical section if it is needed
572
# We use this script file to make the link, it avoids creating a new file
573
if test "$need_locks" = yes; then
574
until $run ln "$0" "$lockfile" 2>/dev/null; do
575
$show "Waiting for $lockfile to be removed"
578
elif test "$need_locks" = warn; then
579
if test -f "$lockfile"; then
581
*** ERROR, $lockfile exists and contains:
582
`cat $lockfile 2>/dev/null`
584
This indicates that another process is trying to use the same
585
temporary object file, and libtool could not work around it because
586
your compiler does not support \`-c' and \`-o' together. If you
587
repeat this compilation, it may succeed, by chance, but you had better
588
avoid parallel builds (make -j) in this platform, or get a better
594
echo $srcfile > "$lockfile"
597
if test -n "$fix_srcfile_path"; then
598
eval srcfile=\"$fix_srcfile_path\"
601
$run $rm "$libobj" "${libobj}T"
603
# Create a libtool object file (analogous to a ".la" file),
604
# but don't create it if we're doing a dry run.
605
test -z "$run" && cat > ${libobj}T <<EOF
606
# $libobj - a libtool object file
607
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
609
# Please DO NOT delete this file!
610
# It is necessary for linking the library.
612
# Name of the PIC object.
615
# Only build a PIC object if we are building libtool libraries.
616
if test "$build_libtool_libs" = yes; then
617
# Without this assignment, base_compile gets emptied.
618
fbsd_hideous_sh_bug=$base_compile
620
if test "$pic_mode" != no; then
621
command="$base_compile $srcfile $pic_flag"
623
# Don't build PIC code
624
command="$base_compile $srcfile"
627
if test ! -d ${xdir}$objdir; then
628
$show "$mkdir ${xdir}$objdir"
629
$run $mkdir ${xdir}$objdir
631
if test $status -ne 0 && test ! -d ${xdir}$objdir; then
636
if test -z "$output_obj"; then
637
# Place PIC objects in $objdir
638
command="$command -o $lobj"
641
$run $rm "$lobj" "$output_obj"
644
if $run eval "$command"; then :
646
test -n "$output_obj" && $run $rm $removelist
650
if test "$need_locks" = warn &&
651
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
653
*** ERROR, $lockfile contains:
654
`cat $lockfile 2>/dev/null`
656
but it should contain:
659
This indicates that another process is trying to use the same
660
temporary object file, and libtool could not work around it because
661
your compiler does not support \`-c' and \`-o' together. If you
662
repeat this compilation, it may succeed, by chance, but you had better
663
avoid parallel builds (make -j) in this platform, or get a better
670
# Just move the object if needed, then go on to compile the next one
671
if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
672
$show "$mv $output_obj $lobj"
673
if $run $mv $output_obj $lobj; then :
681
# Append the name of the PIC object to the libtool object file.
682
test -z "$run" && cat >> ${libobj}T <<EOF
683
pic_object='$objdir/$objname'
687
# Allow error messages only from the first compilation.
688
suppress_output=' >/dev/null 2>&1'
690
# No PIC object so indicate it doesn't exist in the libtool
692
test -z "$run" && cat >> ${libobj}T <<EOF
698
# Only build a position-dependent object if we build old libraries.
699
if test "$build_old_libs" = yes; then
700
if test "$pic_mode" != yes; then
701
# Don't build PIC code
702
command="$base_compile $srcfile"
704
command="$base_compile $srcfile $pic_flag"
706
if test "$compiler_c_o" = yes; then
707
command="$command -o $obj"
710
# Suppress compiler output if we already did a PIC compilation.
711
command="$command$suppress_output"
712
$run $rm "$obj" "$output_obj"
714
if $run eval "$command"; then :
720
if test "$need_locks" = warn &&
721
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
723
*** ERROR, $lockfile contains:
724
`cat $lockfile 2>/dev/null`
726
but it should contain:
729
This indicates that another process is trying to use the same
730
temporary object file, and libtool could not work around it because
731
your compiler does not support \`-c' and \`-o' together. If you
732
repeat this compilation, it may succeed, by chance, but you had better
733
avoid parallel builds (make -j) in this platform, or get a better
740
# Just move the object if needed
741
if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
742
$show "$mv $output_obj $obj"
743
if $run $mv $output_obj $obj; then :
751
# Append the name of the non-PIC object the libtool object file.
752
# Only append if the libtool object file exists.
753
test -z "$run" && cat >> ${libobj}T <<EOF
754
# Name of the non-PIC object.
755
non_pic_object='$objname'
759
# Append the name of the non-PIC object the libtool object file.
760
# Only append if the libtool object file exists.
761
test -z "$run" && cat >> ${libobj}T <<EOF
762
# Name of the non-PIC object.
768
$run $mv "${libobj}T" "${libobj}"
770
# Unlock the critical section if it was locked
771
if test "$need_locks" != no; then
780
modename="$modename: link"
782
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
783
# It is impossible to link a dll without this setting, and
784
# we shouldn't force the makefile maintainer to figure out
785
# which system we are compiling for in order to pass an extra
786
# flag for every libtool invokation.
789
# FIXME: Unfortunately, there are problems with the above when trying
790
# to make a dll which has undefined symbols, in which case not
791
# even a static library is built. For now, we need to specify
792
# -no-undefined on the libtool link line when we can be certain
793
# that all symbols are satisfied, otherwise we get a static library.
800
libtool_args="$nonopt"
801
base_compile="$nonopt"
802
compile_command="$nonopt"
803
finalize_command="$nonopt"
816
lib_search_path=`pwd`
824
export_symbols_regex=
832
prefer_static_libs=no
844
# We need to know -static, to get the right output filenames.
848
-all-static | -static)
849
if test "X$arg" = "X-all-static"; then
850
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
851
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
853
if test -n "$link_static_flag"; then
854
dlopen_self=$dlopen_self_static
857
if test -z "$pic_flag" && test -n "$link_static_flag"; then
858
dlopen_self=$dlopen_self_static
861
build_libtool_libs=no
863
prefer_static_libs=yes
869
# See if our shared archives depend on static archives.
870
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
872
# Go through the arguments, transforming them on the way.
873
while test $# -gt 0; do
875
base_compile="$base_compile $arg"
878
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
879
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
883
libtool_args="$libtool_args $qarg"
885
# If the previous option needs an argument, assign it.
886
if test -n "$prev"; then
889
compile_command="$compile_command @OUTPUT@"
890
finalize_command="$finalize_command @OUTPUT@"
896
if test "$preload" = no; then
897
# Add the symbol object into the linking commands.
898
compile_command="$compile_command @SYMFILE@"
899
finalize_command="$finalize_command @SYMFILE@"
903
*.la | *.lo) ;; # We handle these cases below.
905
if test "$dlself" = no; then
913
if test "$prev" = dlprefiles; then
915
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
925
if test "$prev" = dlfiles; then
926
dlfiles="$dlfiles $arg"
928
dlprefiles="$dlprefiles $arg"
936
export_symbols="$arg"
937
if test ! -f "$arg"; then
938
$echo "$modename: symbol file \`$arg' does not exist"
945
export_symbols_regex="$arg"
955
if test -f "$arg"; then
958
for fil in `cat $save_arg`
960
# moreargs="$moreargs $fil"
962
# A libtool-controlled object.
964
# Check to see that this really is a libtool object.
965
if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
970
# If there is no directory component, then add one.
972
*/* | *\\*) . $arg ;;
976
if test -z "$pic_object" || \
977
test -z "$non_pic_object" ||
978
test "$pic_object" = none && \
979
test "$non_pic_object" = none; then
980
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
984
# Extract subdirectory from the argument.
985
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
986
if test "X$xdir" = "X$arg"; then
992
if test "$pic_object" != none; then
993
# Prepend the subdirectory the object is found in.
994
pic_object="$xdir$pic_object"
996
if test "$prev" = dlfiles; then
997
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
998
dlfiles="$dlfiles $pic_object"
1002
# If libtool objects are unsupported, then we need to preload.
1007
# CHECK ME: I think I busted this. -Ossama
1008
if test "$prev" = dlprefiles; then
1009
# Preload the old-style object.
1010
dlprefiles="$dlprefiles $pic_object"
1015
libobjs="$libobjs $pic_object"
1020
if test "$non_pic_object" != none; then
1021
# Prepend the subdirectory the object is found in.
1022
non_pic_object="$xdir$non_pic_object"
1024
# A standard non-PIC object
1025
non_pic_objects="$non_pic_objects $non_pic_object"
1026
if test -z "$pic_object" || test "$pic_object" = none ; then
1027
arg="$non_pic_object"
1031
# Only an error if not doing a dry-run.
1032
if test -z "$run"; then
1033
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1038
# Extract subdirectory from the argument.
1039
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1040
if test "X$xdir" = "X$arg"; then
1046
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1047
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1048
libobjs="$libobjs $pic_object"
1049
non_pic_objects="$non_pic_objects $non_pic_object"
1054
$echo "$modename: link input file \`$save_arg' does not exist"
1062
# We need an absolute path.
1064
[\\/]* | [A-Za-z]:[\\/]*) ;;
1066
$echo "$modename: only absolute run-paths are allowed" 1>&2
1070
if test "$prev" = rpath; then
1073
*) rpath="$rpath $arg" ;;
1078
*) xrpath="$xrpath $arg" ;;
1085
compiler_flags="$compiler_flags $qarg"
1087
compile_command="$compile_command $qarg"
1088
finalize_command="$finalize_command $qarg"
1092
linker_flags="$linker_flags $qarg"
1093
compiler_flags="$compiler_flags $wl$qarg"
1095
compile_command="$compile_command $wl$qarg"
1096
finalize_command="$finalize_command $wl$qarg"
1100
eval "$prev=\"\$arg\""
1111
if test -n "$link_static_flag"; then
1112
compile_command="$compile_command $link_static_flag"
1113
finalize_command="$finalize_command $link_static_flag"
1119
# FIXME: remove this flag sometime in the future.
1120
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1144
-export-symbols | -export-symbols-regex)
1145
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1146
$echo "$modename: not more than one -exported-symbols argument allowed"
1149
if test "X$arg" = "X-export-symbols"; then
1157
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1158
# so, if we see these flags be careful not to treat them like -L
1160
case $with_gcc/$host in
1162
compile_command="$compile_command $arg"
1163
finalize_command="$finalize_command $arg"
1170
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1171
# We need an absolute path.
1173
[\\/]* | [A-Za-z]:[\\/]*) ;;
1175
absdir=`cd "$dir" && pwd`
1176
if test -z "$absdir"; then
1177
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1186
deplibs="$deplibs -L$dir"
1187
lib_search_path="$lib_search_path $dir"
1191
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1192
case :$dllsearchpath: in
1194
*) dllsearchpath="$dllsearchpath:$dir";;
1202
if test "$arg" = "-lc"; then
1204
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
1205
# These systems don't actually have c library (as such)
1208
*-*-rhapsody* | *-*-darwin1.[012])
1209
# Rhapsody C library is in the System framework
1210
deplibs="$deplibs -framework System"
1214
elif test "$arg" = "-lm"; then
1216
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1217
# These systems don't actually have math library (as such)
1220
*-*-rhapsody* | *-*-darwin1.[012])
1221
# Rhapsody math library is in the System framework
1222
deplibs="$deplibs -framework System"
1227
deplibs="$deplibs $arg"
1243
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1244
# The PATH hackery in wrapper scripts is required on Windows
1245
# in order for the loader to find any dlls it needs.
1246
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1247
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1285
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1286
# We need an absolute path.
1288
[\\/]* | [A-Za-z]:[\\/]*) ;;
1290
$echo "$modename: only absolute run-paths are allowed" 1>&2
1296
*) xrpath="$xrpath $dir" ;;
1302
# The effects of -static are defined in a previous loop.
1303
# We used to do the same as -all-static on platforms that
1304
# didn't have a PIC flag, but the assumption that the effects
1305
# would be equivalent was wrong. It would break on at least
1306
# Digital Unix and AIX.
1321
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1323
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1324
for flag in $args; do
1327
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1332
compiler_flags="$compiler_flags $flag"
1335
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1339
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1341
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1342
for flag in $args; do
1345
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1350
compiler_flags="$compiler_flags $wl$flag"
1351
linker_flags="$linker_flags $flag"
1354
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1367
# Some other compiler flag.
1369
# Unknown arguments in both finalize_command and compile_command need
1370
# to be aesthetically quoted because they are evaled later.
1371
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1373
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1380
# A standard object.
1385
# A libtool-controlled object.
1387
# Check to see that this really is a libtool object.
1388
if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1393
# If there is no directory component, then add one.
1395
*/* | *\\*) . $arg ;;
1399
if test -z "$pic_object" || \
1400
test -z "$non_pic_object" ||
1401
test "$pic_object" = none && \
1402
test "$non_pic_object" = none; then
1403
$echo "$modename: cannot find name of object for \`$arg'" 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
if test "$pic_object" != none; then
1416
# Prepend the subdirectory the object is found in.
1417
pic_object="$xdir$pic_object"
1419
if test "$prev" = dlfiles; then
1420
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1421
dlfiles="$dlfiles $pic_object"
1425
# If libtool objects are unsupported, then we need to preload.
1430
# CHECK ME: I think I busted this. -Ossama
1431
if test "$prev" = dlprefiles; then
1432
# Preload the old-style object.
1433
dlprefiles="$dlprefiles $pic_object"
1438
libobjs="$libobjs $pic_object"
1443
if test "$non_pic_object" != none; then
1444
# Prepend the subdirectory the object is found in.
1445
non_pic_object="$xdir$non_pic_object"
1447
# A standard non-PIC object
1448
non_pic_objects="$non_pic_objects $non_pic_object"
1449
if test -z "$pic_object" || test "$pic_object" = none ; then
1450
arg="$non_pic_object"
1454
# Only an error if not doing a dry-run.
1455
if test -z "$run"; then
1456
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1461
# Extract subdirectory from the argument.
1462
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1463
if test "X$xdir" = "X$arg"; then
1469
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1470
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1471
libobjs="$libobjs $pic_object"
1472
non_pic_objects="$non_pic_objects $non_pic_object"
1479
deplibs="$deplibs $arg"
1480
old_deplibs="$old_deplibs $arg"
1485
# A libtool-controlled library.
1487
if test "$prev" = dlfiles; then
1488
# This library was specified with -dlopen.
1489
dlfiles="$dlfiles $arg"
1491
elif test "$prev" = dlprefiles; then
1492
# The library was specified with -dlpreopen.
1493
dlprefiles="$dlprefiles $arg"
1496
deplibs="$deplibs $arg"
1501
# Some other compiler argument.
1503
# Unknown arguments in both finalize_command and compile_command need
1504
# to be aesthetically quoted because they are evaled later.
1505
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1507
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1514
# Now actually substitute the argument into the commands.
1515
if test -n "$arg"; then
1516
compile_command="$compile_command $arg"
1517
finalize_command="$finalize_command $arg"
1521
if test -n "$prev"; then
1522
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1527
# Infer tagged configuration to use if any are available and
1528
# if one wasn't chosen via the "--tag" command line option.
1529
# Only attempt this if the compiler in the base link
1530
# command doesn't match the default compiler.
1531
if test -n "$available_tags" && test -z "$tagname"; then
1532
case $base_compile in
1534
# Blanks in the command may have been stripped by the calling shell,
1535
# but not from the CC environment variable when ltconfig was run.
1538
for z in $available_tags; do
1539
if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1540
# Evaluate the configuration.
1541
eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1542
case $base_compile in
1544
# The compiler in $compile_command matches
1545
# the one in the tagged configuration.
1546
# Assume this is the tagged configuration we want.
1557
# If $tagname still isn't set, then no tagged configuration
1558
# was found and let the user know that the "--tag" command
1559
# line option must be used.
1560
if test -z "$tagname"; then
1561
echo "$modename: unable to infer tagged configuration"
1562
echo "$modename: specify a tag with \`--tag'" 1>&2
1565
# echo "$modename: using $tagname tagged configuration"
1571
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1572
eval arg=\"$export_dynamic_flag_spec\"
1573
compile_command="$compile_command $arg"
1574
finalize_command="$finalize_command $arg"
1578
# calculate the name of the file, without its directory
1579
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1580
libobjs_save="$libobjs"
1582
if test -n "$shlibpath_var"; then
1583
# get the directories listed in $shlibpath_var
1584
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1588
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1589
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1591
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1592
if test "X$output_objdir" = "X$output"; then
1593
output_objdir="$objdir"
1595
output_objdir="$output_objdir/$objdir"
1597
# Create the object directory.
1598
if test ! -d $output_objdir; then
1599
$show "$mkdir $output_objdir"
1600
$run $mkdir $output_objdir
1602
if test $status -ne 0 && test ! -d $output_objdir; then
1607
# Determine the type of output
1610
$echo "$modename: you must specify an output file" 1>&2
1614
*.$libext) linkmode=oldlib ;;
1615
*.lo | *.$objext) linkmode=obj ;;
1616
*.la) linkmode=lib ;;
1617
*) linkmode=prog ;; # Anything else should be a program.
1622
# Find all interdependent deplibs by searching for libraries
1623
# that are linked more than once (e.g. -la -lb -la)
1624
for deplib in $deplibs; do
1626
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1628
libs="$libs $deplib"
1631
if test $linkmode = lib; then
1632
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1638
need_relink=no # whether we're linking any uninstalled libtool libraries
1639
uninst_deplibs= # uninstalled libtool libraries
1640
uninst_path= # paths that contain uninstalled libtool libraries
1644
for file in $dlfiles $dlprefiles; do
1648
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1660
passes="conv scan dlopen dlpreopen link"
1665
for pass in $passes; do
1666
if test "$linkmode,$pass" = "lib,link" ||
1667
test "$linkmode,$pass" = "prog,scan"; then
1671
if test $linkmode = prog; then
1673
dlopen) libs="$dlfiles" ;;
1674
dlpreopen) libs="$dlprefiles" ;;
1675
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1678
if test $pass = dlopen; then
1679
# Collect dlpreopened libraries
1680
save_deplibs="$deplibs"
1683
for deplib in $libs; do
1688
if test $linkmode != lib && test $linkmode != prog; then
1689
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1692
if test $pass = conv; then
1693
deplibs="$deplib $deplibs"
1696
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1697
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1698
# Search the libtool library
1699
lib="$searchdir/lib${name}.la"
1700
if test -f "$lib"; then
1705
if test "$found" != yes; then
1706
if test "$linkmode,$pass" = "prog,link"; then
1707
compile_deplibs="$deplib $compile_deplibs"
1708
finalize_deplibs="$deplib $finalize_deplibs"
1710
deplibs="$deplib $deplibs"
1711
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1719
deplibs="$deplib $deplibs"
1720
test $pass = conv && continue
1721
newdependency_libs="$deplib $newdependency_libs"
1722
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1725
if test $pass = conv; then
1726
deplibs="$deplib $deplibs"
1729
if test $pass = scan; then
1730
deplibs="$deplib $deplibs"
1731
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1733
compile_deplibs="$deplib $compile_deplibs"
1734
finalize_deplibs="$deplib $finalize_deplibs"
1738
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1744
if test $pass = link; then
1745
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1746
# Make sure the xrpath contains only unique directories.
1749
*) xrpath="$xrpath $dir" ;;
1752
deplibs="$deplib $deplibs"
1755
*.la) lib="$deplib" ;;
1757
if test $pass = conv; then
1758
deplibs="$deplib $deplibs"
1763
if test "$deplibs_check_method" != pass_all; then
1765
echo "*** Warning: This library needs some functionality provided by $deplib."
1766
echo "*** I have the capability to make that library automatically link in when"
1767
echo "*** you link to this library. But I can only do this if you have a"
1768
echo "*** shared version of the library, which you do not appear to have."
1771
echo "*** Warning: Linking the shared library $output against the"
1772
echo "*** static library $deplib is not portable!"
1773
deplibs="$deplib $deplibs"
1778
if test $pass != link; then
1779
deplibs="$deplib $deplibs"
1781
compile_deplibs="$deplib $compile_deplibs"
1782
finalize_deplibs="$deplib $finalize_deplibs"
1789
if test $pass = conv; then
1790
deplibs="$deplib $deplibs"
1791
elif test $linkmode = prog; then
1792
if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1793
# If there is no dlopen support or we're linking statically,
1794
# we need to preload.
1795
newdlprefiles="$newdlprefiles $deplib"
1796
compile_deplibs="$deplib $compile_deplibs"
1797
finalize_deplibs="$deplib $finalize_deplibs"
1799
newdlfiles="$newdlfiles $deplib"
1809
if test $found = yes || test -f "$lib"; then :
1811
$echo "$modename: cannot find the library \`$lib'" 1>&2
1815
# Check to see that this really is a libtool archive.
1816
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1818
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1822
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1823
test "X$ladir" = "X$lib" && ladir="."
1831
# If the library was installed with an old release of libtool,
1832
# it will not redefine variable installed.
1837
*/* | *\\*) . $lib ;;
1841
if test "$linkmode,$pass" = "lib,link" ||
1842
test "$linkmode,$pass" = "prog,scan" ||
1843
{ test $linkmode != prog && test $linkmode != lib; }; then
1844
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1845
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1848
if test $pass = conv; then
1849
# only check for convenience libraries
1850
deplibs="$lib $deplibs"
1851
if test -z "$libdir"; then
1852
if test -z "$old_library"; then
1853
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1856
# It is a libtool convenience library, so add in its objects.
1857
convenience="$convenience $ladir/$objdir/$old_library"
1858
old_convenience="$old_convenience $ladir/$objdir/$old_library"
1860
for deplib in $dependency_libs; do
1861
deplibs="$deplib $deplibs"
1862
case "$tmp_libs " in
1863
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1865
tmp_libs="$tmp_libs $deplib"
1867
elif test $linkmode != prog && test $linkmode != lib; then
1868
$echo "$modename: \`$lib' is not a convenience library" 1>&2
1874
# Get the name of the library we link against.
1876
for l in $old_library $library_names; do
1879
if test -z "$linklib"; then
1880
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1884
# This library was specified with -dlopen.
1885
if test $pass = dlopen; then
1886
if test -z "$libdir"; then
1887
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1890
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1891
# If there is no dlname, no dlopen support or we're linking
1892
# statically, we need to preload. We also need to preload any
1893
# dependent libraries so libltdl's deplib preloader doesn't
1894
# bomb out in the load deplibs phase.
1895
dlprefiles="$dlprefiles $lib $dependency_libs"
1897
newdlfiles="$newdlfiles $lib"
1902
# We need an absolute path.
1904
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1906
abs_ladir=`cd "$ladir" && pwd`
1907
if test -z "$abs_ladir"; then
1908
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1909
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1914
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1916
# Find the relevant object directory and library name.
1917
if test "X$installed" = Xyes; then
1918
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1919
$echo "$modename: warning: library \`$lib' was moved." 1>&2
1928
dir="$ladir/$objdir"
1929
absdir="$abs_ladir/$objdir"
1930
# Remove this search path later
1931
uninst_path="$uninst_path $abs_ladir"
1933
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1935
# This library was specified with -dlpreopen.
1936
if test $pass = dlpreopen; then
1937
if test -z "$libdir"; then
1938
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1941
# Prefer using a static library (so that no silly _DYNAMIC symbols
1942
# are required to link).
1943
if test -n "$old_library"; then
1944
newdlprefiles="$newdlprefiles $dir/$old_library"
1945
# Otherwise, use the dlname, so that lt_dlopen finds it.
1946
elif test -n "$dlname"; then
1947
newdlprefiles="$newdlprefiles $dir/$dlname"
1949
newdlprefiles="$newdlprefiles $dir/$linklib"
1953
if test -z "$libdir"; then
1954
# link the convenience library
1955
if test $linkmode = lib; then
1956
deplibs="$dir/$old_library $deplibs"
1957
elif test "$linkmode,$pass" = "prog,link"; then
1958
compile_deplibs="$dir/$old_library $compile_deplibs"
1959
finalize_deplibs="$dir/$old_library $finalize_deplibs"
1961
deplibs="$lib $deplibs" # used for prog,scan pass
1966
if test $linkmode = prog && test $pass != link; then
1967
newlib_search_path="$newlib_search_path $ladir"
1968
deplibs="$lib $deplibs"
1971
if test "$link_all_deplibs" != no || test -z "$library_names" ||
1972
test "$build_libtool_libs" = no; then
1977
for deplib in $dependency_libs; do
1979
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1981
# Need to link against all dependency_libs?
1982
if test $linkalldeplibs = yes; then
1983
deplibs="$deplib $deplibs"
1985
# Need to hardcode shared library paths
1986
# or/and link against static libraries
1987
newdependency_libs="$deplib $newdependency_libs"
1989
case "$tmp_libs " in
1990
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1992
tmp_libs="$tmp_libs $deplib"
1997
if test "$linkmode,$pass" = "prog,link"; then
1998
if test -n "$library_names" &&
1999
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2000
# We need to hardcode the library path
2001
if test -n "$shlibpath_var"; then
2002
# Make sure the rpath contains only unique directories.
2003
case "$temp_rpath " in
2006
*) temp_rpath="$temp_rpath $dir" ;;
2010
# Hardcode the library path.
2011
# Skip directories that are in the system default run-time
2013
case " $sys_lib_dlsearch_path " in
2016
case "$compile_rpath " in
2018
*) compile_rpath="$compile_rpath $absdir"
2023
case " $sys_lib_dlsearch_path " in
2026
case "$finalize_rpath " in
2028
*) finalize_rpath="$finalize_rpath $libdir"
2034
if test "$alldeplibs" = yes &&
2035
{ test "$deplibs_check_method" = pass_all ||
2036
{ test "$build_libtool_libs" = yes &&
2037
test -n "$library_names"; }; }; then
2038
# We only need to search for static libraries
2043
link_static=no # Whether the deplib will be linked statically
2044
if test -n "$library_names" &&
2045
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2046
if test "$installed" = no; then
2047
uninst_deplibs="$uninst_deplibs $lib"
2050
# This is a shared library
2051
if test $linkmode = lib && test "$hardcode_into_libs" = all; then
2052
# Hardcode the library path.
2053
# Skip directories that are in the system default run-time
2055
case " $sys_lib_dlsearch_path " in
2058
case "$compile_rpath " in
2060
*) compile_rpath="$compile_rpath $absdir"
2064
case " $sys_lib_dlsearch_path " in
2067
case "$finalize_rpath " in
2069
*) finalize_rpath="$finalize_rpath $libdir"
2075
if test -n "$old_archive_from_expsyms_cmds"; then
2076
# figure out the soname
2077
set dummy $library_names
2080
libname=`eval \\$echo \"$libname_spec\"`
2081
# use dlname if we got it. it's perfectly good, no?
2082
if test -n "$dlname"; then
2084
elif test -n "$soname_spec"; then
2088
major=`expr $current - $age`
2092
eval soname=\"$soname_spec\"
2097
# Make a new name for the extract_expsyms_cmds to use
2099
soname=`echo $soroot | sed -e 's/^.*\///'`
2100
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2102
# If the library has no export list, then create one now
2103
if test -f "$output_objdir/$soname-def"; then :
2105
$show "extracting exported symbol list from \`$soname'"
2106
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2107
eval cmds=\"$extract_expsyms_cmds\"
2108
for cmd in $cmds; do
2111
$run eval "$cmd" || exit $?
2117
if test -f "$output_objdir/$newlib"; then :; else
2118
$show "generating import library for \`$soname'"
2119
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2120
eval cmds=\"$old_archive_from_expsyms_cmds\"
2121
for cmd in $cmds; do
2124
$run eval "$cmd" || exit $?
2128
# make sure the library variables are pointing to the new library
2133
if test $linkmode = prog || test "$mode" != relink; then
2138
case $hardcode_action in
2139
immediate | unsupported)
2140
if test "$hardcode_direct" = no; then
2142
elif test "$hardcode_minus_L" = no; then
2144
*-*-sunos*) add_shlibpath="$dir" ;;
2148
elif test "$hardcode_shlibpath_var" = no; then
2149
add_shlibpath="$dir"
2156
if test "$hardcode_direct" = yes; then
2158
elif test "$hardcode_minus_L" = yes; then
2161
elif test "$hardcode_shlibpath_var" = yes; then
2162
add_shlibpath="$dir"
2171
if test "$lib_linked" != yes; then
2172
$echo "$modename: configuration error: unsupported hardcode properties"
2176
if test -n "$add_shlibpath"; then
2177
case :$compile_shlibpath: in
2178
*":$add_shlibpath:"*) ;;
2179
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2182
if test $linkmode = prog; then
2183
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2184
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2186
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2187
test -n "$add" && deplibs="$add $deplibs"
2188
if test "$hardcode_direct" != yes && \
2189
test "$hardcode_minus_L" != yes && \
2190
test "$hardcode_shlibpath_var" = yes; then
2191
case :$finalize_shlibpath: in
2193
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2199
if test $linkmode = prog || test "$mode" = relink; then
2203
# Finalize command for both is simple: just hardcode it.
2204
if test "$hardcode_direct" = yes; then
2205
add="$libdir/$linklib"
2206
elif test "$hardcode_minus_L" = yes; then
2209
elif test "$hardcode_shlibpath_var" = yes; then
2210
case :$finalize_shlibpath: in
2212
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2216
# We cannot seem to hardcode it, guess we'll fake it.
2221
if test $linkmode = prog; then
2222
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2223
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2225
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2226
test -n "$add" && deplibs="$add $deplibs"
2229
elif test $linkmode = prog; then
2230
# Here we assume that one of hardcode_direct or hardcode_minus_L
2231
# is not unsupported. This is valid on all known static and
2233
if test "$hardcode_direct" != unsupported; then
2234
test -n "$old_library" && linklib="$old_library"
2235
compile_deplibs="$dir/$linklib $compile_deplibs"
2236
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2238
compile_deplibs="-l$name -L$dir $compile_deplibs"
2239
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2241
elif test "$build_libtool_libs" = yes; then
2242
# Not a shared library
2243
if test "$deplibs_check_method" != pass_all; then
2244
# We're trying link a shared library against a static one
2245
# but the system doesn't support it.
2246
# Just print a warning and add the library to dependency_libs so
2247
# that the program can be linked against the static library.
2249
echo "*** Warning: This library needs some functionality provided by $lib."
2250
echo "*** I have the capability to make that library automatically link in when"
2251
echo "*** you link to this library. But I can only do this if you have a"
2252
echo "*** shared version of the library, which you do not appear to have."
2254
convenience="$convenience $dir/$old_library"
2255
old_convenience="$old_convenience $dir/$old_library"
2256
deplibs="$dir/$old_library $deplibs"
2261
if test $linkmode = lib; then
2262
if test -n "$dependency_libs" &&
2263
{ test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2264
test $link_static = yes; }; then
2265
# Extract -R from dependency_libs
2267
for libdir in $dependency_libs; do
2269
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2271
*" $temp_xrpath "*) ;;
2272
*) xrpath="$xrpath $temp_xrpath";;
2274
*) temp_deplibs="$temp_deplibs $libdir";;
2277
dependency_libs="$temp_deplibs"
2280
newlib_search_path="$newlib_search_path $absdir"
2281
# Link against this library
2282
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2283
# ... and its dependency_libs
2285
for deplib in $dependency_libs; do
2286
newdependency_libs="$deplib $newdependency_libs"
2287
case "$tmp_libs " in
2288
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2290
tmp_libs="$tmp_libs $deplib"
2293
if test $link_all_deplibs != no; then
2294
# Add the search paths of all dependency libraries
2295
for deplib in $dependency_libs; do
2297
-L*) path="$deplib" ;;
2299
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2300
test "X$dir" = "X$deplib" && dir="."
2301
# We need an absolute path.
2303
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2305
absdir=`cd "$dir" && pwd`
2306
if test -z "$absdir"; then
2307
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2312
if grep "^installed=no" $deplib > /dev/null; then
2313
path="-L$absdir/$objdir"
2315
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2316
if test -z "$libdir"; then
2317
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2320
if test "$absdir" != "$libdir"; then
2321
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2328
case " $deplibs " in
2330
*) deplibs="$path $deplibs" ;;
2336
dependency_libs="$newdependency_libs"
2337
if test $pass = dlpreopen; then
2338
# Link the dlpreopened libraries before other libraries
2339
for deplib in $save_deplibs; do
2340
deplibs="$deplib $deplibs"
2343
if test $pass != dlopen; then
2344
if test $pass != conv; then
2345
# Make sure lib_search_path contains only unique directories.
2347
for dir in $newlib_search_path; do
2348
case "$lib_search_path " in
2350
*) lib_search_path="$lib_search_path $dir" ;;
2356
if test "$linkmode,$pass" != "prog,link"; then
2359
vars="compile_deplibs finalize_deplibs"
2361
for var in $vars dependency_libs; do
2362
# Make sure that $var contains only unique libraries
2363
# and add them in reverse order
2364
eval tmp_libs=\"\$$var\"
2366
for deplib in $tmp_libs; do
2368
-L*) new_libs="$deplib $new_libs" ;;
2370
case " $specialdeplibs " in
2371
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2373
case " $new_libs " in
2375
*) new_libs="$deplib $new_libs" ;;
2383
for deplib in $new_libs; do
2386
case " $tmp_libs " in
2388
*) tmp_libs="$tmp_libs $deplib" ;;
2391
*) tmp_libs="$tmp_libs $deplib" ;;
2394
eval $var=\"$tmp_libs\"
2398
if test $linkmode = prog; then
2399
dlfiles="$newdlfiles"
2400
dlprefiles="$newdlprefiles"
2405
if test -n "$deplibs"; then
2406
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2409
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2410
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2413
if test -n "$rpath"; then
2414
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2417
if test -n "$xrpath"; then
2418
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2421
if test -n "$vinfo"; then
2422
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2425
if test -n "$release"; then
2426
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2429
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2430
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2433
# Now set the variables for building old libraries.
2434
build_libtool_libs=no
2436
objs="$objs$old_deplibs"
2440
# Make sure we only generate libraries of the form `libNAME.la'.
2443
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2444
eval libname=\"$libname_spec\"
2447
if test "$module" = no; then
2448
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2452
if test "$need_lib_prefix" != no; then
2453
# Add the "lib" prefix for modules if required
2454
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2455
eval libname=\"$libname_spec\"
2457
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2462
if test -n "$objs"; then
2463
if test "$deplibs_check_method" != pass_all; then
2464
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2468
echo "*** Warning: Linking the shared library $output against the non-libtool"
2469
echo "*** objects $objs is not portable!"
2470
libobjs="$libobjs $objs"
2474
if test "$dlself" != no; then
2475
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2479
if test $# -gt 2; then
2480
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2485
if test -z "$rpath"; then
2486
if test "$build_libtool_libs" = yes; then
2487
# Building a libtool convenience library.
2488
# Some compilers have problems with a `.al' extension so
2489
# convenience libraries should have the same extension an
2490
# archive normally would.
2491
oldlibs="$output_objdir/$libname.$libext $oldlibs"
2492
build_libtool_libs=convenience
2496
if test -n "$vinfo"; then
2497
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2500
if test -n "$release"; then
2501
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2505
# Parse the version information argument.
2506
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
2507
set dummy $vinfo 0 0 0
2510
if test -n "$8"; then
2511
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2520
# Check that each of the things are valid numbers.
2522
0 | [1-9] | [1-9][0-9]*) ;;
2524
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2525
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2531
0 | [1-9] | [1-9][0-9]*) ;;
2533
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2534
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2540
0 | [1-9] | [1-9][0-9]*) ;;
2542
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2543
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2548
if test $age -gt $current; then
2549
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2550
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2554
# Calculate the version variables.
2558
case $version_type in
2562
# Like Linux, but with the current version available in
2563
# verstring for coding it into the library header
2564
major=.`expr $current - $age`
2565
versuffix="$major.$age.$revision"
2566
# Darwin ld doesn't like 0 for these options...
2567
minor_current=`expr $current + 1`
2568
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2573
versuffix=".$current.$revision";
2578
versuffix=".$current";
2582
major=`expr $current - $age + 1`
2583
verstring="sgi$major.$revision"
2585
# Add in all the interfaces that we are compatible with.
2587
while test $loop != 0; do
2588
iface=`expr $revision - $loop`
2589
loop=`expr $loop - 1`
2590
verstring="sgi$major.$iface:$verstring"
2593
# Before this point, $major must not contain `.'.
2595
versuffix="$major.$revision"
2599
major=.`expr $current - $age`
2600
versuffix="$major.$age.$revision"
2604
major=`expr $current - $age`
2605
versuffix=".$current.$age.$revision"
2606
verstring="$current.$age.$revision"
2608
# Add in all the interfaces that we are compatible with.
2610
while test $loop != 0; do
2611
iface=`expr $current - $loop`
2612
loop=`expr $loop - 1`
2613
verstring="$verstring:${iface}.0"
2616
# Make executables depend on our current version.
2617
verstring="$verstring:${current}.0"
2622
versuffix=".$current.$revision"
2626
# Use '-' rather than '.', since we only want one
2627
# extension on DOS 8.3 filesystems.
2628
major=`expr $current - $age`
2633
$echo "$modename: unknown library version type \`$version_type'" 1>&2
2634
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2639
# Clear the version info if we defaulted, and they specified a release.
2640
if test -z "$vinfo" && test -n "$release"; then
2643
if test "$need_version" = no; then
2650
# Remove version info from name if versioning should be avoided
2651
if test "$avoid_version" = yes && test "$need_version" = no; then
2657
# Check to see if the archive will have undefined symbols.
2658
if test "$allow_undefined" = yes; then
2659
if test "$allow_undefined_flag" = unsupported; then
2660
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2661
build_libtool_libs=no
2665
# Don't allow undefined symbols.
2666
allow_undefined_flag="$no_undefined_flag"
2670
if test "$mode" != relink; then
2671
# Remove our outputs, but don't remove object files since they
2672
# may have been created when compiling PIC objects.
2674
tempremovelist=`echo "$output_objdir/*"`
2675
for p in $tempremovelist; do
2679
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
2680
removelist="$removelist $p"
2685
if test -n "$removelist"; then
2686
$show "${rm}r $removelist"
2687
$run ${rm}r $removelist
2691
# Now set the variables for building old libraries.
2692
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2693
oldlibs="$oldlibs $output_objdir/$libname.$libext"
2695
# Transform .lo files to .o files.
2696
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2699
# Eliminate all temporary directories.
2700
for path in $uninst_path; do
2701
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2702
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2703
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2706
if test -n "$xrpath"; then
2707
# If the user specified any rpath flags, then add them.
2709
for libdir in $xrpath; do
2710
temp_xrpath="$temp_xrpath -R$libdir"
2711
case "$finalize_rpath " in
2713
*) finalize_rpath="$finalize_rpath $libdir" ;;
2716
if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2717
dependency_libs="$temp_xrpath $dependency_libs"
2721
# Make sure dlfiles contains only unique files that won't be dlpreopened
2722
old_dlfiles="$dlfiles"
2724
for lib in $old_dlfiles; do
2725
case " $dlprefiles $dlfiles " in
2727
*) dlfiles="$dlfiles $lib" ;;
2731
# Make sure dlprefiles contains only unique files
2732
old_dlprefiles="$dlprefiles"
2734
for lib in $old_dlprefiles; do
2735
case "$dlprefiles " in
2737
*) dlprefiles="$dlprefiles $lib" ;;
2741
if test "$build_libtool_libs" = yes; then
2742
if test -n "$rpath"; then
2744
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2745
# these systems don't actually have a c library (as such)!
2747
*-*-rhapsody* | *-*-darwin1.[012])
2748
# Rhapsody C library is in the System framework
2749
deplibs="$deplibs -framework System"
2752
# Add libc to deplibs on all other systems if necessary.
2753
if test $build_libtool_need_lc = "yes"; then
2754
deplibs="$deplibs -lc"
2760
# Transform deplibs into only deplibs that can be linked in shared.
2762
libname_save=$libname
2763
release_save=$release
2764
versuffix_save=$versuffix
2766
# I'm not sure if I'm treating the release correctly. I think
2767
# release should show up in the -l (ie -lgmp5) so we don't want to
2768
# add it in twice. Is that correct?
2774
case $deplibs_check_method in
2776
# Don't check for shared/static. Everything works.
2777
# This might be a little naive. We might want to check
2778
# whether the library exists or not. But this is on
2779
# osf3 & osf4 and I'm not really sure... Just
2780
# implementing what was already the behaviour.
2784
# This code stresses the "libraries are programs" paradigm to its
2785
# limits. Maybe even breaks it. We compile a program, linking it
2786
# against the deplibs as a proxy for the library. Then we can check
2787
# whether they linked in statically or dynamically with ldd.
2789
cat > conftest.c <<EOF
2790
int main() { return 0; }
2793
$LTCC -o conftest conftest.c $deplibs
2794
if test $? -eq 0 ; then
2795
ldd_output=`ldd conftest`
2796
for i in $deplibs; do
2797
name="`expr $i : '-l\(.*\)'`"
2798
# If $name is empty we are operating on a -L argument.
2799
if test "$name" != "" -a "$name" != "0"; then
2800
libname=`eval \\$echo \"$libname_spec\"`
2801
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2802
set dummy $deplib_matches
2804
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2805
newdeplibs="$newdeplibs $i"
2809
echo "*** Warning: This library needs some functionality provided by $i."
2810
echo "*** I have the capability to make that library automatically link in when"
2811
echo "*** you link to this library. But I can only do this if you have a"
2812
echo "*** shared version of the library, which you do not appear to have."
2815
newdeplibs="$newdeplibs $i"
2819
# Error occured in the first compile. Let's try to salvage the situation:
2820
# Compile a seperate program for each library.
2821
for i in $deplibs; do
2822
name="`expr $i : '-l\(.*\)'`"
2823
# If $name is empty we are operating on a -L argument.
2824
if test "$name" != "" -a "$name" != "0"; then
2826
$LTCC -o conftest conftest.c $i
2828
if test $? -eq 0 ; then
2829
ldd_output=`ldd conftest`
2830
libname=`eval \\$echo \"$libname_spec\"`
2831
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2832
set dummy $deplib_matches
2834
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2835
newdeplibs="$newdeplibs $i"
2839
echo "*** Warning: This library needs some functionality provided by $i."
2840
echo "*** I have the capability to make that library automatically link in when"
2841
echo "*** you link to this library. But I can only do this if you have a"
2842
echo "*** shared version of the library, which you do not appear to have."
2847
echo "*** Warning! Library $i is needed by this library but I was not able to"
2848
echo "*** make it link in! You will probably need to install it or some"
2849
echo "*** library that it depends on before this library will be fully"
2850
echo "*** functional. Installing it before continuing would be even better."
2853
newdeplibs="$newdeplibs $i"
2859
set dummy $deplibs_check_method
2860
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2861
for a_deplib in $deplibs; do
2862
name="`expr $a_deplib : '-l\(.*\)'`"
2863
# If $name is empty we are operating on a -L argument.
2864
if test "$name" != "" -a "$name" != "0"; then
2865
libname=`eval \\$echo \"$libname_spec\"`
2866
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2867
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2868
for potent_lib in $potential_libs; do
2869
# Follow soft links.
2870
if ls -lLd "$potent_lib" 2>/dev/null \
2871
| grep " -> " >/dev/null; then
2874
# The statement above tries to avoid entering an
2875
# endless loop below, in case of cyclic links.
2876
# We might still enter an endless loop, since a link
2877
# loop can be closed while we follow links,
2879
potlib="$potent_lib"
2880
while test -h "$potlib" 2>/dev/null; do
2881
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2883
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2884
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2887
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2889
| egrep "$file_magic_regex" > /dev/null; then
2890
newdeplibs="$newdeplibs $a_deplib"
2896
if test -n "$a_deplib" ; then
2899
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2900
echo "*** I have the capability to make that library automatically link in when"
2901
echo "*** you link to this library. But I can only do this if you have a"
2902
echo "*** shared version of the library, which you do not appear to have."
2905
# Add a -L argument.
2906
newdeplibs="$newdeplibs $a_deplib"
2908
done # Gone through all deplibs.
2912
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2913
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2914
grep . >/dev/null; then
2916
if test "X$deplibs_check_method" = "Xnone"; then
2917
echo "*** Warning: inter-library dependencies are not supported in this platform."
2919
echo "*** Warning: inter-library dependencies are not known to be supported."
2921
echo "*** All declared inter-library dependencies are being dropped."
2926
versuffix=$versuffix_save
2928
release=$release_save
2929
libname=$libname_save
2932
if test "$droppeddeps" = yes; then
2933
if test "$module" = yes; then
2935
echo "*** Warning: libtool could not satisfy all declared inter-library"
2936
echo "*** dependencies of module $libname. Therefore, libtool will create"
2937
echo "*** a static module, that should work as long as the dlopening"
2938
echo "*** application is linked with the -dlopen flag."
2939
if test -z "$global_symbol_pipe"; then
2941
echo "*** However, this would only work if libtool was able to extract symbol"
2942
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2943
echo "*** not find such a program. So, this module is probably useless."
2944
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2946
if test "$build_old_libs" = no; then
2947
oldlibs="$output_objdir/$libname.$libext"
2948
build_libtool_libs=module
2951
build_libtool_libs=no
2954
echo "*** The inter-library dependencies that have been dropped here will be"
2955
echo "*** automatically added whenever a program is linked with this library"
2956
echo "*** or is declared to -dlopen it."
2958
if test $allow_undefined = no; then
2960
echo "*** Since this library must not contain undefined symbols,"
2961
echo "*** because either the platform does not support them or"
2962
echo "*** it was explicitly requested with -no-undefined,"
2963
echo "*** libtool will only create a static version of it."
2964
if test "$build_old_libs" = no; then
2965
oldlibs="$output_objdir/$libname.$libext"
2966
build_libtool_libs=module
2969
build_libtool_libs=no
2974
# Done checking deplibs!
2978
# All the library-specific variables (install_libdir is set above).
2983
# Test again, we may have decided not to build it any more
2984
if test "$build_libtool_libs" = yes; then
2985
if test $hardcode_into_libs = yes; then
2986
# Hardcode the library paths
2989
rpath="$finalize_rpath"
2990
test "$mode" != relink && rpath="$compile_rpath$rpath"
2991
for libdir in $rpath; do
2992
if test -n "$hardcode_libdir_flag_spec"; then
2993
if test -n "$hardcode_libdir_separator"; then
2994
if test -z "$hardcode_libdirs"; then
2995
hardcode_libdirs="$libdir"
2997
# Just accumulate the unique libdirs.
2998
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2999
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3002
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3007
eval flag=\"$hardcode_libdir_flag_spec\"
3008
dep_rpath="$dep_rpath $flag"
3010
elif test -n "$runpath_var"; then
3011
case "$perm_rpath " in
3013
*) perm_rpath="$perm_rpath $libdir" ;;
3017
# Substitute the hardcoded libdirs into the rpath.
3018
if test -n "$hardcode_libdir_separator" &&
3019
test -n "$hardcode_libdirs"; then
3020
libdir="$hardcode_libdirs"
3021
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3023
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3024
# We should set the runpath_var.
3026
for dir in $perm_rpath; do
3029
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3031
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3034
shlibpath="$finalize_shlibpath"
3035
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3036
if test -n "$shlibpath"; then
3037
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3040
# Get the real and link names of the library.
3041
eval library_names=\"$library_names_spec\"
3042
set dummy $library_names
3046
if test -n "$soname_spec"; then
3047
eval soname=\"$soname_spec\"
3051
if test x$dlname = x; then
3055
lib="$output_objdir/$realname"
3058
linknames="$linknames $link"
3061
# # Ensure that we have .o objects for linkers which dislike .lo
3062
# # (e.g. aix) in case we are running --disable-static
3063
# for obj in $libobjs; do
3064
# xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3065
# if test "X$xdir" = "X$obj"; then
3070
# baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3071
# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3072
# if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
3073
# $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3074
# $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3078
# Use standard objects if they are pic
3079
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3081
# Prepare the list of exported symbols
3082
if test -z "$export_symbols"; then
3083
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3084
$show "generating symbol list for \`$libname.la'"
3085
export_symbols="$output_objdir/$libname.exp"
3086
$run $rm $export_symbols
3087
eval cmds=\"$export_symbols_cmds\"
3088
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3089
for cmd in $cmds; do
3092
$run eval "$cmd" || exit $?
3095
if test -n "$export_symbols_regex"; then
3096
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3097
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3098
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3099
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3104
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3105
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3108
if test -n "$convenience"; then
3109
if test -n "$whole_archive_flag_spec"; then
3110
save_libobjs=$libobjs
3111
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3113
gentop="$output_objdir/${outputname}x"
3114
$show "${rm}r $gentop"
3115
$run ${rm}r "$gentop"
3116
$show "$mkdir $gentop"
3117
$run $mkdir "$gentop"
3119
if test $status -ne 0 && test ! -d "$gentop"; then
3122
generated="$generated $gentop"
3124
for xlib in $convenience; do
3125
# Extract the objects.
3127
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3128
*) xabs=`pwd`"/$xlib" ;;
3130
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3131
xdir="$gentop/$xlib"
3133
$show "${rm}r $xdir"
3135
$show "$mkdir $xdir"
3138
if test $status -ne 0 && test ! -d "$xdir"; then
3141
$show "(cd $xdir && $AR x $xabs)"
3142
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3144
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3149
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3150
eval flag=\"$thread_safe_flag_spec\"
3151
linker_flags="$linker_flags $flag"
3154
# Make a backup of the uninstalled library when relinking
3155
if test "$mode" = relink && test "$hardcode_into_libs" = all; then
3156
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3159
# Do each of the archive commands.
3160
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3161
eval cmds=\"$archive_expsym_cmds\"
3163
eval cmds=\"$archive_cmds\"
3165
if len=`expr "X$cmds" : ".*"` &&
3166
test $len -le $max_cmd_len; then
3169
# The command line is too long to link in one step, link piecewise.
3170
$echo "creating reloadable object files..."
3172
# Save the value of $output and $libobjs because we want to
3173
# use them later. If we have whole_archive_flag_spec, we
3174
# want to use save_libobjs as it was before
3175
# whole_archive_flag_spec was expanded, because we can't
3176
# assume the linker understands whole_archive_flag_spec.
3177
# This may have to be revisited, in case too many
3178
# convenience libraries get linked in and end up exceeding
3180
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3181
save_libobjs=$libobjs
3185
# Clear the reloadable object creation command queue and
3186
# initialize k to one.
3193
output=$output_objdir/$save_output-${k}.$objext
3194
# Loop over the list of objects to be linked.
3195
for obj in $save_libobjs
3197
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3198
if test "X$objlist" = X ||
3199
{ len=`expr "X$test_cmds" : ".*"` &&
3200
test $len -le $max_cmd_len; }; then
3201
objlist="$objlist $obj"
3203
# The command $test_cmds is almost too long, add a
3204
# command to the queue.
3205
if test $k -eq 1 ; then
3206
# The first file doesn't have a previous command to add.
3207
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3209
# All subsequent reloadable object files will link in
3210
# the last one created.
3211
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3213
last_robj=$output_objdir/$save_output-${k}.$objext
3215
output=$output_objdir/$save_output-${k}.$objext
3220
# Handle the remaining objects by creating one last
3221
# reloadable object file. All subsequent reloadable object
3222
# files will link in the last one created.
3223
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3224
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3226
# Set up a command to remove the reloadale object files
3227
# after they are used.
3229
while test $i -lt $k
3232
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3235
$echo "creating a temporary reloadable object file: $output"
3237
# Loop through the commands generated above and execute them.
3238
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3239
for cmd in $concat_cmds; do
3242
$run eval "$cmd" || exit $?
3247
# Restore the value of output.
3250
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3251
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3253
# Expand the library linking commands again to reset the
3254
# value of $libobjs for piecewise linking.
3256
# Do each of the archive commands.
3257
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3258
eval cmds=\"$archive_expsym_cmds\"
3260
eval cmds=\"$archive_cmds\"
3263
# Append the command to remove the reloadable object files
3264
# to the just-reset $cmds.
3265
eval cmds=\"\$cmds~$rm $delfiles\"
3267
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3268
for cmd in $cmds; do
3271
$run eval "$cmd" || exit $?
3275
# Restore the uninstalled library and exit
3276
if test "$mode" = relink && test "$hardcode_into_libs" = all; then
3277
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3281
# Create links to the real library.
3282
for linkname in $linknames; do
3283
if test "$realname" != "$linkname"; then
3284
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3285
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3289
# If -module or -export-dynamic was specified, set the dlname.
3290
if test "$module" = yes || test "$export_dynamic" = yes; then
3291
# On all known operating systems, these are identical.
3298
if test -n "$deplibs"; then
3299
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3302
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3303
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3306
if test -n "$rpath"; then
3307
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3310
if test -n "$xrpath"; then
3311
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3314
if test -n "$vinfo"; then
3315
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3318
if test -n "$release"; then
3319
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3324
if test -n "$objs$old_deplibs"; then
3325
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3329
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3337
# Delete the old objects.
3338
$run $rm $obj $libobj
3340
# Objects from convenience libraries. This assumes
3341
# single-version convenience libraries. Whenever we create
3342
# different ones for PIC/non-PIC, this we'll have to duplicate
3346
# reload_cmds runs $LD directly, so let us get rid of
3347
# -Wl from whole_archive_flag_spec
3350
if test -n "$convenience"; then
3351
if test -n "$whole_archive_flag_spec"; then
3352
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3354
gentop="$output_objdir/${obj}x"
3355
$show "${rm}r $gentop"
3356
$run ${rm}r "$gentop"
3357
$show "$mkdir $gentop"
3358
$run $mkdir "$gentop"
3360
if test $status -ne 0 && test ! -d "$gentop"; then
3363
generated="$generated $gentop"
3365
for xlib in $convenience; do
3366
# Extract the objects.
3368
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3369
*) xabs=`pwd`"/$xlib" ;;
3371
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3372
xdir="$gentop/$xlib"
3374
$show "${rm}r $xdir"
3376
$show "$mkdir $xdir"
3379
if test $status -ne 0 && test ! -d "$xdir"; then
3382
$show "(cd $xdir && $AR x $xabs)"
3383
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3385
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3390
# Create the old-style object.
3391
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
3394
eval cmds=\"$reload_cmds\"
3395
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3396
for cmd in $cmds; do
3399
$run eval "$cmd" || exit $?
3403
# Exit if we aren't doing a library object file.
3404
if test -z "$libobj"; then
3405
if test -n "$gentop"; then
3406
$show "${rm}r $gentop"
3413
if test "$build_libtool_libs" != yes; then
3414
if test -n "$gentop"; then
3415
$show "${rm}r $gentop"
3419
# Create an invalid libtool object if no PIC, so that we don't
3420
# accidentally link it into a program.
3421
# $show "echo timestamp > $libobj"
3422
# $run eval "echo timestamp > $libobj" || exit $?
3426
if test -n "$pic_flag" || test "$pic_mode" != default; then
3427
# Only do commands if we really have different PIC objects.
3428
reload_objs="$libobjs $reload_conv_objs"
3430
eval cmds=\"$reload_cmds\"
3431
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3432
for cmd in $cmds; do
3435
$run eval "$cmd" || exit $?
3439
# # Just create a symlink.
3442
# xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3443
# if test "X$xdir" = "X$libobj"; then
3448
# baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3449
# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3450
# $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3451
# $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3454
if test -n "$gentop"; then
3455
$show "${rm}r $gentop"
3464
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3466
if test -n "$vinfo"; then
3467
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3470
if test -n "$release"; then
3471
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3474
if test "$preload" = yes; then
3475
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3476
test "$dlopen_self_static" = unknown; then
3477
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3481
compile_command="$compile_command $compile_deplibs"
3482
finalize_command="$finalize_command $finalize_deplibs"
3484
if test -n "$rpath$xrpath"; then
3485
# If the user specified any rpath flags, then add them.
3486
for libdir in $rpath $xrpath; do
3487
# This is the magic to use -rpath.
3488
case "$finalize_rpath " in
3490
*) finalize_rpath="$finalize_rpath $libdir" ;;
3495
# Now hardcode the library paths
3498
for libdir in $compile_rpath $finalize_rpath; do
3499
if test -n "$hardcode_libdir_flag_spec"; then
3500
if test -n "$hardcode_libdir_separator"; then
3501
if test -z "$hardcode_libdirs"; then
3502
hardcode_libdirs="$libdir"
3504
# Just accumulate the unique libdirs.
3505
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3506
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3509
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3514
eval flag=\"$hardcode_libdir_flag_spec\"
3515
rpath="$rpath $flag"
3517
elif test -n "$runpath_var"; then
3518
case "$perm_rpath " in
3520
*) perm_rpath="$perm_rpath $libdir" ;;
3524
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3525
case :$dllsearchpath: in
3527
*) dllsearchpath="$dllsearchpath:$libdir";;
3532
# Substitute the hardcoded libdirs into the rpath.
3533
if test -n "$hardcode_libdir_separator" &&
3534
test -n "$hardcode_libdirs"; then
3535
libdir="$hardcode_libdirs"
3536
eval rpath=\" $hardcode_libdir_flag_spec\"
3538
compile_rpath="$rpath"
3542
for libdir in $finalize_rpath; do
3543
if test -n "$hardcode_libdir_flag_spec"; then
3544
if test -n "$hardcode_libdir_separator"; then
3545
if test -z "$hardcode_libdirs"; then
3546
hardcode_libdirs="$libdir"
3548
# Just accumulate the unique libdirs.
3549
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3550
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3553
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3558
eval flag=\"$hardcode_libdir_flag_spec\"
3559
rpath="$rpath $flag"
3561
elif test -n "$runpath_var"; then
3562
case "$finalize_perm_rpath " in
3564
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3568
# Substitute the hardcoded libdirs into the rpath.
3569
if test -n "$hardcode_libdir_separator" &&
3570
test -n "$hardcode_libdirs"; then
3571
libdir="$hardcode_libdirs"
3572
eval rpath=\" $hardcode_libdir_flag_spec\"
3574
finalize_rpath="$rpath"
3577
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3578
if test -n "$NM" && test -n "$global_symbol_pipe"; then
3579
dlsyms="${outputname}S.c"
3581
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3585
if test -n "$dlsyms"; then
3589
# Discover the nlist of each of the dlfiles.
3590
nlist="$output_objdir/${outputname}.nm"
3592
$show "$rm $nlist ${nlist}S ${nlist}T"
3593
$run $rm "$nlist" "${nlist}S" "${nlist}T"
3595
# Parse the name list into a source file.
3596
$show "creating $output_objdir/$dlsyms"
3598
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3599
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3600
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3606
/* Prevent the only kind of declaration conflicts we can make. */
3607
#define lt_preloaded_symbols some_other_symbol
3609
/* External symbol declarations for the compiler. */\
3612
if test "$dlself" = yes; then
3613
$show "generating symbol list for \`$output'"
3615
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3617
# Add our own program objects to the symbol list.
3618
progfiles="$objs$old_deplibs"
3619
for arg in $progfiles; do
3620
$show "extracting global C symbols from \`$arg'"
3621
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3624
if test -n "$exclude_expsyms"; then
3625
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3626
$run eval '$mv "$nlist"T "$nlist"'
3629
if test -n "$export_symbols_regex"; then
3630
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3631
$run eval '$mv "$nlist"T "$nlist"'
3634
# Prepare the list of exported symbols
3635
if test -z "$export_symbols"; then
3636
export_symbols="$output_objdir/$output.exp"
3637
$run $rm $export_symbols
3638
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3640
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3641
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3642
$run eval 'mv "$nlist"T "$nlist"'
3646
for arg in $dlprefiles; do
3647
$show "extracting global C symbols from \`$arg'"
3648
name=`echo "$arg" | sed -e 's%^.*/%%'`
3649
$run eval 'echo ": $name " >> "$nlist"'
3650
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3653
if test -z "$run"; then
3654
# Make sure we have at least an empty file.
3655
test -f "$nlist" || : > "$nlist"
3657
if test -n "$exclude_expsyms"; then
3658
egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3659
$mv "$nlist"T "$nlist"
3662
# Try sorting and uniquifying the output.
3663
if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3666
grep -v "^: " < "$nlist" > "$nlist"S
3669
if test -f "$nlist"S; then
3670
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3672
echo '/* NONE */' >> "$output_objdir/$dlsyms"
3675
$echo >> "$output_objdir/$dlsyms" "\
3677
#undef lt_preloaded_symbols
3679
#if defined (__STDC__) && __STDC__
3680
# define lt_ptr_t void *
3682
# define lt_ptr_t char *
3686
/* The mapping between symbol names and symbols. */
3691
lt_preloaded_symbols[] =
3695
sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3696
-e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3697
< "$nlist" >> "$output_objdir/$dlsyms"
3699
$echo >> "$output_objdir/$dlsyms" "\
3703
/* This works around a problem in FreeBSD linker */
3704
#ifdef FREEBSD_WORKAROUND
3705
static const void *lt_preloaded_setup() {
3706
return lt_preloaded_symbols;
3716
pic_flag_for_symtable=
3718
# compiling the symbol table file with pic_flag works around
3719
# a FreeBSD bug that causes programs to crash when -lm is
3720
# linked before any other PIC object. But we must not use
3721
# pic_flag when linking with -static. The problem exists in
3722
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3723
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3724
case "$compile_command " in
3726
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
3729
case "$compile_command " in
3731
*) pic_flag_for_symtable=" $pic_flag";;
3735
# Now compile the dynamic symbol file.
3736
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3737
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3739
# Clean up the generated files.
3740
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3741
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3743
# Transform the symbol file into the correct name.
3744
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3745
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3748
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3753
# We keep going just in case the user didn't refer to
3754
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3755
# really was required.
3757
# Nullify the symbol file.
3758
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3759
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3762
# AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
3763
# Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
3764
# Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
3765
# This does not apply on AIX for ia64, which uses a SysV linker.
3768
*-*-aix4* | *-*-aix5*)
3769
compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
3770
finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
3773
if test $need_relink = no || test "$build_libtool_libs" != yes; then
3774
# Replace the output file specification.
3775
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3776
link_command="$compile_command$compile_rpath"
3778
# We have no uninstalled library dependencies, so finalize right now.
3779
$show "$link_command"
3780
$run eval "$link_command"
3783
# Delete the generated files.
3784
if test -n "$dlsyms"; then
3785
$show "$rm $output_objdir/${outputname}S.${objext}"
3786
$run $rm "$output_objdir/${outputname}S.${objext}"
3792
if test -n "$shlibpath_var"; then
3793
# We should set the shlibpath_var
3795
for dir in $temp_rpath; do
3797
[\\/]* | [A-Za-z]:[\\/]*)
3802
# Relative path: add a thisdir entry.
3803
rpath="$rpath\$thisdir/$dir:"
3810
if test -n "$compile_shlibpath$finalize_shlibpath"; then
3811
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3813
if test -n "$finalize_shlibpath"; then
3814
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3819
if test -n "$runpath_var"; then
3820
if test -n "$perm_rpath"; then
3821
# We should set the runpath_var.
3823
for dir in $perm_rpath; do
3826
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3828
if test -n "$finalize_perm_rpath"; then
3829
# We should set the runpath_var.
3831
for dir in $finalize_perm_rpath; do
3834
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3838
if test "$no_install" = yes; then
3839
# We don't need to create a wrapper script.
3840
link_command="$compile_var$compile_command$compile_rpath"
3841
# Replace the output file specification.
3842
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3843
# Delete the old output file.
3845
# Link the executable and exit
3846
$show "$link_command"
3847
$run eval "$link_command" || exit $?
3851
if test "$hardcode_action" = relink; then
3852
# Fast installation is not supported
3853
link_command="$compile_var$compile_command$compile_rpath"
3854
relink_command="$finalize_var$finalize_command$finalize_rpath"
3856
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3857
$echo "$modename: \`$output' will be relinked during installation" 1>&2
3859
if test "$fast_install" != no; then
3860
link_command="$finalize_var$compile_command$finalize_rpath"
3861
if test "$fast_install" = yes; then
3862
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3864
# fast_install is set to needless
3868
link_command="$compile_var$compile_command$compile_rpath"
3869
relink_command="$finalize_var$finalize_command$finalize_rpath"
3873
# Replace the output file specification.
3874
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3876
# Delete the old output files.
3877
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3879
$show "$link_command"
3880
$run eval "$link_command" || exit $?
3882
# Now create the wrapper script.
3883
$show "creating $output"
3885
# Quote the relink command for shipping.
3886
if test -n "$relink_command"; then
3887
# Preserve any variables that may affect compiler behavior
3888
for var in $variables_saved_for_relink; do
3889
if eval test -z \"\${$var+set}\"; then
3890
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3891
elif eval var_value=\$$var; test -z "$var_value"; then
3892
relink_command="$var=; export $var; $relink_command"
3894
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3895
relink_command="$var=\"$var_value\"; export $var; $relink_command"
3898
relink_command="cd `pwd`; $relink_command"
3899
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3902
# Quote $echo for shipping.
3903
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3905
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3906
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3908
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3910
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3913
# Only actually do things if our run command is non-null.
3914
if test -z "$run"; then
3915
# win32 will think the script is a binary if it has
3916
# a .exe suffix, so we strip it off here.
3918
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3920
# test for cygwin because mv fails w/o .exe extensions
3922
*cygwin*) exeext=.exe ;;
3926
trap "$rm $output; exit 1" 1 2 15
3931
# $output - temporary wrapper script for $objdir/$outputname
3932
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3934
# The $output program cannot be directly executed until all the libtool
3935
# libraries that it depends on are installed.
3937
# This wrapper script should never be moved out of the build directory.
3938
# If it is, it will not operate correctly.
3940
# Sed substitution that helps us do robust quoting. It backslashifies
3941
# metacharacters that are still active within double-quoted strings.
3942
Xsed='sed -e 1s/^X//'
3943
sed_quote_subst='$sed_quote_subst'
3945
# The HP-UX ksh and POSIX shell print the target directory to stdout
3947
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3949
relink_command=\"$relink_command\"
3951
# This environment variable determines our operation mode.
3952
if test \"\$libtool_install_magic\" = \"$magic\"; then
3953
# install mode needs the following variable:
3954
uninst_deplibs='$uninst_deplibs'
3956
# When we are sourced in execute mode, \$file and \$echo are already set.
3957
if test \"\$libtool_execute_magic\" != \"$magic\"; then
3960
# Make sure echo works.
3961
if test \"X\$1\" = X--no-reexec; then
3962
# Discard the --no-reexec flag, and continue.
3964
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3965
# Yippee, \$echo works!
3968
# Restart under the correct shell, and then maybe \$echo will work.
3969
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3975
# Find the directory that this script lives in.
3976
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3977
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3979
# Follow symbolic links until we get to the real thisdir.
3980
file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3981
while test -n \"\$file\"; do
3982
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3984
# If there was a directory component, then change thisdir.
3985
if test \"x\$destdir\" != \"x\$file\"; then
3986
case \"\$destdir\" in
3987
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3988
*) thisdir=\"\$thisdir/\$destdir\" ;;
3992
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3993
file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3996
# Try to get the absolute directory name.
3997
absdir=\`cd \"\$thisdir\" && pwd\`
3998
test -n \"\$absdir\" && thisdir=\"\$absdir\"
4001
if test "$fast_install" = yes; then
4003
program=lt-'$outputname'$exeext
4004
progdir=\"\$thisdir/$objdir\"
4006
if test ! -f \"\$progdir/\$program\" || \\
4007
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
4008
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4010
file=\"\$\$-\$program\"
4012
if test ! -d \"\$progdir\"; then
4013
$mkdir \"\$progdir\"
4015
$rm \"\$progdir/\$file\"
4020
# relink executable if necessary
4021
if test -n \"\$relink_command\"; then
4022
if (eval \$relink_command); then :
4024
$rm \"\$progdir/\$file\"
4029
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4030
{ $rm \"\$progdir/\$program\";
4031
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4032
$rm \"\$progdir/\$file\"
4036
program='$outputname'
4037
progdir=\"\$thisdir/$objdir\"
4043
if test -f \"\$progdir/\$program\"; then"
4045
# Export our shlibpath_var if we have one.
4046
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4048
# Add our own library path to $shlibpath_var
4049
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4051
# Some systems cannot cope with colon-terminated $shlibpath_var
4052
# The second colon is a workaround for a bug in BeOS R4 sed
4053
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4055
export $shlibpath_var
4059
# fixup the dll searchpath if we need to.
4060
if test -n "$dllsearchpath"; then
4062
# Add the dll search path components to the executable PATH
4063
PATH=$dllsearchpath:\$PATH
4068
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4069
# Run the actual program with our arguments.
4072
# win32 systems need to use the prog path for dll
4074
*-*-cygwin* | *-*-pw32*)
4076
exec \$progdir/\$program \${1+\"\$@\"}
4080
# Backslashes separate directories on plain windows
4081
*-*-mingw | *-*-os2*)
4083
exec \$progdir\\\\\$program \${1+\"\$@\"}
4089
# Export the path to the program.
4090
PATH=\"\$progdir:\$PATH\"
4093
exec \$program \${1+\"\$@\"}
4098
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4102
# The program doesn't exist.
4103
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4104
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4105
echo \"See the $PACKAGE documentation for more information.\" 1>&2
4116
# See if we need to build an old-fashioned archive.
4117
for oldlib in $oldlibs; do
4119
if test "$build_libtool_libs" = convenience; then
4120
oldobjs="$libobjs_save"
4121
addlibs="$convenience"
4122
build_libtool_libs=no
4124
if test "$build_libtool_libs" = module; then
4125
oldobjs="$libobjs_save"
4126
build_libtool_libs=no
4128
oldobjs="$objs$old_deplibs $non_pic_objects"
4130
addlibs="$old_convenience"
4133
if test -n "$addlibs"; then
4134
gentop="$output_objdir/${outputname}x"
4135
$show "${rm}r $gentop"
4136
$run ${rm}r "$gentop"
4137
$show "$mkdir $gentop"
4138
$run $mkdir "$gentop"
4140
if test $status -ne 0 && test ! -d "$gentop"; then
4143
generated="$generated $gentop"
4145
# Add in members from convenience archives.
4146
for xlib in $addlibs; do
4147
# Extract the objects.
4149
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4150
*) xabs=`pwd`"/$xlib" ;;
4152
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4153
xdir="$gentop/$xlib"
4155
$show "${rm}r $xdir"
4157
$show "$mkdir $xdir"
4160
if test $status -ne 0 && test ! -d "$xdir"; then
4163
$show "(cd $xdir && $AR x $xabs)"
4164
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4166
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
4170
# Do each command in the archive commands.
4171
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4172
eval cmds=\"$old_archive_from_new_cmds\"
4174
# # Ensure that we have .o objects in place in case we decided
4175
# # not to build a shared library, and have fallen back to building
4176
# # static libs even though --disable-static was passed!
4177
# for oldobj in $oldobjs; do
4178
# if test ! -f $oldobj; then
4179
# xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4180
# if test "X$xdir" = "X$oldobj"; then
4185
# baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4186
# obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4187
# $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4188
# $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4192
eval cmds=\"$old_archive_cmds\"
4194
if len=`expr "X$cmds" : ".*"` &&
4195
test $len -le $max_cmd_len; then
4198
# the command line is too long to link in one step, link in parts
4199
$echo "using piecewise archive linking..."
4204
save_oldobjs=$oldobjs
4205
for obj in $save_oldobjs
4207
oldobjs="$objlist $obj"
4208
objlist="$objlist $obj"
4209
eval test_cmds=\"$old_archive_cmds\"
4210
if len=`expr "X$test_cmds" : ".*"` &&
4211
test $len -le $max_cmd_len; then
4214
# the above command should be used before it gets too long
4216
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4217
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4223
eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4226
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4227
for cmd in $cmds; do
4230
$run eval "$cmd" || exit $?
4235
if test -n "$generated"; then
4236
$show "${rm}r$generated"
4237
$run ${rm}r$generated
4240
# Now create the libtool archive.
4244
test "$build_old_libs" = yes && old_library="$libname.$libext"
4245
$show "creating $output"
4247
# Preserve any variables that may affect compiler behavior
4248
for var in $variables_saved_for_relink; do
4249
if eval test -z \"\${$var+set}\"; then
4250
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4251
elif eval var_value=\$$var; test -z "$var_value"; then
4252
relink_command="$var=; export $var; $relink_command"
4254
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4255
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4258
# Quote the link command for shipping.
4259
relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
4260
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4262
# Only create the output if not a dry run.
4263
if test -z "$run"; then
4264
for installed in no yes; do
4265
if test "$installed" = yes; then
4266
if test -z "$install_libdir"; then
4269
output="$output_objdir/$outputname"i
4270
# Replace all uninstalled libtool libraries with the installed ones
4272
for deplib in $dependency_libs; do
4275
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4276
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4277
if test -z "$libdir"; then
4278
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4281
newdependency_libs="$newdependency_libs $libdir/$name"
4283
*) newdependency_libs="$newdependency_libs $deplib" ;;
4286
dependency_libs="$newdependency_libs"
4288
for lib in $dlfiles; do
4289
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4290
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4291
if test -z "$libdir"; then
4292
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4295
newdlfiles="$newdlfiles $libdir/$name"
4297
dlfiles="$newdlfiles"
4299
for lib in $dlprefiles; do
4300
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4301
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4302
if test -z "$libdir"; then
4303
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4306
newdlprefiles="$newdlprefiles $libdir/$name"
4308
dlprefiles="$newdlprefiles"
4311
# place dlname in correct position for cygwin
4313
case $host,$output,$installed,$module,$dlname in
4314
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4317
# $outputname - a libtool library file
4318
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4320
# Please DO NOT delete this file!
4321
# It is necessary for linking the library.
4323
# The name that we can dlopen(3).
4326
# Names of this library.
4327
library_names='$library_names'
4329
# The name of the static archive.
4330
old_library='$old_library'
4332
# Libraries that this one depends upon.
4333
dependency_libs='$dependency_libs'
4335
# Version information for $libname.
4340
# Is this an already installed library?
4341
installed=$installed
4343
# Files to dlopen/dlpreopen
4345
dlpreopen='$dlprefiles'
4347
# Directory that this library needs to be installed in:
4348
libdir='$install_libdir'"
4349
if test $hardcode_into_libs = all &&
4350
test "$installed" = no && test $need_relink = yes; then
4352
relink_command=\"$relink_command\""
4357
# Do a symbolic link so that the libtool archive can be found in
4358
# LD_LIBRARY_PATH before the program is installed.
4359
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4360
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4366
# libtool install mode
4368
modename="$modename: install"
4370
# There may be an optional sh(1) argument at the beginning of
4371
# install_prog (especially on Windows NT).
4372
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4373
# Allow the use of GNU shtool's install command.
4374
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4375
# Aesthetically quote it.
4376
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4378
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4382
install_prog="$arg "
4390
# The real first argument should be the name of the installation program.
4391
# Aesthetically quote it.
4392
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4394
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4398
install_prog="$install_prog$arg"
4400
# We need to accept at least all the BSD install flags.
4410
if test -n "$dest"; then
4411
files="$files $dest"
4429
# If the previous option needed an argument, then skip it.
4430
if test -n "$prev"; then
4439
# Aesthetically quote the argument.
4440
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4442
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4446
install_prog="$install_prog $arg"
4449
if test -z "$install_prog"; then
4450
$echo "$modename: you must specify an install program" 1>&2
4455
if test -n "$prev"; then
4456
$echo "$modename: the \`$prev' option requires an argument" 1>&2
4461
if test -z "$files"; then
4462
if test -z "$dest"; then
4463
$echo "$modename: no file or destination specified" 1>&2
4465
$echo "$modename: you must specify a destination" 1>&2
4471
# Strip any trailing slash from the destination.
4472
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4474
# Check to see that the destination is a directory.
4475
test -d "$dest" && isdir=yes
4476
if test "$isdir" = yes; then
4480
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4481
test "X$destdir" = "X$dest" && destdir=.
4482
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4484
# Not a directory, so check to see that there is only one file specified.
4486
if test $# -gt 2; then
4487
$echo "$modename: \`$dest' is not a directory" 1>&2
4493
[\\/]* | [A-Za-z]:[\\/]*) ;;
4495
for file in $files; do
4499
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4508
# This variable tells wrapper scripts just to set variables rather
4509
# than running their programs.
4510
libtool_install_magic="$magic"
4515
for file in $files; do
4517
# Do each installation.
4520
# Do the static libraries later.
4521
staticlibs="$staticlibs $file"
4525
# Check to see that this really is a libtool archive.
4526
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4528
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4536
# If there is no directory component, then add one.
4538
*/* | *\\*) . $file ;;
4542
# Add the libdir to current_libdirs if it is the destination.
4543
if test "X$destdir" = "X$libdir"; then
4544
case "$current_libdirs " in
4546
*) current_libdirs="$current_libdirs $libdir" ;;
4549
# Note the libdir as a future libdir.
4550
case "$future_libdirs " in
4552
*) future_libdirs="$future_libdirs $libdir" ;;
4556
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4557
test "X$dir" = "X$file/" && dir=
4560
if test "$hardcode_into_libs" = all && test -n "$relink_command"; then
4561
$echo "$modename: warning: relinking \`$file'" 1>&2
4562
$show "$relink_command"
4563
if $run eval "$relink_command"; then :
4565
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4570
# See the names of the shared library.
4571
set dummy $library_names
4572
if test -n "$2"; then
4578
test "$hardcode_into_libs" = all && test -n "$relink_command" && srcname="$realname"T
4580
# Install the shared library and build the symlinks.
4581
$show "$install_prog $dir/$srcname $destdir/$realname"
4582
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4583
if test -n "$stripme" && test -n "$striplib"; then
4584
$show "$striplib $destdir/$realname"
4585
$run eval "$striplib $destdir/$realname" || exit $?
4588
if test $# -gt 0; then
4589
# Delete the old symlinks, and create new ones.
4592
if test "$linkname" != "$realname"; then
4593
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4594
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4599
# Do each command in the postinstall commands.
4600
lib="$destdir/$realname"
4601
eval cmds=\"$postinstall_cmds\"
4602
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4603
for cmd in $cmds; do
4606
$run eval "$cmd" || exit $?
4611
# Install the pseudo-library for information purposes.
4612
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4613
instname="$dir/$name"i
4614
$show "$install_prog $instname $destdir/$name"
4615
$run eval "$install_prog $instname $destdir/$name" || exit $?
4617
# Maybe install the static library, too.
4618
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4622
# Install (i.e. copy) a libtool object.
4624
# Figure out destination file name, if it wasn't already specified.
4625
if test -n "$destname"; then
4626
destfile="$destdir/$destname"
4628
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4629
destfile="$destdir/$destfile"
4632
# Deduce the name of the destination old-style object file.
4635
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4638
staticdest="$destfile"
4642
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4648
# Install the libtool object if requested.
4649
if test -n "$destfile"; then
4650
$show "$install_prog $file $destfile"
4651
$run eval "$install_prog $file $destfile" || exit $?
4654
# Install the old object if enabled.
4655
if test "$build_old_libs" = yes; then
4656
# Deduce the name of the old-style object file.
4657
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4659
$show "$install_prog $staticobj $staticdest"
4660
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
4666
# Figure out destination file name, if it wasn't already specified.
4667
if test -n "$destname"; then
4668
destfile="$destdir/$destname"
4670
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4671
destfile="$destdir/$destfile"
4674
# Do a test to see if this is really a libtool program.
4675
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4679
# If there is no directory component, then add one.
4681
*/* | *\\*) . $file ;;
4685
# Check the variables that should have been set.
4686
if test -z "$uninst_deplibs"; then
4687
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4692
for lib in $uninst_deplibs; do
4693
# Check to see that each library is installed.
4695
if test -f "$lib"; then
4696
# If there is no directory component, then add one.
4698
*/* | *\\*) . $lib ;;
4702
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4703
if test -n "$libdir" && test ! -f "$libfile"; then
4704
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4710
# If there is no directory component, then add one.
4712
*/* | *\\*) . $file ;;
4717
if test "$fast_install" = no && test -n "$relink_command"; then
4718
if test "$finalize" = yes && test -z "$run"; then
4720
test -n "$TMPDIR" && tmpdir="$TMPDIR"
4721
tmpdir="$tmpdir/libtool-$$"
4722
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4724
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4727
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4728
outputname="$tmpdir/$file"
4729
# Replace the output file specification.
4730
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4732
$show "$relink_command"
4733
if $run eval "$relink_command"; then :
4735
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4741
$echo "$modename: warning: cannot relink \`$file'" 1>&2
4744
# Install the binary that we compiled earlier.
4745
file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4750
# remove .exe since cygwin /usr/bin/install will append another
4752
case $install_prog,$host in
4753
*/usr/bin/install*,*cygwin*)
4754
case $file:$destfile in
4759
destfile=$destfile.exe
4762
destfile=`echo $destfile | sed -e 's,.exe$,,'`
4768
$show "$install_prog$stripme $file $destfile"
4769
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4770
test -n "$outputname" && ${rm}r "$tmpdir"
4775
for file in $staticlibs; do
4776
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4778
# Set up the ranlib parameters.
4779
oldlib="$destdir/$name"
4781
$show "$install_prog $file $oldlib"
4782
$run eval "$install_prog \$file \$oldlib" || exit $?
4784
if test -n "$stripme" && test -n "$striplib"; then
4785
$show "$old_striplib $oldlib"
4786
$run eval "$old_striplib $oldlib" || exit $?
4789
# Do each command in the postinstall commands.
4790
eval cmds=\"$old_postinstall_cmds\"
4791
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4792
for cmd in $cmds; do
4795
$run eval "$cmd" || exit $?
4800
if test -n "$future_libdirs"; then
4801
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4804
if test -n "$current_libdirs"; then
4805
# Maybe just do a dry run.
4806
test -n "$run" && current_libdirs=" -n$current_libdirs"
4807
exec $SHELL $0 --finish$current_libdirs
4814
# libtool finish mode
4816
modename="$modename: finish"
4820
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4823
libdirs="$libdirs $dir"
4826
for libdir in $libdirs; do
4827
if test -n "$finish_cmds"; then
4828
# Do each command in the finish commands.
4829
eval cmds=\"$finish_cmds\"
4830
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4831
for cmd in $cmds; do
4834
$run eval "$cmd" || admincmds="$admincmds
4839
if test -n "$finish_eval"; then
4840
# Do the single finish_eval.
4841
eval cmds=\"$finish_eval\"
4842
$run eval "$cmds" || admincmds="$admincmds
4848
# Exit here if they wanted silent mode.
4851
echo "----------------------------------------------------------------------"
4852
echo "Libraries have been installed in:"
4853
for libdir in $libdirs; do
4857
echo "If you ever happen to want to link against installed libraries"
4858
echo "in a given directory, LIBDIR, you must either use libtool, and"
4859
echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4860
echo "flag during linking and do at least one of the following:"
4861
if test -n "$shlibpath_var"; then
4862
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4863
echo " during execution"
4865
if test -n "$runpath_var"; then
4866
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4867
echo " during linking"
4869
if test -n "$hardcode_libdir_flag_spec"; then
4871
eval flag=\"$hardcode_libdir_flag_spec\"
4873
echo " - use the \`$flag' linker flag"
4875
if test -n "$admincmds"; then
4876
echo " - have your system administrator run these commands:$admincmds"
4878
if test -f /etc/ld.so.conf; then
4879
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4882
echo "See any operating system documentation about shared libraries for"
4883
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4884
echo "----------------------------------------------------------------------"
4888
# libtool execute mode
4890
modename="$modename: execute"
4892
# The first argument is the command name.
4894
if test -z "$cmd"; then
4895
$echo "$modename: you must specify a COMMAND" 1>&2
4900
# Handle -dlopen flags immediately.
4901
for file in $execute_dlfiles; do
4902
if test ! -f "$file"; then
4903
$echo "$modename: \`$file' is not a file" 1>&2
4911
# Check to see that this really is a libtool archive.
4912
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4914
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4919
# Read the libtool library.
4923
# If there is no directory component, then add one.
4925
*/* | *\\*) . $file ;;
4929
# Skip this library if it cannot be dlopened.
4930
if test -z "$dlname"; then
4931
# Warn if it was a shared library.
4932
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4936
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4937
test "X$dir" = "X$file" && dir=.
4939
if test -f "$dir/$objdir/$dlname"; then
4942
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4948
# Just add the directory containing the .lo file.
4949
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4950
test "X$dir" = "X$file" && dir=.
4954
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4959
# Get the absolute pathname.
4960
absdir=`cd "$dir" && pwd`
4961
test -n "$absdir" && dir="$absdir"
4963
# Now add the directory to shlibpath_var.
4964
if eval "test -z \"\$$shlibpath_var\""; then
4965
eval "$shlibpath_var=\"\$dir\""
4967
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4971
# This variable tells wrapper scripts just to set shlibpath_var
4972
# rather than running their programs.
4973
libtool_execute_magic="$magic"
4975
# Check if any of the arguments is a wrapper script.
4982
# Do a test to see if this is really a libtool program.
4983
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4984
# If there is no directory component, then add one.
4986
*/* | *\\*) . $file ;;
4990
# Transform arg to wrapped name.
4991
file="$progdir/$program"
4995
# Quote arguments (to preserve shell metacharacters).
4996
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4997
args="$args \"$file\""
5000
if test -z "$run"; then
5001
if test -n "$shlibpath_var"; then
5002
# Export the shlibpath_var.
5003
eval "export $shlibpath_var"
5006
# Restore saved enviroment variables
5007
if test "${save_LC_ALL+set}" = set; then
5008
LC_ALL="$save_LC_ALL"; export LC_ALL
5010
if test "${save_LANG+set}" = set; then
5011
LANG="$save_LANG"; export LANG
5014
# Now actually exec the command.
5015
eval "exec \$cmd$args"
5017
$echo "$modename: cannot exec \$cmd$args"
5020
# Display what would be done.
5021
if test -n "$shlibpath_var"; then
5022
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5023
$echo "export $shlibpath_var"
5030
# libtool clean and uninstall mode
5032
modename="$modename: $mode"
5036
# This variable tells wrapper scripts just to set variables rather
5037
# than running their programs.
5038
libtool_install_magic="$magic"
5043
-*) rm="$rm $arg" ;;
5044
*) files="$files $arg" ;;
5048
if test -z "$rm"; then
5049
$echo "$modename: you must specify an RM program" 1>&2
5056
for file in $files; do
5057
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5058
if test "X$dir" = "X$file"; then
5062
objdir="$dir/$objdir"
5064
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5065
test $mode = uninstall && objdir="$dir"
5067
# Remember objdir for removal later, being careful to avoid duplicates
5068
if test $mode = clean; then
5071
*) rmdirs="$rmdirs $objdir" ;;
5079
# Possibly a libtool archive, so verify it.
5080
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5083
# Delete the libtool libraries and symlinks.
5084
for n in $library_names; do
5085
rmfiles="$rmfiles $objdir/$n"
5087
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5088
test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5090
if test $mode = uninstall; then
5091
if test -n "$library_names"; then
5092
# Do each command in the postuninstall commands.
5093
eval cmds=\"$postuninstall_cmds\"
5094
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5095
for cmd in $cmds; do
5103
if test -n "$old_library"; then
5104
# Do each command in the old_postuninstall commands.
5105
eval cmds=\"$old_postuninstall_cmds\"
5106
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5107
for cmd in $cmds; do
5114
# FIXME: should reinstall the best remaining shared library.
5120
# Possibly a libtool object, so verify it.
5121
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5126
# Add PIC object to the list of files to remove.
5127
if test -n "$pic_object" \
5128
&& test "$pic_object" != none; then
5129
rmfiles="$rmfiles $dir/$pic_object"
5132
# Add non-PIC object to the list of files to remove.
5133
if test -n "$non_pic_object" \
5134
&& test "$non_pic_object" != none; then
5135
rmfiles="$rmfiles $dir/$non_pic_object"
5141
# Do a test to see if this is a libtool program.
5142
if test $mode = clean &&
5143
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5147
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5148
if test "$fast_install" = yes && test -n "$relink_command"; then
5149
rmfiles="$rmfiles $objdir/lt-$name"
5154
$show "$rm $rmfiles"
5158
# Try to remove the ${objdir}s in the directories where we deleted files
5159
for dir in $rmdirs; do
5160
if test -d "$dir"; then
5162
$run rmdir $dir >/dev/null 2>&1
5170
$echo "$modename: you must specify a MODE" 1>&2
5171
$echo "$generic_help" 1>&2
5176
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5177
$echo "$generic_help" 1>&2
5179
fi # test -z "$show_help"
5181
# We need to display help for each of the modes.
5184
"Usage: $modename [OPTION]... [MODE-ARG]...
5186
Provide generalized library-building support services.
5188
--config show all configuration variables
5189
--debug enable verbose shell tracing
5190
-n, --dry-run display commands without modifying any files
5191
--features display basic configuration information and exit
5192
--finish same as \`--mode=finish'
5193
--help display this help message and exit
5194
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5195
--quiet same as \`--silent'
5196
--silent don't print informational messages
5197
--tag=TAG use configuration variables from tag TAG
5198
--version print version information
5200
MODE must be one of the following:
5202
clean remove files from the build directory
5203
compile compile a source file into a libtool object
5204
execute automatically set library path, then run a program
5205
finish complete the installation of libtool libraries
5206
install install libraries or executables
5207
link create a library or an executable
5208
uninstall remove libraries from an installed directory
5210
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5211
a more detailed description of MODE."
5217
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5219
Remove files from the build directory.
5221
RM is the name of the program to use to delete files associated with each FILE
5222
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5225
If FILE is a libtool library, object or program, all the files associated
5226
with it are deleted. Otherwise, only FILE itself is deleted using RM."
5231
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5233
Compile a source file into a libtool library object.
5235
This mode accepts the following additional options:
5237
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
5238
-static always build a \`.o' file suitable for static linking
5240
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5241
from the given SOURCEFILE.
5243
The output file name is determined by removing the directory component from
5244
SOURCEFILE, then substituting the C source code suffix \`.c' with the
5245
library object suffix, \`.lo'."
5250
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5252
Automatically set library path, then run a program.
5254
This mode accepts the following additional options:
5256
-dlopen FILE add the directory containing FILE to the library path
5258
This mode sets the library path environment variable according to \`-dlopen'
5261
If any of the ARGS are libtool executable wrappers, then they are translated
5262
into their corresponding uninstalled binary, and any of their required library
5263
directories are added to the library path.
5265
Then, COMMAND is executed, with ARGS as arguments."
5270
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5272
Complete the installation of libtool libraries.
5274
Each LIBDIR is a directory that contains libtool libraries.
5276
The commands that this mode executes may require superuser privileges. Use
5277
the \`--dry-run' option if you just want to see what would be executed."
5282
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5284
Install executables or libraries.
5286
INSTALL-COMMAND is the installation command. The first component should be
5287
either the \`install' or \`cp' program.
5289
The rest of the components are interpreted as arguments to that command (only
5290
BSD-compatible install options are recognized)."
5295
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5297
Link object files or libraries together to form another library, or to
5298
create an executable program.
5300
LINK-COMMAND is a command using the C compiler that you would use to create
5301
a program from several object files.
5303
The following components of LINK-COMMAND are treated specially:
5305
-all-static do not do any dynamic linking at all
5306
-avoid-version do not add a version suffix if possible
5307
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5308
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5309
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5310
-export-symbols SYMFILE
5311
try to export only the symbols listed in SYMFILE
5312
-export-symbols-regex REGEX
5313
try to export only the symbols matching REGEX
5314
-LLIBDIR search LIBDIR for required installed libraries
5315
-lNAME OUTPUT-FILE requires the installed library libNAME
5316
-module build a library that can dlopened
5317
-no-fast-install disable the fast-install mode
5318
-no-install link a not-installable executable
5319
-no-undefined declare that a library does not refer to external symbols
5320
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5321
-objectlist FILE Use a list of object files found in FILE to specify objects
5322
-release RELEASE specify package release information
5323
-rpath LIBDIR the created library will eventually be installed in LIBDIR
5324
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5325
-static do not do any dynamic linking of libtool libraries
5326
-version-info CURRENT[:REVISION[:AGE]]
5327
specify library version info [each variable defaults to 0]
5329
All other options (arguments beginning with \`-') are ignored.
5331
Every other argument is treated as a filename. Files ending in \`.la' are
5332
treated as uninstalled libtool libraries, other files are standard or library
5335
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5336
only library objects (\`.lo' files) may be specified, and \`-rpath' is
5337
required, except when creating a convenience library.
5339
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5340
using \`ar' and \`ranlib', or on Windows using \`lib'.
5342
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5343
is created, otherwise an executable program is created."
5348
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5350
Remove libraries from an installation directory.
5352
RM is the name of the program to use to delete files associated with each FILE
5353
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5356
If FILE is a libtool library, all the files associated with it are deleted.
5357
Otherwise, only FILE itself is deleted using RM."
5361
$echo "$modename: invalid operation mode \`$mode'" 1>&2
5368
$echo "Try \`$modename --help' for more information about other modes."
5372
# The TAGs below are defined such that we never get into a situation
5373
# in which we disable both kinds of libraries. Given conflicting
5374
# choices, we go for a static library, that is the most portable,
5375
# since we can't tell whether shared libraries were disabled because
5376
# the user asked for that or because the platform doesn't support
5377
# them. This is particularly important on AIX, because we don't
5378
# support having both static and shared libraries enabled at the same
5379
# time on that platform, so we default to a shared-only configuration.
5380
# If a disable-shared tag is given, we'll fallback to a static-only
5381
# configuration. But we'll never go from static-only to shared-only.
5383
### BEGIN LIBTOOL TAG CONFIG: disable-shared
5384
build_libtool_libs=no
5386
### END LIBTOOL TAG CONFIG: disable-shared
5388
### BEGIN LIBTOOL TAG CONFIG: disable-static
5389
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5390
### END LIBTOOL TAG CONFIG: disable-static