1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
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.1220.2.35 2003/11/12 18:51:58) Debian$Rev: 179 $"
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.
70
Xsed="${SED}"' -e 1s/^X//'
71
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72
# test EBCDIC or ASCII
73
case `echo A|tr A '\301'` in
74
A) # EBCDIC based system
75
SP2NL="tr '\100' '\n'"
76
NL2SP="tr '\r\n' '\100\100'"
78
*) # Assume ASCII based system
79
SP2NL="tr '\040' '\012'"
80
NL2SP="tr '\015\012' '\040\040'"
85
# Only set LANG and LC_ALL to C if already set.
86
# These must not be set unconditionally because not all systems understand
87
# e.g. LANG=C (notably SCO).
88
# We save the old values to restore during execute mode.
89
if test "${LC_ALL+set}" = set; then
90
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
92
if test "${LANG+set}" = set; then
93
save_LANG="$LANG"; LANG=C; export LANG
96
# Make sure IFS has a sensible default
100
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
101
$echo "$modename: not configured to build any kind of library" 1>&2
102
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
115
lo2o="s/\\.lo\$/.${objext}/"
116
o2lo="s/\\.${objext}\$/.lo/"
118
#####################################
119
# Shell function definitions:
120
# This seems to be the best place for them
122
# Need a lot of goo to handle *both* DLLs and import libs
123
# Has to be a shell function in order to 'eat' the argument
124
# that is supplied when $file_magic_command is called.
126
win32_libid_type="unknown"
127
win32_fileres=`file -L $1 2>/dev/null`
128
case $win32_fileres in
129
*ar\ archive\ import\ library*) # definitely import
130
win32_libid_type="x86 archive import"
132
*ar\ archive*) # could be an import, or static
133
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
134
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
135
win32_nmres=`eval $NM -f posix -A $1 | \
136
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
137
if test "X$win32_nmres" = "Ximport" ; then
138
win32_libid_type="x86 archive import"
140
win32_libid_type="x86 archive static"
145
win32_libid_type="x86 DLL"
147
*executable*) # but shell scripts are "executable" too...
148
case $win32_fileres in
149
*MS\ Windows\ PE\ Intel*)
150
win32_libid_type="x86 DLL"
155
$echo $win32_libid_type
158
# End of Shell function definitions
159
#####################################
161
# Parse our command line options once, thoroughly.
162
while test "$#" -gt 0
168
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
172
# If the previous option needs an argument, assign it.
173
if test -n "$prev"; then
176
execute_dlfiles="$execute_dlfiles $arg"
180
preserve_args="${preserve_args}=$arg"
182
# Check whether tagname contains only valid characters
185
$echo "$progname: invalid tag name: $tagname" 1>&2
192
# Don't test for the "default" C tag, as we know, it's there, but
193
# not specially marked.
196
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
197
taglist="$taglist $tagname"
198
# Evaluate the configuration.
199
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
201
$echo "$progname: ignoring unknown tag $tagname" 1>&2
216
# Have we seen a non-optional argument yet?
223
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
225
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
226
$echo "This is free software; see the source for copying conditions. There is NO"
227
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
232
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
233
# Now print the configurations for the tags.
234
for tagname in $taglist; do
235
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
241
$echo "$progname: enabling shell trace mode"
243
preserve_args="$preserve_args $arg"
252
if test "$build_libtool_libs" = yes; then
253
$echo "enable shared libraries"
255
$echo "disable shared libraries"
257
if test "$build_old_libs" = yes; then
258
$echo "enable static libraries"
260
$echo "disable static libraries"
265
--finish) mode="finish" ;;
267
--mode) prevopt="--mode" prev=mode ;;
268
--mode=*) mode="$optarg" ;;
270
--preserve-dup-deps) duplicate_deps="yes" ;;
274
preserve_args="$preserve_args $arg"
277
--tag) prevopt="--tag" prev=tag ;;
279
set tag "$optarg" ${1+"$@"}
282
preserve_args="$preserve_args --tag"
291
$echo "$modename: unrecognized option \`$arg'" 1>&2
303
if test -n "$prevopt"; then
304
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
309
# If this variable is set in any of the actions, the command in it
310
# will be execed at the end. This prevents here-documents from being
311
# left over by shells.
314
if test -z "$show_help"; then
316
# Infer the operation mode.
317
if test -z "$mode"; then
318
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
319
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
321
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
333
*db | *dbx | *strace | *truss)
343
# If we have no mode, but dlfiles were specified, then do execute mode.
344
test -n "$execute_dlfiles" && mode=execute
346
# Just use the default operation mode.
347
if test -z "$mode"; then
348
if test -n "$nonopt"; then
349
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
351
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
358
# Only execute mode is allowed to have -dlopen flags.
359
if test -n "$execute_dlfiles" && test "$mode" != execute; then
360
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
365
# Change the help message to a mode-specific one.
367
help="Try \`$modename --help --mode=$mode' for more information."
369
# These modes are in order of execution frequency so that they run quickly.
371
# libtool compile mode
373
modename="$modename: compile"
374
# Get the compilation command and the source file.
376
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
387
# do not "continue". Instead, add this to base_compile
399
# Accept any command-line options.
402
if test -n "$libobj" ; then
403
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
410
-static | -prefer-pic | -prefer-non-pic)
421
arg_mode=arg # the next one goes into the "base_compile" arg list
422
continue # The current "srcfile" will either be retained or
423
;; # replaced later. I would guess that would be a bug.
426
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
428
save_ifs="$IFS"; IFS=','
432
# Double-quote args containing other shell metacharacters.
433
# Many Bourne shells cannot handle close brackets correctly
434
# in scan sets, so we specify it separately.
436
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
440
lastarg="$lastarg $arg"
443
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
445
# Add the arguments to base_compile.
446
base_compile="$base_compile $lastarg"
451
# Accept the current argument as the source file.
452
# The previous "srcfile" becomes the current argument.
459
esac # case $arg_mode
461
# Aesthetically quote the previous argument.
462
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
465
# Double-quote args containing other shell metacharacters.
466
# Many Bourne shells cannot handle close brackets correctly
467
# in scan sets, so we specify it separately.
468
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
469
lastarg="\"$lastarg\""
473
base_compile="$base_compile $lastarg"
478
$echo "$modename: you must specify an argument for -Xcompile"
482
$echo "$modename: you must specify a target with \`-o'" 1>&2
486
# Get the name of the library object.
487
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
491
# Recognize several different file suffixes.
492
# If the user specifies -o file.o, it is replaced with file.lo
502
*.class) xform=class ;;
507
*.java) xform=java ;;
510
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
513
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
515
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
520
# Infer tagged configuration to use if any are available and
521
# if one wasn't chosen via the "--tag" command line option.
522
# Only attempt this if the compiler in the base compile
523
# command doesn't match the default compiler.
524
if test -n "$available_tags" && test -z "$tagname"; then
525
case $base_compile in
526
# Blanks in the command may have been stripped by the calling shell,
527
# but not from the CC environment variable when configure was run.
528
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
529
# Blanks at the start of $base_compile will cause this to fail
530
# if we don't check for them as well.
532
for z in $available_tags; do
533
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
534
# Evaluate the configuration.
535
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
536
case "$base_compile " in
537
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
538
# The compiler in the base compile command matches
539
# the one in the tagged configuration.
540
# Assume this is the tagged configuration we want.
547
# If $tagname still isn't set, then no tagged configuration
548
# was found and let the user know that the "--tag" command
549
# line option must be used.
550
if test -z "$tagname"; then
551
$echo "$modename: unable to infer tagged configuration"
552
$echo "$modename: specify a tag with \`--tag'" 1>&2
555
# $echo "$modename: using $tagname tagged configuration"
561
for arg in $later; do
580
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
581
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
582
if test "X$xdir" = "X$obj"; then
587
lobj=${xdir}$objdir/$objname
589
if test -z "$base_compile"; then
590
$echo "$modename: you must specify a compilation command" 1>&2
595
# Delete any leftover library objects.
596
if test "$build_old_libs" = yes; then
597
removelist="$obj $lobj $libobj ${libobj}T"
599
removelist="$lobj $libobj ${libobj}T"
603
trap "$run $rm $removelist; exit 1" 1 2 15
605
# On Cygwin there's no "real" PIC flag so we must build both object types
607
cygwin* | mingw* | pw32* | os2*)
611
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
612
# non-PIC code in shared libraries is not supported
616
# Calculate the filename of the output object if compiler does
617
# not support -o with -c
618
if test "$compiler_c_o" = no; then
619
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
620
lockfile="$output_obj.lock"
621
removelist="$removelist $output_obj $lockfile"
622
trap "$run $rm $removelist; exit 1" 1 2 15
629
# Lock this critical section if it is needed
630
# We use this script file to make the link, it avoids creating a new file
631
if test "$need_locks" = yes; then
632
until $run ln "$0" "$lockfile" 2>/dev/null; do
633
$show "Waiting for $lockfile to be removed"
636
elif test "$need_locks" = warn; then
637
if test -f "$lockfile"; then
639
*** ERROR, $lockfile exists and contains:
640
`cat $lockfile 2>/dev/null`
642
This indicates that another process is trying to use the same
643
temporary object file, and libtool could not work around it because
644
your compiler does not support \`-c' and \`-o' together. If you
645
repeat this compilation, it may succeed, by chance, but you had better
646
avoid parallel builds (make -j) in this platform, or get a better
652
$echo $srcfile > "$lockfile"
655
if test -n "$fix_srcfile_path"; then
656
eval srcfile=\"$fix_srcfile_path\"
659
$run $rm "$libobj" "${libobj}T"
661
# Create a libtool object file (analogous to a ".la" file),
662
# but don't create it if we're doing a dry run.
663
test -z "$run" && cat > ${libobj}T <<EOF
664
# $libobj - a libtool object file
665
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
667
# Please DO NOT delete this file!
668
# It is necessary for linking the library.
670
# Name of the PIC object.
673
# Only build a PIC object if we are building libtool libraries.
674
if test "$build_libtool_libs" = yes; then
675
# Without this assignment, base_compile gets emptied.
676
fbsd_hideous_sh_bug=$base_compile
678
if test "$pic_mode" != no; then
679
command="$base_compile $srcfile $pic_flag"
681
# Don't build PIC code
682
command="$base_compile $srcfile"
685
if test ! -d "${xdir}$objdir"; then
686
$show "$mkdir ${xdir}$objdir"
687
$run $mkdir ${xdir}$objdir
689
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
694
if test -z "$output_obj"; then
695
# Place PIC objects in $objdir
696
command="$command -o $lobj"
699
$run $rm "$lobj" "$output_obj"
702
if $run eval "$command"; then :
704
test -n "$output_obj" && $run $rm $removelist
708
if test "$need_locks" = warn &&
709
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
711
*** ERROR, $lockfile contains:
712
`cat $lockfile 2>/dev/null`
714
but it should contain:
717
This indicates that another process is trying to use the same
718
temporary object file, and libtool could not work around it because
719
your compiler does not support \`-c' and \`-o' together. If you
720
repeat this compilation, it may succeed, by chance, but you had better
721
avoid parallel builds (make -j) in this platform, or get a better
728
# Just move the object if needed, then go on to compile the next one
729
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
730
$show "$mv $output_obj $lobj"
731
if $run $mv $output_obj $lobj; then :
739
# Append the name of the PIC object to the libtool object file.
740
test -z "$run" && cat >> ${libobj}T <<EOF
741
pic_object='$objdir/$objname'
745
# Allow error messages only from the first compilation.
746
if test "$suppress_opt" = yes; then
747
suppress_output=' >/dev/null 2>&1'
750
# No PIC object so indicate it doesn't exist in the libtool
752
test -z "$run" && cat >> ${libobj}T <<EOF
758
# Only build a position-dependent object if we build old libraries.
759
if test "$build_old_libs" = yes; then
760
if test "$pic_mode" != yes; then
761
# Don't build PIC code
762
command="$base_compile $srcfile"
764
command="$base_compile $srcfile $pic_flag"
766
if test "$compiler_c_o" = yes; then
767
command="$command -o $obj"
770
# Suppress compiler output if we already did a PIC compilation.
771
command="$command$suppress_output"
772
$run $rm "$obj" "$output_obj"
774
if $run eval "$command"; then :
780
if test "$need_locks" = warn &&
781
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
783
*** ERROR, $lockfile contains:
784
`cat $lockfile 2>/dev/null`
786
but it should contain:
789
This indicates that another process is trying to use the same
790
temporary object file, and libtool could not work around it because
791
your compiler does not support \`-c' and \`-o' together. If you
792
repeat this compilation, it may succeed, by chance, but you had better
793
avoid parallel builds (make -j) in this platform, or get a better
800
# Just move the object if needed
801
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
802
$show "$mv $output_obj $obj"
803
if $run $mv $output_obj $obj; then :
811
# Append the name of the non-PIC object the libtool object file.
812
# Only append if the libtool object file exists.
813
test -z "$run" && cat >> ${libobj}T <<EOF
814
# Name of the non-PIC object.
815
non_pic_object='$objname'
819
# Append the name of the non-PIC object the libtool object file.
820
# Only append if the libtool object file exists.
821
test -z "$run" && cat >> ${libobj}T <<EOF
822
# Name of the non-PIC object.
828
$run $mv "${libobj}T" "${libobj}"
830
# Unlock the critical section if it was locked
831
if test "$need_locks" != no; then
840
modename="$modename: link"
842
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
843
# It is impossible to link a dll without this setting, and
844
# we shouldn't force the makefile maintainer to figure out
845
# which system we are compiling for in order to pass an extra
846
# flag for every libtool invocation.
849
# FIXME: Unfortunately, there are problems with the above when trying
850
# to make a dll which has undefined symbols, in which case not
851
# even a static library is built. For now, we need to specify
852
# -no-undefined on the libtool link line when we can be certain
853
# that all symbols are satisfied, otherwise we get a static library.
860
libtool_args="$nonopt"
861
base_compile="$nonopt $@"
862
compile_command="$nonopt"
863
finalize_command="$nonopt"
876
lib_search_path=`pwd`
885
export_symbols_regex=
893
prefer_static_libs=no
906
# Infer tagged configuration to use if any are available and
907
# if one wasn't chosen via the "--tag" command line option.
908
# Only attempt this if the compiler in the base link
909
# command doesn't match the default compiler.
910
if test -n "$available_tags" && test -z "$tagname"; then
911
case $base_compile in
912
# Blanks in the command may have been stripped by the calling shell,
913
# but not from the CC environment variable when configure was run.
914
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
915
# Blanks at the start of $base_compile will cause this to fail
916
# if we don't check for them as well.
918
for z in $available_tags; do
919
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
920
# Evaluate the configuration.
921
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
922
case $base_compile in
923
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
924
# The compiler in $compile_command matches
925
# the one in the tagged configuration.
926
# Assume this is the tagged configuration we want.
933
# If $tagname still isn't set, then no tagged configuration
934
# was found and let the user know that the "--tag" command
935
# line option must be used.
936
if test -z "$tagname"; then
937
$echo "$modename: unable to infer tagged configuration"
938
$echo "$modename: specify a tag with \`--tag'" 1>&2
941
# $echo "$modename: using $tagname tagged configuration"
947
# We need to know -static, to get the right output filenames.
951
-all-static | -static)
952
if test "X$arg" = "X-all-static"; then
953
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
954
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
956
if test -n "$link_static_flag"; then
957
dlopen_self=$dlopen_self_static
960
if test -z "$pic_flag" && test -n "$link_static_flag"; then
961
dlopen_self=$dlopen_self_static
964
build_libtool_libs=no
966
prefer_static_libs=yes
972
# See if our shared archives depend on static archives.
973
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
975
# Go through the arguments, transforming them on the way.
976
while test "$#" -gt 0; do
980
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
981
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
985
libtool_args="$libtool_args $qarg"
987
# If the previous option needs an argument, assign it.
988
if test -n "$prev"; then
991
compile_command="$compile_command @OUTPUT@"
992
finalize_command="$finalize_command @OUTPUT@"
998
if test "$preload" = no; then
999
# Add the symbol object into the linking commands.
1000
compile_command="$compile_command @SYMFILE@"
1001
finalize_command="$finalize_command @SYMFILE@"
1005
*.la | *.lo) ;; # We handle these cases below.
1007
if test "$dlself" = no; then
1015
if test "$prev" = dlprefiles; then
1017
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1027
if test "$prev" = dlfiles; then
1028
dlfiles="$dlfiles $arg"
1030
dlprefiles="$dlprefiles $arg"
1038
export_symbols="$arg"
1039
if test ! -f "$arg"; then
1040
$echo "$modename: symbol file \`$arg' does not exist"
1047
export_symbols_regex="$arg"
1052
inst_prefix_dir="$arg"
1062
if test -f "$arg"; then
1065
for fil in `cat $save_arg`
1067
# moreargs="$moreargs $fil"
1069
# A libtool-controlled object.
1071
# Check to see that this really is a libtool object.
1072
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1077
# If there is no directory component, then add one.
1079
*/* | *\\*) . $arg ;;
1083
if test -z "$pic_object" || \
1084
test -z "$non_pic_object" ||
1085
test "$pic_object" = none && \
1086
test "$non_pic_object" = none; then
1087
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1091
# Extract subdirectory from the argument.
1092
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1093
if test "X$xdir" = "X$arg"; then
1099
if test "$pic_object" != none; then
1100
# Prepend the subdirectory the object is found in.
1101
pic_object="$xdir$pic_object"
1103
if test "$prev" = dlfiles; then
1104
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1105
dlfiles="$dlfiles $pic_object"
1109
# If libtool objects are unsupported, then we need to preload.
1114
# CHECK ME: I think I busted this. -Ossama
1115
if test "$prev" = dlprefiles; then
1116
# Preload the old-style object.
1117
dlprefiles="$dlprefiles $pic_object"
1122
libobjs="$libobjs $pic_object"
1127
if test "$non_pic_object" != none; then
1128
# Prepend the subdirectory the object is found in.
1129
non_pic_object="$xdir$non_pic_object"
1131
# A standard non-PIC object
1132
non_pic_objects="$non_pic_objects $non_pic_object"
1133
if test -z "$pic_object" || test "$pic_object" = none ; then
1134
arg="$non_pic_object"
1138
# Only an error if not doing a dry-run.
1139
if test -z "$run"; then
1140
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1145
# Extract subdirectory from the argument.
1146
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1147
if test "X$xdir" = "X$arg"; then
1153
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1154
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1155
libobjs="$libobjs $pic_object"
1156
non_pic_objects="$non_pic_objects $non_pic_object"
1161
$echo "$modename: link input file \`$save_arg' does not exist"
1169
# We need an absolute path.
1171
[\\/]* | [A-Za-z]:[\\/]*) ;;
1173
$echo "$modename: only absolute run-paths are allowed" 1>&2
1177
if test "$prev" = rpath; then
1180
*) rpath="$rpath $arg" ;;
1185
*) xrpath="$xrpath $arg" ;;
1192
compiler_flags="$compiler_flags $qarg"
1194
compile_command="$compile_command $qarg"
1195
finalize_command="$finalize_command $qarg"
1199
linker_flags="$linker_flags $qarg"
1200
compiler_flags="$compiler_flags $wl$qarg"
1202
compile_command="$compile_command $wl$qarg"
1203
finalize_command="$finalize_command $wl$qarg"
1207
linker_flags="$linker_flags $qarg"
1208
compiler_flags="$compiler_flags $qarg"
1210
compile_command="$compile_command $qarg"
1211
finalize_command="$finalize_command $qarg"
1215
eval "$prev=\"\$arg\""
1220
fi # test -n "$prev"
1226
if test -n "$link_static_flag"; then
1227
compile_command="$compile_command $link_static_flag"
1228
finalize_command="$finalize_command $link_static_flag"
1234
# FIXME: remove this flag sometime in the future.
1235
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1259
-export-symbols | -export-symbols-regex)
1260
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1261
$echo "$modename: more than one -exported-symbols argument is not allowed"
1264
if test "X$arg" = "X-export-symbols"; then
1277
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1278
# so, if we see these flags be careful not to treat them like -L
1280
case $with_gcc/$host in
1281
no/*-*-irix* | /*-*-irix*)
1282
compile_command="$compile_command $arg"
1283
finalize_command="$finalize_command $arg"
1290
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1291
# We need an absolute path.
1293
[\\/]* | [A-Za-z]:[\\/]*) ;;
1295
absdir=`cd "$dir" && pwd`
1296
if test -z "$absdir"; then
1297
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1306
deplibs="$deplibs -L$dir"
1307
lib_search_path="$lib_search_path $dir"
1311
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1312
case :$dllsearchpath: in
1314
*) dllsearchpath="$dllsearchpath:$dir";;
1322
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1324
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1325
# These systems don't actually have a C or math library (as such)
1328
*-*-mingw* | *-*-os2*)
1329
# These systems don't actually have a C library (as such)
1330
test "X$arg" = "X-lc" && continue
1332
*-*-openbsd* | *-*-freebsd*)
1333
# Do not include libc due to us having libc/libc_r.
1334
test "X$arg" = "X-lc" && continue
1336
*-*-rhapsody* | *-*-darwin1.[012])
1337
# Rhapsody C and math libraries are in the System framework
1338
deplibs="$deplibs -framework System"
1341
elif test "X$arg" = "X-lc_r"; then
1343
*-*-openbsd* | *-*-freebsd*)
1344
# Do not include libc_r directly, use -pthread flag.
1349
deplibs="$deplibs $arg"
1353
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1354
deplibs="$deplibs $arg"
1363
# gcc -m* arguments should be passed to the linker via $compiler_flags
1364
# in order to pass architecture information to the linker
1365
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1366
# but this is not reliable with gcc because gcc may use -mfoo to
1367
# select a different linker, different libraries, etc, while
1368
# -Wl,-mfoo simply passes -mfoo to the linker.
1370
# Unknown arguments in both finalize_command and compile_command need
1371
# to be aesthetically quoted because they are evaled later.
1372
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1374
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1378
compile_command="$compile_command $arg"
1379
finalize_command="$finalize_command $arg"
1380
if test "$with_gcc" = "yes" ; then
1381
compiler_flags="$compiler_flags $arg"
1398
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1399
# The PATH hackery in wrapper scripts is required on Windows
1400
# in order for the loader to find any dlls it needs.
1401
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1402
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1405
*) no_install=yes ;;
1438
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1439
# We need an absolute path.
1441
[\\/]* | [A-Za-z]:[\\/]*) ;;
1443
$echo "$modename: only absolute run-paths are allowed" 1>&2
1449
*) xrpath="$xrpath $dir" ;;
1455
# The effects of -static are defined in a previous loop.
1456
# We used to do the same as -all-static on platforms that
1457
# didn't have a PIC flag, but the assumption that the effects
1458
# would be equivalent was wrong. It would break on at least
1459
# Digital Unix and AIX.
1479
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1481
save_ifs="$IFS"; IFS=','
1482
for flag in $args; do
1485
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1490
compiler_flags="$compiler_flags $flag"
1493
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1497
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1499
save_ifs="$IFS"; IFS=','
1500
for flag in $args; do
1503
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1508
compiler_flags="$compiler_flags $wl$flag"
1509
linker_flags="$linker_flags $flag"
1512
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1530
# Some other compiler flag.
1532
# Unknown arguments in both finalize_command and compile_command need
1533
# to be aesthetically quoted because they are evaled later.
1534
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1536
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1543
# A standard object.
1548
# A libtool-controlled object.
1550
# Check to see that this really is a libtool object.
1551
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1556
# If there is no directory component, then add one.
1558
*/* | *\\*) . $arg ;;
1562
if test -z "$pic_object" || \
1563
test -z "$non_pic_object" ||
1564
test "$pic_object" = none && \
1565
test "$non_pic_object" = none; then
1566
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1570
# Extract subdirectory from the argument.
1571
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1572
if test "X$xdir" = "X$arg"; then
1578
if test "$pic_object" != none; then
1579
# Prepend the subdirectory the object is found in.
1580
pic_object="$xdir$pic_object"
1582
if test "$prev" = dlfiles; then
1583
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1584
dlfiles="$dlfiles $pic_object"
1588
# If libtool objects are unsupported, then we need to preload.
1593
# CHECK ME: I think I busted this. -Ossama
1594
if test "$prev" = dlprefiles; then
1595
# Preload the old-style object.
1596
dlprefiles="$dlprefiles $pic_object"
1601
libobjs="$libobjs $pic_object"
1606
if test "$non_pic_object" != none; then
1607
# Prepend the subdirectory the object is found in.
1608
non_pic_object="$xdir$non_pic_object"
1610
# A standard non-PIC object
1611
non_pic_objects="$non_pic_objects $non_pic_object"
1612
if test -z "$pic_object" || test "$pic_object" = none ; then
1613
arg="$non_pic_object"
1617
# Only an error if not doing a dry-run.
1618
if test -z "$run"; then
1619
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1624
# Extract subdirectory from the argument.
1625
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1626
if test "X$xdir" = "X$arg"; then
1632
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1633
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1634
libobjs="$libobjs $pic_object"
1635
non_pic_objects="$non_pic_objects $non_pic_object"
1642
deplibs="$deplibs $arg"
1643
old_deplibs="$old_deplibs $arg"
1648
# A libtool-controlled library.
1650
if test "$prev" = dlfiles; then
1651
# This library was specified with -dlopen.
1652
dlfiles="$dlfiles $arg"
1654
elif test "$prev" = dlprefiles; then
1655
# The library was specified with -dlpreopen.
1656
dlprefiles="$dlprefiles $arg"
1659
deplibs="$deplibs $arg"
1664
# Some other compiler argument.
1666
# Unknown arguments in both finalize_command and compile_command need
1667
# to be aesthetically quoted because they are evaled later.
1668
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1670
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1677
# Now actually substitute the argument into the commands.
1678
if test -n "$arg"; then
1679
compile_command="$compile_command $arg"
1680
finalize_command="$finalize_command $arg"
1682
done # argument parsing loop
1684
if test -n "$prev"; then
1685
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1690
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1691
eval arg=\"$export_dynamic_flag_spec\"
1692
compile_command="$compile_command $arg"
1693
finalize_command="$finalize_command $arg"
1697
# calculate the name of the file, without its directory
1698
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1699
libobjs_save="$libobjs"
1701
if test -n "$shlibpath_var"; then
1702
# get the directories listed in $shlibpath_var
1703
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1707
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1708
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1710
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1711
if test "X$output_objdir" = "X$output"; then
1712
output_objdir="$objdir"
1714
output_objdir="$output_objdir/$objdir"
1716
# Create the object directory.
1717
if test ! -d "$output_objdir"; then
1718
$show "$mkdir $output_objdir"
1719
$run $mkdir $output_objdir
1721
if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1726
# Determine the type of output
1729
$echo "$modename: you must specify an output file" 1>&2
1733
*.$libext) linkmode=oldlib ;;
1734
*.lo | *.$objext) linkmode=obj ;;
1735
*.la) linkmode=lib ;;
1736
*) linkmode=prog ;; # Anything else should be a program.
1740
*cygwin* | *mingw* | *pw32*)
1741
# don't eliminate duplcations in $postdeps and $predeps
1742
duplicate_compiler_generated_deps=yes
1745
duplicate_compiler_generated_deps=$duplicate_deps
1751
# Find all interdependent deplibs by searching for libraries
1752
# that are linked more than once (e.g. -la -lb -la)
1753
for deplib in $deplibs; do
1754
if test "X$duplicate_deps" = "Xyes" ; then
1756
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1759
libs="$libs $deplib"
1762
if test "$linkmode" = lib; then
1763
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1765
# Compute libraries that are listed more than once in $predeps
1766
# $postdeps and mark them as special (i.e., whose duplicates are
1767
# not to be eliminated).
1769
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1770
for pre_post_dep in $predeps $postdeps; do
1771
case "$pre_post_deps " in
1772
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1774
pre_post_deps="$pre_post_deps $pre_post_dep"
1783
need_relink=no # whether we're linking any uninstalled libtool libraries
1784
notinst_deplibs= # not-installed libtool libraries
1785
notinst_path= # paths that contain not-installed libtool libraries
1789
for file in $dlfiles $dlprefiles; do
1793
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1805
passes="conv scan dlopen dlpreopen link"
1810
for pass in $passes; do
1811
if test "$linkmode,$pass" = "lib,link" ||
1812
test "$linkmode,$pass" = "prog,scan"; then
1816
if test "$linkmode" = prog; then
1818
dlopen) libs="$dlfiles" ;;
1819
dlpreopen) libs="$dlprefiles" ;;
1820
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1823
if test "$pass" = dlopen; then
1824
# Collect dlpreopened libraries
1825
save_deplibs="$deplibs"
1828
for deplib in $libs; do
1832
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1833
if test "$linkmode,$pass" = "prog,link"; then
1834
compile_deplibs="$deplib $compile_deplibs"
1835
finalize_deplibs="$deplib $finalize_deplibs"
1837
deplibs="$deplib $deplibs"
1842
if test "$linkmode" != lib && test "$linkmode" != prog; then
1843
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1846
if test "$pass" = conv; then
1847
deplibs="$deplib $deplibs"
1850
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1851
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1852
for search_ext in .la $shrext .so .a; do
1853
# Search the libtool library
1854
lib="$searchdir/lib${name}${search_ext}"
1855
if test -f "$lib"; then
1856
if test "$search_ext" = ".la"; then
1865
if test "$found" != yes; then
1866
# deplib doesn't seem to be a libtool library
1867
if test "$linkmode,$pass" = "prog,link"; then
1868
compile_deplibs="$deplib $compile_deplibs"
1869
finalize_deplibs="$deplib $finalize_deplibs"
1871
deplibs="$deplib $deplibs"
1872
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1875
else # deplib is a libtool library
1876
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1877
# We need to do some special things here, and not later.
1878
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1879
case " $predeps $postdeps " in
1881
if (${SED} -e '2q' $lib |
1882
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1886
*/* | *\\*) . $lib ;;
1889
for l in $old_library $library_names; do
1892
if test "X$ll" = "X$old_library" ; then # only static version available
1894
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1895
test "X$ladir" = "X$lib" && ladir="."
1896
lib=$ladir/$old_library
1897
if test "$linkmode,$pass" = "prog,link"; then
1898
compile_deplibs="$deplib $compile_deplibs"
1899
finalize_deplibs="$deplib $finalize_deplibs"
1901
deplibs="$deplib $deplibs"
1902
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1916
deplibs="$deplib $deplibs"
1917
test "$pass" = conv && continue
1918
newdependency_libs="$deplib $newdependency_libs"
1919
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1922
if test "$pass" = conv; then
1923
deplibs="$deplib $deplibs"
1926
if test "$pass" = scan; then
1927
deplibs="$deplib $deplibs"
1928
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1930
compile_deplibs="$deplib $compile_deplibs"
1931
finalize_deplibs="$deplib $finalize_deplibs"
1935
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1941
if test "$pass" = link; then
1942
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1943
# Make sure the xrpath contains only unique directories.
1946
*) xrpath="$xrpath $dir" ;;
1949
deplibs="$deplib $deplibs"
1952
*.la) lib="$deplib" ;;
1954
if test "$pass" = conv; then
1955
deplibs="$deplib $deplibs"
1960
if test "$deplibs_check_method" != pass_all; then
1962
$echo "*** Warning: Trying to link with static lib archive $deplib."
1963
$echo "*** I have the capability to make that library automatically link in when"
1964
$echo "*** you link to this library. But I can only do this if you have a"
1965
$echo "*** shared version of the library, which you do not appear to have"
1966
$echo "*** because the file extensions .$libext of this argument makes me believe"
1967
$echo "*** that it is just a static archive that I should not used here."
1970
$echo "*** Warning: Linking the shared library $output against the"
1971
$echo "*** static library $deplib is not portable!"
1972
deplibs="$deplib $deplibs"
1977
if test "$pass" != link; then
1978
deplibs="$deplib $deplibs"
1980
compile_deplibs="$deplib $compile_deplibs"
1981
finalize_deplibs="$deplib $finalize_deplibs"
1988
if test "$pass" = conv; then
1989
deplibs="$deplib $deplibs"
1990
elif test "$linkmode" = prog; then
1991
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1992
# If there is no dlopen support or we're linking statically,
1993
# we need to preload.
1994
newdlprefiles="$newdlprefiles $deplib"
1995
compile_deplibs="$deplib $compile_deplibs"
1996
finalize_deplibs="$deplib $finalize_deplibs"
1998
newdlfiles="$newdlfiles $deplib"
2008
if test "$found" = yes || test -f "$lib"; then :
2010
$echo "$modename: cannot find the library \`$lib'" 1>&2
2014
# Check to see that this really is a libtool archive.
2015
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2017
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2021
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2022
test "X$ladir" = "X$lib" && ladir="."
2030
# If the library was installed with an old release of libtool,
2031
# it will not redefine variables installed, or shouldnotlink
2037
*/* | *\\*) . $lib ;;
2041
if test "$linkmode,$pass" = "lib,link" ||
2042
test "$linkmode,$pass" = "prog,scan" ||
2043
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2044
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2045
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2048
if test "$pass" = conv; then
2049
# Only check for convenience libraries
2050
deplibs="$lib $deplibs"
2051
if test -z "$libdir"; then
2052
if test -z "$old_library"; then
2053
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2056
# It is a libtool convenience library, so add in its objects.
2057
convenience="$convenience $ladir/$objdir/$old_library"
2058
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2060
for deplib in $dependency_libs; do
2061
deplibs="$deplib $deplibs"
2062
if test "X$duplicate_deps" = "Xyes" ; then
2063
case "$tmp_libs " in
2064
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2067
tmp_libs="$tmp_libs $deplib"
2069
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2070
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2077
# Get the name of the library we link against.
2079
for l in $old_library $library_names; do
2082
if test -z "$linklib"; then
2083
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2087
# This library was specified with -dlopen.
2088
if test "$pass" = dlopen; then
2089
if test -z "$libdir"; then
2090
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2093
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2094
# If there is no dlname, no dlopen support or we're linking
2095
# statically, we need to preload. We also need to preload any
2096
# dependent libraries so libltdl's deplib preloader doesn't
2097
# bomb out in the load deplibs phase.
2098
dlprefiles="$dlprefiles $lib $dependency_libs"
2100
newdlfiles="$newdlfiles $lib"
2105
# We need an absolute path.
2107
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2109
abs_ladir=`cd "$ladir" && pwd`
2110
if test -z "$abs_ladir"; then
2111
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2112
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2117
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2119
# Find the relevant object directory and library name.
2120
if test "X$installed" = Xyes; then
2121
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2122
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2131
dir="$ladir/$objdir"
2132
absdir="$abs_ladir/$objdir"
2133
# Remove this search path later
2134
notinst_path="$notinst_path $abs_ladir"
2135
fi # $installed = yes
2136
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2138
# This library was specified with -dlpreopen.
2139
if test "$pass" = dlpreopen; then
2140
if test -z "$libdir"; then
2141
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2144
# Prefer using a static library (so that no silly _DYNAMIC symbols
2145
# are required to link).
2146
if test -n "$old_library"; then
2147
newdlprefiles="$newdlprefiles $dir/$old_library"
2148
# Otherwise, use the dlname, so that lt_dlopen finds it.
2149
elif test -n "$dlname"; then
2150
newdlprefiles="$newdlprefiles $dir/$dlname"
2152
newdlprefiles="$newdlprefiles $dir/$linklib"
2154
fi # $pass = dlpreopen
2156
if test -z "$libdir"; then
2157
# Link the convenience library
2158
if test "$linkmode" = lib; then
2159
deplibs="$dir/$old_library $deplibs"
2160
elif test "$linkmode,$pass" = "prog,link"; then
2161
compile_deplibs="$dir/$old_library $compile_deplibs"
2162
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2164
deplibs="$lib $deplibs" # used for prog,scan pass
2170
if test "$linkmode" = prog && test "$pass" != link; then
2171
newlib_search_path="$newlib_search_path $ladir"
2172
deplibs="$lib $deplibs"
2175
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2176
test "$build_libtool_libs" = no; then
2181
for deplib in $dependency_libs; do
2183
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2185
# Need to link against all dependency_libs?
2186
if test "$linkalldeplibs" = yes; then
2187
deplibs="$deplib $deplibs"
2189
# Need to hardcode shared library paths
2190
# or/and link against static libraries
2191
newdependency_libs="$deplib $newdependency_libs"
2193
if test "X$duplicate_deps" = "Xyes" ; then
2194
case "$tmp_libs " in
2195
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2198
tmp_libs="$tmp_libs $deplib"
2201
fi # $linkmode = prog...
2203
if test "$linkmode,$pass" = "prog,link"; then
2204
if test -n "$library_names" &&
2205
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2206
# We need to hardcode the library path
2207
if test -n "$shlibpath_var"; then
2208
# Make sure the rpath contains only unique directories.
2209
case "$temp_rpath " in
2212
*) temp_rpath="$temp_rpath $dir" ;;
2216
# Hardcode the library path.
2217
# Skip directories that are in the system default run-time
2219
case " $sys_lib_dlsearch_path " in
2222
case "$compile_rpath " in
2224
*) compile_rpath="$compile_rpath $absdir"
2228
case " $sys_lib_dlsearch_path " in
2231
case "$finalize_rpath " in
2233
*) finalize_rpath="$finalize_rpath $libdir"
2237
fi # $linkmode,$pass = prog,link...
2239
if test "$alldeplibs" = yes &&
2240
{ test "$deplibs_check_method" = pass_all ||
2241
{ test "$build_libtool_libs" = yes &&
2242
test -n "$library_names"; }; }; then
2243
# We only need to search for static libraries
2248
link_static=no # Whether the deplib will be linked statically
2249
if test -n "$library_names" &&
2250
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2251
if test "$installed" = no; then
2252
notinst_deplibs="$notinst_deplibs $lib"
2255
# This is a shared library
2257
# Warn about portability, can't link against -module's on some systems (darwin)
2258
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2260
if test "$linkmode" = prog; then
2261
$echo "*** Warning: Linking the executable $output against the loadable module"
2263
$echo "*** Warning: Linking the shared library $output against the loadable module"
2265
$echo "*** $linklib is not portable!"
2267
if test "$linkmode" = lib &&
2268
test "$hardcode_into_libs" = yes; then
2269
# Hardcode the library path.
2270
# Skip directories that are in the system default run-time
2272
case " $sys_lib_dlsearch_path " in
2275
case "$compile_rpath " in
2277
*) compile_rpath="$compile_rpath $absdir"
2281
case " $sys_lib_dlsearch_path " in
2284
case "$finalize_rpath " in
2286
*) finalize_rpath="$finalize_rpath $libdir"
2292
if test -n "$old_archive_from_expsyms_cmds"; then
2293
# figure out the soname
2294
set dummy $library_names
2297
libname=`eval \\$echo \"$libname_spec\"`
2298
# use dlname if we got it. it's perfectly good, no?
2299
if test -n "$dlname"; then
2301
elif test -n "$soname_spec"; then
2305
major=`expr $current - $age`
2309
eval soname=\"$soname_spec\"
2314
# Make a new name for the extract_expsyms_cmds to use
2316
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2317
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2319
# If the library has no export list, then create one now
2320
if test -f "$output_objdir/$soname-def"; then :
2322
$show "extracting exported symbol list from \`$soname'"
2323
save_ifs="$IFS"; IFS='~'
2324
eval cmds=\"$extract_expsyms_cmds\"
2325
for cmd in $cmds; do
2328
$run eval "$cmd" || exit $?
2334
if test -f "$output_objdir/$newlib"; then :; else
2335
$show "generating import library for \`$soname'"
2336
save_ifs="$IFS"; IFS='~'
2337
eval cmds=\"$old_archive_from_expsyms_cmds\"
2338
for cmd in $cmds; do
2341
$run eval "$cmd" || exit $?
2345
# make sure the library variables are pointing to the new library
2348
fi # test -n "$old_archive_from_expsyms_cmds"
2350
if test "$linkmode" = prog || test "$mode" != relink; then
2355
case $hardcode_action in
2356
immediate | unsupported)
2357
if test "$hardcode_direct" = no; then
2360
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2362
# if the lib is a module then we can not link against it, someone
2363
# is ignoring the new warnings I added
2364
if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2365
$echo "** Warning, lib $linklib is a module, not a shared library"
2366
if test -z "$old_library" ; then
2368
$echo "** And there doesn't seem to be a static archive available"
2369
$echo "** The link will probably fail, sorry"
2371
add="$dir/$old_library"
2375
elif test "$hardcode_minus_L" = no; then
2377
*-*-sunos*) add_shlibpath="$dir" ;;
2381
elif test "$hardcode_shlibpath_var" = no; then
2382
add_shlibpath="$dir"
2389
if test "$hardcode_direct" = yes; then
2391
elif test "$hardcode_minus_L" = yes; then
2393
# Try looking first in the location we're being installed to.
2394
if test -n "$inst_prefix_dir"; then
2397
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2402
elif test "$hardcode_shlibpath_var" = yes; then
2403
add_shlibpath="$dir"
2412
if test "$lib_linked" != yes; then
2413
$echo "$modename: configuration error: unsupported hardcode properties"
2417
if test -n "$add_shlibpath"; then
2418
case :$compile_shlibpath: in
2419
*":$add_shlibpath:"*) ;;
2420
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2423
if test "$linkmode" = prog; then
2424
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2425
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2427
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2428
test -n "$add" && deplibs="$add $deplibs"
2429
if test "$hardcode_direct" != yes && \
2430
test "$hardcode_minus_L" != yes && \
2431
test "$hardcode_shlibpath_var" = yes; then
2432
case :$finalize_shlibpath: in
2434
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2440
if test "$linkmode" = prog || test "$mode" = relink; then
2444
# Finalize command for both is simple: just hardcode it.
2445
if test "$hardcode_direct" = yes; then
2446
add="$libdir/$linklib"
2447
elif test "$hardcode_minus_L" = yes; then
2450
elif test "$hardcode_shlibpath_var" = yes; then
2451
case :$finalize_shlibpath: in
2453
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2456
elif test "$hardcode_automatic" = yes; then
2457
if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2458
add="$inst_prefix_dir$libdir/$linklib"
2460
add="$libdir/$linklib"
2463
# We cannot seem to hardcode it, guess we'll fake it.
2465
# Try looking first in the location we're being installed to.
2466
if test -n "$inst_prefix_dir"; then
2469
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2476
if test "$linkmode" = prog; then
2477
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2478
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2480
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2481
test -n "$add" && deplibs="$add $deplibs"
2484
elif test "$linkmode" = prog; then
2485
# Here we assume that one of hardcode_direct or hardcode_minus_L
2486
# is not unsupported. This is valid on all known static and
2488
if test "$hardcode_direct" != unsupported; then
2489
test -n "$old_library" && linklib="$old_library"
2490
compile_deplibs="$dir/$linklib $compile_deplibs"
2491
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2493
compile_deplibs="-l$name -L$dir $compile_deplibs"
2494
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2496
elif test "$build_libtool_libs" = yes; then
2497
# Not a shared library
2498
if test "$deplibs_check_method" != pass_all; then
2499
# We're trying link a shared library against a static one
2500
# but the system doesn't support it.
2502
# Just print a warning and add the library to dependency_libs so
2503
# that the program can be linked against the static library.
2505
$echo "*** Warning: This system can not link to static lib archive $lib."
2506
$echo "*** I have the capability to make that library automatically link in when"
2507
$echo "*** you link to this library. But I can only do this if you have a"
2508
$echo "*** shared version of the library, which you do not appear to have."
2509
if test "$module" = yes; then
2510
$echo "*** But as you try to build a module library, libtool will still create "
2511
$echo "*** a static module, that should work as long as the dlopening application"
2512
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2513
if test -z "$global_symbol_pipe"; then
2515
$echo "*** However, this would only work if libtool was able to extract symbol"
2516
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2517
$echo "*** not find such a program. So, this module is probably useless."
2518
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2520
if test "$build_old_libs" = no; then
2521
build_libtool_libs=module
2524
build_libtool_libs=no
2528
convenience="$convenience $dir/$old_library"
2529
old_convenience="$old_convenience $dir/$old_library"
2530
deplibs="$dir/$old_library $deplibs"
2533
fi # link shared/static library?
2535
if test "$linkmode" = lib; then
2536
if test -n "$dependency_libs" &&
2537
{ test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2538
test "$link_static" = yes; }; then
2539
# Extract -R from dependency_libs
2541
for libdir in $dependency_libs; do
2543
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2545
*" $temp_xrpath "*) ;;
2546
*) xrpath="$xrpath $temp_xrpath";;
2548
*) temp_deplibs="$temp_deplibs $libdir";;
2551
dependency_libs="$temp_deplibs"
2554
newlib_search_path="$newlib_search_path $absdir"
2555
# Link against this library
2556
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2557
# ... and its dependency_libs
2559
for deplib in $dependency_libs; do
2560
newdependency_libs="$deplib $newdependency_libs"
2561
if test "X$duplicate_deps" = "Xyes" ; then
2562
case "$tmp_libs " in
2563
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2566
tmp_libs="$tmp_libs $deplib"
2569
if test "$link_all_deplibs" != no; then
2570
# Add the search paths of all dependency libraries
2571
for deplib in $dependency_libs; do
2573
-L*) path="$deplib" ;;
2575
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2576
test "X$dir" = "X$deplib" && dir="."
2577
# We need an absolute path.
2579
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2581
absdir=`cd "$dir" && pwd`
2582
if test -z "$absdir"; then
2583
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2588
if grep "^installed=no" $deplib > /dev/null; then
2589
path="$absdir/$objdir"
2591
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2592
if test -z "$libdir"; then
2593
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2596
if test "$absdir" != "$libdir"; then
2597
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2604
# we do not want to link against static libs, but need to link against shared
2605
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2606
if test -n "$deplibrary_names" ; then
2607
for tmp in $deplibrary_names ; do
2610
if test -f "$path/$depdepl" ; then
2611
depdepl="$path/$depdepl"
2613
# do not add paths which are already there
2614
case " $newlib_search_path " in
2616
*) newlib_search_path="$newlib_search_path $path";;
2630
# Again, we only want to link against shared libraries
2631
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2632
for tmp in $newlib_search_path ; do
2633
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2634
eval depdepl="$tmp/lib$tmp_libs.dylib"
2645
case " $deplibs " in
2647
*) deplibs="$deplibs $depdepl" ;;
2649
case " $deplibs " in
2651
*) deplibs="$deplibs $path" ;;
2654
fi # link_all_deplibs != no
2656
done # for deplib in $libs
2657
dependency_libs="$newdependency_libs"
2658
if test "$pass" = dlpreopen; then
2659
# Link the dlpreopened libraries before other libraries
2660
for deplib in $save_deplibs; do
2661
deplibs="$deplib $deplibs"
2664
if test "$pass" != dlopen; then
2665
if test "$pass" != conv; then
2666
# Make sure lib_search_path contains only unique directories.
2668
for dir in $newlib_search_path; do
2669
case "$lib_search_path " in
2671
*) lib_search_path="$lib_search_path $dir" ;;
2677
if test "$linkmode,$pass" != "prog,link"; then
2680
vars="compile_deplibs finalize_deplibs"
2682
for var in $vars dependency_libs; do
2683
# Add libraries to $var in reverse order
2684
eval tmp_libs=\"\$$var\"
2686
for deplib in $tmp_libs; do
2687
# FIXME: Pedantically, this is the right thing to do, so
2688
# that some nasty dependency loop isn't accidentally
2690
#new_libs="$deplib $new_libs"
2691
# Pragmatically, this seems to cause very few problems in
2694
-L*) new_libs="$deplib $new_libs" ;;
2697
# And here is the reason: when a library appears more
2698
# than once as an explicit dependence of a library, or
2699
# is implicitly linked in more than once by the
2700
# compiler, it is considered special, and multiple
2701
# occurrences thereof are not removed. Compare this
2702
# with having the same library being listed as a
2703
# dependency of multiple other libraries: in this case,
2704
# we know (pedantically, we assume) the library does not
2705
# need to be listed more than once, so we keep only the
2706
# last copy. This is not always right, but it is rare
2707
# enough that we require users that really mean to play
2708
# such unportable linking tricks to link the library
2709
# using -Wl,-lname, so that libtool does not consider it
2710
# for duplicate removal.
2711
case " $specialdeplibs " in
2712
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2714
case " $new_libs " in
2716
*) new_libs="$deplib $new_libs" ;;
2724
for deplib in $new_libs; do
2727
case " $tmp_libs " in
2729
*) tmp_libs="$tmp_libs $deplib" ;;
2732
*) tmp_libs="$tmp_libs $deplib" ;;
2735
eval $var=\"$tmp_libs\"
2738
# Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2740
for i in $dependency_libs ; do
2741
case " $predeps $postdeps $compiler_lib_search_path " in
2746
if test -n "$i" ; then
2747
tmp_libs="$tmp_libs $i"
2750
dependency_libs=$tmp_libs
2752
if test "$linkmode" = prog; then
2753
dlfiles="$newdlfiles"
2754
dlprefiles="$newdlprefiles"
2759
if test -n "$deplibs"; then
2760
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2763
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2764
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2767
if test -n "$rpath"; then
2768
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2771
if test -n "$xrpath"; then
2772
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2775
if test -n "$vinfo"; then
2776
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2779
if test -n "$release"; then
2780
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2783
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2784
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2787
# Now set the variables for building old libraries.
2788
build_libtool_libs=no
2790
objs="$objs$old_deplibs"
2794
# Make sure we only generate libraries of the form `libNAME.la'.
2797
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2798
eval shared_ext=\"$shrext\"
2799
eval libname=\"$libname_spec\"
2802
if test "$module" = no; then
2803
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2807
if test "$need_lib_prefix" != no; then
2808
# Add the "lib" prefix for modules if required
2809
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2810
eval shared_ext=\"$shrext\"
2811
eval libname=\"$libname_spec\"
2813
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2818
if test -n "$objs"; then
2819
if test "$deplibs_check_method" != pass_all; then
2820
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2824
$echo "*** Warning: Linking the shared library $output against the non-libtool"
2825
$echo "*** objects $objs is not portable!"
2826
libobjs="$libobjs $objs"
2830
if test "$dlself" != no; then
2831
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2835
if test "$#" -gt 2; then
2836
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2841
if test -z "$rpath"; then
2842
if test "$build_libtool_libs" = yes; then
2843
# Building a libtool convenience library.
2844
# Some compilers have problems with a `.al' extension so
2845
# convenience libraries should have the same extension an
2846
# archive normally would.
2847
oldlibs="$output_objdir/$libname.$libext $oldlibs"
2848
build_libtool_libs=convenience
2852
if test -n "$vinfo"; then
2853
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2856
if test -n "$release"; then
2857
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2861
# Parse the version information argument.
2862
save_ifs="$IFS"; IFS=':'
2863
set dummy $vinfo 0 0 0
2866
if test -n "$8"; then
2867
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2872
# convert absolute version numbers to libtool ages
2873
# this retains compatibility with .la files and attempts
2874
# to make the code below a bit more comprehensible
2876
case $vinfo_number in
2880
number_revision="$4"
2882
# There are really only two kinds -- those that
2883
# use the current revision as the major version
2884
# and those that subtract age and use age as
2885
# a minor version. But, then there is irix
2886
# which has an extra 1 added just for fun
2888
case $version_type in
2889
darwin|linux|osf|windows)
2890
current=`expr $number_major + $number_minor`
2892
revision="$number_revision"
2894
freebsd-aout|freebsd-elf|sunos)
2895
current="$number_major"
2896
revision="$number_minor"
2900
current=`expr $number_major + $number_minor - 1`
2902
revision="$number_minor"
2913
# Check that each of the things are valid numbers.
2915
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2917
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2918
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2924
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2926
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2927
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2933
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2935
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2936
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2941
if test "$age" -gt "$current"; then
2942
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2943
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2947
# Calculate the version variables.
2951
case $version_type in
2955
# Like Linux, but with the current version available in
2956
# verstring for coding it into the library header
2957
major=.`expr $current - $age`
2958
versuffix="$major.$age.$revision"
2959
# Darwin ld doesn't like 0 for these options...
2960
minor_current=`expr $current + 1`
2961
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2966
versuffix=".$current.$revision";
2971
versuffix=".$current";
2975
major=`expr $current - $age + 1`
2977
case $version_type in
2978
nonstopux) verstring_prefix=nonstopux ;;
2979
*) verstring_prefix=sgi ;;
2981
verstring="$verstring_prefix$major.$revision"
2983
# Add in all the interfaces that we are compatible with.
2985
while test "$loop" -ne 0; do
2986
iface=`expr $revision - $loop`
2987
loop=`expr $loop - 1`
2988
verstring="$verstring_prefix$major.$iface:$verstring"
2991
# Before this point, $major must not contain `.'.
2993
versuffix="$major.$revision"
2997
major=.`expr $current - $age`
2998
versuffix="$major.$age.$revision"
3002
major=.`expr $current - $age`
3003
versuffix=".$current.$age.$revision"
3004
verstring="$current.$age.$revision"
3006
# Add in all the interfaces that we are compatible with.
3008
while test "$loop" -ne 0; do
3009
iface=`expr $current - $loop`
3010
loop=`expr $loop - 1`
3011
verstring="$verstring:${iface}.0"
3014
# Make executables depend on our current version.
3015
verstring="$verstring:${current}.0"
3020
versuffix=".$current.$revision"
3024
# Use '-' rather than '.', since we only want one
3025
# extension on DOS 8.3 filesystems.
3026
major=`expr $current - $age`
3031
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3032
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3037
# Clear the version info if we defaulted, and they specified a release.
3038
if test -z "$vinfo" && test -n "$release"; then
3040
case $version_type in
3042
# we can't check for "0.0" in archive_cmds due to quoting
3043
# problems, so we reset it completely
3050
if test "$need_version" = no; then
3057
# Remove version info from name if versioning should be avoided
3058
if test "$avoid_version" = yes && test "$need_version" = no; then
3064
# Check to see if the archive will have undefined symbols.
3065
if test "$allow_undefined" = yes; then
3066
if test "$allow_undefined_flag" = unsupported; then
3067
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3068
build_libtool_libs=no
3072
# Don't allow undefined symbols.
3073
allow_undefined_flag="$no_undefined_flag"
3077
if test "$mode" != relink; then
3078
# Remove our outputs, but don't remove object files since they
3079
# may have been created when compiling PIC objects.
3081
tempremovelist=`$echo "$output_objdir/*"`
3082
for p in $tempremovelist; do
3086
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3087
removelist="$removelist $p"
3092
if test -n "$removelist"; then
3093
$show "${rm}r $removelist"
3094
$run ${rm}r $removelist
3098
# Now set the variables for building old libraries.
3099
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3100
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3102
# Transform .lo files to .o files.
3103
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3106
# Eliminate all temporary directories.
3107
for path in $notinst_path; do
3108
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3109
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3110
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3113
if test -n "$xrpath"; then
3114
# If the user specified any rpath flags, then add them.
3116
for libdir in $xrpath; do
3117
temp_xrpath="$temp_xrpath -R$libdir"
3118
case "$finalize_rpath " in
3120
*) finalize_rpath="$finalize_rpath $libdir" ;;
3123
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3124
dependency_libs="$temp_xrpath $dependency_libs"
3128
# Make sure dlfiles contains only unique files that won't be dlpreopened
3129
old_dlfiles="$dlfiles"
3131
for lib in $old_dlfiles; do
3132
case " $dlprefiles $dlfiles " in
3134
*) dlfiles="$dlfiles $lib" ;;
3138
# Make sure dlprefiles contains only unique files
3139
old_dlprefiles="$dlprefiles"
3141
for lib in $old_dlprefiles; do
3142
case "$dlprefiles " in
3144
*) dlprefiles="$dlprefiles $lib" ;;
3148
if test "$build_libtool_libs" = yes; then
3149
if test -n "$rpath"; then
3151
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3152
# these systems don't actually have a c library (as such)!
3154
*-*-rhapsody* | *-*-darwin1.[012])
3155
# Rhapsody C library is in the System framework
3156
deplibs="$deplibs -framework System"
3159
# Don't link with libc until the a.out ld.so is fixed.
3161
*-*-openbsd* | *-*-freebsd*)
3162
# Do not include libc due to us having libc/libc_r.
3163
test "X$arg" = "X-lc" && continue
3166
# Add libc to deplibs on all other systems if necessary.
3167
if test "$build_libtool_need_lc" = "yes"; then
3168
deplibs="$deplibs -lc"
3174
# Transform deplibs into only deplibs that can be linked in shared.
3176
libname_save=$libname
3177
release_save=$release
3178
versuffix_save=$versuffix
3180
# I'm not sure if I'm treating the release correctly. I think
3181
# release should show up in the -l (ie -lgmp5) so we don't want to
3182
# add it in twice. Is that correct?
3188
case $deplibs_check_method in
3190
# Don't check for shared/static. Everything works.
3191
# This might be a little naive. We might want to check
3192
# whether the library exists or not. But this is on
3193
# osf3 & osf4 and I'm not really sure... Just
3194
# implementing what was already the behavior.
3198
# This code stresses the "libraries are programs" paradigm to its
3199
# limits. Maybe even breaks it. We compile a program, linking it
3200
# against the deplibs as a proxy for the library. Then we can check
3201
# whether they linked in statically or dynamically with ldd.
3203
cat > conftest.c <<EOF
3204
int main() { return 0; }
3207
$LTCC -o conftest conftest.c $deplibs
3208
if test "$?" -eq 0 ; then
3209
ldd_output=`ldd conftest`
3210
for i in $deplibs; do
3211
name="`expr $i : '-l\(.*\)'`"
3212
# If $name is empty we are operating on a -L argument.
3213
if test "$name" != "" && test "$name" -ne "0"; then
3214
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3215
case " $predeps $postdeps " in
3217
newdeplibs="$newdeplibs $i"
3222
if test -n "$i" ; then
3223
libname=`eval \\$echo \"$libname_spec\"`
3224
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3225
set dummy $deplib_matches
3227
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3228
newdeplibs="$newdeplibs $i"
3232
$echo "*** Warning: dynamic linker does not accept needed library $i."
3233
$echo "*** I have the capability to make that library automatically link in when"
3234
$echo "*** you link to this library. But I can only do this if you have a"
3235
$echo "*** shared version of the library, which I believe you do not have"
3236
$echo "*** because a test_compile did reveal that the linker did not use it for"
3237
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3241
newdeplibs="$newdeplibs $i"
3245
# Error occurred in the first compile. Let's try to salvage
3246
# the situation: Compile a separate program for each library.
3247
for i in $deplibs; do
3248
name="`expr $i : '-l\(.*\)'`"
3249
# If $name is empty we are operating on a -L argument.
3250
if test "$name" != "" && test "$name" != "0"; then
3252
$LTCC -o conftest conftest.c $i
3254
if test "$?" -eq 0 ; then
3255
ldd_output=`ldd conftest`
3256
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3257
case " $predeps $postdeps " in
3259
newdeplibs="$newdeplibs $i"
3264
if test -n "$i" ; then
3265
libname=`eval \\$echo \"$libname_spec\"`
3266
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3267
set dummy $deplib_matches
3269
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3270
newdeplibs="$newdeplibs $i"
3274
$echo "*** Warning: dynamic linker does not accept needed library $i."
3275
$echo "*** I have the capability to make that library automatically link in when"
3276
$echo "*** you link to this library. But I can only do this if you have a"
3277
$echo "*** shared version of the library, which you do not appear to have"
3278
$echo "*** because a test_compile did reveal that the linker did not use this one"
3279
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3285
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3286
$echo "*** make it link in! You will probably need to install it or some"
3287
$echo "*** library that it depends on before this library will be fully"
3288
$echo "*** functional. Installing it before continuing would be even better."
3291
newdeplibs="$newdeplibs $i"
3297
set dummy $deplibs_check_method
3298
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3299
for a_deplib in $deplibs; do
3300
name="`expr $a_deplib : '-l\(.*\)'`"
3301
# If $name is empty we are operating on a -L argument.
3302
if test "$name" != "" && test "$name" != "0"; then
3303
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3304
case " $predeps $postdeps " in
3306
newdeplibs="$newdeplibs $a_deplib"
3311
if test -n "$a_deplib" ; then
3312
libname=`eval \\$echo \"$libname_spec\"`
3313
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3314
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3315
for potent_lib in $potential_libs; do
3316
# Follow soft links.
3317
if ls -lLd "$potent_lib" 2>/dev/null \
3318
| grep " -> " >/dev/null; then
3321
# The statement above tries to avoid entering an
3322
# endless loop below, in case of cyclic links.
3323
# We might still enter an endless loop, since a link
3324
# loop can be closed while we follow links,
3326
potlib="$potent_lib"
3327
while test -h "$potlib" 2>/dev/null; do
3328
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3330
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3331
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3334
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3336
| $EGREP "$file_magic_regex" > /dev/null; then
3337
newdeplibs="$newdeplibs $a_deplib"
3344
if test -n "$a_deplib" ; then
3347
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3348
$echo "*** I have the capability to make that library automatically link in when"
3349
$echo "*** you link to this library. But I can only do this if you have a"
3350
$echo "*** shared version of the library, which you do not appear to have"
3351
$echo "*** because I did check the linker path looking for a file starting"
3352
if test -z "$potlib" ; then
3353
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3355
$echo "*** with $libname and none of the candidates passed a file format test"
3356
$echo "*** using a file magic. Last file checked: $potlib"
3360
# Add a -L argument.
3361
newdeplibs="$newdeplibs $a_deplib"
3363
done # Gone through all deplibs.
3366
set dummy $deplibs_check_method
3367
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3368
for a_deplib in $deplibs; do
3369
name="`expr $a_deplib : '-l\(.*\)'`"
3370
# If $name is empty we are operating on a -L argument.
3371
if test -n "$name" && test "$name" != "0"; then
3372
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3373
case " $predeps $postdeps " in
3375
newdeplibs="$newdeplibs $a_deplib"
3380
if test -n "$a_deplib" ; then
3381
libname=`eval \\$echo \"$libname_spec\"`
3382
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3383
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3384
for potent_lib in $potential_libs; do
3385
potlib="$potent_lib" # see symlink-check above in file_magic test
3386
if eval $echo \"$potent_lib\" 2>/dev/null \
3388
| $EGREP "$match_pattern_regex" > /dev/null; then
3389
newdeplibs="$newdeplibs $a_deplib"
3396
if test -n "$a_deplib" ; then
3399
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3400
$echo "*** I have the capability to make that library automatically link in when"
3401
$echo "*** you link to this library. But I can only do this if you have a"
3402
$echo "*** shared version of the library, which you do not appear to have"
3403
$echo "*** because I did check the linker path looking for a file starting"
3404
if test -z "$potlib" ; then
3405
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3407
$echo "*** with $libname and none of the candidates passed a file format test"
3408
$echo "*** using a regex pattern. Last file checked: $potlib"
3412
# Add a -L argument.
3413
newdeplibs="$newdeplibs $a_deplib"
3415
done # Gone through all deplibs.
3419
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3420
-e 's/ -[LR][^ ]*//g'`
3421
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3422
for i in $predeps $postdeps ; do
3423
# can't use Xsed below, because $i might contain '/'
3424
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3427
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3428
| grep . >/dev/null; then
3430
if test "X$deplibs_check_method" = "Xnone"; then
3431
$echo "*** Warning: inter-library dependencies are not supported in this platform."
3433
$echo "*** Warning: inter-library dependencies are not known to be supported."
3435
$echo "*** All declared inter-library dependencies are being dropped."
3440
versuffix=$versuffix_save
3442
release=$release_save
3443
libname=$libname_save
3447
*-*-rhapsody* | *-*-darwin1.[012])
3448
# On Rhapsody replace the C library is the System framework
3449
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3453
if test "$droppeddeps" = yes; then
3454
if test "$module" = yes; then
3456
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3457
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3458
$echo "*** a static module, that should work as long as the dlopening"
3459
$echo "*** application is linked with the -dlopen flag."
3460
if test -z "$global_symbol_pipe"; then
3462
$echo "*** However, this would only work if libtool was able to extract symbol"
3463
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3464
$echo "*** not find such a program. So, this module is probably useless."
3465
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3467
if test "$build_old_libs" = no; then
3468
oldlibs="$output_objdir/$libname.$libext"
3469
build_libtool_libs=module
3472
build_libtool_libs=no
3475
$echo "*** The inter-library dependencies that have been dropped here will be"
3476
$echo "*** automatically added whenever a program is linked with this library"
3477
$echo "*** or is declared to -dlopen it."
3479
if test "$allow_undefined" = no; then
3481
$echo "*** Since this library must not contain undefined symbols,"
3482
$echo "*** because either the platform does not support them or"
3483
$echo "*** it was explicitly requested with -no-undefined,"
3484
$echo "*** libtool will only create a static version of it."
3485
if test "$build_old_libs" = no; then
3486
oldlibs="$output_objdir/$libname.$libext"
3487
build_libtool_libs=module
3490
build_libtool_libs=no
3495
# Done checking deplibs!
3499
# All the library-specific variables (install_libdir is set above).
3504
# Test again, we may have decided not to build it any more
3505
if test "$build_libtool_libs" = yes; then
3506
if test "$hardcode_into_libs" = yes; then
3507
# Hardcode the library paths
3510
rpath="$finalize_rpath"
3511
test "$mode" != relink && rpath="$compile_rpath$rpath"
3512
for libdir in $rpath; do
3513
if test -n "$hardcode_libdir_flag_spec"; then
3514
if test -n "$hardcode_libdir_separator"; then
3515
if test -z "$hardcode_libdirs"; then
3516
hardcode_libdirs="$libdir"
3518
# Just accumulate the unique libdirs.
3519
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3520
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3523
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3528
eval flag=\"$hardcode_libdir_flag_spec\"
3529
dep_rpath="$dep_rpath $flag"
3531
elif test -n "$runpath_var"; then
3532
case "$perm_rpath " in
3534
*) perm_rpath="$perm_rpath $libdir" ;;
3538
# Substitute the hardcoded libdirs into the rpath.
3539
if test -n "$hardcode_libdir_separator" &&
3540
test -n "$hardcode_libdirs"; then
3541
libdir="$hardcode_libdirs"
3542
if test -n "$hardcode_libdir_flag_spec_ld"; then
3543
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3545
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3548
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3549
# We should set the runpath_var.
3551
for dir in $perm_rpath; do
3554
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3556
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3559
shlibpath="$finalize_shlibpath"
3560
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3561
if test -n "$shlibpath"; then
3562
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3565
# Get the real and link names of the library.
3566
eval shared_ext=\"$shrext\"
3567
eval library_names=\"$library_names_spec\"
3568
set dummy $library_names
3572
if test -n "$soname_spec"; then
3573
eval soname=\"$soname_spec\"
3577
if test -z "$dlname"; then
3581
lib="$output_objdir/$realname"
3584
linknames="$linknames $link"
3587
# Use standard objects if they are pic
3588
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3590
# Prepare the list of exported symbols
3591
if test -z "$export_symbols"; then
3592
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3593
$show "generating symbol list for \`$libname.la'"
3594
export_symbols="$output_objdir/$libname.exp"
3595
$run $rm $export_symbols
3596
eval cmds=\"$export_symbols_cmds\"
3597
save_ifs="$IFS"; IFS='~'
3598
for cmd in $cmds; do
3600
if len=`expr "X$cmd" : ".*"` &&
3601
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3603
$run eval "$cmd" || exit $?
3604
skipped_export=false
3606
# The command line is too long to execute in one step.
3607
$show "using reloadable object file for export list..."
3612
if test -n "$export_symbols_regex"; then
3613
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3614
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3615
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3616
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3621
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3622
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3626
for test_deplib in $deplibs; do
3627
case " $convenience " in
3628
*" $test_deplib "*) ;;
3630
tmp_deplibs="$tmp_deplibs $test_deplib"
3634
deplibs="$tmp_deplibs"
3636
if test -n "$convenience"; then
3637
if test -n "$whole_archive_flag_spec"; then
3638
save_libobjs=$libobjs
3639
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3641
gentop="$output_objdir/${outputname}x"
3642
$show "${rm}r $gentop"
3643
$run ${rm}r "$gentop"
3644
$show "$mkdir $gentop"
3645
$run $mkdir "$gentop"
3647
if test "$status" -ne 0 && test ! -d "$gentop"; then
3650
generated="$generated $gentop"
3652
for xlib in $convenience; do
3653
# Extract the objects.
3655
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3656
*) xabs=`pwd`"/$xlib" ;;
3658
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3659
xdir="$gentop/$xlib"
3661
$show "${rm}r $xdir"
3663
$show "$mkdir $xdir"
3666
if test "$status" -ne 0 && test ! -d "$xdir"; then
3669
# We will extract separately just the conflicting names and we will no
3670
# longer touch any unique names. It is faster to leave these extract
3671
# automatically by $AR in one run.
3672
$show "(cd $xdir && $AR x $xabs)"
3673
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3674
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3677
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3678
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3679
$AR t "$xabs" | sort | uniq -cd | while read -r count name
3682
while test "$i" -le "$count"
3684
# Put our $i before any first dot (extension)
3685
# Never overwrite any file
3687
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3689
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3691
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3692
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3698
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3703
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3704
eval flag=\"$thread_safe_flag_spec\"
3705
linker_flags="$linker_flags $flag"
3708
# Make a backup of the uninstalled library when relinking
3709
if test "$mode" = relink; then
3710
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3713
# Do each of the archive commands.
3714
if test "$module" = yes && test -n "$module_cmds" ; then
3715
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3716
eval cmds=\"$module_expsym_cmds\"
3718
eval cmds=\"$module_cmds\"
3721
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3722
eval cmds=\"$archive_expsym_cmds\"
3724
eval cmds=\"$archive_cmds\"
3728
if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3729
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3732
# The command line is too long to link in one step, link piecewise.
3733
$echo "creating reloadable object files..."
3735
# Save the value of $output and $libobjs because we want to
3736
# use them later. If we have whole_archive_flag_spec, we
3737
# want to use save_libobjs as it was before
3738
# whole_archive_flag_spec was expanded, because we can't
3739
# assume the linker understands whole_archive_flag_spec.
3740
# This may have to be revisited, in case too many
3741
# convenience libraries get linked in and end up exceeding
3743
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3744
save_libobjs=$libobjs
3748
# Clear the reloadable object creation command queue and
3749
# initialize k to one.
3756
output=$output_objdir/$save_output-${k}.$objext
3757
# Loop over the list of objects to be linked.
3758
for obj in $save_libobjs
3760
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3761
if test "X$objlist" = X ||
3762
{ len=`expr "X$test_cmds" : ".*"` &&
3763
test "$len" -le "$max_cmd_len"; }; then
3764
objlist="$objlist $obj"
3766
# The command $test_cmds is almost too long, add a
3767
# command to the queue.
3768
if test "$k" -eq 1 ; then
3769
# The first file doesn't have a previous command to add.
3770
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3772
# All subsequent reloadable object files will link in
3773
# the last one created.
3774
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3776
last_robj=$output_objdir/$save_output-${k}.$objext
3778
output=$output_objdir/$save_output-${k}.$objext
3783
# Handle the remaining objects by creating one last
3784
# reloadable object file. All subsequent reloadable object
3785
# files will link in the last one created.
3786
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3787
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3789
if ${skipped_export-false}; then
3790
$show "generating symbol list for \`$libname.la'"
3791
export_symbols="$output_objdir/$libname.exp"
3792
$run $rm $export_symbols
3794
# Append the command to create the export file.
3795
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3798
# Set up a command to remove the reloadale object files
3799
# after they are used.
3801
while test "$i" -lt "$k"
3804
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3807
$echo "creating a temporary reloadable object file: $output"
3809
# Loop through the commands generated above and execute them.
3810
save_ifs="$IFS"; IFS='~'
3811
for cmd in $concat_cmds; do
3814
$run eval "$cmd" || exit $?
3819
# Restore the value of output.
3822
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3823
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3825
# Expand the library linking commands again to reset the
3826
# value of $libobjs for piecewise linking.
3828
# Do each of the archive commands.
3829
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3830
eval cmds=\"$archive_expsym_cmds\"
3832
eval cmds=\"$archive_cmds\"
3835
# Append the command to remove the reloadable object files
3836
# to the just-reset $cmds.
3837
eval cmds=\"\$cmds~$rm $delfiles\"
3839
save_ifs="$IFS"; IFS='~'
3840
for cmd in $cmds; do
3843
$run eval "$cmd" || exit $?
3847
# Restore the uninstalled library and exit
3848
if test "$mode" = relink; then
3849
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3853
# Create links to the real library.
3854
for linkname in $linknames; do
3855
if test "$realname" != "$linkname"; then
3856
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3857
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3861
# If -module or -export-dynamic was specified, set the dlname.
3862
if test "$module" = yes || test "$export_dynamic" = yes; then
3863
# On all known operating systems, these are identical.
3870
if test -n "$deplibs"; then
3871
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3874
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3875
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3878
if test -n "$rpath"; then
3879
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3882
if test -n "$xrpath"; then
3883
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3886
if test -n "$vinfo"; then
3887
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3890
if test -n "$release"; then
3891
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3896
if test -n "$objs$old_deplibs"; then
3897
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3901
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3909
# Delete the old objects.
3910
$run $rm $obj $libobj
3912
# Objects from convenience libraries. This assumes
3913
# single-version convenience libraries. Whenever we create
3914
# different ones for PIC/non-PIC, this we'll have to duplicate
3918
# reload_cmds runs $LD directly, so let us get rid of
3919
# -Wl from whole_archive_flag_spec
3922
if test -n "$convenience"; then
3923
if test -n "$whole_archive_flag_spec"; then
3924
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3926
gentop="$output_objdir/${obj}x"
3927
$show "${rm}r $gentop"
3928
$run ${rm}r "$gentop"
3929
$show "$mkdir $gentop"
3930
$run $mkdir "$gentop"
3932
if test "$status" -ne 0 && test ! -d "$gentop"; then
3935
generated="$generated $gentop"
3937
for xlib in $convenience; do
3938
# Extract the objects.
3940
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3941
*) xabs=`pwd`"/$xlib" ;;
3943
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3944
xdir="$gentop/$xlib"
3946
$show "${rm}r $xdir"
3948
$show "$mkdir $xdir"
3951
if test "$status" -ne 0 && test ! -d "$xdir"; then
3954
# We will extract separately just the conflicting names and we will no
3955
# longer touch any unique names. It is faster to leave these extract
3956
# automatically by $AR in one run.
3957
$show "(cd $xdir && $AR x $xabs)"
3958
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3959
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3962
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3963
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3964
$AR t "$xabs" | sort | uniq -cd | while read -r count name
3967
while test "$i" -le "$count"
3969
# Put our $i before any first dot (extension)
3970
# Never overwrite any file
3972
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3974
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3976
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3977
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3983
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3988
# Create the old-style object.
3989
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
3992
eval cmds=\"$reload_cmds\"
3993
save_ifs="$IFS"; IFS='~'
3994
for cmd in $cmds; do
3997
$run eval "$cmd" || exit $?
4001
# Exit if we aren't doing a library object file.
4002
if test -z "$libobj"; then
4003
if test -n "$gentop"; then
4004
$show "${rm}r $gentop"
4011
if test "$build_libtool_libs" != yes; then
4012
if test -n "$gentop"; then
4013
$show "${rm}r $gentop"
4017
# Create an invalid libtool object if no PIC, so that we don't
4018
# accidentally link it into a program.
4019
# $show "echo timestamp > $libobj"
4020
# $run eval "echo timestamp > $libobj" || exit $?
4024
if test -n "$pic_flag" || test "$pic_mode" != default; then
4025
# Only do commands if we really have different PIC objects.
4026
reload_objs="$libobjs $reload_conv_objs"
4028
eval cmds=\"$reload_cmds\"
4029
save_ifs="$IFS"; IFS='~'
4030
for cmd in $cmds; do
4033
$run eval "$cmd" || exit $?
4038
if test -n "$gentop"; then
4039
$show "${rm}r $gentop"
4048
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4050
if test -n "$vinfo"; then
4051
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4054
if test -n "$release"; then
4055
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4058
if test "$preload" = yes; then
4059
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4060
test "$dlopen_self_static" = unknown; then
4061
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4066
*-*-rhapsody* | *-*-darwin1.[012])
4067
# On Rhapsody replace the C library is the System framework
4068
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4069
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4075
# Don't allow lazy linking, it breaks C++ global constructors
4076
if test "$tagname" = CXX ; then
4077
compile_command="$compile_command ${wl}-bind_at_load"
4078
finalize_command="$finalize_command ${wl}-bind_at_load"
4083
compile_command="$compile_command $compile_deplibs"
4084
finalize_command="$finalize_command $finalize_deplibs"
4086
if test -n "$rpath$xrpath"; then
4087
# If the user specified any rpath flags, then add them.
4088
for libdir in $rpath $xrpath; do
4089
# This is the magic to use -rpath.
4090
case "$finalize_rpath " in
4092
*) finalize_rpath="$finalize_rpath $libdir" ;;
4097
# Now hardcode the library paths
4100
for libdir in $compile_rpath $finalize_rpath; do
4101
if test -n "$hardcode_libdir_flag_spec"; then
4102
if test -n "$hardcode_libdir_separator"; then
4103
if test -z "$hardcode_libdirs"; then
4104
hardcode_libdirs="$libdir"
4106
# Just accumulate the unique libdirs.
4107
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4108
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4111
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4116
eval flag=\"$hardcode_libdir_flag_spec\"
4117
rpath="$rpath $flag"
4119
elif test -n "$runpath_var"; then
4120
case "$perm_rpath " in
4122
*) perm_rpath="$perm_rpath $libdir" ;;
4126
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4127
case :$dllsearchpath: in
4129
*) dllsearchpath="$dllsearchpath:$libdir";;
4134
# Substitute the hardcoded libdirs into the rpath.
4135
if test -n "$hardcode_libdir_separator" &&
4136
test -n "$hardcode_libdirs"; then
4137
libdir="$hardcode_libdirs"
4138
eval rpath=\" $hardcode_libdir_flag_spec\"
4140
compile_rpath="$rpath"
4144
for libdir in $finalize_rpath; do
4145
if test -n "$hardcode_libdir_flag_spec"; then
4146
if test -n "$hardcode_libdir_separator"; then
4147
if test -z "$hardcode_libdirs"; then
4148
hardcode_libdirs="$libdir"
4150
# Just accumulate the unique libdirs.
4151
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4152
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4155
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4160
eval flag=\"$hardcode_libdir_flag_spec\"
4161
rpath="$rpath $flag"
4163
elif test -n "$runpath_var"; then
4164
case "$finalize_perm_rpath " in
4166
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4170
# Substitute the hardcoded libdirs into the rpath.
4171
if test -n "$hardcode_libdir_separator" &&
4172
test -n "$hardcode_libdirs"; then
4173
libdir="$hardcode_libdirs"
4174
eval rpath=\" $hardcode_libdir_flag_spec\"
4176
finalize_rpath="$rpath"
4178
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4179
# Transform all the library objects into standard objects.
4180
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4181
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4185
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4186
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4187
dlsyms="${outputname}S.c"
4189
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4193
if test -n "$dlsyms"; then
4197
# Discover the nlist of each of the dlfiles.
4198
nlist="$output_objdir/${outputname}.nm"
4200
$show "$rm $nlist ${nlist}S ${nlist}T"
4201
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4203
# Parse the name list into a source file.
4204
$show "creating $output_objdir/$dlsyms"
4206
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4207
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4208
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4214
/* Prevent the only kind of declaration conflicts we can make. */
4215
#define lt_preloaded_symbols some_other_symbol
4217
/* External symbol declarations for the compiler. */\
4220
if test "$dlself" = yes; then
4221
$show "generating symbol list for \`$output'"
4223
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4225
# Add our own program objects to the symbol list.
4226
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4227
for arg in $progfiles; do
4228
$show "extracting global C symbols from \`$arg'"
4229
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4232
if test -n "$exclude_expsyms"; then
4233
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4234
$run eval '$mv "$nlist"T "$nlist"'
4237
if test -n "$export_symbols_regex"; then
4238
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4239
$run eval '$mv "$nlist"T "$nlist"'
4242
# Prepare the list of exported symbols
4243
if test -z "$export_symbols"; then
4244
export_symbols="$output_objdir/$output.exp"
4245
$run $rm $export_symbols
4246
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4248
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4249
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4250
$run eval 'mv "$nlist"T "$nlist"'
4254
for arg in $dlprefiles; do
4255
$show "extracting global C symbols from \`$arg'"
4256
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4257
$run eval '$echo ": $name " >> "$nlist"'
4258
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4261
if test -z "$run"; then
4262
# Make sure we have at least an empty file.
4263
test -f "$nlist" || : > "$nlist"
4265
if test -n "$exclude_expsyms"; then
4266
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4267
$mv "$nlist"T "$nlist"
4270
# Try sorting and uniquifying the output.
4271
if grep -v "^: " < "$nlist" |
4272
if sort -k 3 </dev/null >/dev/null 2>&1; then
4277
uniq > "$nlist"S; then
4280
grep -v "^: " < "$nlist" > "$nlist"S
4283
if test -f "$nlist"S; then
4284
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4286
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
4289
$echo >> "$output_objdir/$dlsyms" "\
4291
#undef lt_preloaded_symbols
4293
#if defined (__STDC__) && __STDC__
4294
# define lt_ptr void *
4296
# define lt_ptr char *
4300
/* The mapping between symbol names and symbols. */
4305
lt_preloaded_symbols[] =
4309
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4311
$echo >> "$output_objdir/$dlsyms" "\
4315
/* This works around a problem in FreeBSD linker */
4316
#ifdef FREEBSD_WORKAROUND
4317
static const void *lt_preloaded_setup() {
4318
return lt_preloaded_symbols;
4328
pic_flag_for_symtable=
4330
# compiling the symbol table file with pic_flag works around
4331
# a FreeBSD bug that causes programs to crash when -lm is
4332
# linked before any other PIC object. But we must not use
4333
# pic_flag when linking with -static. The problem exists in
4334
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4335
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4336
case "$compile_command " in
4338
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4341
case "$compile_command " in
4343
*) pic_flag_for_symtable=" $pic_flag";;
4347
# Now compile the dynamic symbol file.
4348
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4349
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4351
# Clean up the generated files.
4352
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4353
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4355
# Transform the symbol file into the correct name.
4356
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4357
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4360
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4365
# We keep going just in case the user didn't refer to
4366
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4367
# really was required.
4369
# Nullify the symbol file.
4370
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4371
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4374
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4375
# Replace the output file specification.
4376
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4377
link_command="$compile_command$compile_rpath"
4379
# We have no uninstalled library dependencies, so finalize right now.
4380
$show "$link_command"
4381
$run eval "$link_command"
4384
# Delete the generated files.
4385
if test -n "$dlsyms"; then
4386
$show "$rm $output_objdir/${outputname}S.${objext}"
4387
$run $rm "$output_objdir/${outputname}S.${objext}"
4393
if test -n "$shlibpath_var"; then
4394
# We should set the shlibpath_var
4396
for dir in $temp_rpath; do
4398
[\\/]* | [A-Za-z]:[\\/]*)
4403
# Relative path: add a thisdir entry.
4404
rpath="$rpath\$thisdir/$dir:"
4411
if test -n "$compile_shlibpath$finalize_shlibpath"; then
4412
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4414
if test -n "$finalize_shlibpath"; then
4415
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4420
if test -n "$runpath_var"; then
4421
if test -n "$perm_rpath"; then
4422
# We should set the runpath_var.
4424
for dir in $perm_rpath; do
4427
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4429
if test -n "$finalize_perm_rpath"; then
4430
# We should set the runpath_var.
4432
for dir in $finalize_perm_rpath; do
4435
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4439
if test "$no_install" = yes; then
4440
# We don't need to create a wrapper script.
4441
link_command="$compile_var$compile_command$compile_rpath"
4442
# Replace the output file specification.
4443
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4444
# Delete the old output file.
4446
# Link the executable and exit
4447
$show "$link_command"
4448
$run eval "$link_command" || exit $?
4452
if test "$hardcode_action" = relink; then
4453
# Fast installation is not supported
4454
link_command="$compile_var$compile_command$compile_rpath"
4455
relink_command="$finalize_var$finalize_command$finalize_rpath"
4457
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4458
$echo "$modename: \`$output' will be relinked during installation" 1>&2
4460
if test "$fast_install" != no; then
4461
link_command="$finalize_var$compile_command$finalize_rpath"
4462
if test "$fast_install" = yes; then
4463
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4465
# fast_install is set to needless
4469
link_command="$compile_var$compile_command$compile_rpath"
4470
relink_command="$finalize_var$finalize_command$finalize_rpath"
4474
# Replace the output file specification.
4475
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4477
# Delete the old output files.
4478
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4480
$show "$link_command"
4481
$run eval "$link_command" || exit $?
4483
# Now create the wrapper script.
4484
$show "creating $output"
4486
# Quote the relink command for shipping.
4487
if test -n "$relink_command"; then
4488
# Preserve any variables that may affect compiler behavior
4489
for var in $variables_saved_for_relink; do
4490
if eval test -z \"\${$var+set}\"; then
4491
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4492
elif eval var_value=\$$var; test -z "$var_value"; then
4493
relink_command="$var=; export $var; $relink_command"
4495
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4496
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4499
relink_command="(cd `pwd`; $relink_command)"
4500
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4503
# Quote $echo for shipping.
4504
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4506
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4507
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4509
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4511
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4514
# Only actually do things if our run command is non-null.
4515
if test -z "$run"; then
4516
# win32 will think the script is a binary if it has
4517
# a .exe suffix, so we strip it off here.
4519
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4521
# test for cygwin because mv fails w/o .exe extensions
4525
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4529
*cygwin* | *mingw* )
4530
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4531
cwrapper=`$echo ${output}.exe`
4532
$rm $cwrappersource $cwrapper
4533
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4535
cat > $cwrappersource <<EOF
4537
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4538
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4540
The $output program cannot be directly executed until all the libtool
4541
libraries that it depends on are installed.
4543
This wrapper executable should never be moved out of the build directory.
4544
If it is, it will not operate correctly.
4546
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4547
but could eventually absorb all of the scripts functionality and
4548
exec $objdir/$outputname directly.
4551
cat >> $cwrappersource<<"EOF"
4559
#if defined(PATH_MAX)
4560
# define LT_PATHMAX PATH_MAX
4561
#elif defined(MAXPATHLEN)
4562
# define LT_PATHMAX MAXPATHLEN
4564
# define LT_PATHMAX 1024
4567
#ifndef DIR_SEPARATOR
4568
#define DIR_SEPARATOR '/'
4571
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4573
#define HAVE_DOS_BASED_FILE_SYSTEM
4574
#ifndef DIR_SEPARATOR_2
4575
#define DIR_SEPARATOR_2 '\\'
4579
#ifndef DIR_SEPARATOR_2
4580
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4581
#else /* DIR_SEPARATOR_2 */
4582
# define IS_DIR_SEPARATOR(ch) \
4583
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4584
#endif /* DIR_SEPARATOR_2 */
4586
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4587
#define XFREE(stale) do { \
4588
if (stale) { free ((void *) stale); stale = 0; } \
4591
const char *program_name = NULL;
4593
void * xmalloc (size_t num);
4594
char * xstrdup (const char *string);
4595
char * basename (const char *name);
4596
char * fnqualify(const char *path);
4597
char * strendzap(char *str, const char *pat);
4598
void lt_fatal (const char *message, ...);
4601
main (int argc, char *argv[])
4606
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4607
newargz = XMALLOC(char *, argc+2);
4610
cat >> $cwrappersource <<EOF
4611
newargz[0] = "$SHELL";
4614
cat >> $cwrappersource <<"EOF"
4615
newargz[1] = fnqualify(argv[0]);
4616
/* we know the script has the same name, without the .exe */
4617
/* so make sure newargz[1] doesn't end in .exe */
4618
strendzap(newargz[1],".exe");
4619
for (i = 1; i < argc; i++)
4620
newargz[i+1] = xstrdup(argv[i]);
4621
newargz[argc+1] = NULL;
4624
cat >> $cwrappersource <<EOF
4625
execv("$SHELL",newargz);
4628
cat >> $cwrappersource <<"EOF"
4632
xmalloc (size_t num)
4634
void * p = (void *) malloc (num);
4636
lt_fatal ("Memory exhausted");
4642
xstrdup (const char *string)
4644
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4649
basename (const char *name)
4653
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4654
/* Skip over the disk name in MSDOS pathnames. */
4655
if (isalpha (name[0]) && name[1] == ':')
4659
for (base = name; *name; name++)
4660
if (IS_DIR_SEPARATOR (*name))
4662
return (char *) base;
4666
fnqualify(const char *path)
4670
char tmp[LT_PATHMAX + 1];
4672
assert(path != NULL);
4674
/* Is it qualified already? */
4675
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4676
if (isalpha (path[0]) && path[1] == ':')
4677
return xstrdup (path);
4679
if (IS_DIR_SEPARATOR (path[0]))
4680
return xstrdup (path);
4682
/* prepend the current directory */
4683
/* doesn't handle '~' */
4684
if (getcwd (tmp, LT_PATHMAX) == NULL)
4685
lt_fatal ("getcwd failed");
4686
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4687
p = XMALLOC(char, size);
4688
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4693
strendzap(char *str, const char *pat)
4697
assert(str != NULL);
4698
assert(pat != NULL);
4701
patlen = strlen(pat);
4705
str += len - patlen;
4706
if (strcmp(str, pat) == 0)
4713
lt_error_core (int exit_status, const char * mode,
4714
const char * message, va_list ap)
4716
fprintf (stderr, "%s: %s: ", program_name, mode);
4717
vfprintf (stderr, message, ap);
4718
fprintf (stderr, ".\n");
4720
if (exit_status >= 0)
4725
lt_fatal (const char *message, ...)
4728
va_start (ap, message);
4729
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4733
# we should really use a build-platform specific compiler
4734
# here, but OTOH, the wrappers (shell script and this C one)
4735
# are only useful if you want to execute the "real" binary.
4736
# Since the "real" binary is built for $host, then this
4737
# wrapper might as well be built for $host, too.
4738
$run $LTCC -s -o $cwrapper $cwrappersource
4742
trap "$rm $output; exit 1" 1 2 15
4747
# $output - temporary wrapper script for $objdir/$outputname
4748
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4750
# The $output program cannot be directly executed until all the libtool
4751
# libraries that it depends on are installed.
4753
# This wrapper script should never be moved out of the build directory.
4754
# If it is, it will not operate correctly.
4756
# Sed substitution that helps us do robust quoting. It backslashifies
4757
# metacharacters that are still active within double-quoted strings.
4758
Xsed='${SED} -e 1s/^X//'
4759
sed_quote_subst='$sed_quote_subst'
4761
# The HP-UX ksh and POSIX shell print the target directory to stdout
4763
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4765
relink_command=\"$relink_command\"
4767
# This environment variable determines our operation mode.
4768
if test \"\$libtool_install_magic\" = \"$magic\"; then
4769
# install mode needs the following variable:
4770
notinst_deplibs='$notinst_deplibs'
4772
# When we are sourced in execute mode, \$file and \$echo are already set.
4773
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4776
# Make sure echo works.
4777
if test \"X\$1\" = X--no-reexec; then
4778
# Discard the --no-reexec flag, and continue.
4780
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4781
# Yippee, \$echo works!
4784
# Restart under the correct shell, and then maybe \$echo will work.
4785
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4791
# Find the directory that this script lives in.
4792
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4793
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4795
# Follow symbolic links until we get to the real thisdir.
4796
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4797
while test -n \"\$file\"; do
4798
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4800
# If there was a directory component, then change thisdir.
4801
if test \"x\$destdir\" != \"x\$file\"; then
4802
case \"\$destdir\" in
4803
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4804
*) thisdir=\"\$thisdir/\$destdir\" ;;
4808
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4809
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4812
# Try to get the absolute directory name.
4813
absdir=\`cd \"\$thisdir\" && pwd\`
4814
test -n \"\$absdir\" && thisdir=\"\$absdir\"
4817
if test "$fast_install" = yes; then
4819
program=lt-'$outputname'$exeext
4820
progdir=\"\$thisdir/$objdir\"
4822
if test ! -f \"\$progdir/\$program\" || \\
4823
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4824
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4826
file=\"\$\$-\$program\"
4828
if test ! -d \"\$progdir\"; then
4829
$mkdir \"\$progdir\"
4831
$rm \"\$progdir/\$file\"
4836
# relink executable if necessary
4837
if test -n \"\$relink_command\"; then
4838
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4840
$echo \"\$relink_command_output\" >&2
4841
$rm \"\$progdir/\$file\"
4846
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4847
{ $rm \"\$progdir/\$program\";
4848
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4849
$rm \"\$progdir/\$file\"
4853
program='$outputname'
4854
progdir=\"\$thisdir/$objdir\"
4860
if test -f \"\$progdir/\$program\"; then"
4862
# Export our shlibpath_var if we have one.
4863
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4865
# Add our own library path to $shlibpath_var
4866
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4868
# Some systems cannot cope with colon-terminated $shlibpath_var
4869
# The second colon is a workaround for a bug in BeOS R4 sed
4870
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4872
export $shlibpath_var
4876
# fixup the dll searchpath if we need to.
4877
if test -n "$dllsearchpath"; then
4879
# Add the dll search path components to the executable PATH
4880
PATH=$dllsearchpath:\$PATH
4885
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4886
# Run the actual program with our arguments.
4889
# Backslashes separate directories on plain windows
4890
*-*-mingw | *-*-os2*)
4892
exec \$progdir\\\\\$program \${1+\"\$@\"}
4898
exec \$progdir/\$program \${1+\"\$@\"}
4903
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4907
# The program doesn't exist.
4908
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4909
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4910
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
4921
# See if we need to build an old-fashioned archive.
4922
for oldlib in $oldlibs; do
4924
if test "$build_libtool_libs" = convenience; then
4925
oldobjs="$libobjs_save"
4926
addlibs="$convenience"
4927
build_libtool_libs=no
4929
if test "$build_libtool_libs" = module; then
4930
oldobjs="$libobjs_save"
4931
build_libtool_libs=no
4933
oldobjs="$old_deplibs $non_pic_objects"
4935
addlibs="$old_convenience"
4938
if test -n "$addlibs"; then
4939
gentop="$output_objdir/${outputname}x"
4940
$show "${rm}r $gentop"
4941
$run ${rm}r "$gentop"
4942
$show "$mkdir $gentop"
4943
$run $mkdir "$gentop"
4945
if test "$status" -ne 0 && test ! -d "$gentop"; then
4948
generated="$generated $gentop"
4950
# Add in members from convenience archives.
4951
for xlib in $addlibs; do
4952
# Extract the objects.
4954
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4955
*) xabs=`pwd`"/$xlib" ;;
4957
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4958
xdir="$gentop/$xlib"
4960
$show "${rm}r $xdir"
4962
$show "$mkdir $xdir"
4965
if test "$status" -ne 0 && test ! -d "$xdir"; then
4968
# We will extract separately just the conflicting names and we will no
4969
# longer touch any unique names. It is faster to leave these extract
4970
# automatically by $AR in one run.
4971
$show "(cd $xdir && $AR x $xabs)"
4972
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4973
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4976
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4977
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4978
$AR t "$xabs" | sort | uniq -cd | while read -r count name
4981
while test "$i" -le "$count"
4983
# Put our $i before any first dot (extension)
4984
# Never overwrite any file
4986
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4988
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4990
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4991
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4997
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5001
# Do each command in the archive commands.
5002
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5003
eval cmds=\"$old_archive_from_new_cmds\"
5005
eval cmds=\"$old_archive_cmds\"
5007
if len=`expr "X$cmds" : ".*"` &&
5008
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5011
# the command line is too long to link in one step, link in parts
5012
$echo "using piecewise archive linking..."
5017
save_oldobjs=$oldobjs
5018
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5019
# encoded into archives. This makes 'ar r' malfunction in
5020
# this piecewise linking case whenever conflicting object
5021
# names appear in distinct ar calls; check, warn and compensate.
5022
if (for obj in $save_oldobjs
5024
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5025
done | sort | sort -uc >/dev/null 2>&1); then
5028
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5029
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5032
# Is there a better way of finding the last object in the list?
5033
for obj in $save_oldobjs
5037
for obj in $save_oldobjs
5039
oldobjs="$objlist $obj"
5040
objlist="$objlist $obj"
5041
eval test_cmds=\"$old_archive_cmds\"
5042
if len=`expr "X$test_cmds" : ".*"` &&
5043
test "$len" -le "$max_cmd_len"; then
5046
# the above command should be used before it gets too long
5048
if test "$obj" = "$last_oldobj" ; then
5051
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5052
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5058
if test "X$oldobjs" = "X" ; then
5059
eval cmds=\"\$concat_cmds\"
5061
eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5065
save_ifs="$IFS"; IFS='~'
5066
for cmd in $cmds; do
5069
$run eval "$cmd" || exit $?
5074
if test -n "$generated"; then
5075
$show "${rm}r$generated"
5076
$run ${rm}r$generated
5079
# Now create the libtool archive.
5083
test "$build_old_libs" = yes && old_library="$libname.$libext"
5084
$show "creating $output"
5086
# Preserve any variables that may affect compiler behavior
5087
for var in $variables_saved_for_relink; do
5088
if eval test -z \"\${$var+set}\"; then
5089
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5090
elif eval var_value=\$$var; test -z "$var_value"; then
5091
relink_command="$var=; export $var; $relink_command"
5093
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5094
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5097
# Quote the link command for shipping.
5098
relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5099
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5100
if test "$hardcode_automatic" = yes ; then
5103
# Only create the output if not a dry run.
5104
if test -z "$run"; then
5105
for installed in no yes; do
5106
if test "$installed" = yes; then
5107
if test -z "$install_libdir"; then
5110
output="$output_objdir/$outputname"i
5111
# Replace all uninstalled libtool libraries with the installed ones
5113
for deplib in $dependency_libs; do
5116
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5117
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5118
if test -z "$libdir"; then
5119
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5122
newdependency_libs="$newdependency_libs $libdir/$name"
5124
*) newdependency_libs="$newdependency_libs $deplib" ;;
5127
dependency_libs="$newdependency_libs"
5129
for lib in $dlfiles; do
5130
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5131
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5132
if test -z "$libdir"; then
5133
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5136
newdlfiles="$newdlfiles $libdir/$name"
5138
dlfiles="$newdlfiles"
5140
for lib in $dlprefiles; do
5141
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5142
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5143
if test -z "$libdir"; then
5144
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5147
newdlprefiles="$newdlprefiles $libdir/$name"
5149
dlprefiles="$newdlprefiles"
5152
for lib in $dlfiles; do
5154
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5155
*) abs=`pwd`"/$lib" ;;
5157
newdlfiles="$newdlfiles $abs"
5159
dlfiles="$newdlfiles"
5161
for lib in $dlprefiles; do
5163
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5164
*) abs=`pwd`"/$lib" ;;
5166
newdlprefiles="$newdlprefiles $abs"
5168
dlprefiles="$newdlprefiles"
5171
# place dlname in correct position for cygwin
5173
case $host,$output,$installed,$module,$dlname in
5174
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5177
# $outputname - a libtool library file
5178
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5180
# Please DO NOT delete this file!
5181
# It is necessary for linking the library.
5183
# The name that we can dlopen(3).
5186
# Names of this library.
5187
library_names='$library_names'
5189
# The name of the static archive.
5190
old_library='$old_library'
5192
# Libraries that this one depends upon.
5193
dependency_libs='$dependency_libs'
5195
# Version information for $libname.
5200
# Is this an already installed library?
5201
installed=$installed
5203
# Should we warn about portability when linking against -modules?
5204
shouldnotlink=$module
5206
# Files to dlopen/dlpreopen
5208
dlpreopen='$dlprefiles'
5210
# Directory that this library needs to be installed in:
5211
libdir='$install_libdir'"
5212
if test "$installed" = no && test "$need_relink" = yes; then
5214
relink_command=\"$relink_command\""
5219
# Do a symbolic link so that the libtool archive can be found in
5220
# LD_LIBRARY_PATH before the program is installed.
5221
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5222
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5228
# libtool install mode
5230
modename="$modename: install"
5232
# There may be an optional sh(1) argument at the beginning of
5233
# install_prog (especially on Windows NT).
5234
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5235
# Allow the use of GNU shtool's install command.
5236
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5237
# Aesthetically quote it.
5238
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5240
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5244
install_prog="$arg "
5252
# The real first argument should be the name of the installation program.
5253
# Aesthetically quote it.
5254
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5256
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5260
install_prog="$install_prog$arg"
5262
# We need to accept at least all the BSD install flags.
5272
if test -n "$dest"; then
5273
files="$files $dest"
5291
# If the previous option needed an argument, then skip it.
5292
if test -n "$prev"; then
5301
# Aesthetically quote the argument.
5302
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5304
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5308
install_prog="$install_prog $arg"
5311
if test -z "$install_prog"; then
5312
$echo "$modename: you must specify an install program" 1>&2
5317
if test -n "$prev"; then
5318
$echo "$modename: the \`$prev' option requires an argument" 1>&2
5323
if test -z "$files"; then
5324
if test -z "$dest"; then
5325
$echo "$modename: no file or destination specified" 1>&2
5327
$echo "$modename: you must specify a destination" 1>&2
5333
# Strip any trailing slash from the destination.
5334
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5336
# Check to see that the destination is a directory.
5337
test -d "$dest" && isdir=yes
5338
if test "$isdir" = yes; then
5342
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5343
test "X$destdir" = "X$dest" && destdir=.
5344
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5346
# Not a directory, so check to see that there is only one file specified.
5348
if test "$#" -gt 2; then
5349
$echo "$modename: \`$dest' is not a directory" 1>&2
5355
[\\/]* | [A-Za-z]:[\\/]*) ;;
5357
for file in $files; do
5361
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5370
# This variable tells wrapper scripts just to set variables rather
5371
# than running their programs.
5372
libtool_install_magic="$magic"
5377
for file in $files; do
5379
# Do each installation.
5382
# Do the static libraries later.
5383
staticlibs="$staticlibs $file"
5387
# Check to see that this really is a libtool archive.
5388
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5390
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5398
# If there is no directory component, then add one.
5400
*/* | *\\*) . $file ;;
5404
# Add the libdir to current_libdirs if it is the destination.
5405
if test "X$destdir" = "X$libdir"; then
5406
case "$current_libdirs " in
5408
*) current_libdirs="$current_libdirs $libdir" ;;
5411
# Note the libdir as a future libdir.
5412
case "$future_libdirs " in
5414
*) future_libdirs="$future_libdirs $libdir" ;;
5418
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5419
test "X$dir" = "X$file/" && dir=
5422
if test -n "$relink_command"; then
5423
# Determine the prefix the user has applied to our future dir.
5424
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5426
# Don't allow the user to place us outside of our expected
5427
# location b/c this prevents finding dependent libraries that
5428
# are installed to the same prefix.
5429
# At present, this check doesn't affect windows .dll's that
5430
# are installed into $libdir/../bin (currently, that works fine)
5431
# but it's something to keep an eye on.
5432
if test "$inst_prefix_dir" = "$destdir"; then
5433
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5437
if test -n "$inst_prefix_dir"; then
5438
# Stick the inst_prefix_dir data into the link command.
5439
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5441
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5444
$echo "$modename: warning: relinking \`$file'" 1>&2
5445
$show "$relink_command"
5446
if $run eval "$relink_command"; then :
5448
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5453
# See the names of the shared library.
5454
set dummy $library_names
5455
if test -n "$2"; then
5461
test -n "$relink_command" && srcname="$realname"T
5463
# Install the shared library and build the symlinks.
5464
$show "$install_prog $dir/$srcname $destdir/$realname"
5465
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5466
if test -n "$stripme" && test -n "$striplib"; then
5467
$show "$striplib $destdir/$realname"
5468
$run eval "$striplib $destdir/$realname" || exit $?
5471
if test "$#" -gt 0; then
5472
# Delete the old symlinks, and create new ones.
5475
if test "$linkname" != "$realname"; then
5476
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5477
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5482
# Do each command in the postinstall commands.
5483
lib="$destdir/$realname"
5484
eval cmds=\"$postinstall_cmds\"
5485
save_ifs="$IFS"; IFS='~'
5486
for cmd in $cmds; do
5489
$run eval "$cmd" || exit $?
5494
# Install the pseudo-library for information purposes.
5495
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5496
instname="$dir/$name"i
5497
$show "$install_prog $instname $destdir/$name"
5498
$run eval "$install_prog $instname $destdir/$name" || exit $?
5500
# Maybe install the static library, too.
5501
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5505
# Install (i.e. copy) a libtool object.
5507
# Figure out destination file name, if it wasn't already specified.
5508
if test -n "$destname"; then
5509
destfile="$destdir/$destname"
5511
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5512
destfile="$destdir/$destfile"
5515
# Deduce the name of the destination old-style object file.
5518
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5521
staticdest="$destfile"
5525
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5531
# Install the libtool object if requested.
5532
if test -n "$destfile"; then
5533
$show "$install_prog $file $destfile"
5534
$run eval "$install_prog $file $destfile" || exit $?
5537
# Install the old object if enabled.
5538
if test "$build_old_libs" = yes; then
5539
# Deduce the name of the old-style object file.
5540
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5542
$show "$install_prog $staticobj $staticdest"
5543
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
5549
# Figure out destination file name, if it wasn't already specified.
5550
if test -n "$destname"; then
5551
destfile="$destdir/$destname"
5553
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5554
destfile="$destdir/$destfile"
5557
# If the file is missing, and there is a .exe on the end, strip it
5558
# because it is most likely a libtool script we actually want to
5563
if test ! -f "$file"; then
5564
file=`$echo $file|${SED} 's,.exe$,,'`
5570
# Do a test to see if this is really a libtool program.
5573
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5579
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5583
# To insure that "foo" is sourced, and not "foo.exe",
5584
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5585
# which disallows the automatic-append-.exe behavior.
5587
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5588
*) wrapperdot=${wrapper} ;;
5590
# If there is no directory component, then add one.
5592
*/* | *\\*) . ${wrapperdot} ;;
5593
*) . ./${wrapperdot} ;;
5596
# Check the variables that should have been set.
5597
if test -z "$notinst_deplibs"; then
5598
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5603
for lib in $notinst_deplibs; do
5604
# Check to see that each library is installed.
5606
if test -f "$lib"; then
5607
# If there is no directory component, then add one.
5609
*/* | *\\*) . $lib ;;
5613
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5614
if test -n "$libdir" && test ! -f "$libfile"; then
5615
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5621
# To insure that "foo" is sourced, and not "foo.exe",
5622
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5623
# which disallows the automatic-append-.exe behavior.
5625
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5626
*) wrapperdot=${wrapper} ;;
5628
# If there is no directory component, then add one.
5630
*/* | *\\*) . ${wrapperdot} ;;
5631
*) . ./${wrapperdot} ;;
5635
if test "$fast_install" = no && test -n "$relink_command"; then
5636
if test "$finalize" = yes && test -z "$run"; then
5638
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5639
tmpdir="$tmpdir/libtool-$$"
5640
if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
5642
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5645
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5646
outputname="$tmpdir/$file"
5647
# Replace the output file specification.
5648
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5650
$show "$relink_command"
5651
if $run eval "$relink_command"; then :
5653
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5659
$echo "$modename: warning: cannot relink \`$file'" 1>&2
5662
# Install the binary that we compiled earlier.
5663
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5667
# remove .exe since cygwin /usr/bin/install will append another
5669
case $install_prog,$host in
5670
*/usr/bin/install*,*cygwin*)
5671
case $file:$destfile in
5676
destfile=$destfile.exe
5679
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5684
$show "$install_prog$stripme $file $destfile"
5685
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5686
test -n "$outputname" && ${rm}r "$tmpdir"
5691
for file in $staticlibs; do
5692
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5694
# Set up the ranlib parameters.
5695
oldlib="$destdir/$name"
5697
$show "$install_prog $file $oldlib"
5698
$run eval "$install_prog \$file \$oldlib" || exit $?
5700
if test -n "$stripme" && test -n "$striplib"; then
5701
$show "$old_striplib $oldlib"
5702
$run eval "$old_striplib $oldlib" || exit $?
5705
# Do each command in the postinstall commands.
5706
eval cmds=\"$old_postinstall_cmds\"
5707
save_ifs="$IFS"; IFS='~'
5708
for cmd in $cmds; do
5711
$run eval "$cmd" || exit $?
5716
if test -n "$future_libdirs"; then
5717
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5720
if test -n "$current_libdirs"; then
5721
# Maybe just do a dry run.
5722
test -n "$run" && current_libdirs=" -n$current_libdirs"
5723
exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
5729
# libtool finish mode
5731
modename="$modename: finish"
5735
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5738
libdirs="$libdirs $dir"
5741
for libdir in $libdirs; do
5742
if test -n "$finish_cmds"; then
5743
# Do each command in the finish commands.
5744
eval cmds=\"$finish_cmds\"
5745
save_ifs="$IFS"; IFS='~'
5746
for cmd in $cmds; do
5749
$run eval "$cmd" || admincmds="$admincmds
5754
if test -n "$finish_eval"; then
5755
# Do the single finish_eval.
5756
eval cmds=\"$finish_eval\"
5757
$run eval "$cmds" || admincmds="$admincmds
5763
# Exit here if they wanted silent mode.
5764
test "$show" = : && exit 0
5766
$echo "----------------------------------------------------------------------"
5767
$echo "Libraries have been installed in:"
5768
for libdir in $libdirs; do
5772
$echo "If you ever happen to want to link against installed libraries"
5773
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5774
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5775
$echo "flag during linking and do at least one of the following:"
5776
if test -n "$shlibpath_var"; then
5777
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5778
$echo " during execution"
5780
if test -n "$runpath_var"; then
5781
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5782
$echo " during linking"
5784
if test -n "$hardcode_libdir_flag_spec"; then
5786
eval flag=\"$hardcode_libdir_flag_spec\"
5788
$echo " - use the \`$flag' linker flag"
5790
if test -n "$admincmds"; then
5791
$echo " - have your system administrator run these commands:$admincmds"
5793
if test -f /etc/ld.so.conf; then
5794
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5797
$echo "See any operating system documentation about shared libraries for"
5798
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5799
$echo "----------------------------------------------------------------------"
5803
# libtool execute mode
5805
modename="$modename: execute"
5807
# The first argument is the command name.
5809
if test -z "$cmd"; then
5810
$echo "$modename: you must specify a COMMAND" 1>&2
5815
# Handle -dlopen flags immediately.
5816
for file in $execute_dlfiles; do
5817
if test ! -f "$file"; then
5818
$echo "$modename: \`$file' is not a file" 1>&2
5826
# Check to see that this really is a libtool archive.
5827
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5829
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5834
# Read the libtool library.
5838
# If there is no directory component, then add one.
5840
*/* | *\\*) . $file ;;
5844
# Skip this library if it cannot be dlopened.
5845
if test -z "$dlname"; then
5846
# Warn if it was a shared library.
5847
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5851
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5852
test "X$dir" = "X$file" && dir=.
5854
if test -f "$dir/$objdir/$dlname"; then
5857
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5863
# Just add the directory containing the .lo file.
5864
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5865
test "X$dir" = "X$file" && dir=.
5869
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5874
# Get the absolute pathname.
5875
absdir=`cd "$dir" && pwd`
5876
test -n "$absdir" && dir="$absdir"
5878
# Now add the directory to shlibpath_var.
5879
if eval "test -z \"\$$shlibpath_var\""; then
5880
eval "$shlibpath_var=\"\$dir\""
5882
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5886
# This variable tells wrapper scripts just to set shlibpath_var
5887
# rather than running their programs.
5888
libtool_execute_magic="$magic"
5890
# Check if any of the arguments is a wrapper script.
5897
# Do a test to see if this is really a libtool program.
5898
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5899
# If there is no directory component, then add one.
5901
*/* | *\\*) . $file ;;
5905
# Transform arg to wrapped name.
5906
file="$progdir/$program"
5910
# Quote arguments (to preserve shell metacharacters).
5911
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5912
args="$args \"$file\""
5915
if test -z "$run"; then
5916
if test -n "$shlibpath_var"; then
5917
# Export the shlibpath_var.
5918
eval "export $shlibpath_var"
5921
# Restore saved environment variables
5922
if test "${save_LC_ALL+set}" = set; then
5923
LC_ALL="$save_LC_ALL"; export LC_ALL
5925
if test "${save_LANG+set}" = set; then
5926
LANG="$save_LANG"; export LANG
5929
# Now prepare to actually exec the command.
5930
exec_cmd="\$cmd$args"
5932
# Display what would be done.
5933
if test -n "$shlibpath_var"; then
5934
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5935
$echo "export $shlibpath_var"
5942
# libtool clean and uninstall mode
5944
modename="$modename: $mode"
5950
# This variable tells wrapper scripts just to set variables rather
5951
# than running their programs.
5952
libtool_install_magic="$magic"
5957
-f) rm="$rm $arg"; rmforce=yes ;;
5958
-*) rm="$rm $arg" ;;
5959
*) files="$files $arg" ;;
5963
if test -z "$rm"; then
5964
$echo "$modename: you must specify an RM program" 1>&2
5971
origobjdir="$objdir"
5972
for file in $files; do
5973
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5974
if test "X$dir" = "X$file"; then
5976
objdir="$origobjdir"
5978
objdir="$dir/$origobjdir"
5980
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5981
test "$mode" = uninstall && objdir="$dir"
5983
# Remember objdir for removal later, being careful to avoid duplicates
5984
if test "$mode" = clean; then
5987
*) rmdirs="$rmdirs $objdir" ;;
5991
# Don't error if the file doesn't exist and rm -f was used.
5992
if (test -L "$file") >/dev/null 2>&1 \
5993
|| (test -h "$file") >/dev/null 2>&1 \
5994
|| test -f "$file"; then
5996
elif test -d "$file"; then
5999
elif test "$rmforce" = yes; then
6007
# Possibly a libtool archive, so verify it.
6008
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6011
# Delete the libtool libraries and symlinks.
6012
for n in $library_names; do
6013
rmfiles="$rmfiles $objdir/$n"
6015
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6016
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6018
if test "$mode" = uninstall; then
6019
if test -n "$library_names"; then
6020
# Do each command in the postuninstall commands.
6021
eval cmds=\"$postuninstall_cmds\"
6022
save_ifs="$IFS"; IFS='~'
6023
for cmd in $cmds; do
6027
if test "$?" -ne 0 && test "$rmforce" != yes; then
6034
if test -n "$old_library"; then
6035
# Do each command in the old_postuninstall commands.
6036
eval cmds=\"$old_postuninstall_cmds\"
6037
save_ifs="$IFS"; IFS='~'
6038
for cmd in $cmds; do
6042
if test "$?" -ne 0 && test "$rmforce" != yes; then
6048
# FIXME: should reinstall the best remaining shared library.
6054
# Possibly a libtool object, so verify it.
6055
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6060
# Add PIC object to the list of files to remove.
6061
if test -n "$pic_object" \
6062
&& test "$pic_object" != none; then
6063
rmfiles="$rmfiles $dir/$pic_object"
6066
# Add non-PIC object to the list of files to remove.
6067
if test -n "$non_pic_object" \
6068
&& test "$non_pic_object" != none; then
6069
rmfiles="$rmfiles $dir/$non_pic_object"
6075
if test "$mode" = clean ; then
6079
file=`$echo $file|${SED} 's,.exe$,,'`
6080
noexename=`$echo $name|${SED} 's,.exe$,,'`
6081
# $file with .exe has already been added to rmfiles,
6082
# add $file without .exe
6083
rmfiles="$rmfiles $file"
6086
# Do a test to see if this is a libtool program.
6087
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6091
# note $name still contains .exe if it was in $file originally
6092
# as does the version of $file that was added into $rmfiles
6093
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6094
if test "$fast_install" = yes && test -n "$relink_command"; then
6095
rmfiles="$rmfiles $objdir/lt-$name"
6097
if test "X$noexename" != "X$name" ; then
6098
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6104
$show "$rm $rmfiles"
6105
$run $rm $rmfiles || exit_status=1
6107
objdir="$origobjdir"
6109
# Try to remove the ${objdir}s in the directories where we deleted files
6110
for dir in $rmdirs; do
6111
if test -d "$dir"; then
6113
$run rmdir $dir >/dev/null 2>&1
6121
$echo "$modename: you must specify a MODE" 1>&2
6122
$echo "$generic_help" 1>&2
6127
if test -z "$exec_cmd"; then
6128
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6129
$echo "$generic_help" 1>&2
6132
fi # test -z "$show_help"
6134
if test -n "$exec_cmd"; then
6139
# We need to display help for each of the modes.
6142
"Usage: $modename [OPTION]... [MODE-ARG]...
6144
Provide generalized library-building support services.
6146
--config show all configuration variables
6147
--debug enable verbose shell tracing
6148
-n, --dry-run display commands without modifying any files
6149
--features display basic configuration information and exit
6150
--finish same as \`--mode=finish'
6151
--help display this help message and exit
6152
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6153
--quiet same as \`--silent'
6154
--silent don't print informational messages
6155
--tag=TAG use configuration variables from tag TAG
6156
--version print version information
6158
MODE must be one of the following:
6160
clean remove files from the build directory
6161
compile compile a source file into a libtool object
6162
execute automatically set library path, then run a program
6163
finish complete the installation of libtool libraries
6164
install install libraries or executables
6165
link create a library or an executable
6166
uninstall remove libraries from an installed directory
6168
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6169
a more detailed description of MODE.
6171
Report bugs to <bug-libtool@gnu.org>."
6177
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6179
Remove files from the build directory.
6181
RM is the name of the program to use to delete files associated with each FILE
6182
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6185
If FILE is a libtool library, object or program, all the files associated
6186
with it are deleted. Otherwise, only FILE itself is deleted using RM."
6191
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6193
Compile a source file into a libtool library object.
6195
This mode accepts the following additional options:
6197
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
6198
-prefer-pic try to building PIC objects only
6199
-prefer-non-pic try to building non-PIC objects only
6200
-static always build a \`.o' file suitable for static linking
6202
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6203
from the given SOURCEFILE.
6205
The output file name is determined by removing the directory component from
6206
SOURCEFILE, then substituting the C source code suffix \`.c' with the
6207
library object suffix, \`.lo'."
6212
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6214
Automatically set library path, then run a program.
6216
This mode accepts the following additional options:
6218
-dlopen FILE add the directory containing FILE to the library path
6220
This mode sets the library path environment variable according to \`-dlopen'
6223
If any of the ARGS are libtool executable wrappers, then they are translated
6224
into their corresponding uninstalled binary, and any of their required library
6225
directories are added to the library path.
6227
Then, COMMAND is executed, with ARGS as arguments."
6232
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6234
Complete the installation of libtool libraries.
6236
Each LIBDIR is a directory that contains libtool libraries.
6238
The commands that this mode executes may require superuser privileges. Use
6239
the \`--dry-run' option if you just want to see what would be executed."
6244
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6246
Install executables or libraries.
6248
INSTALL-COMMAND is the installation command. The first component should be
6249
either the \`install' or \`cp' program.
6251
The rest of the components are interpreted as arguments to that command (only
6252
BSD-compatible install options are recognized)."
6257
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6259
Link object files or libraries together to form another library, or to
6260
create an executable program.
6262
LINK-COMMAND is a command using the C compiler that you would use to create
6263
a program from several object files.
6265
The following components of LINK-COMMAND are treated specially:
6267
-all-static do not do any dynamic linking at all
6268
-avoid-version do not add a version suffix if possible
6269
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6270
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6271
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6272
-export-symbols SYMFILE
6273
try to export only the symbols listed in SYMFILE
6274
-export-symbols-regex REGEX
6275
try to export only the symbols matching REGEX
6276
-LLIBDIR search LIBDIR for required installed libraries
6277
-lNAME OUTPUT-FILE requires the installed library libNAME
6278
-module build a library that can dlopened
6279
-no-fast-install disable the fast-install mode
6280
-no-install link a not-installable executable
6281
-no-undefined declare that a library does not refer to external symbols
6282
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6283
-objectlist FILE Use a list of object files found in FILE to specify objects
6284
-release RELEASE specify package release information
6285
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6286
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6287
-static do not do any dynamic linking of libtool libraries
6288
-version-info CURRENT[:REVISION[:AGE]]
6289
specify library version info [each variable defaults to 0]
6291
All other options (arguments beginning with \`-') are ignored.
6293
Every other argument is treated as a filename. Files ending in \`.la' are
6294
treated as uninstalled libtool libraries, other files are standard or library
6297
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6298
only library objects (\`.lo' files) may be specified, and \`-rpath' is
6299
required, except when creating a convenience library.
6301
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6302
using \`ar' and \`ranlib', or on Windows using \`lib'.
6304
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6305
is created, otherwise an executable program is created."
6310
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6312
Remove libraries from an installation directory.
6314
RM is the name of the program to use to delete files associated with each FILE
6315
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6318
If FILE is a libtool library, all the files associated with it are deleted.
6319
Otherwise, only FILE itself is deleted using RM."
6323
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6330
$echo "Try \`$modename --help' for more information about other modes."
6334
# The TAGs below are defined such that we never get into a situation
6335
# in which we disable both kinds of libraries. Given conflicting
6336
# choices, we go for a static library, that is the most portable,
6337
# since we can't tell whether shared libraries were disabled because
6338
# the user asked for that or because the platform doesn't support
6339
# them. This is particularly important on AIX, because we don't
6340
# support having both static and shared libraries enabled at the same
6341
# time on that platform, so we default to a shared-only configuration.
6342
# If a disable-shared tag is given, we'll fallback to a static-only
6343
# configuration. But we'll never go from static-only to shared-only.
6345
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6346
build_libtool_libs=no
6348
# ### END LIBTOOL TAG CONFIG: disable-shared
6350
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6351
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6352
# ### END LIBTOOL TAG CONFIG: disable-static