1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
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.920 2001/04/24 23:26:18)"
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 "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
88
echo "$modename: not configured to build any kind of library" 1>&2
89
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
102
lo2o="s/\\.lo\$/.${objext}/"
103
o2lo="s/\\.${objext}\$/.lo/"
105
# Parse our command line options once, thoroughly.
112
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
116
# If the previous option needs an argument, assign it.
117
if test -n "$prev"; then
120
execute_dlfiles="$execute_dlfiles $arg"
132
# Have we seen a non-optional argument yet?
139
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
144
sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
149
echo "$progname: enabling shell trace mode"
159
if test "$build_libtool_libs" = yes; then
160
echo "enable shared libraries"
162
echo "disable shared libraries"
164
if test "$build_old_libs" = yes; then
165
echo "enable static libraries"
167
echo "disable static libraries"
172
--finish) mode="finish" ;;
174
--mode) prevopt="--mode" prev=mode ;;
175
--mode=*) mode="$optarg" ;;
187
$echo "$modename: unrecognized option \`$arg'" 1>&2
199
if test -n "$prevopt"; then
200
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
205
if test -z "$show_help"; then
207
# Infer the operation mode.
208
if test -z "$mode"; then
210
*cc | *++ | gcc* | *-gcc*)
222
*db | *dbx | *strace | *truss)
232
# If we have no mode, but dlfiles were specified, then do execute mode.
233
test -n "$execute_dlfiles" && mode=execute
235
# Just use the default operation mode.
236
if test -z "$mode"; then
237
if test -n "$nonopt"; then
238
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
240
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
247
# Only execute mode is allowed to have -dlopen flags.
248
if test -n "$execute_dlfiles" && test "$mode" != execute; then
249
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
254
# Change the help message to a mode-specific one.
256
help="Try \`$modename --help --mode=$mode' for more information."
258
# These modes are in order of execution frequency so that they run quickly.
260
# libtool compile mode
262
modename="$modename: compile"
263
# Get the compilation command and the source file.
276
# Aesthetically quote the previous argument.
278
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
281
# Double-quote args containing other shell metacharacters.
282
# Many Bourne shells cannot handle close brackets correctly
283
# in scan sets, so we specify it separately.
284
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
289
# Add the previous argument to base_compile.
290
if test -z "$base_compile"; then
291
base_compile="$lastarg"
293
base_compile="$base_compile $lastarg"
299
# Accept any command-line options.
302
if test "$user_target" != "no"; then
303
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
330
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
332
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
336
# Double-quote args containing other shell metacharacters.
337
# Many Bourne shells cannot handle close brackets correctly
338
# in scan sets, so we specify it separately.
340
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
344
lastarg="$lastarg $arg"
347
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
349
# Add the arguments to base_compile.
350
if test -z "$base_compile"; then
351
base_compile="$lastarg"
353
base_compile="$base_compile $lastarg"
361
# The next one is the -o target name
366
# We got the output file
373
# Accept the current argument as the source file.
377
# Aesthetically quote the previous argument.
379
# Backslashify any backslashes, double quotes, and dollar signs.
380
# These are the only characters that are still specially
381
# interpreted inside of double-quoted scrings.
382
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
384
# Double-quote args containing other shell metacharacters.
385
# Many Bourne shells cannot handle close brackets correctly
386
# in scan sets, so we specify it separately.
388
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
389
lastarg="\"$lastarg\""
393
# Add the previous argument to base_compile.
394
if test -z "$base_compile"; then
395
base_compile="$lastarg"
397
base_compile="$base_compile $lastarg"
405
# Get the name of the library object.
406
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
409
$echo "$modename: you must specify a target with \`-o'" 1>&2
414
# Recognize several different file suffixes.
415
# If the user specifies -o file.o, it is replaced with file.lo
430
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
433
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
435
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
440
if test -z "$base_compile"; then
441
$echo "$modename: you must specify a compilation command" 1>&2
446
# Delete any leftover library objects.
447
if test "$build_old_libs" = yes; then
448
removelist="$obj $libobj"
454
trap "$run $rm $removelist; exit 1" 1 2 15
456
# On Cygwin there's no "real" PIC flag so we must build both object types
458
cygwin* | mingw* | pw32* | os2*)
462
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
463
# non-PIC code in shared libraries is not supported
467
# Calculate the filename of the output object if compiler does
468
# not support -o with -c
469
if test "$compiler_c_o" = no; then
470
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
471
lockfile="$output_obj.lock"
472
removelist="$removelist $output_obj $lockfile"
473
trap "$run $rm $removelist; exit 1" 1 2 15
479
# Lock this critical section if it is needed
480
# We use this script file to make the link, it avoids creating a new file
481
if test "$need_locks" = yes; then
482
until $run ln "$0" "$lockfile" 2>/dev/null; do
483
$show "Waiting for $lockfile to be removed"
486
elif test "$need_locks" = warn; then
487
if test -f "$lockfile"; then
489
*** ERROR, $lockfile exists and contains:
490
`cat $lockfile 2>/dev/null`
492
This indicates that another process is trying to use the same
493
temporary object file, and libtool could not work around it because
494
your compiler does not support \`-c' and \`-o' together. If you
495
repeat this compilation, it may succeed, by chance, but you had better
496
avoid parallel builds (make -j) in this platform, or get a better
502
echo $srcfile > "$lockfile"
505
if test -n "$fix_srcfile_path"; then
506
eval srcfile=\"$fix_srcfile_path\"
509
# Only build a PIC object if we are building libtool libraries.
510
if test "$build_libtool_libs" = yes; then
511
# Without this assignment, base_compile gets emptied.
512
fbsd_hideous_sh_bug=$base_compile
514
if test "$pic_mode" != no; then
515
# All platforms use -DPIC, to notify preprocessed assembler code.
516
command="$base_compile $srcfile $pic_flag -DPIC"
518
# Don't build PIC code
519
command="$base_compile $srcfile"
521
if test "$build_old_libs" = yes; then
523
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
524
if test "X$dir" = "X$libobj"; then
529
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
531
if test -d "$dir"; then
538
if test $status -ne 0 && test ! -d $dir; then
543
if test "$compiler_o_lo" = yes; then
545
command="$command -o $output_obj"
546
elif test "$compiler_c_o" = yes; then
548
command="$command -o $output_obj"
551
$run $rm "$output_obj"
553
if $run eval "$command"; then :
555
test -n "$output_obj" && $run $rm $removelist
559
if test "$need_locks" = warn &&
560
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
562
*** ERROR, $lockfile contains:
563
`cat $lockfile 2>/dev/null`
565
but it should contain:
568
This indicates that another process is trying to use the same
569
temporary object file, and libtool could not work around it because
570
your compiler does not support \`-c' and \`-o' together. If you
571
repeat this compilation, it may succeed, by chance, but you had better
572
avoid parallel builds (make -j) in this platform, or get a better
579
# Just move the object if needed, then go on to compile the next one
580
if test x"$output_obj" != x"$libobj"; then
581
$show "$mv $output_obj $libobj"
582
if $run $mv $output_obj $libobj; then :
590
# If we have no pic_flag, then copy the object into place and finish.
591
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
592
test "$build_old_libs" = yes; then
593
# Rename the .lo from within objdir to obj
594
if test -f $obj; then
599
$show "$mv $libobj $obj"
600
if $run $mv $libobj $obj; then :
607
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
608
if test "X$xdir" = "X$obj"; then
613
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
614
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
615
# Now arrange that obj and lo_libobj become the same file
616
$show "(cd $xdir && $LN_S $baseobj $libobj)"
617
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
626
# Allow error messages only from the first compilation.
627
suppress_output=' >/dev/null 2>&1'
630
# Only build a position-dependent object if we build old libraries.
631
if test "$build_old_libs" = yes; then
632
if test "$pic_mode" != yes; then
633
# Don't build PIC code
634
command="$base_compile $srcfile"
636
# All platforms use -DPIC, to notify preprocessed assembler code.
637
command="$base_compile $srcfile $pic_flag -DPIC"
639
if test "$compiler_c_o" = yes; then
640
command="$command -o $obj"
644
# Suppress compiler output if we already did a PIC compilation.
645
command="$command$suppress_output"
646
$run $rm "$output_obj"
648
if $run eval "$command"; then :
654
if test "$need_locks" = warn &&
655
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
657
*** ERROR, $lockfile contains:
658
`cat $lockfile 2>/dev/null`
660
but it should contain:
663
This indicates that another process is trying to use the same
664
temporary object file, and libtool could not work around it because
665
your compiler does not support \`-c' and \`-o' together. If you
666
repeat this compilation, it may succeed, by chance, but you had better
667
avoid parallel builds (make -j) in this platform, or get a better
674
# Just move the object if needed
675
if test x"$output_obj" != x"$obj"; then
676
$show "$mv $output_obj $obj"
677
if $run $mv $output_obj $obj; then :
685
# Create an invalid libtool object if no PIC, so that we do not
686
# accidentally link it into a program.
687
if test "$build_libtool_libs" != yes; then
688
$show "echo timestamp > $libobj"
689
$run eval "echo timestamp > \$libobj" || exit $?
691
# Move the .lo from within objdir
692
$show "$mv $libobj $lo_libobj"
693
if $run $mv $libobj $lo_libobj; then :
702
# Unlock the critical section if it was locked
703
if test "$need_locks" != no; then
712
modename="$modename: link"
714
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
715
# It is impossible to link a dll without this setting, and
716
# we shouldn't force the makefile maintainer to figure out
717
# which system we are compiling for in order to pass an extra
718
# flag for every libtool invokation.
721
# FIXME: Unfortunately, there are problems with the above when trying
722
# to make a dll which has undefined symbols, in which case not
723
# even a static library is built. For now, we need to specify
724
# -no-undefined on the libtool link line when we can be certain
725
# that all symbols are satisfied, otherwise we get a static library.
732
libtool_args="$nonopt"
733
compile_command="$nonopt"
734
finalize_command="$nonopt"
747
lib_search_path=`pwd`
755
export_symbols_regex=
762
prefer_static_libs=no
774
# We need to know -static, to get the right output filenames.
778
-all-static | -static)
779
if test "X$arg" = "X-all-static"; then
780
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
781
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
783
if test -n "$link_static_flag"; then
784
dlopen_self=$dlopen_self_static
787
if test -z "$pic_flag" && test -n "$link_static_flag"; then
788
dlopen_self=$dlopen_self_static
791
build_libtool_libs=no
793
prefer_static_libs=yes
799
# See if our shared archives depend on static archives.
800
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
802
# Go through the arguments, transforming them on the way.
803
while test $# -gt 0; do
807
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
808
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
812
libtool_args="$libtool_args $qarg"
814
# If the previous option needs an argument, assign it.
815
if test -n "$prev"; then
818
compile_command="$compile_command @OUTPUT@"
819
finalize_command="$finalize_command @OUTPUT@"
825
if test "$preload" = no; then
826
# Add the symbol object into the linking commands.
827
compile_command="$compile_command @SYMFILE@"
828
finalize_command="$finalize_command @SYMFILE@"
832
*.la | *.lo) ;; # We handle these cases below.
834
if test "$dlself" = no; then
842
if test "$prev" = dlprefiles; then
844
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
854
if test "$prev" = dlfiles; then
855
dlfiles="$dlfiles $arg"
857
dlprefiles="$dlprefiles $arg"
865
export_symbols="$arg"
866
if test ! -f "$arg"; then
867
$echo "$modename: symbol file \`$arg' does not exist"
874
export_symbols_regex="$arg"
884
# We need an absolute path.
886
[\\/]* | [A-Za-z]:[\\/]*) ;;
888
$echo "$modename: only absolute run-paths are allowed" 1>&2
892
if test "$prev" = rpath; then
895
*) rpath="$rpath $arg" ;;
900
*) xrpath="$xrpath $arg" ;;
907
compiler_flags="$compiler_flags $qarg"
909
compile_command="$compile_command $qarg"
910
finalize_command="$finalize_command $qarg"
914
linker_flags="$linker_flags $qarg"
915
compiler_flags="$compiler_flags $wl$qarg"
917
compile_command="$compile_command $wl$qarg"
918
finalize_command="$finalize_command $wl$qarg"
922
eval "$prev=\"\$arg\""
933
if test -n "$link_static_flag"; then
934
compile_command="$compile_command $link_static_flag"
935
finalize_command="$finalize_command $link_static_flag"
941
# FIXME: remove this flag sometime in the future.
942
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
966
-export-symbols | -export-symbols-regex)
967
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
968
$echo "$modename: more than one -exported-symbols argument is not allowed"
971
if test "X$arg" = "X-export-symbols"; then
979
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
980
# so, if we see these flags be careful not to treat them like -L
982
case $with_gcc/$host in
984
compile_command="$compile_command $arg"
985
finalize_command="$finalize_command $arg"
992
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
993
# We need an absolute path.
995
[\\/]* | [A-Za-z]:[\\/]*) ;;
997
absdir=`cd "$dir" && pwd`
998
if test -z "$absdir"; then
999
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1008
deplibs="$deplibs -L$dir"
1009
lib_search_path="$lib_search_path $dir"
1013
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1014
case :$dllsearchpath: in
1016
*) dllsearchpath="$dllsearchpath:$dir";;
1024
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1026
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1027
# These systems don't actually have a C or math library (as such)
1030
*-*-mingw* | *-*-os2*)
1031
# These systems don't actually have a C library (as such)
1032
test "X$arg" = "X-lc" && continue
1036
deplibs="$deplibs $arg"
1052
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1053
# The PATH hackery in wrapper scripts is required on Windows
1054
# in order for the loader to find any dlls it needs.
1055
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1056
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1059
*) no_install=yes ;;
1087
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1088
# We need an absolute path.
1090
[\\/]* | [A-Za-z]:[\\/]*) ;;
1092
$echo "$modename: only absolute run-paths are allowed" 1>&2
1098
*) xrpath="$xrpath $dir" ;;
1104
# The effects of -static are defined in a previous loop.
1105
# We used to do the same as -all-static on platforms that
1106
# didn't have a PIC flag, but the assumption that the effects
1107
# would be equivalent was wrong. It would break on at least
1108
# Digital Unix and AIX.
1123
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1125
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1126
for flag in $args; do
1129
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1134
compiler_flags="$compiler_flags $flag"
1137
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1141
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1143
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1144
for flag in $args; do
1147
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1152
compiler_flags="$compiler_flags $wl$flag"
1153
linker_flags="$linker_flags $flag"
1156
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1169
# Some other compiler flag.
1171
# Unknown arguments in both finalize_command and compile_command need
1172
# to be aesthetically quoted because they are evaled later.
1173
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1175
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1182
# A library or standard object.
1183
if test "$prev" = dlfiles; then
1184
# This file was specified with -dlopen.
1185
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1186
dlfiles="$dlfiles $arg"
1190
# If libtool objects are unsupported, then we need to preload.
1195
if test "$prev" = dlprefiles; then
1196
# Preload the old-style object.
1197
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1201
*.lo) libobjs="$libobjs $arg" ;;
1202
*) objs="$objs $arg" ;;
1209
deplibs="$deplibs $arg"
1210
old_deplibs="$old_deplibs $arg"
1215
# A libtool-controlled library.
1217
if test "$prev" = dlfiles; then
1218
# This library was specified with -dlopen.
1219
dlfiles="$dlfiles $arg"
1221
elif test "$prev" = dlprefiles; then
1222
# The library was specified with -dlpreopen.
1223
dlprefiles="$dlprefiles $arg"
1226
deplibs="$deplibs $arg"
1231
# Some other compiler argument.
1233
# Unknown arguments in both finalize_command and compile_command need
1234
# to be aesthetically quoted because they are evaled later.
1235
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1237
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1244
# Now actually substitute the argument into the commands.
1245
if test -n "$arg"; then
1246
compile_command="$compile_command $arg"
1247
finalize_command="$finalize_command $arg"
1249
done # argument parsing loop
1251
if test -n "$prev"; then
1252
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1257
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1258
eval arg=\"$export_dynamic_flag_spec\"
1259
compile_command="$compile_command $arg"
1260
finalize_command="$finalize_command $arg"
1263
# calculate the name of the file, without its directory
1264
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1265
libobjs_save="$libobjs"
1267
if test -n "$shlibpath_var"; then
1268
# get the directories listed in $shlibpath_var
1269
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1273
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1274
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1276
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1277
if test "X$output_objdir" = "X$output"; then
1278
output_objdir="$objdir"
1280
output_objdir="$output_objdir/$objdir"
1282
# Create the object directory.
1283
if test ! -d $output_objdir; then
1284
$show "$mkdir $output_objdir"
1285
$run $mkdir $output_objdir
1287
if test $status -ne 0 && test ! -d $output_objdir; then
1292
# Determine the type of output
1295
$echo "$modename: you must specify an output file" 1>&2
1299
*.$libext) linkmode=oldlib ;;
1300
*.lo | *.$objext) linkmode=obj ;;
1301
*.la) linkmode=lib ;;
1302
*) linkmode=prog ;; # Anything else should be a program.
1307
# Find all interdependent deplibs by searching for libraries
1308
# that are linked more than once (e.g. -la -lb -la)
1309
for deplib in $deplibs; do
1311
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1313
libs="$libs $deplib"
1318
need_relink=no # whether we're linking any uninstalled libtool libraries
1319
notinst_deplibs= # not-installed libtool libraries
1320
notinst_path= # paths that contain not-installed libtool libraries
1324
for file in $dlfiles $dlprefiles; do
1328
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1340
passes="conv scan dlopen dlpreopen link"
1345
for pass in $passes; do
1346
if test "$linkmode" = prog; then
1347
# Determine which files to process
1351
save_deplibs="$deplibs" # Collect dlpreopened libraries
1354
dlpreopen) libs="$dlprefiles" ;;
1355
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1358
for deplib in $libs; do
1363
if test "$linkmode" = oldlib && test "$linkmode" = obj; then
1364
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1367
if test "$pass" = conv; then
1368
deplibs="$deplib $deplibs"
1371
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1372
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1373
# Search the libtool library
1374
lib="$searchdir/lib${name}.la"
1375
if test -f "$lib"; then
1380
if test "$found" != yes; then
1381
# deplib doesn't seem to be a libtool library
1382
if test "$linkmode,$pass" = "prog,link"; then
1383
compile_deplibs="$deplib $compile_deplibs"
1384
finalize_deplibs="$deplib $finalize_deplibs"
1386
deplibs="$deplib $deplibs"
1387
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1395
deplibs="$deplib $deplibs"
1396
test "$pass" = conv && continue
1397
newdependency_libs="$deplib $newdependency_libs"
1398
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1401
if test "$pass" = conv; then
1402
deplibs="$deplib $deplibs"
1405
if test "$pass" = scan; then
1406
deplibs="$deplib $deplibs"
1407
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1409
compile_deplibs="$deplib $compile_deplibs"
1410
finalize_deplibs="$deplib $finalize_deplibs"
1414
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1420
if test "$pass" = link; then
1421
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1422
# Make sure the xrpath contains only unique directories.
1425
*) xrpath="$xrpath $dir" ;;
1428
deplibs="$deplib $deplibs"
1431
*.la) lib="$deplib" ;;
1433
if test "$pass" = conv; then
1434
deplibs="$deplib $deplibs"
1439
if test "$deplibs_check_method" != pass_all; then
1441
echo "*** Warning: This library needs some functionality provided by $deplib."
1442
echo "*** I have the capability to make that library automatically link in when"
1443
echo "*** you link to this library. But I can only do this if you have a"
1444
echo "*** shared version of the library, which you do not appear to have."
1447
echo "*** Warning: Linking the shared library $output against the"
1448
echo "*** static library $deplib is not portable!"
1449
deplibs="$deplib $deplibs"
1454
if test "$pass" != link; then
1455
deplibs="$deplib $deplibs"
1457
compile_deplibs="$deplib $compile_deplibs"
1458
finalize_deplibs="$deplib $finalize_deplibs"
1465
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1466
# If there is no dlopen support or we're linking statically,
1467
# we need to preload.
1468
newdlprefiles="$newdlprefiles $deplib"
1469
compile_deplibs="$deplib $compile_deplibs"
1470
finalize_deplibs="$deplib $finalize_deplibs"
1472
newdlfiles="$newdlfiles $deplib"
1481
if test $found = yes || test -f "$lib"; then :
1483
$echo "$modename: cannot find the library \`$lib'" 1>&2
1487
# Check to see that this really is a libtool archive.
1488
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1490
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1494
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1495
test "X$ladir" = "X$lib" && ladir="."
1503
# If the library was installed with an old release of libtool,
1504
# it will not redefine variable installed.
1509
*/* | *\\*) . $lib ;;
1513
if test "$linkmode,$pass" = "lib,link" ||
1514
test "$linkmode,$pass" = "prog,scan" ||
1515
{ test "$linkmode" = oldlib && test "$linkmode" = obj; }; then
1516
# Add dl[pre]opened files of deplib
1517
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1518
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1521
if test "$pass" = conv; then
1522
# Only check for convenience libraries
1523
deplibs="$lib $deplibs"
1524
if test -z "$libdir"; then
1525
if test -z "$old_library"; then
1526
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1529
# It is a libtool convenience library, so add in its objects.
1530
convenience="$convenience $ladir/$objdir/$old_library"
1531
old_convenience="$old_convenience $ladir/$objdir/$old_library"
1533
for deplib in $dependency_libs; do
1534
deplibs="$deplib $deplibs"
1535
case "$tmp_libs " in
1536
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1538
tmp_libs="$tmp_libs $deplib"
1540
elif test "$linkmode" != prog && test "$linkmode" != lib; then
1541
$echo "$modename: \`$lib' is not a convenience library" 1>&2
1547
# Get the name of the library we link against.
1549
for l in $old_library $library_names; do
1552
if test -z "$linklib"; then
1553
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1557
# This library was specified with -dlopen.
1558
if test "$pass" = dlopen; then
1559
if test -z "$libdir"; then
1560
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1563
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1564
# If there is no dlname, no dlopen support or we're linking
1565
# statically, we need to preload.
1566
dlprefiles="$dlprefiles $lib"
1568
newdlfiles="$newdlfiles $lib"
1573
# We need an absolute path.
1575
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1577
abs_ladir=`cd "$ladir" && pwd`
1578
if test -z "$abs_ladir"; then
1579
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1580
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1585
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1587
# Find the relevant object directory and library name.
1588
if test "X$installed" = Xyes; then
1589
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1590
$echo "$modename: warning: library \`$lib' was moved." 1>&2
1599
dir="$ladir/$objdir"
1600
absdir="$abs_ladir/$objdir"
1601
# Remove this search path later
1602
notinst_path="$notinst_path $abs_ladir"
1603
fi # $installed = yes
1604
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1606
# This library was specified with -dlpreopen.
1607
if test "$pass" = dlpreopen; then
1608
if test -z "$libdir"; then
1609
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1612
# Prefer using a static library (so that no silly _DYNAMIC symbols
1613
# are required to link).
1614
if test -n "$old_library"; then
1615
newdlprefiles="$newdlprefiles $dir/$old_library"
1616
# Otherwise, use the dlname, so that lt_dlopen finds it.
1617
elif test -n "$dlname"; then
1618
newdlprefiles="$newdlprefiles $dir/$dlname"
1620
newdlprefiles="$newdlprefiles $dir/$linklib"
1622
fi # $pass = dlpreopen
1624
if test -z "$libdir"; then
1625
# Link the convenience library
1626
if test "$linkmode" = lib; then
1627
deplibs="$dir/$old_library $deplibs"
1628
elif test "$linkmode,$pass" = "prog,link"; then
1629
compile_deplibs="$dir/$old_library $compile_deplibs"
1630
finalize_deplibs="$dir/$old_library $finalize_deplibs"
1632
deplibs="$lib $deplibs"
1637
if test "$linkmode" = prog && test "$pass" != link; then
1638
newlib_search_path="$newlib_search_path $ladir"
1639
deplibs="$lib $deplibs"
1642
if test "$link_all_deplibs" != no || test -z "$library_names" ||
1643
test "$build_libtool_libs" = no; then
1648
for deplib in $dependency_libs; do
1650
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1652
# Need to link against all dependency_libs?
1653
if test $linkalldeplibs = yes; then
1654
deplibs="$deplib $deplibs"
1656
# Need to hardcode shared library paths
1657
# or/and link against static libraries
1658
newdependency_libs="$deplib $newdependency_libs"
1660
case "$tmp_libs " in
1661
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1663
tmp_libs="$tmp_libs $deplib"
1666
fi # $linkmode = prog...
1668
link_static=no # Whether the deplib will be linked statically
1669
if test -n "$library_names" &&
1670
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1671
# Link against this shared library
1673
if test "$linkmode,$pass" = "prog,link" ||
1674
{ test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
1675
# Hardcode the library path.
1676
# Skip directories that are in the system default run-time
1678
case " $sys_lib_dlsearch_path " in
1681
case "$compile_rpath " in
1683
*) compile_rpath="$compile_rpath $absdir"
1687
case " $sys_lib_dlsearch_path " in
1690
case "$finalize_rpath " in
1692
*) finalize_rpath="$finalize_rpath $libdir"
1696
if test "$linkmode" = prog; then
1697
# We need to hardcode the library path
1698
if test -n "$shlibpath_var"; then
1699
# Make sure the rpath contains only unique directories.
1700
case "$temp_rpath " in
1703
*) temp_rpath="$temp_rpath $dir" ;;
1707
fi # $linkmode,$pass = prog,link...
1709
if test "$alldeplibs" = yes &&
1710
{ test "$deplibs_check_method" = pass_all ||
1711
{ test "$build_libtool_libs" = yes &&
1712
test -n "$library_names"; }; }; then
1713
# We only need to search for static libraries
1717
if test "$installed" = no; then
1718
notinst_deplibs="$notinst_deplibs $lib"
1722
if test -n "$old_archive_from_expsyms_cmds"; then
1723
# figure out the soname
1724
set dummy $library_names
1727
libname=`eval \\$echo \"$libname_spec\"`
1728
# use dlname if we got it. it's perfectly good, no?
1729
if test -n "$dlname"; then
1731
elif test -n "$soname_spec"; then
1735
major=`expr $current - $age`
1739
eval soname=\"$soname_spec\"
1744
# Make a new name for the extract_expsyms_cmds to use
1746
soname=`echo $soroot | sed -e 's/^.*\///'`
1747
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1749
# If the library has no export list, then create one now
1750
if test -f "$output_objdir/$soname-def"; then :
1752
$show "extracting exported symbol list from \`$soname'"
1753
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1754
eval cmds=\"$extract_expsyms_cmds\"
1755
for cmd in $cmds; do
1758
$run eval "$cmd" || exit $?
1764
if test -f "$output_objdir/$newlib"; then :; else
1765
$show "generating import library for \`$soname'"
1766
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1767
eval cmds=\"$old_archive_from_expsyms_cmds\"
1768
for cmd in $cmds; do
1771
$run eval "$cmd" || exit $?
1775
# make sure the library variables are pointing to the new library
1778
fi # test -n $old_archive_from_expsyms_cmds
1780
if test "$linkmode" = prog || test "$mode" != relink; then
1785
case $hardcode_action in
1786
immediate | unsupported)
1787
if test "$hardcode_direct" = no; then
1789
elif test "$hardcode_minus_L" = no; then
1791
*-*-sunos*) add_shlibpath="$dir" ;;
1795
elif test "$hardcode_shlibpath_var" = no; then
1796
add_shlibpath="$dir"
1803
if test "$hardcode_direct" = yes; then
1805
elif test "$hardcode_minus_L" = yes; then
1808
elif test "$hardcode_shlibpath_var" = yes; then
1809
add_shlibpath="$dir"
1818
if test "$lib_linked" != yes; then
1819
$echo "$modename: configuration error: unsupported hardcode properties"
1823
if test -n "$add_shlibpath"; then
1824
case :$compile_shlibpath: in
1825
*":$add_shlibpath:"*) ;;
1826
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1829
if test "$linkmode" = prog; then
1830
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1831
test -n "$add" && compile_deplibs="$add $compile_deplibs"
1833
test -n "$add_dir" && deplibs="$add_dir $deplibs"
1834
test -n "$add" && deplibs="$add $deplibs"
1835
if test "$hardcode_direct" != yes && \
1836
test "$hardcode_minus_L" != yes && \
1837
test "$hardcode_shlibpath_var" = yes; then
1838
case :$finalize_shlibpath: in
1840
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1846
if test "$linkmode" = prog || test "$mode" = relink; then
1850
# Finalize command for both is simple: just hardcode it.
1851
if test "$hardcode_direct" = yes; then
1852
add="$libdir/$linklib"
1853
elif test "$hardcode_minus_L" = yes; then
1856
elif test "$hardcode_shlibpath_var" = yes; then
1857
case :$finalize_shlibpath: in
1859
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1863
# We cannot seem to hardcode it, guess we'll fake it.
1868
if test "$linkmode" = prog; then
1869
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1870
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1872
test -n "$add_dir" && deplibs="$add_dir $deplibs"
1873
test -n "$add" && deplibs="$add $deplibs"
1876
elif test "$linkmode" = prog; then
1877
if test "$alldeplibs" = yes &&
1878
{ test "$deplibs_check_method" = pass_all ||
1879
{ test "$build_libtool_libs" = yes &&
1880
test -n "$library_names"; }; }; then
1881
# We only need to search for static libraries
1885
# Try to link the static library
1886
# Here we assume that one of hardcode_direct or hardcode_minus_L
1887
# is not unsupported. This is valid on all known static and
1889
if test "$hardcode_direct" != unsupported; then
1890
test -n "$old_library" && linklib="$old_library"
1891
compile_deplibs="$dir/$linklib $compile_deplibs"
1892
finalize_deplibs="$dir/$linklib $finalize_deplibs"
1894
compile_deplibs="-l$name -L$dir $compile_deplibs"
1895
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1897
elif test "$build_libtool_libs" = yes; then
1898
# Not a shared library
1899
if test "$deplibs_check_method" != pass_all; then
1900
# We're trying link a shared library against a static one
1901
# but the system doesn't support it.
1903
# Just print a warning and add the library to dependency_libs so
1904
# that the program can be linked against the static library.
1906
echo "*** Warning: This library needs some functionality provided by $lib."
1907
echo "*** I have the capability to make that library automatically link in when"
1908
echo "*** you link to this library. But I can only do this if you have a"
1909
echo "*** shared version of the library, which you do not appear to have."
1910
if test "$module" = yes; then
1911
echo "*** Therefore, libtool will create a static module, that should work "
1912
echo "*** as long as the dlopening application is linked with the -dlopen flag."
1913
if test -z "$global_symbol_pipe"; then
1915
echo "*** However, this would only work if libtool was able to extract symbol"
1916
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1917
echo "*** not find such a program. So, this module is probably useless."
1918
echo "*** \`nm' from GNU binutils and a full rebuild may help."
1920
if test "$build_old_libs" = no; then
1921
build_libtool_libs=module
1924
build_libtool_libs=no
1928
convenience="$convenience $dir/$old_library"
1929
old_convenience="$old_convenience $dir/$old_library"
1930
deplibs="$dir/$old_library $deplibs"
1933
fi # link shared/static library?
1935
if test "$linkmode" = lib; then
1936
if test -n "$dependency_libs" &&
1937
{ test "$hardcode_into_libs" != yes || test $build_old_libs = yes ||
1938
test $link_static = yes; }; then
1939
# Extract -R from dependency_libs
1941
for libdir in $dependency_libs; do
1943
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1945
*" $temp_xrpath "*) ;;
1946
*) xrpath="$xrpath $temp_xrpath";;
1948
*) temp_deplibs="$temp_deplibs $libdir";;
1951
dependency_libs="$temp_deplibs"
1954
newlib_search_path="$newlib_search_path $absdir"
1955
# Link against this library
1956
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
1957
# ... and its dependency_libs
1959
for deplib in $dependency_libs; do
1960
newdependency_libs="$deplib $newdependency_libs"
1961
case "$tmp_libs " in
1962
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1964
tmp_libs="$tmp_libs $deplib"
1967
if test "$link_all_deplibs" != no; then
1968
# Add the search paths of all dependency libraries
1969
for deplib in $dependency_libs; do
1971
-L*) path="$deplib" ;;
1973
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
1974
test "X$dir" = "X$deplib" && dir="."
1975
# We need an absolute path.
1977
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1979
absdir=`cd "$dir" && pwd`
1980
if test -z "$absdir"; then
1981
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1986
if grep "^installed=no" $deplib > /dev/null; then
1987
path="-L$absdir/$objdir"
1989
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
1990
if test -z "$libdir"; then
1991
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
1994
if test "$absdir" != "$libdir"; then
1995
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2002
case " $deplibs " in
2004
*) deplibs="$deplibs $path" ;;
2007
fi # link_all_deplibs != no
2009
done # for deplib in $libs
2010
if test "$pass" = dlpreopen; then
2011
# Link the dlpreopened libraries before other libraries
2012
for deplib in $save_deplibs; do
2013
deplibs="$deplib $deplibs"
2016
if test "$pass" != dlopen; then
2017
test "$pass" != scan && dependency_libs="$newdependency_libs"
2018
if test "$pass" != conv; then
2019
# Make sure lib_search_path contains only unique directories.
2021
for dir in $newlib_search_path; do
2022
case "$lib_search_path " in
2024
*) lib_search_path="$lib_search_path $dir" ;;
2030
if test "$linkmode,$pass" != "prog,link"; then
2033
vars="compile_deplibs finalize_deplibs"
2035
for var in $vars dependency_libs; do
2036
# Add libraries to $var in reverse order
2037
eval tmp_libs=\"\$$var\"
2039
for deplib in $tmp_libs; do
2041
-L*) new_libs="$deplib $new_libs" ;;
2043
case " $specialdeplibs " in
2044
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2046
case " $new_libs " in
2048
*) new_libs="$deplib $new_libs" ;;
2056
for deplib in $new_libs; do
2059
case " $tmp_libs " in
2061
*) tmp_libs="$tmp_libs $deplib" ;;
2064
*) tmp_libs="$tmp_libs $deplib" ;;
2067
eval $var=\"$tmp_libs\"
2070
if test "$pass" = "conv" &&
2071
{ test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2072
libs="$deplibs" # reset libs
2076
if test "$linkmode" = prog; then
2077
dlfiles="$newdlfiles"
2078
dlprefiles="$newdlprefiles"
2083
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2084
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2087
if test -n "$rpath"; then
2088
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2091
if test -n "$xrpath"; then
2092
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2095
if test -n "$vinfo"; then
2096
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2099
if test -n "$release"; then
2100
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2103
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2104
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2107
# Now set the variables for building old libraries.
2108
build_libtool_libs=no
2110
objs="$objs$old_deplibs"
2114
# Make sure we only generate libraries of the form `libNAME.la'.
2117
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2118
eval libname=\"$libname_spec\"
2121
if test "$module" = no; then
2122
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2126
if test "$need_lib_prefix" != no; then
2127
# Add the "lib" prefix for modules if required
2128
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2129
eval libname=\"$libname_spec\"
2131
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2136
if test -n "$objs"; then
2137
if test "$deplibs_check_method" != pass_all; then
2138
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2142
echo "*** Warning: Linking the shared library $output against the non-libtool"
2143
echo "*** objects $objs is not portable!"
2144
libobjs="$libobjs $objs"
2148
if test "$dlself" != no; then
2149
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2153
if test $# -gt 2; then
2154
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2159
if test -z "$rpath"; then
2160
if test "$build_libtool_libs" = yes; then
2161
# Building a libtool convenience library.
2163
oldlibs="$output_objdir/$libname.$libext $oldlibs"
2164
build_libtool_libs=convenience
2168
if test -n "$vinfo"; then
2169
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2172
if test -n "$release"; then
2173
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2177
# Parse the version information argument.
2178
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
2179
set dummy $vinfo 0 0 0
2182
if test -n "$8"; then
2183
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2192
# Check that each of the things are valid numbers.
2194
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2196
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2197
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2203
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2205
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2206
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2212
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2214
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2215
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2220
if test $age -gt $current; then
2221
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2222
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2226
# Calculate the version variables.
2230
case $version_type in
2234
# Like Linux, but with the current version available in
2235
# verstring for coding it into the library header
2236
major=.`expr $current - $age`
2237
versuffix="$major.$age.$revision"
2238
# Darwin ld doesn't like 0 for these options...
2239
minor_current=`expr $current + 1`
2240
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2245
versuffix=".$current.$revision";
2250
versuffix=".$current";
2254
major=`expr $current - $age + 1`
2255
verstring="sgi$major.$revision"
2257
# Add in all the interfaces that we are compatible with.
2259
while test $loop != 0; do
2260
iface=`expr $revision - $loop`
2261
loop=`expr $loop - 1`
2262
verstring="sgi$major.$iface:$verstring"
2265
# Before this point, $major must not contain `.'.
2267
versuffix="$major.$revision"
2271
major=.`expr $current - $age`
2272
versuffix="$major.$age.$revision"
2276
major=`expr $current - $age`
2277
versuffix=".$current.$age.$revision"
2278
verstring="$current.$age.$revision"
2280
# Add in all the interfaces that we are compatible with.
2282
while test $loop != 0; do
2283
iface=`expr $current - $loop`
2284
loop=`expr $loop - 1`
2285
verstring="$verstring:${iface}.0"
2288
# Make executables depend on our current version.
2289
verstring="$verstring:${current}.0"
2294
versuffix=".$current.$revision"
2298
# Use '-' rather than '.', since we only want one
2299
# extension on DOS 8.3 filesystems.
2300
major=`expr $current - $age`
2305
$echo "$modename: unknown library version type \`$version_type'" 1>&2
2306
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2311
# Clear the version info if we defaulted, and they specified a release.
2312
if test -z "$vinfo" && test -n "$release"; then
2315
if test "$need_version" = no; then
2322
# Remove version info from name if versioning should be avoided
2323
if test "$avoid_version" = yes && test "$need_version" = no; then
2329
# Check to see if the archive will have undefined symbols.
2330
if test "$allow_undefined" = yes; then
2331
if test "$allow_undefined_flag" = unsupported; then
2332
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2333
build_libtool_libs=no
2337
# Don't allow undefined symbols.
2338
allow_undefined_flag="$no_undefined_flag"
2342
if test "$mode" != relink; then
2343
# Remove our outputs.
2344
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2345
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2348
# Now set the variables for building old libraries.
2349
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2350
oldlibs="$oldlibs $output_objdir/$libname.$libext"
2352
# Transform .lo files to .o files.
2353
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2356
# Eliminate all temporary directories.
2357
for path in $notinst_path; do
2358
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2359
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2360
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2363
if test -n "$xrpath"; then
2364
# If the user specified any rpath flags, then add them.
2366
for libdir in $xrpath; do
2367
temp_xrpath="$temp_xrpath -R$libdir"
2368
case "$finalize_rpath " in
2370
*) finalize_rpath="$finalize_rpath $libdir" ;;
2373
if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2374
dependency_libs="$temp_xrpath $dependency_libs"
2378
# Make sure dlfiles contains only unique files that won't be dlpreopened
2379
old_dlfiles="$dlfiles"
2381
for lib in $old_dlfiles; do
2382
case " $dlprefiles $dlfiles " in
2384
*) dlfiles="$dlfiles $lib" ;;
2388
# Make sure dlprefiles contains only unique files
2389
old_dlprefiles="$dlprefiles"
2391
for lib in $old_dlprefiles; do
2392
case "$dlprefiles " in
2394
*) dlprefiles="$dlprefiles $lib" ;;
2398
if test "$build_libtool_libs" = yes; then
2399
if test -n "$rpath"; then
2401
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2402
# these systems don't actually have a c library (as such)!
2404
*-*-rhapsody* | *-*-darwin1.[012])
2405
# Rhapsody C library is in the System framework
2406
deplibs="$deplibs -framework System"
2409
# Don't link with libc until the a.out ld.so is fixed.
2412
# Add libc to deplibs on all other systems if necessary.
2413
if test "$build_libtool_need_lc" = "yes"; then
2414
deplibs="$deplibs -lc"
2420
# Transform deplibs into only deplibs that can be linked in shared.
2422
libname_save=$libname
2423
release_save=$release
2424
versuffix_save=$versuffix
2426
# I'm not sure if I'm treating the release correctly. I think
2427
# release should show up in the -l (ie -lgmp5) so we don't want to
2428
# add it in twice. Is that correct?
2434
case $deplibs_check_method in
2436
# Don't check for shared/static. Everything works.
2437
# This might be a little naive. We might want to check
2438
# whether the library exists or not. But this is on
2439
# osf3 & osf4 and I'm not really sure... Just
2440
# implementing what was already the behaviour.
2444
# This code stresses the "libraries are programs" paradigm to its
2445
# limits. Maybe even breaks it. We compile a program, linking it
2446
# against the deplibs as a proxy for the library. Then we can check
2447
# whether they linked in statically or dynamically with ldd.
2449
cat > conftest.c <<EOF
2450
int main() { return 0; }
2453
$CC -o conftest conftest.c $deplibs
2454
if test $? -eq 0 ; then
2455
ldd_output=`ldd conftest`
2456
for i in $deplibs; do
2457
name="`expr $i : '-l\(.*\)'`"
2458
# If $name is empty we are operating on a -L argument.
2459
if test -n "$name" && test "$name" != "0"; then
2460
libname=`eval \\$echo \"$libname_spec\"`
2461
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2462
set dummy $deplib_matches
2464
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2465
newdeplibs="$newdeplibs $i"
2469
echo "*** Warning: This library needs some functionality provided by $i."
2470
echo "*** I have the capability to make that library automatically link in when"
2471
echo "*** you link to this library. But I can only do this if you have a"
2472
echo "*** shared version of the library, which you do not appear to have."
2475
newdeplibs="$newdeplibs $i"
2479
# Error occured in the first compile. Let's try to salvage the situation:
2480
# Compile a seperate program for each library.
2481
for i in $deplibs; do
2482
name="`expr $i : '-l\(.*\)'`"
2483
# If $name is empty we are operating on a -L argument.
2484
if test -n "$name" && test "$name" != "0"; then
2486
$CC -o conftest conftest.c $i
2488
if test $? -eq 0 ; then
2489
ldd_output=`ldd conftest`
2490
libname=`eval \\$echo \"$libname_spec\"`
2491
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2492
set dummy $deplib_matches
2494
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2495
newdeplibs="$newdeplibs $i"
2499
echo "*** Warning: This library needs some functionality provided by $i."
2500
echo "*** I have the capability to make that library automatically link in when"
2501
echo "*** you link to this library. But I can only do this if you have a"
2502
echo "*** shared version of the library, which you do not appear to have."
2507
echo "*** Warning! Library $i is needed by this library but I was not able to"
2508
echo "*** make it link in! You will probably need to install it or some"
2509
echo "*** library that it depends on before this library will be fully"
2510
echo "*** functional. Installing it before continuing would be even better."
2513
newdeplibs="$newdeplibs $i"
2519
set dummy $deplibs_check_method
2520
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2521
for a_deplib in $deplibs; do
2522
name="`expr $a_deplib : '-l\(.*\)'`"
2523
# If $name is empty we are operating on a -L argument.
2524
if test -n "$name" && test "$name" != "0"; then
2525
libname=`eval \\$echo \"$libname_spec\"`
2526
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2527
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2528
for potent_lib in $potential_libs; do
2529
# Follow soft links.
2530
if ls -lLd "$potent_lib" 2>/dev/null \
2531
| grep " -> " >/dev/null; then
2534
# The statement above tries to avoid entering an
2535
# endless loop below, in case of cyclic links.
2536
# We might still enter an endless loop, since a link
2537
# loop can be closed while we follow links,
2539
potlib="$potent_lib"
2540
while test -h "$potlib" 2>/dev/null; do
2541
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2543
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2544
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2547
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2549
| egrep "$file_magic_regex" > /dev/null; then
2550
newdeplibs="$newdeplibs $a_deplib"
2556
if test -n "$a_deplib" ; then
2559
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2560
echo "*** I have the capability to make that library automatically link in when"
2561
echo "*** you link to this library. But I can only do this if you have a"
2562
echo "*** shared version of the library, which you do not appear to have."
2565
# Add a -L argument.
2566
newdeplibs="$newdeplibs $a_deplib"
2568
done # Gone through all deplibs.
2571
set dummy $deplibs_check_method
2572
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2573
for a_deplib in $deplibs; do
2574
name="`expr $a_deplib : '-l\(.*\)'`"
2575
# If $name is empty we are operating on a -L argument.
2576
if test -n "$name" && test "$name" != "0"; then
2577
libname=`eval \\$echo \"$libname_spec\"`
2578
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2579
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2580
for potent_lib in $potential_libs; do
2581
if eval echo \"$potent_lib\" 2>/dev/null \
2583
| egrep "$match_pattern_regex" > /dev/null; then
2584
newdeplibs="$newdeplibs $a_deplib"
2590
if test -n "$a_deplib" ; then
2593
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2594
echo "*** I have the capability to make that library automatically link in when"
2595
echo "*** you link to this library. But I can only do this if you have a"
2596
echo "*** shared version of the library, which you do not appear to have."
2599
# Add a -L argument.
2600
newdeplibs="$newdeplibs $a_deplib"
2602
done # Gone through all deplibs.
2606
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2607
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2608
grep . >/dev/null; then
2610
if test "X$deplibs_check_method" = "Xnone"; then
2611
echo "*** Warning: inter-library dependencies are not supported in this platform."
2613
echo "*** Warning: inter-library dependencies are not known to be supported."
2615
echo "*** All declared inter-library dependencies are being dropped."
2620
versuffix=$versuffix_save
2622
release=$release_save
2623
libname=$libname_save
2627
*-*-rhapsody* | *-*-darwin1.[012])
2628
# On Rhapsody replace the C library is the System framework
2629
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2633
if test "$droppeddeps" = yes; then
2634
if test "$module" = yes; then
2636
echo "*** Warning: libtool could not satisfy all declared inter-library"
2637
echo "*** dependencies of module $libname. Therefore, libtool will create"
2638
echo "*** a static module, that should work as long as the dlopening"
2639
echo "*** application is linked with the -dlopen flag."
2640
if test -z "$global_symbol_pipe"; then
2642
echo "*** However, this would only work if libtool was able to extract symbol"
2643
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2644
echo "*** not find such a program. So, this module is probably useless."
2645
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2647
if test "$build_old_libs" = no; then
2648
oldlibs="$output_objdir/$libname.$libext"
2649
build_libtool_libs=module
2652
build_libtool_libs=no
2655
echo "*** The inter-library dependencies that have been dropped here will be"
2656
echo "*** automatically added whenever a program is linked with this library"
2657
echo "*** or is declared to -dlopen it."
2659
if test $allow_undefined = no; then
2661
echo "*** Since this library must not contain undefined symbols,"
2662
echo "*** because either the platform does not support them or"
2663
echo "*** it was explicitly requested with -no-undefined,"
2664
echo "*** libtool will only create a static version of it."
2665
if test "$build_old_libs" = no; then
2666
oldlibs="$output_objdir/$libname.$libext"
2667
build_libtool_libs=module
2670
build_libtool_libs=no
2675
# Done checking deplibs!
2679
# All the library-specific variables (install_libdir is set above).
2684
# Test again, we may have decided not to build it any more
2685
if test "$build_libtool_libs" = yes; then
2686
if test "$hardcode_into_libs" = yes; then
2687
# Hardcode the library paths
2690
rpath="$finalize_rpath"
2691
test "$mode" != relink && rpath="$compile_rpath$rpath"
2692
for libdir in $rpath; do
2693
if test -n "$hardcode_libdir_flag_spec"; then
2694
if test -n "$hardcode_libdir_separator"; then
2695
if test -z "$hardcode_libdirs"; then
2696
hardcode_libdirs="$libdir"
2698
# Just accumulate the unique libdirs.
2699
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2700
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2703
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2708
eval flag=\"$hardcode_libdir_flag_spec\"
2709
dep_rpath="$dep_rpath $flag"
2711
elif test -n "$runpath_var"; then
2712
case "$perm_rpath " in
2714
*) perm_rpath="$perm_rpath $libdir" ;;
2718
# Substitute the hardcoded libdirs into the rpath.
2719
if test -n "$hardcode_libdir_separator" &&
2720
test -n "$hardcode_libdirs"; then
2721
libdir="$hardcode_libdirs"
2722
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2724
if test -n "$runpath_var" && test -n "$perm_rpath"; then
2725
# We should set the runpath_var.
2727
for dir in $perm_rpath; do
2730
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2732
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2735
shlibpath="$finalize_shlibpath"
2736
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2737
if test -n "$shlibpath"; then
2738
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2741
# Get the real and link names of the library.
2742
eval library_names=\"$library_names_spec\"
2743
set dummy $library_names
2747
if test -n "$soname_spec"; then
2748
eval soname=\"$soname_spec\"
2752
test -z "$dlname" && dlname=$soname
2754
lib="$output_objdir/$realname"
2757
linknames="$linknames $link"
2760
# Ensure that we have .o objects for linkers which dislike .lo
2761
# (e.g. aix) in case we are running --disable-static
2762
for obj in $libobjs; do
2763
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2764
if test "X$xdir" = "X$obj"; then
2769
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2770
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2771
if test ! -f $xdir/$oldobj; then
2772
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2773
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2777
# Use standard objects if they are pic
2778
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2780
# Prepare the list of exported symbols
2781
if test -z "$export_symbols"; then
2782
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2783
$show "generating symbol list for \`$libname.la'"
2784
export_symbols="$output_objdir/$libname.exp"
2785
$run $rm $export_symbols
2786
eval cmds=\"$export_symbols_cmds\"
2787
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2788
for cmd in $cmds; do
2791
$run eval "$cmd" || exit $?
2794
if test -n "$export_symbols_regex"; then
2795
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2796
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2797
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
2798
$run eval '$mv "${export_symbols}T" "$export_symbols"'
2803
if test -n "$export_symbols" && test -n "$include_expsyms"; then
2804
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2807
if test -n "$convenience"; then
2808
if test -n "$whole_archive_flag_spec"; then
2809
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2811
gentop="$output_objdir/${outputname}x"
2812
$show "${rm}r $gentop"
2813
$run ${rm}r "$gentop"
2814
$show "mkdir $gentop"
2815
$run mkdir "$gentop"
2817
if test $status -ne 0 && test ! -d "$gentop"; then
2820
generated="$generated $gentop"
2822
for xlib in $convenience; do
2823
# Extract the objects.
2825
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2826
*) xabs=`pwd`"/$xlib" ;;
2828
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2829
xdir="$gentop/$xlib"
2831
$show "${rm}r $xdir"
2836
if test $status -ne 0 && test ! -d "$xdir"; then
2839
$show "(cd $xdir && $AR x $xabs)"
2840
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2842
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2847
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2848
eval flag=\"$thread_safe_flag_spec\"
2849
linker_flags="$linker_flags $flag"
2852
# Make a backup of the uninstalled library when relinking
2853
if test "$mode" = relink; then
2854
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2857
# Do each of the archive commands.
2858
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2859
eval cmds=\"$archive_expsym_cmds\"
2861
eval cmds=\"$archive_cmds\"
2863
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2864
for cmd in $cmds; do
2867
$run eval "$cmd" || exit $?
2871
# Restore the uninstalled library and exit
2872
if test "$mode" = relink; then
2873
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
2877
# Create links to the real library.
2878
for linkname in $linknames; do
2879
if test "$realname" != "$linkname"; then
2880
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2881
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2885
# If -module or -export-dynamic was specified, set the dlname.
2886
if test "$module" = yes || test "$export_dynamic" = yes; then
2887
# On all known operating systems, these are identical.
2894
if test -n "$deplibs"; then
2895
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2898
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2899
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2902
if test -n "$rpath"; then
2903
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2906
if test -n "$xrpath"; then
2907
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2910
if test -n "$vinfo"; then
2911
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2914
if test -n "$release"; then
2915
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2920
if test -n "$objs$old_deplibs"; then
2921
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2925
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2933
# Delete the old objects.
2934
$run $rm $obj $libobj
2936
# Objects from convenience libraries. This assumes
2937
# single-version convenience libraries. Whenever we create
2938
# different ones for PIC/non-PIC, this we'll have to duplicate
2942
# reload_cmds runs $LD directly, so let us get rid of
2943
# -Wl from whole_archive_flag_spec
2946
if test -n "$convenience"; then
2947
if test -n "$whole_archive_flag_spec"; then
2948
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2950
gentop="$output_objdir/${obj}x"
2951
$show "${rm}r $gentop"
2952
$run ${rm}r "$gentop"
2953
$show "mkdir $gentop"
2954
$run mkdir "$gentop"
2956
if test $status -ne 0 && test ! -d "$gentop"; then
2959
generated="$generated $gentop"
2961
for xlib in $convenience; do
2962
# Extract the objects.
2964
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2965
*) xabs=`pwd`"/$xlib" ;;
2967
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2968
xdir="$gentop/$xlib"
2970
$show "${rm}r $xdir"
2975
if test $status -ne 0 && test ! -d "$xdir"; then
2978
$show "(cd $xdir && $AR x $xabs)"
2979
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2981
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2986
# Create the old-style object.
2987
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
2990
eval cmds=\"$reload_cmds\"
2991
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2992
for cmd in $cmds; do
2995
$run eval "$cmd" || exit $?
2999
# Exit if we aren't doing a library object file.
3000
if test -z "$libobj"; then
3001
if test -n "$gentop"; then
3002
$show "${rm}r $gentop"
3009
if test "$build_libtool_libs" != yes; then
3010
if test -n "$gentop"; then
3011
$show "${rm}r $gentop"
3015
# Create an invalid libtool object if no PIC, so that we don't
3016
# accidentally link it into a program.
3017
$show "echo timestamp > $libobj"
3018
$run eval "echo timestamp > $libobj" || exit $?
3022
if test -n "$pic_flag" || test "$pic_mode" != default; then
3023
# Only do commands if we really have different PIC objects.
3024
reload_objs="$libobjs $reload_conv_objs"
3026
eval cmds=\"$reload_cmds\"
3027
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3028
for cmd in $cmds; do
3031
$run eval "$cmd" || exit $?
3035
# Just create a symlink.
3038
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3039
if test "X$xdir" = "X$libobj"; then
3044
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3045
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3046
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
3047
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3050
if test -n "$gentop"; then
3051
$show "${rm}r $gentop"
3060
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3062
if test -n "$vinfo"; then
3063
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3066
if test -n "$release"; then
3067
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3070
if test "$preload" = yes; then
3071
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3072
test "$dlopen_self_static" = unknown; then
3073
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3078
*-*-rhapsody* | *-*-darwin1.[012])
3079
# On Rhapsody replace the C library is the System framework
3080
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3081
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3085
compile_command="$compile_command $compile_deplibs"
3086
finalize_command="$finalize_command $finalize_deplibs"
3088
if test -n "$rpath$xrpath"; then
3089
# If the user specified any rpath flags, then add them.
3090
for libdir in $rpath $xrpath; do
3091
# This is the magic to use -rpath.
3092
case "$finalize_rpath " in
3094
*) finalize_rpath="$finalize_rpath $libdir" ;;
3099
# Now hardcode the library paths
3102
for libdir in $compile_rpath $finalize_rpath; do
3103
if test -n "$hardcode_libdir_flag_spec"; then
3104
if test -n "$hardcode_libdir_separator"; then
3105
if test -z "$hardcode_libdirs"; then
3106
hardcode_libdirs="$libdir"
3108
# Just accumulate the unique libdirs.
3109
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3110
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3113
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3118
eval flag=\"$hardcode_libdir_flag_spec\"
3119
rpath="$rpath $flag"
3121
elif test -n "$runpath_var"; then
3122
case "$perm_rpath " in
3124
*) perm_rpath="$perm_rpath $libdir" ;;
3128
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3129
case :$dllsearchpath: in
3131
*) dllsearchpath="$dllsearchpath:$libdir";;
3136
# Substitute the hardcoded libdirs into the rpath.
3137
if test -n "$hardcode_libdir_separator" &&
3138
test -n "$hardcode_libdirs"; then
3139
libdir="$hardcode_libdirs"
3140
eval rpath=\" $hardcode_libdir_flag_spec\"
3142
compile_rpath="$rpath"
3146
for libdir in $finalize_rpath; do
3147
if test -n "$hardcode_libdir_flag_spec"; then
3148
if test -n "$hardcode_libdir_separator"; then
3149
if test -z "$hardcode_libdirs"; then
3150
hardcode_libdirs="$libdir"
3152
# Just accumulate the unique libdirs.
3153
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3154
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3157
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3162
eval flag=\"$hardcode_libdir_flag_spec\"
3163
rpath="$rpath $flag"
3165
elif test -n "$runpath_var"; then
3166
case "$finalize_perm_rpath " in
3168
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3172
# Substitute the hardcoded libdirs into the rpath.
3173
if test -n "$hardcode_libdir_separator" &&
3174
test -n "$hardcode_libdirs"; then
3175
libdir="$hardcode_libdirs"
3176
eval rpath=\" $hardcode_libdir_flag_spec\"
3178
finalize_rpath="$rpath"
3180
if test -n "$libobjs" && test "$build_old_libs" = yes; then
3181
# Transform all the library objects into standard objects.
3182
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3183
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3187
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3188
if test -n "$NM" && test -n "$global_symbol_pipe"; then
3189
dlsyms="${outputname}S.c"
3191
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3195
if test -n "$dlsyms"; then
3199
# Discover the nlist of each of the dlfiles.
3200
nlist="$output_objdir/${outputname}.nm"
3202
$show "$rm $nlist ${nlist}S ${nlist}T"
3203
$run $rm "$nlist" "${nlist}S" "${nlist}T"
3205
# Parse the name list into a source file.
3206
$show "creating $output_objdir/$dlsyms"
3208
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3209
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3210
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3216
/* Prevent the only kind of declaration conflicts we can make. */
3217
#define lt_preloaded_symbols some_other_symbol
3219
/* External symbol declarations for the compiler. */\
3222
if test "$dlself" = yes; then
3223
$show "generating symbol list for \`$output'"
3225
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3227
# Add our own program objects to the symbol list.
3228
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3229
for arg in $progfiles; do
3230
$show "extracting global C symbols from \`$arg'"
3231
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3234
if test -n "$exclude_expsyms"; then
3235
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3236
$run eval '$mv "$nlist"T "$nlist"'
3239
if test -n "$export_symbols_regex"; then
3240
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3241
$run eval '$mv "$nlist"T "$nlist"'
3244
# Prepare the list of exported symbols
3245
if test -z "$export_symbols"; then
3246
export_symbols="$output_objdir/$output.exp"
3247
$run $rm $export_symbols
3248
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3250
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3251
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3252
$run eval 'mv "$nlist"T "$nlist"'
3256
for arg in $dlprefiles; do
3257
$show "extracting global C symbols from \`$arg'"
3258
name=`echo "$arg" | sed -e 's%^.*/%%'`
3259
$run eval 'echo ": $name " >> "$nlist"'
3260
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3263
if test -z "$run"; then
3264
# Make sure we have at least an empty file.
3265
test -f "$nlist" || : > "$nlist"
3267
if test -n "$exclude_expsyms"; then
3268
egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3269
$mv "$nlist"T "$nlist"
3272
# Try sorting and uniquifying the output.
3273
if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3276
grep -v "^: " < "$nlist" > "$nlist"S
3279
if test -f "$nlist"S; then
3280
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3282
echo '/* NONE */' >> "$output_objdir/$dlsyms"
3285
$echo >> "$output_objdir/$dlsyms" "\
3287
#undef lt_preloaded_symbols
3289
#if defined (__STDC__) && __STDC__
3290
# define lt_ptr_t void *
3292
# define lt_ptr_t char *
3296
/* The mapping between symbol names and symbols. */
3301
lt_preloaded_symbols[] =
3305
sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3306
-e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3307
< "$nlist" >> "$output_objdir/$dlsyms"
3309
$echo >> "$output_objdir/$dlsyms" "\
3313
/* This works around a problem in FreeBSD linker */
3314
#ifdef FREEBSD_WORKAROUND
3315
static const void *lt_preloaded_setup() {
3316
return lt_preloaded_symbols;
3326
pic_flag_for_symtable=
3328
# compiling the symbol table file with pic_flag works around
3329
# a FreeBSD bug that causes programs to crash when -lm is
3330
# linked before any other PIC object. But we must not use
3331
# pic_flag when linking with -static. The problem exists in
3332
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3333
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3334
case "$compile_command " in
3336
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3339
case "$compile_command " in
3341
*) pic_flag_for_symtable=" $pic_flag -DPIC";;
3345
# Now compile the dynamic symbol file.
3346
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3347
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3349
# Clean up the generated files.
3350
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3351
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3353
# Transform the symbol file into the correct name.
3354
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3355
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3358
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3363
# We keep going just in case the user didn't refer to
3364
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3365
# really was required.
3367
# Nullify the symbol file.
3368
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3369
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3372
if test $need_relink = no || test "$build_libtool_libs" != yes; then
3373
# Replace the output file specification.
3374
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3375
link_command="$compile_command$compile_rpath"
3377
# We have no uninstalled library dependencies, so finalize right now.
3378
$show "$link_command"
3379
$run eval "$link_command"
3382
# Delete the generated files.
3383
if test -n "$dlsyms"; then
3384
$show "$rm $output_objdir/${outputname}S.${objext}"
3385
$run $rm "$output_objdir/${outputname}S.${objext}"
3391
if test -n "$shlibpath_var"; then
3392
# We should set the shlibpath_var
3394
for dir in $temp_rpath; do
3396
[\\/]* | [A-Za-z]:[\\/]*)
3401
# Relative path: add a thisdir entry.
3402
rpath="$rpath\$thisdir/$dir:"
3409
if test -n "$compile_shlibpath$finalize_shlibpath"; then
3410
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3412
if test -n "$finalize_shlibpath"; then
3413
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3418
if test -n "$runpath_var"; then
3419
if test -n "$perm_rpath"; then
3420
# We should set the runpath_var.
3422
for dir in $perm_rpath; do
3425
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3427
if test -n "$finalize_perm_rpath"; then
3428
# We should set the runpath_var.
3430
for dir in $finalize_perm_rpath; do
3433
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3437
if test "$no_install" = yes; then
3438
# We don't need to create a wrapper script.
3439
link_command="$compile_var$compile_command$compile_rpath"
3440
# Replace the output file specification.
3441
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3442
# Delete the old output file.
3444
# Link the executable and exit
3445
$show "$link_command"
3446
$run eval "$link_command" || exit $?
3450
if test "$hardcode_action" = relink; then
3451
# Fast installation is not supported
3452
link_command="$compile_var$compile_command$compile_rpath"
3453
relink_command="$finalize_var$finalize_command$finalize_rpath"
3455
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3456
$echo "$modename: \`$output' will be relinked during installation" 1>&2
3458
if test "$fast_install" != no; then
3459
link_command="$finalize_var$compile_command$finalize_rpath"
3460
if test "$fast_install" = yes; then
3461
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3463
# fast_install is set to needless
3467
link_command="$compile_var$compile_command$compile_rpath"
3468
relink_command="$finalize_var$finalize_command$finalize_rpath"
3472
# Replace the output file specification.
3473
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3475
# Delete the old output files.
3476
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3478
$show "$link_command"
3479
$run eval "$link_command" || exit $?
3481
# Now create the wrapper script.
3482
$show "creating $output"
3484
# Quote the relink command for shipping.
3485
if test -n "$relink_command"; then
3486
# Preserve any variables that may affect compiler behavior
3487
for var in $variables_saved_for_relink; do
3488
if eval test -z \"\${$var+set}\"; then
3489
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3490
elif eval var_value=\$$var; test -z "$var_value"; then
3491
relink_command="$var=; export $var; $relink_command"
3493
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3494
relink_command="$var=\"$var_value\"; export $var; $relink_command"
3497
relink_command="cd `pwd`; $relink_command"
3498
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3501
# Quote $echo for shipping.
3502
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3504
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3505
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3507
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3509
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3512
# Only actually do things if our run command is non-null.
3513
if test -z "$run"; then
3514
# win32 will think the script is a binary if it has
3515
# a .exe suffix, so we strip it off here.
3517
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3519
# test for cygwin because mv fails w/o .exe extensions
3521
*cygwin*) exeext=.exe ;;
3525
trap "$rm $output; exit 1" 1 2 15
3530
# $output - temporary wrapper script for $objdir/$outputname
3531
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3533
# The $output program cannot be directly executed until all the libtool
3534
# libraries that it depends on are installed.
3536
# This wrapper script should never be moved out of the build directory.
3537
# If it is, it will not operate correctly.
3539
# Sed substitution that helps us do robust quoting. It backslashifies
3540
# metacharacters that are still active within double-quoted strings.
3541
Xsed='sed -e 1s/^X//'
3542
sed_quote_subst='$sed_quote_subst'
3544
# The HP-UX ksh and POSIX shell print the target directory to stdout
3546
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3548
relink_command=\"$relink_command\"
3550
# This environment variable determines our operation mode.
3551
if test \"\$libtool_install_magic\" = \"$magic\"; then
3552
# install mode needs the following variable:
3553
notinst_deplibs='$notinst_deplibs'
3555
# When we are sourced in execute mode, \$file and \$echo are already set.
3556
if test \"\$libtool_execute_magic\" != \"$magic\"; then
3559
# Make sure echo works.
3560
if test \"X\$1\" = X--no-reexec; then
3561
# Discard the --no-reexec flag, and continue.
3563
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3564
# Yippee, \$echo works!
3567
# Restart under the correct shell, and then maybe \$echo will work.
3568
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3574
# Find the directory that this script lives in.
3575
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3576
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3578
# Follow symbolic links until we get to the real thisdir.
3579
file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3580
while test -n \"\$file\"; do
3581
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3583
# If there was a directory component, then change thisdir.
3584
if test \"x\$destdir\" != \"x\$file\"; then
3585
case \"\$destdir\" in
3586
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3587
*) thisdir=\"\$thisdir/\$destdir\" ;;
3591
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3592
file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3595
# Try to get the absolute directory name.
3596
absdir=\`cd \"\$thisdir\" && pwd\`
3597
test -n \"\$absdir\" && thisdir=\"\$absdir\"
3600
if test "$fast_install" = yes; then
3602
program=lt-'$outputname'$exeext
3603
progdir=\"\$thisdir/$objdir\"
3605
if test ! -f \"\$progdir/\$program\" || \\
3606
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3607
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3609
file=\"\$\$-\$program\"
3611
if test ! -d \"\$progdir\"; then
3612
$mkdir \"\$progdir\"
3614
$rm \"\$progdir/\$file\"
3619
# relink executable if necessary
3620
if test -n \"\$relink_command\"; then
3621
if (eval \$relink_command); then :
3623
$rm \"\$progdir/\$file\"
3628
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3629
{ $rm \"\$progdir/\$program\";
3630
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3631
$rm \"\$progdir/\$file\"
3635
program='$outputname'
3636
progdir=\"\$thisdir/$objdir\"
3642
if test -f \"\$progdir/\$program\"; then"
3644
# Export our shlibpath_var if we have one.
3645
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3647
# Add our own library path to $shlibpath_var
3648
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3650
# Some systems cannot cope with colon-terminated $shlibpath_var
3651
# The second colon is a workaround for a bug in BeOS R4 sed
3652
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3654
export $shlibpath_var
3658
# fixup the dll searchpath if we need to.
3659
if test -n "$dllsearchpath"; then
3661
# Add the dll search path components to the executable PATH
3662
PATH=$dllsearchpath:\$PATH
3667
if test \"\$libtool_execute_magic\" != \"$magic\"; then
3668
# Run the actual program with our arguments.
3671
# win32 systems need to use the prog path for dll
3673
*-*-cygwin* | *-*-pw32*)
3675
exec \$progdir/\$program \${1+\"\$@\"}
3679
# Backslashes separate directories on plain windows
3680
*-*-mingw | *-*-os2*)
3682
exec \$progdir\\\\\$program \${1+\"\$@\"}
3688
# Export the path to the program.
3689
PATH=\"\$progdir:\$PATH\"
3692
exec \$program \${1+\"\$@\"}
3697
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3701
# The program doesn't exist.
3702
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3703
\$echo \"This script is just a wrapper for \$program.\" 1>&2
3704
echo \"See the $PACKAGE documentation for more information.\" 1>&2
3715
# See if we need to build an old-fashioned archive.
3716
for oldlib in $oldlibs; do
3718
if test "$build_libtool_libs" = convenience; then
3719
oldobjs="$libobjs_save"
3720
addlibs="$convenience"
3721
build_libtool_libs=no
3723
if test "$build_libtool_libs" = module; then
3724
oldobjs="$libobjs_save"
3725
build_libtool_libs=no
3727
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3729
addlibs="$old_convenience"
3732
if test -n "$addlibs"; then
3733
gentop="$output_objdir/${outputname}x"
3734
$show "${rm}r $gentop"
3735
$run ${rm}r "$gentop"
3736
$show "mkdir $gentop"
3737
$run mkdir "$gentop"
3739
if test $status -ne 0 && test ! -d "$gentop"; then
3742
generated="$generated $gentop"
3744
# Add in members from convenience archives.
3745
for xlib in $addlibs; do
3746
# Extract the objects.
3748
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3749
*) xabs=`pwd`"/$xlib" ;;
3751
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3752
xdir="$gentop/$xlib"
3754
$show "${rm}r $xdir"
3759
if test $status -ne 0 && test ! -d "$xdir"; then
3762
$show "(cd $xdir && $AR x $xabs)"
3763
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3765
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3769
# Do each command in the archive commands.
3770
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3771
eval cmds=\"$old_archive_from_new_cmds\"
3773
# Ensure that we have .o objects in place in case we decided
3774
# not to build a shared library, and have fallen back to building
3775
# static libs even though --disable-static was passed!
3776
for oldobj in $oldobjs; do
3777
if test ! -f $oldobj; then
3778
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3779
if test "X$xdir" = "X$oldobj"; then
3784
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3785
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3786
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3787
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3791
eval cmds=\"$old_archive_cmds\"
3793
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3794
for cmd in $cmds; do
3797
$run eval "$cmd" || exit $?
3802
if test -n "$generated"; then
3803
$show "${rm}r$generated"
3804
$run ${rm}r$generated
3807
# Now create the libtool archive.
3811
test "$build_old_libs" = yes && old_library="$libname.$libext"
3812
$show "creating $output"
3814
# Preserve any variables that may affect compiler behavior
3815
for var in $variables_saved_for_relink; do
3816
if eval test -z \"\${$var+set}\"; then
3817
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3818
elif eval var_value=\$$var; test -z "$var_value"; then
3819
relink_command="$var=; export $var; $relink_command"
3821
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3822
relink_command="$var=\"$var_value\"; export $var; $relink_command"
3825
# Quote the link command for shipping.
3826
relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3827
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3829
# Only create the output if not a dry run.
3830
if test -z "$run"; then
3831
for installed in no yes; do
3832
if test "$installed" = yes; then
3833
if test -z "$install_libdir"; then
3836
output="$output_objdir/$outputname"i
3837
# Replace all uninstalled libtool libraries with the installed ones
3839
for deplib in $dependency_libs; do
3842
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3843
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3844
if test -z "$libdir"; then
3845
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3848
newdependency_libs="$newdependency_libs $libdir/$name"
3850
*) newdependency_libs="$newdependency_libs $deplib" ;;
3853
dependency_libs="$newdependency_libs"
3855
for lib in $dlfiles; do
3856
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3857
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3858
if test -z "$libdir"; then
3859
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3862
newdlfiles="$newdlfiles $libdir/$name"
3864
dlfiles="$newdlfiles"
3866
for lib in $dlprefiles; do
3867
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3868
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3869
if test -z "$libdir"; then
3870
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3873
newdlprefiles="$newdlprefiles $libdir/$name"
3875
dlprefiles="$newdlprefiles"
3878
# place dlname in correct position for cygwin
3880
case $host,$output,$installed,$module,$dlname in
3881
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3884
# $outputname - a libtool library file
3885
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3887
# Please DO NOT delete this file!
3888
# It is necessary for linking the library.
3890
# The name that we can dlopen(3).
3893
# Names of this library.
3894
library_names='$library_names'
3896
# The name of the static archive.
3897
old_library='$old_library'
3899
# Libraries that this one depends upon.
3900
dependency_libs='$dependency_libs'
3902
# Version information for $libname.
3907
# Is this an already installed library?
3908
installed=$installed
3910
# Files to dlopen/dlpreopen
3912
dlpreopen='$dlprefiles'
3914
# Directory that this library needs to be installed in:
3915
libdir='$install_libdir'"
3916
if test "$installed" = no && test $need_relink = yes; then
3918
relink_command=\"$relink_command\""
3923
# Do a symbolic link so that the libtool archive can be found in
3924
# LD_LIBRARY_PATH before the program is installed.
3925
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3926
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
3932
# libtool install mode
3934
modename="$modename: install"
3936
# There may be an optional sh(1) argument at the beginning of
3937
# install_prog (especially on Windows NT).
3938
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3939
# Allow the use of GNU shtool's install command.
3940
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
3941
# Aesthetically quote it.
3942
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3944
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3948
install_prog="$arg "
3956
# The real first argument should be the name of the installation program.
3957
# Aesthetically quote it.
3958
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3960
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3964
install_prog="$install_prog$arg"
3966
# We need to accept at least all the BSD install flags.
3976
if test -n "$dest"; then
3977
files="$files $dest"
3995
# If the previous option needed an argument, then skip it.
3996
if test -n "$prev"; then
4005
# Aesthetically quote the argument.
4006
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4008
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4012
install_prog="$install_prog $arg"
4015
if test -z "$install_prog"; then
4016
$echo "$modename: you must specify an install program" 1>&2
4021
if test -n "$prev"; then
4022
$echo "$modename: the \`$prev' option requires an argument" 1>&2
4027
if test -z "$files"; then
4028
if test -z "$dest"; then
4029
$echo "$modename: no file or destination specified" 1>&2
4031
$echo "$modename: you must specify a destination" 1>&2
4037
# Strip any trailing slash from the destination.
4038
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4040
# Check to see that the destination is a directory.
4041
test -d "$dest" && isdir=yes
4042
if test "$isdir" = yes; then
4046
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4047
test "X$destdir" = "X$dest" && destdir=.
4048
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4050
# Not a directory, so check to see that there is only one file specified.
4052
if test $# -gt 2; then
4053
$echo "$modename: \`$dest' is not a directory" 1>&2
4059
[\\/]* | [A-Za-z]:[\\/]*) ;;
4061
for file in $files; do
4065
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4074
# This variable tells wrapper scripts just to set variables rather
4075
# than running their programs.
4076
libtool_install_magic="$magic"
4081
for file in $files; do
4083
# Do each installation.
4086
# Do the static libraries later.
4087
staticlibs="$staticlibs $file"
4091
# Check to see that this really is a libtool archive.
4092
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4094
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4102
# If there is no directory component, then add one.
4104
*/* | *\\*) . $file ;;
4108
# Add the libdir to current_libdirs if it is the destination.
4109
if test "X$destdir" = "X$libdir"; then
4110
case "$current_libdirs " in
4112
*) current_libdirs="$current_libdirs $libdir" ;;
4115
# Note the libdir as a future libdir.
4116
case "$future_libdirs " in
4118
*) future_libdirs="$future_libdirs $libdir" ;;
4122
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4123
test "X$dir" = "X$file/" && dir=
4126
if test -n "$relink_command"; then
4127
$echo "$modename: warning: relinking \`$file'" 1>&2
4128
$show "$relink_command"
4129
if $run eval "$relink_command"; then :
4131
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4136
# See the names of the shared library.
4137
set dummy $library_names
4138
if test -n "$2"; then
4144
test -n "$relink_command" && srcname="$realname"T
4146
# Install the shared library and build the symlinks.
4147
$show "$install_prog $dir/$srcname $destdir/$realname"
4148
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4149
if test -n "$stripme" && test -n "$striplib"; then
4150
$show "$striplib $destdir/$realname"
4151
$run eval "$striplib $destdir/$realname" || exit $?
4154
if test $# -gt 0; then
4155
# Delete the old symlinks, and create new ones.
4158
if test "$linkname" != "$realname"; then
4159
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4160
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4165
# Do each command in the postinstall commands.
4166
lib="$destdir/$realname"
4167
eval cmds=\"$postinstall_cmds\"
4168
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4169
for cmd in $cmds; do
4172
$run eval "$cmd" || exit $?
4177
# Install the pseudo-library for information purposes.
4178
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4179
instname="$dir/$name"i
4180
$show "$install_prog $instname $destdir/$name"
4181
$run eval "$install_prog $instname $destdir/$name" || exit $?
4183
# Maybe install the static library, too.
4184
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4188
# Install (i.e. copy) a libtool object.
4190
# Figure out destination file name, if it wasn't already specified.
4191
if test -n "$destname"; then
4192
destfile="$destdir/$destname"
4194
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4195
destfile="$destdir/$destfile"
4198
# Deduce the name of the destination old-style object file.
4201
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4204
staticdest="$destfile"
4208
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4214
# Install the libtool object if requested.
4215
if test -n "$destfile"; then
4216
$show "$install_prog $file $destfile"
4217
$run eval "$install_prog $file $destfile" || exit $?
4220
# Install the old object if enabled.
4221
if test "$build_old_libs" = yes; then
4222
# Deduce the name of the old-style object file.
4223
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4225
$show "$install_prog $staticobj $staticdest"
4226
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
4232
# Figure out destination file name, if it wasn't already specified.
4233
if test -n "$destname"; then
4234
destfile="$destdir/$destname"
4236
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4237
destfile="$destdir/$destfile"
4240
# Do a test to see if this is really a libtool program.
4241
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4245
# If there is no directory component, then add one.
4247
*/* | *\\*) . $file ;;
4251
# Check the variables that should have been set.
4252
if test -z "$notinst_deplibs"; then
4253
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4258
for lib in $notinst_deplibs; do
4259
# Check to see that each library is installed.
4261
if test -f "$lib"; then
4262
# If there is no directory component, then add one.
4264
*/* | *\\*) . $lib ;;
4268
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4269
if test -n "$libdir" && test ! -f "$libfile"; then
4270
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4276
# If there is no directory component, then add one.
4278
*/* | *\\*) . $file ;;
4283
if test "$fast_install" = no && test -n "$relink_command"; then
4284
if test "$finalize" = yes && test -z "$run"; then
4286
test -n "$TMPDIR" && tmpdir="$TMPDIR"
4287
tmpdir="$tmpdir/libtool-$$"
4288
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4290
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4293
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4294
outputname="$tmpdir/$file"
4295
# Replace the output file specification.
4296
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4298
$show "$relink_command"
4299
if $run eval "$relink_command"; then :
4301
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4307
$echo "$modename: warning: cannot relink \`$file'" 1>&2
4310
# Install the binary that we compiled earlier.
4311
file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4315
# remove .exe since cygwin /usr/bin/install will append another
4317
case $install_prog,$host in
4318
/usr/bin/install*,*cygwin*)
4319
case $file:$destfile in
4324
destfile=$destfile.exe
4327
destfile=`echo $destfile | sed -e 's,.exe$,,'`
4332
$show "$install_prog$stripme $file $destfile"
4333
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4334
test -n "$outputname" && ${rm}r "$tmpdir"
4339
for file in $staticlibs; do
4340
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4342
# Set up the ranlib parameters.
4343
oldlib="$destdir/$name"
4345
$show "$install_prog $file $oldlib"
4346
$run eval "$install_prog \$file \$oldlib" || exit $?
4348
if test -n "$stripme" && test -n "$striplib"; then
4349
$show "$old_striplib $oldlib"
4350
$run eval "$old_striplib $oldlib" || exit $?
4353
# Do each command in the postinstall commands.
4354
eval cmds=\"$old_postinstall_cmds\"
4355
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4356
for cmd in $cmds; do
4359
$run eval "$cmd" || exit $?
4364
if test -n "$future_libdirs"; then
4365
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4368
if test -n "$current_libdirs"; then
4369
# Maybe just do a dry run.
4370
test -n "$run" && current_libdirs=" -n$current_libdirs"
4371
exec $SHELL $0 --finish$current_libdirs
4378
# libtool finish mode
4380
modename="$modename: finish"
4384
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4387
libdirs="$libdirs $dir"
4390
for libdir in $libdirs; do
4391
if test -n "$finish_cmds"; then
4392
# Do each command in the finish commands.
4393
eval cmds=\"$finish_cmds\"
4394
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4395
for cmd in $cmds; do
4398
$run eval "$cmd" || admincmds="$admincmds
4403
if test -n "$finish_eval"; then
4404
# Do the single finish_eval.
4405
eval cmds=\"$finish_eval\"
4406
$run eval "$cmds" || admincmds="$admincmds
4412
# Exit here if they wanted silent mode.
4413
test "$show" = ":" && exit 0
4415
echo "----------------------------------------------------------------------"
4416
echo "Libraries have been installed in:"
4417
for libdir in $libdirs; do
4421
echo "If you ever happen to want to link against installed libraries"
4422
echo "in a given directory, LIBDIR, you must either use libtool, and"
4423
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4424
echo "flag during linking and do at least one of the following:"
4425
if test -n "$shlibpath_var"; then
4426
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4427
echo " during execution"
4429
if test -n "$runpath_var"; then
4430
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4431
echo " during linking"
4433
if test -n "$hardcode_libdir_flag_spec"; then
4435
eval flag=\"$hardcode_libdir_flag_spec\"
4437
echo " - use the \`$flag' linker flag"
4439
if test -n "$admincmds"; then
4440
echo " - have your system administrator run these commands:$admincmds"
4442
if test -f /etc/ld.so.conf; then
4443
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4446
echo "See any operating system documentation about shared libraries for"
4447
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4448
echo "----------------------------------------------------------------------"
4452
# libtool execute mode
4454
modename="$modename: execute"
4456
# The first argument is the command name.
4458
if test -z "$cmd"; then
4459
$echo "$modename: you must specify a COMMAND" 1>&2
4464
# Handle -dlopen flags immediately.
4465
for file in $execute_dlfiles; do
4466
if test ! -f "$file"; then
4467
$echo "$modename: \`$file' is not a file" 1>&2
4475
# Check to see that this really is a libtool archive.
4476
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4478
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4483
# Read the libtool library.
4487
# If there is no directory component, then add one.
4489
*/* | *\\*) . $file ;;
4493
# Skip this library if it cannot be dlopened.
4494
if test -z "$dlname"; then
4495
# Warn if it was a shared library.
4496
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4500
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4501
test "X$dir" = "X$file" && dir=.
4503
if test -f "$dir/$objdir/$dlname"; then
4506
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4512
# Just add the directory containing the .lo file.
4513
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4514
test "X$dir" = "X$file" && dir=.
4518
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4523
# Get the absolute pathname.
4524
absdir=`cd "$dir" && pwd`
4525
test -n "$absdir" && dir="$absdir"
4527
# Now add the directory to shlibpath_var.
4528
if eval "test -z \"\$$shlibpath_var\""; then
4529
eval "$shlibpath_var=\"\$dir\""
4531
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4535
# This variable tells wrapper scripts just to set shlibpath_var
4536
# rather than running their programs.
4537
libtool_execute_magic="$magic"
4539
# Check if any of the arguments is a wrapper script.
4546
# Do a test to see if this is really a libtool program.
4547
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4548
# If there is no directory component, then add one.
4550
*/* | *\\*) . $file ;;
4554
# Transform arg to wrapped name.
4555
file="$progdir/$program"
4559
# Quote arguments (to preserve shell metacharacters).
4560
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4561
args="$args \"$file\""
4564
if test -z "$run"; then
4565
if test -n "$shlibpath_var"; then
4566
# Export the shlibpath_var.
4567
eval "export $shlibpath_var"
4570
# Restore saved enviroment variables
4571
if test "${save_LC_ALL+set}" = set; then
4572
LC_ALL="$save_LC_ALL"; export LC_ALL
4574
if test "${save_LANG+set}" = set; then
4575
LANG="$save_LANG"; export LANG
4578
# Now actually exec the command.
4579
eval "exec \$cmd$args"
4581
$echo "$modename: cannot exec \$cmd$args"
4584
# Display what would be done.
4585
if test -n "$shlibpath_var"; then
4586
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4587
$echo "export $shlibpath_var"
4594
# libtool clean and uninstall mode
4596
modename="$modename: $mode"
4602
# This variable tells wrapper scripts just to set variables rather
4603
# than running their programs.
4604
libtool_install_magic="$magic"
4609
-f) rm="$rm $arg"; rmforce=yes ;;
4610
-*) rm="$rm $arg" ;;
4611
*) files="$files $arg" ;;
4615
if test -z "$rm"; then
4616
$echo "$modename: you must specify an RM program" 1>&2
4623
for file in $files; do
4624
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4625
if test "X$dir" = "X$file"; then
4629
objdir="$dir/$objdir"
4631
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4632
test $mode = uninstall && objdir="$dir"
4634
# Remember objdir for removal later, being careful to avoid duplicates
4635
if test $mode = clean; then
4638
*) rmdirs="$rmdirs $objdir" ;;
4642
# Don't error if the file doesn't exist and rm -f was used.
4643
if (test -L "$file") >/dev/null 2>&1 \
4644
|| (test -h "$file") >/dev/null 2>&1 \
4645
|| test -f "$file"; then
4647
elif test -d "$file"; then
4650
elif test "$rmforce" = yes; then
4658
# Possibly a libtool archive, so verify it.
4659
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4662
# Delete the libtool libraries and symlinks.
4663
for n in $library_names; do
4664
rmfiles="$rmfiles $objdir/$n"
4666
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4667
test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4669
if test $mode = uninstall; then
4670
if test -n "$library_names"; then
4671
# Do each command in the postuninstall commands.
4672
eval cmds=\"$postuninstall_cmds\"
4673
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4674
for cmd in $cmds; do
4678
if test $? != 0 && test "$rmforce" != yes; then
4685
if test -n "$old_library"; then
4686
# Do each command in the old_postuninstall commands.
4687
eval cmds=\"$old_postuninstall_cmds\"
4688
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4689
for cmd in $cmds; do
4693
if test $? != 0 && test "$rmforce" != yes; then
4699
# FIXME: should reinstall the best remaining shared library.
4705
if test "$build_old_libs" = yes; then
4706
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4707
rmfiles="$rmfiles $dir/$oldobj"
4712
# Do a test to see if this is a libtool program.
4713
if test $mode = clean &&
4714
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4718
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4719
if test "$fast_install" = yes && test -n "$relink_command"; then
4720
rmfiles="$rmfiles $objdir/lt-$name"
4725
$show "$rm $rmfiles"
4726
$run $rm $rmfiles || exit_status=1
4729
# Try to remove the ${objdir}s in the directories where we deleted files
4730
for dir in $rmdirs; do
4731
if test -d "$dir"; then
4733
$run rmdir $dir >/dev/null 2>&1
4741
$echo "$modename: you must specify a MODE" 1>&2
4742
$echo "$generic_help" 1>&2
4747
$echo "$modename: invalid operation mode \`$mode'" 1>&2
4748
$echo "$generic_help" 1>&2
4750
fi # test -z "$show_help"
4752
# We need to display help for each of the modes.
4755
"Usage: $modename [OPTION]... [MODE-ARG]...
4757
Provide generalized library-building support services.
4759
--config show all configuration variables
4760
--debug enable verbose shell tracing
4761
-n, --dry-run display commands without modifying any files
4762
--features display basic configuration information and exit
4763
--finish same as \`--mode=finish'
4764
--help display this help message and exit
4765
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4766
--quiet same as \`--silent'
4767
--silent don't print informational messages
4768
--version print version information
4770
MODE must be one of the following:
4772
clean remove files from the build directory
4773
compile compile a source file into a libtool object
4774
execute automatically set library path, then run a program
4775
finish complete the installation of libtool libraries
4776
install install libraries or executables
4777
link create a library or an executable
4778
uninstall remove libraries from an installed directory
4780
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4781
a more detailed description of MODE."
4787
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4789
Remove files from the build directory.
4791
RM is the name of the program to use to delete files associated with each FILE
4792
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4795
If FILE is a libtool library, object or program, all the files associated
4796
with it are deleted. Otherwise, only FILE itself is deleted using RM."
4801
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4803
Compile a source file into a libtool library object.
4805
This mode accepts the following additional options:
4807
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
4808
-prefer-pic try to building PIC objects only
4809
-prefer-non-pic try to building non-PIC objects only
4810
-static always build a \`.o' file suitable for static linking
4812
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4813
from the given SOURCEFILE.
4815
The output file name is determined by removing the directory component from
4816
SOURCEFILE, then substituting the C source code suffix \`.c' with the
4817
library object suffix, \`.lo'."
4822
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4824
Automatically set library path, then run a program.
4826
This mode accepts the following additional options:
4828
-dlopen FILE add the directory containing FILE to the library path
4830
This mode sets the library path environment variable according to \`-dlopen'
4833
If any of the ARGS are libtool executable wrappers, then they are translated
4834
into their corresponding uninstalled binary, and any of their required library
4835
directories are added to the library path.
4837
Then, COMMAND is executed, with ARGS as arguments."
4842
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4844
Complete the installation of libtool libraries.
4846
Each LIBDIR is a directory that contains libtool libraries.
4848
The commands that this mode executes may require superuser privileges. Use
4849
the \`--dry-run' option if you just want to see what would be executed."
4854
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4856
Install executables or libraries.
4858
INSTALL-COMMAND is the installation command. The first component should be
4859
either the \`install' or \`cp' program.
4861
The rest of the components are interpreted as arguments to that command (only
4862
BSD-compatible install options are recognized)."
4867
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4869
Link object files or libraries together to form another library, or to
4870
create an executable program.
4872
LINK-COMMAND is a command using the C compiler that you would use to create
4873
a program from several object files.
4875
The following components of LINK-COMMAND are treated specially:
4877
-all-static do not do any dynamic linking at all
4878
-avoid-version do not add a version suffix if possible
4879
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4880
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4881
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4882
-export-symbols SYMFILE
4883
try to export only the symbols listed in SYMFILE
4884
-export-symbols-regex REGEX
4885
try to export only the symbols matching REGEX
4886
-LLIBDIR search LIBDIR for required installed libraries
4887
-lNAME OUTPUT-FILE requires the installed library libNAME
4888
-module build a library that can dlopened
4889
-no-fast-install disable the fast-install mode
4890
-no-install link a not-installable executable
4891
-no-undefined declare that a library does not refer to external symbols
4892
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4893
-release RELEASE specify package release information
4894
-rpath LIBDIR the created library will eventually be installed in LIBDIR
4895
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4896
-static do not do any dynamic linking of libtool libraries
4897
-version-info CURRENT[:REVISION[:AGE]]
4898
specify library version info [each variable defaults to 0]
4900
All other options (arguments beginning with \`-') are ignored.
4902
Every other argument is treated as a filename. Files ending in \`.la' are
4903
treated as uninstalled libtool libraries, other files are standard or library
4906
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4907
only library objects (\`.lo' files) may be specified, and \`-rpath' is
4908
required, except when creating a convenience library.
4910
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4911
using \`ar' and \`ranlib', or on Windows using \`lib'.
4913
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4914
is created, otherwise an executable program is created."
4919
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4921
Remove libraries from an installation directory.
4923
RM is the name of the program to use to delete files associated with each FILE
4924
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4927
If FILE is a libtool library, all the files associated with it are deleted.
4928
Otherwise, only FILE itself is deleted using RM."
4932
$echo "$modename: invalid operation mode \`$mode'" 1>&2
4939
$echo "Try \`$modename --help' for more information about other modes."