1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
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.
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30
# is ksh but when the shell is invoked as "sh" and the current value of
31
# the _XPG environment variable is not equal to 1 (one), the special
32
# positional parameter $0, within a function call, is the name of the
36
# define SED for historic ltconfig's generated by Libtool 1.3
37
test -z "$SED" && SED=sed
39
# The name of this program:
40
progname=`echo "$progpath" | $SED $basename`
50
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
53
# Check that we have a working $echo.
54
if test "X$1" = X--no-reexec; then
55
# Discard the --no-reexec flag, and continue.
57
elif test "X$1" = X--fallback-echo; then
58
# Avoid inline document here, it may be left over
60
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
61
# Yippee, $echo works!
64
# Restart under the correct shell, and then maybe $echo will work.
65
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
68
if test "X$1" = X--fallback-echo; then
69
# used as fallback echo
78
help="Try \`$progname --help' for more information."
79
magic="%%%MAGIC variable%%%"
84
# Sed substitution that helps us do robust quoting. It backslashifies
85
# metacharacters that are still active within double-quoted strings.
86
Xsed="${SED}"' -e 1s/^X//'
87
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
88
# test EBCDIC or ASCII
89
case `echo A|tr A '\301'` in
90
A) # EBCDIC based system
91
SP2NL="tr '\100' '\n'"
92
NL2SP="tr '\r\n' '\100\100'"
94
*) # Assume ASCII based system
95
SP2NL="tr '\040' '\012'"
96
NL2SP="tr '\015\012' '\040\040'"
101
# Only set LANG and LC_ALL to C if already set.
102
# These must not be set unconditionally because not all systems understand
103
# e.g. LANG=C (notably SCO).
104
# We save the old values to restore during execute mode.
105
if test "${LC_ALL+set}" = set; then
106
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
108
if test "${LANG+set}" = set; then
109
save_LANG="$LANG"; LANG=C; export LANG
112
# Make sure IFS has a sensible default
116
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
117
$echo "$modename: not configured to build any kind of library" 1>&2
118
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
131
lo2o="s/\\.lo\$/.${objext}/"
132
o2lo="s/\\.${objext}\$/.lo/"
134
#####################################
135
# Shell function definitions:
136
# This seems to be the best place for them
138
# func_win32_libid arg
139
# return the library type of file 'arg'
141
# Need a lot of goo to handle *both* DLLs and import libs
142
# Has to be a shell function in order to 'eat' the argument
143
# that is supplied when $file_magic_command is called.
144
func_win32_libid () {
145
win32_libid_type="unknown"
146
win32_fileres=`file -L $1 2>/dev/null`
147
case $win32_fileres in
148
*ar\ archive\ import\ library*) # definitely import
149
win32_libid_type="x86 archive import"
151
*ar\ archive*) # could be an import, or static
152
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
153
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
154
win32_nmres=`eval $NM -f posix -A $1 | \
155
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
156
if test "X$win32_nmres" = "Ximport" ; then
157
win32_libid_type="x86 archive import"
159
win32_libid_type="x86 archive static"
164
win32_libid_type="x86 DLL"
166
*executable*) # but shell scripts are "executable" too...
167
case $win32_fileres in
168
*MS\ Windows\ PE\ Intel*)
169
win32_libid_type="x86 DLL"
174
$echo $win32_libid_type
179
# Infer tagged configuration to use if any are available and
180
# if one wasn't chosen via the "--tag" command line option.
181
# Only attempt this if the compiler in the base compile
182
# command doesn't match the default compiler.
183
# arg is usually of the form 'gcc ...'
185
if test -n "$available_tags" && test -z "$tagname"; then
189
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
193
CC_quoted="$CC_quoted $arg"
196
# Blanks in the command may have been stripped by the calling shell,
197
# but not from the CC environment variable when configure was run.
198
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
199
# Blanks at the start of $base_compile will cause this to fail
200
# if we don't check for them as well.
202
for z in $available_tags; do
203
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
204
# Evaluate the configuration.
205
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
208
# Double-quote args containing other shell metacharacters.
210
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
214
CC_quoted="$CC_quoted $arg"
217
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
218
# The compiler in the base compile command matches
219
# the one in the tagged configuration.
220
# Assume this is the tagged configuration we want.
227
# If $tagname still isn't set, then no tagged configuration
228
# was found and let the user know that the "--tag" command
229
# line option must be used.
230
if test -z "$tagname"; then
231
$echo "$modename: unable to infer tagged configuration"
232
$echo "$modename: specify a tag with \`--tag'" 1>&2
235
# $echo "$modename: using $tagname tagged configuration"
241
# End of Shell function definitions
242
#####################################
245
#eval std_shrext=\"$shrext_cmds\"
247
# And fixing for Darwin sucks for everybody else
248
if test -z "$shrext_cmds" && test -n "$shrext"; then
249
eval shrext_cmds=\"$shrext\"
251
eval std_shrext=\"$shrext_cmds\"
253
# This value is evaluated to 32768, so place it here as a compatilibity hack
254
# because older libtool.m4 didn't define this variable
255
test -z "$max_cmd_len" && max_cmd_len=32768
257
# Parse our command line options once, thoroughly.
258
while test "$#" -gt 0
264
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
268
# If the previous option needs an argument, assign it.
269
if test -n "$prev"; then
272
execute_dlfiles="$execute_dlfiles $arg"
276
preserve_args="${preserve_args}=$arg"
278
# Check whether tagname contains only valid characters
281
$echo "$progname: invalid tag name: $tagname" 1>&2
288
# Don't test for the "default" C tag, as we know, it's there, but
289
# not specially marked.
292
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
293
taglist="$taglist $tagname"
294
# Evaluate the configuration.
295
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
297
$echo "$progname: ignoring unknown tag $tagname" 1>&2
312
# Have we seen a non-optional argument yet?
319
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
321
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
322
$echo "This is free software; see the source for copying conditions. There is NO"
323
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
328
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
329
# Now print the configurations for the tags.
330
for tagname in $taglist; do
331
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
337
$echo "$progname: enabling shell trace mode"
339
preserve_args="$preserve_args $arg"
348
if test "$build_libtool_libs" = yes; then
349
$echo "enable shared libraries"
351
$echo "disable shared libraries"
353
if test "$build_old_libs" = yes; then
354
$echo "enable static libraries"
356
$echo "disable static libraries"
361
--finish) mode="finish" ;;
363
--mode) prevopt="--mode" prev=mode ;;
364
--mode=*) mode="$optarg" ;;
366
--preserve-dup-deps) duplicate_deps="yes" ;;
370
preserve_args="$preserve_args $arg"
373
--tag) prevopt="--tag" prev=tag ;;
375
set tag "$optarg" ${1+"$@"}
378
preserve_args="$preserve_args --tag"
387
$echo "$modename: unrecognized option \`$arg'" 1>&2
399
if test -n "$prevopt"; then
400
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
405
# If this variable is set in any of the actions, the command in it
406
# will be execed at the end. This prevents here-documents from being
407
# left over by shells.
410
if test -z "$show_help"; then
412
# Infer the operation mode.
413
if test -z "$mode"; then
414
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
415
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
417
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
429
*db | *dbx | *strace | *truss)
439
# If we have no mode, but dlfiles were specified, then do execute mode.
440
test -n "$execute_dlfiles" && mode=execute
442
# Just use the default operation mode.
443
if test -z "$mode"; then
444
if test -n "$nonopt"; then
445
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
447
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
454
# Only execute mode is allowed to have -dlopen flags.
455
if test -n "$execute_dlfiles" && test "$mode" != execute; then
456
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
461
# Change the help message to a mode-specific one.
463
help="Try \`$modename --help --mode=$mode' for more information."
465
# These modes are in order of execution frequency so that they run quickly.
467
# libtool compile mode
469
modename="$modename: compile"
470
# Get the compilation command and the source file.
472
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
483
# do not "continue". Instead, add this to base_compile
495
# Accept any command-line options.
498
if test -n "$libobj" ; then
499
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
506
-static | -prefer-pic | -prefer-non-pic)
517
arg_mode=arg # the next one goes into the "base_compile" arg list
518
continue # The current "srcfile" will either be retained or
519
;; # replaced later. I would guess that would be a bug.
522
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
524
save_ifs="$IFS"; IFS=','
528
# Double-quote args containing other shell metacharacters.
529
# Many Bourne shells cannot handle close brackets correctly
530
# in scan sets, so we specify it separately.
532
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
536
lastarg="$lastarg $arg"
539
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
541
# Add the arguments to base_compile.
542
base_compile="$base_compile $lastarg"
547
# Accept the current argument as the source file.
548
# The previous "srcfile" becomes the current argument.
555
esac # case $arg_mode
557
# Aesthetically quote the previous argument.
558
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
561
# Double-quote args containing other shell metacharacters.
562
# Many Bourne shells cannot handle close brackets correctly
563
# in scan sets, so we specify it separately.
564
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
565
lastarg="\"$lastarg\""
569
base_compile="$base_compile $lastarg"
574
$echo "$modename: you must specify an argument for -Xcompile"
578
$echo "$modename: you must specify a target with \`-o'" 1>&2
582
# Get the name of the library object.
583
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
587
# Recognize several different file suffixes.
588
# If the user specifies -o file.o, it is replaced with file.lo
598
*.class) xform=class ;;
603
*.java) xform=java ;;
606
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
609
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
611
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
616
func_infer_tag $base_compile
618
for arg in $later; do
637
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
638
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
639
if test "X$xdir" = "X$obj"; then
644
lobj=${xdir}$objdir/$objname
646
if test -z "$base_compile"; then
647
$echo "$modename: you must specify a compilation command" 1>&2
652
# Delete any leftover library objects.
653
if test "$build_old_libs" = yes; then
654
removelist="$obj $lobj $libobj ${libobj}T"
656
removelist="$lobj $libobj ${libobj}T"
660
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
662
# On Cygwin there's no "real" PIC flag so we must build both object types
664
cygwin* | mingw* | pw32* | os2*)
668
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
669
# non-PIC code in shared libraries is not supported
673
# Calculate the filename of the output object if compiler does
674
# not support -o with -c
675
if test "$compiler_c_o" = no; then
676
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
677
lockfile="$output_obj.lock"
678
removelist="$removelist $output_obj $lockfile"
679
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
686
# Lock this critical section if it is needed
687
# We use this script file to make the link, it avoids creating a new file
688
if test "$need_locks" = yes; then
689
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
690
$show "Waiting for $lockfile to be removed"
693
elif test "$need_locks" = warn; then
694
if test -f "$lockfile"; then
696
*** ERROR, $lockfile exists and contains:
697
`cat $lockfile 2>/dev/null`
699
This indicates that another process is trying to use the same
700
temporary object file, and libtool could not work around it because
701
your compiler does not support \`-c' and \`-o' together. If you
702
repeat this compilation, it may succeed, by chance, but you had better
703
avoid parallel builds (make -j) in this platform, or get a better
709
$echo $srcfile > "$lockfile"
712
if test -n "$fix_srcfile_path"; then
713
eval srcfile=\"$fix_srcfile_path\"
716
$run $rm "$libobj" "${libobj}T"
718
# Create a libtool object file (analogous to a ".la" file),
719
# but don't create it if we're doing a dry run.
720
test -z "$run" && cat > ${libobj}T <<EOF
721
# $libobj - a libtool object file
722
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
724
# Please DO NOT delete this file!
725
# It is necessary for linking the library.
727
# Name of the PIC object.
730
# Only build a PIC object if we are building libtool libraries.
731
if test "$build_libtool_libs" = yes; then
732
# Without this assignment, base_compile gets emptied.
733
fbsd_hideous_sh_bug=$base_compile
735
if test "$pic_mode" != no; then
736
command="$base_compile $srcfile $pic_flag"
738
# Don't build PIC code
739
command="$base_compile $srcfile"
742
if test ! -d "${xdir}$objdir"; then
743
$show "$mkdir ${xdir}$objdir"
744
$run $mkdir ${xdir}$objdir
746
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
751
if test -z "$output_obj"; then
752
# Place PIC objects in $objdir
753
command="$command -o $lobj"
756
$run $rm "$lobj" "$output_obj"
759
if $run eval "$command"; then :
761
test -n "$output_obj" && $run $rm $removelist
765
if test "$need_locks" = warn &&
766
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
768
*** ERROR, $lockfile contains:
769
`cat $lockfile 2>/dev/null`
771
but it should contain:
774
This indicates that another process is trying to use the same
775
temporary object file, and libtool could not work around it because
776
your compiler does not support \`-c' and \`-o' together. If you
777
repeat this compilation, it may succeed, by chance, but you had better
778
avoid parallel builds (make -j) in this platform, or get a better
785
# Just move the object if needed, then go on to compile the next one
786
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
787
$show "$mv $output_obj $lobj"
788
if $run $mv $output_obj $lobj; then :
796
# Append the name of the PIC object to the libtool object file.
797
test -z "$run" && cat >> ${libobj}T <<EOF
798
pic_object='$objdir/$objname'
802
# Allow error messages only from the first compilation.
803
if test "$suppress_opt" = yes; then
804
suppress_output=' >/dev/null 2>&1'
807
# No PIC object so indicate it doesn't exist in the libtool
809
test -z "$run" && cat >> ${libobj}T <<EOF
815
# Only build a position-dependent object if we build old libraries.
816
if test "$build_old_libs" = yes; then
817
if test "$pic_mode" != yes; then
818
# Don't build PIC code
819
command="$base_compile $srcfile"
821
command="$base_compile $srcfile $pic_flag"
823
if test "$compiler_c_o" = yes; then
824
command="$command -o $obj"
827
# Suppress compiler output if we already did a PIC compilation.
828
command="$command$suppress_output"
829
$run $rm "$obj" "$output_obj"
831
if $run eval "$command"; then :
837
if test "$need_locks" = warn &&
838
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
840
*** ERROR, $lockfile contains:
841
`cat $lockfile 2>/dev/null`
843
but it should contain:
846
This indicates that another process is trying to use the same
847
temporary object file, and libtool could not work around it because
848
your compiler does not support \`-c' and \`-o' together. If you
849
repeat this compilation, it may succeed, by chance, but you had better
850
avoid parallel builds (make -j) in this platform, or get a better
857
# Just move the object if needed
858
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
859
$show "$mv $output_obj $obj"
860
if $run $mv $output_obj $obj; then :
868
# Append the name of the non-PIC object the libtool object file.
869
# Only append if the libtool object file exists.
870
test -z "$run" && cat >> ${libobj}T <<EOF
871
# Name of the non-PIC object.
872
non_pic_object='$objname'
876
# Append the name of the non-PIC object the libtool object file.
877
# Only append if the libtool object file exists.
878
test -z "$run" && cat >> ${libobj}T <<EOF
879
# Name of the non-PIC object.
885
$run $mv "${libobj}T" "${libobj}"
887
# Unlock the critical section if it was locked
888
if test "$need_locks" != no; then
897
modename="$modename: link"
899
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
900
# It is impossible to link a dll without this setting, and
901
# we shouldn't force the makefile maintainer to figure out
902
# which system we are compiling for in order to pass an extra
903
# flag for every libtool invocation.
906
# FIXME: Unfortunately, there are problems with the above when trying
907
# to make a dll which has undefined symbols, in which case not
908
# even a static library is built. For now, we need to specify
909
# -no-undefined on the libtool link line when we can be certain
910
# that all symbols are satisfied, otherwise we get a static library.
917
libtool_args="$nonopt"
918
base_compile="$nonopt $@"
919
compile_command="$nonopt"
920
finalize_command="$nonopt"
933
lib_search_path=`pwd`
942
export_symbols_regex=
950
precious_files_regex=
951
prefer_static_libs=no
964
func_infer_tag $base_compile
966
# We need to know -static, to get the right output filenames.
970
-all-static | -static)
971
if test "X$arg" = "X-all-static"; then
972
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
973
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
975
if test -n "$link_static_flag"; then
976
dlopen_self=$dlopen_self_static
979
if test -z "$pic_flag" && test -n "$link_static_flag"; then
980
dlopen_self=$dlopen_self_static
983
build_libtool_libs=no
985
prefer_static_libs=yes
991
# See if our shared archives depend on static archives.
992
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
994
# Go through the arguments, transforming them on the way.
995
while test "$#" -gt 0; do
999
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1000
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1004
libtool_args="$libtool_args $qarg"
1006
# If the previous option needs an argument, assign it.
1007
if test -n "$prev"; then
1010
compile_command="$compile_command @OUTPUT@"
1011
finalize_command="$finalize_command @OUTPUT@"
1017
if test "$preload" = no; then
1018
# Add the symbol object into the linking commands.
1019
compile_command="$compile_command @SYMFILE@"
1020
finalize_command="$finalize_command @SYMFILE@"
1024
*.la | *.lo) ;; # We handle these cases below.
1026
if test "$dlself" = no; then
1034
if test "$prev" = dlprefiles; then
1036
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1046
if test "$prev" = dlfiles; then
1047
dlfiles="$dlfiles $arg"
1049
dlprefiles="$dlprefiles $arg"
1057
export_symbols="$arg"
1058
if test ! -f "$arg"; then
1059
$echo "$modename: symbol file \`$arg' does not exist"
1066
export_symbols_regex="$arg"
1071
inst_prefix_dir="$arg"
1076
precious_files_regex="$arg"
1086
if test -f "$arg"; then
1089
for fil in `cat $save_arg`
1091
# moreargs="$moreargs $fil"
1093
# A libtool-controlled object.
1095
# Check to see that this really is a libtool object.
1096
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1101
# If there is no directory component, then add one.
1103
*/* | *\\*) . $arg ;;
1107
if test -z "$pic_object" || \
1108
test -z "$non_pic_object" ||
1109
test "$pic_object" = none && \
1110
test "$non_pic_object" = none; then
1111
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1115
# Extract subdirectory from the argument.
1116
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1117
if test "X$xdir" = "X$arg"; then
1123
if test "$pic_object" != none; then
1124
# Prepend the subdirectory the object is found in.
1125
pic_object="$xdir$pic_object"
1127
if test "$prev" = dlfiles; then
1128
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1129
dlfiles="$dlfiles $pic_object"
1133
# If libtool objects are unsupported, then we need to preload.
1138
# CHECK ME: I think I busted this. -Ossama
1139
if test "$prev" = dlprefiles; then
1140
# Preload the old-style object.
1141
dlprefiles="$dlprefiles $pic_object"
1146
libobjs="$libobjs $pic_object"
1151
if test "$non_pic_object" != none; then
1152
# Prepend the subdirectory the object is found in.
1153
non_pic_object="$xdir$non_pic_object"
1155
# A standard non-PIC object
1156
non_pic_objects="$non_pic_objects $non_pic_object"
1157
if test -z "$pic_object" || test "$pic_object" = none ; then
1158
arg="$non_pic_object"
1162
# Only an error if not doing a dry-run.
1163
if test -z "$run"; then
1164
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1169
# Extract subdirectory from the argument.
1170
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1171
if test "X$xdir" = "X$arg"; then
1177
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1178
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1179
libobjs="$libobjs $pic_object"
1180
non_pic_objects="$non_pic_objects $non_pic_object"
1185
$echo "$modename: link input file \`$save_arg' does not exist"
1193
# We need an absolute path.
1195
[\\/]* | [A-Za-z]:[\\/]*) ;;
1197
$echo "$modename: only absolute run-paths are allowed" 1>&2
1201
if test "$prev" = rpath; then
1204
*) rpath="$rpath $arg" ;;
1209
*) xrpath="$xrpath $arg" ;;
1216
compiler_flags="$compiler_flags $qarg"
1218
compile_command="$compile_command $qarg"
1219
finalize_command="$finalize_command $qarg"
1223
linker_flags="$linker_flags $qarg"
1224
compiler_flags="$compiler_flags $wl$qarg"
1226
compile_command="$compile_command $wl$qarg"
1227
finalize_command="$finalize_command $wl$qarg"
1231
linker_flags="$linker_flags $qarg"
1232
compiler_flags="$compiler_flags $qarg"
1234
compile_command="$compile_command $qarg"
1235
finalize_command="$finalize_command $qarg"
1244
eval "$prev=\"\$arg\""
1249
fi # test -n "$prev"
1255
if test -n "$link_static_flag"; then
1256
compile_command="$compile_command $link_static_flag"
1257
finalize_command="$finalize_command $link_static_flag"
1263
# FIXME: remove this flag sometime in the future.
1264
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1288
-export-symbols | -export-symbols-regex)
1289
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1290
$echo "$modename: more than one -exported-symbols argument is not allowed"
1293
if test "X$arg" = "X-export-symbols"; then
1306
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1307
# so, if we see these flags be careful not to treat them like -L
1309
case $with_gcc/$host in
1310
no/*-*-irix* | /*-*-irix*)
1311
compile_command="$compile_command $arg"
1312
finalize_command="$finalize_command $arg"
1319
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1320
# We need an absolute path.
1322
[\\/]* | [A-Za-z]:[\\/]*) ;;
1324
absdir=`cd "$dir" && pwd`
1325
if test -z "$absdir"; then
1326
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1335
deplibs="$deplibs -L$dir"
1336
lib_search_path="$lib_search_path $dir"
1340
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1341
case :$dllsearchpath: in
1343
*) dllsearchpath="$dllsearchpath:$dir";;
1351
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1353
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1354
# These systems don't actually have a C or math library (as such)
1357
*-*-mingw* | *-*-os2*)
1358
# These systems don't actually have a C library (as such)
1359
test "X$arg" = "X-lc" && continue
1361
*-*-openbsd* | *-*-freebsd*)
1362
# Do not include libc due to us having libc/libc_r.
1363
test "X$arg" = "X-lc" && continue
1365
*-*-rhapsody* | *-*-darwin1.[012])
1366
# Rhapsody C and math libraries are in the System framework
1367
deplibs="$deplibs -framework System"
1370
elif test "X$arg" = "X-lc_r"; then
1372
*-*-openbsd* | *-*-freebsd*)
1373
# Do not include libc_r directly, use -pthread flag.
1378
deplibs="$deplibs $arg"
1382
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1383
deplibs="$deplibs $arg"
1392
# gcc -m* arguments should be passed to the linker via $compiler_flags
1393
# in order to pass architecture information to the linker
1394
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1395
# but this is not reliable with gcc because gcc may use -mfoo to
1396
# select a different linker, different libraries, etc, while
1397
# -Wl,-mfoo simply passes -mfoo to the linker.
1399
# Unknown arguments in both finalize_command and compile_command need
1400
# to be aesthetically quoted because they are evaled later.
1401
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1403
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1407
compile_command="$compile_command $arg"
1408
finalize_command="$finalize_command $arg"
1409
if test "$with_gcc" = "yes" ; then
1410
compiler_flags="$compiler_flags $arg"
1427
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1428
# The PATH hackery in wrapper scripts is required on Windows
1429
# in order for the loader to find any dlls it needs.
1430
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1431
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1434
*) no_install=yes ;;
1451
-precious-files-regex)
1472
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1473
# We need an absolute path.
1475
[\\/]* | [A-Za-z]:[\\/]*) ;;
1477
$echo "$modename: only absolute run-paths are allowed" 1>&2
1483
*) xrpath="$xrpath $dir" ;;
1489
# The effects of -static are defined in a previous loop.
1490
# We used to do the same as -all-static on platforms that
1491
# didn't have a PIC flag, but the assumption that the effects
1492
# would be equivalent was wrong. It would break on at least
1493
# Digital Unix and AIX.
1513
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1515
save_ifs="$IFS"; IFS=','
1516
for flag in $args; do
1519
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1524
compiler_flags="$compiler_flags $flag"
1527
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1531
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1533
save_ifs="$IFS"; IFS=','
1534
for flag in $args; do
1537
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1542
compiler_flags="$compiler_flags $wl$flag"
1543
linker_flags="$linker_flags $flag"
1546
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1564
# Some other compiler flag.
1566
# Unknown arguments in both finalize_command and compile_command need
1567
# to be aesthetically quoted because they are evaled later.
1568
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1570
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1577
# A standard object.
1582
# A libtool-controlled object.
1584
# Check to see that this really is a libtool object.
1585
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1590
# If there is no directory component, then add one.
1592
*/* | *\\*) . $arg ;;
1596
if test -z "$pic_object" || \
1597
test -z "$non_pic_object" ||
1598
test "$pic_object" = none && \
1599
test "$non_pic_object" = none; then
1600
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1604
# Extract subdirectory from the argument.
1605
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1606
if test "X$xdir" = "X$arg"; then
1612
if test "$pic_object" != none; then
1613
# Prepend the subdirectory the object is found in.
1614
pic_object="$xdir$pic_object"
1616
if test "$prev" = dlfiles; then
1617
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1618
dlfiles="$dlfiles $pic_object"
1622
# If libtool objects are unsupported, then we need to preload.
1627
# CHECK ME: I think I busted this. -Ossama
1628
if test "$prev" = dlprefiles; then
1629
# Preload the old-style object.
1630
dlprefiles="$dlprefiles $pic_object"
1635
libobjs="$libobjs $pic_object"
1640
if test "$non_pic_object" != none; then
1641
# Prepend the subdirectory the object is found in.
1642
non_pic_object="$xdir$non_pic_object"
1644
# A standard non-PIC object
1645
non_pic_objects="$non_pic_objects $non_pic_object"
1646
if test -z "$pic_object" || test "$pic_object" = none ; then
1647
arg="$non_pic_object"
1651
# Only an error if not doing a dry-run.
1652
if test -z "$run"; then
1653
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1658
# Extract subdirectory from the argument.
1659
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1660
if test "X$xdir" = "X$arg"; then
1666
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1667
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1668
libobjs="$libobjs $pic_object"
1669
non_pic_objects="$non_pic_objects $non_pic_object"
1676
deplibs="$deplibs $arg"
1677
old_deplibs="$old_deplibs $arg"
1682
# A libtool-controlled library.
1684
if test "$prev" = dlfiles; then
1685
# This library was specified with -dlopen.
1686
dlfiles="$dlfiles $arg"
1688
elif test "$prev" = dlprefiles; then
1689
# The library was specified with -dlpreopen.
1690
dlprefiles="$dlprefiles $arg"
1693
deplibs="$deplibs $arg"
1698
# Some other compiler argument.
1700
# Unknown arguments in both finalize_command and compile_command need
1701
# to be aesthetically quoted because they are evaled later.
1702
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1704
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1711
# Now actually substitute the argument into the commands.
1712
if test -n "$arg"; then
1713
compile_command="$compile_command $arg"
1714
finalize_command="$finalize_command $arg"
1716
done # argument parsing loop
1718
if test -n "$prev"; then
1719
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1724
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1725
eval arg=\"$export_dynamic_flag_spec\"
1726
compile_command="$compile_command $arg"
1727
finalize_command="$finalize_command $arg"
1731
# calculate the name of the file, without its directory
1732
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1733
libobjs_save="$libobjs"
1735
if test -n "$shlibpath_var"; then
1736
# get the directories listed in $shlibpath_var
1737
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1741
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1742
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1744
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1745
if test "X$output_objdir" = "X$output"; then
1746
output_objdir="$objdir"
1748
output_objdir="$output_objdir/$objdir"
1750
# Create the object directory.
1751
if test ! -d "$output_objdir"; then
1752
$show "$mkdir $output_objdir"
1753
$run $mkdir $output_objdir
1755
if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1760
# Determine the type of output
1763
$echo "$modename: you must specify an output file" 1>&2
1767
*.$libext) linkmode=oldlib ;;
1768
*.lo | *.$objext) linkmode=obj ;;
1769
*.la) linkmode=lib ;;
1770
*) linkmode=prog ;; # Anything else should be a program.
1774
*cygwin* | *mingw* | *pw32*)
1775
# don't eliminate duplications in $postdeps and $predeps
1776
duplicate_compiler_generated_deps=yes
1779
duplicate_compiler_generated_deps=$duplicate_deps
1785
# Find all interdependent deplibs by searching for libraries
1786
# that are linked more than once (e.g. -la -lb -la)
1787
for deplib in $deplibs; do
1788
if test "X$duplicate_deps" = "Xyes" ; then
1790
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1793
libs="$libs $deplib"
1796
if test "$linkmode" = lib; then
1797
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1799
# Compute libraries that are listed more than once in $predeps
1800
# $postdeps and mark them as special (i.e., whose duplicates are
1801
# not to be eliminated).
1803
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1804
for pre_post_dep in $predeps $postdeps; do
1805
case "$pre_post_deps " in
1806
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1808
pre_post_deps="$pre_post_deps $pre_post_dep"
1817
need_relink=no # whether we're linking any uninstalled libtool libraries
1818
notinst_deplibs= # not-installed libtool libraries
1819
notinst_path= # paths that contain not-installed libtool libraries
1823
for file in $dlfiles $dlprefiles; do
1827
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1839
passes="conv scan dlopen dlpreopen link"
1844
for pass in $passes; do
1845
if test "$linkmode,$pass" = "lib,link" ||
1846
test "$linkmode,$pass" = "prog,scan"; then
1850
if test "$linkmode" = prog; then
1852
dlopen) libs="$dlfiles" ;;
1853
dlpreopen) libs="$dlprefiles" ;;
1854
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1857
if test "$pass" = dlopen; then
1858
# Collect dlpreopened libraries
1859
save_deplibs="$deplibs"
1862
for deplib in $libs; do
1866
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1867
if test "$linkmode,$pass" = "prog,link"; then
1868
compile_deplibs="$deplib $compile_deplibs"
1869
finalize_deplibs="$deplib $finalize_deplibs"
1871
deplibs="$deplib $deplibs"
1876
if test "$linkmode" != lib && test "$linkmode" != prog; then
1877
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1880
if test "$pass" = conv; then
1881
deplibs="$deplib $deplibs"
1884
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1885
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1886
for search_ext in .la $std_shrext .so .a; do
1887
# Search the libtool library
1888
lib="$searchdir/lib${name}${search_ext}"
1889
if test -f "$lib"; then
1890
if test "$search_ext" = ".la"; then
1899
if test "$found" != yes; then
1900
# deplib doesn't seem to be a libtool library
1901
if test "$linkmode,$pass" = "prog,link"; then
1902
compile_deplibs="$deplib $compile_deplibs"
1903
finalize_deplibs="$deplib $finalize_deplibs"
1905
deplibs="$deplib $deplibs"
1906
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1909
else # deplib is a libtool library
1910
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1911
# We need to do some special things here, and not later.
1912
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1913
case " $predeps $postdeps " in
1915
if (${SED} -e '2q' $lib |
1916
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1920
*/* | *\\*) . $lib ;;
1923
for l in $old_library $library_names; do
1926
if test "X$ll" = "X$old_library" ; then # only static version available
1928
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1929
test "X$ladir" = "X$lib" && ladir="."
1930
lib=$ladir/$old_library
1931
if test "$linkmode,$pass" = "prog,link"; then
1932
compile_deplibs="$deplib $compile_deplibs"
1933
finalize_deplibs="$deplib $finalize_deplibs"
1935
deplibs="$deplib $deplibs"
1936
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1950
deplibs="$deplib $deplibs"
1951
test "$pass" = conv && continue
1952
newdependency_libs="$deplib $newdependency_libs"
1953
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1956
if test "$pass" = conv; then
1957
deplibs="$deplib $deplibs"
1960
if test "$pass" = scan; then
1961
deplibs="$deplib $deplibs"
1963
compile_deplibs="$deplib $compile_deplibs"
1964
finalize_deplibs="$deplib $finalize_deplibs"
1966
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1969
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1975
if test "$pass" = link; then
1976
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1977
# Make sure the xrpath contains only unique directories.
1980
*) xrpath="$xrpath $dir" ;;
1983
deplibs="$deplib $deplibs"
1986
*.la) lib="$deplib" ;;
1988
if test "$pass" = conv; then
1989
deplibs="$deplib $deplibs"
1994
if test "$deplibs_check_method" != pass_all; then
1996
$echo "*** Warning: Trying to link with static lib archive $deplib."
1997
$echo "*** I have the capability to make that library automatically link in when"
1998
$echo "*** you link to this library. But I can only do this if you have a"
1999
$echo "*** shared version of the library, which you do not appear to have"
2000
$echo "*** because the file extensions .$libext of this argument makes me believe"
2001
$echo "*** that it is just a static archive that I should not used here."
2004
$echo "*** Warning: Linking the shared library $output against the"
2005
$echo "*** static library $deplib is not portable!"
2006
deplibs="$deplib $deplibs"
2011
if test "$pass" != link; then
2012
deplibs="$deplib $deplibs"
2014
compile_deplibs="$deplib $compile_deplibs"
2015
finalize_deplibs="$deplib $finalize_deplibs"
2022
if test "$pass" = conv; then
2023
deplibs="$deplib $deplibs"
2024
elif test "$linkmode" = prog; then
2025
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2026
# If there is no dlopen support or we're linking statically,
2027
# we need to preload.
2028
newdlprefiles="$newdlprefiles $deplib"
2029
compile_deplibs="$deplib $compile_deplibs"
2030
finalize_deplibs="$deplib $finalize_deplibs"
2032
newdlfiles="$newdlfiles $deplib"
2042
if test "$found" = yes || test -f "$lib"; then :
2044
$echo "$modename: cannot find the library \`$lib'" 1>&2
2048
# Check to see that this really is a libtool archive.
2049
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2051
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2055
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2056
test "X$ladir" = "X$lib" && ladir="."
2064
# If the library was installed with an old release of libtool,
2065
# it will not redefine variables installed, or shouldnotlink
2071
*/* | *\\*) . $lib ;;
2075
if test "$linkmode,$pass" = "lib,link" ||
2076
test "$linkmode,$pass" = "prog,scan" ||
2077
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2078
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2079
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2082
if test "$pass" = conv; then
2083
# Only check for convenience libraries
2084
deplibs="$lib $deplibs"
2085
if test -z "$libdir"; then
2086
if test -z "$old_library"; then
2087
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2090
# It is a libtool convenience library, so add in its objects.
2091
convenience="$convenience $ladir/$objdir/$old_library"
2092
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2094
for deplib in $dependency_libs; do
2095
deplibs="$deplib $deplibs"
2096
if test "X$duplicate_deps" = "Xyes" ; then
2097
case "$tmp_libs " in
2098
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2101
tmp_libs="$tmp_libs $deplib"
2103
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2104
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2111
# Get the name of the library we link against.
2113
for l in $old_library $library_names; do
2116
if test -z "$linklib"; then
2117
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2121
# This library was specified with -dlopen.
2122
if test "$pass" = dlopen; then
2123
if test -z "$libdir"; then
2124
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2127
if test -z "$dlname" ||
2128
test "$dlopen_support" != yes ||
2129
test "$build_libtool_libs" = no; then
2130
# If there is no dlname, no dlopen support or we're linking
2131
# statically, we need to preload. We also need to preload any
2132
# dependent libraries so libltdl's deplib preloader doesn't
2133
# bomb out in the load deplibs phase.
2134
dlprefiles="$dlprefiles $lib $dependency_libs"
2136
newdlfiles="$newdlfiles $lib"
2141
# We need an absolute path.
2143
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2145
abs_ladir=`cd "$ladir" && pwd`
2146
if test -z "$abs_ladir"; then
2147
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2148
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2153
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2155
# Find the relevant object directory and library name.
2156
if test "X$installed" = Xyes; then
2157
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2158
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2167
dir="$ladir/$objdir"
2168
absdir="$abs_ladir/$objdir"
2169
# Remove this search path later
2170
notinst_path="$notinst_path $abs_ladir"
2171
fi # $installed = yes
2172
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2174
# This library was specified with -dlpreopen.
2175
if test "$pass" = dlpreopen; then
2176
if test -z "$libdir"; then
2177
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2180
# Prefer using a static library (so that no silly _DYNAMIC symbols
2181
# are required to link).
2182
if test -n "$old_library"; then
2183
newdlprefiles="$newdlprefiles $dir/$old_library"
2184
# Otherwise, use the dlname, so that lt_dlopen finds it.
2185
elif test -n "$dlname"; then
2186
newdlprefiles="$newdlprefiles $dir/$dlname"
2188
newdlprefiles="$newdlprefiles $dir/$linklib"
2190
fi # $pass = dlpreopen
2192
if test -z "$libdir"; then
2193
# Link the convenience library
2194
if test "$linkmode" = lib; then
2195
deplibs="$dir/$old_library $deplibs"
2196
elif test "$linkmode,$pass" = "prog,link"; then
2197
compile_deplibs="$dir/$old_library $compile_deplibs"
2198
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2200
deplibs="$lib $deplibs" # used for prog,scan pass
2206
if test "$linkmode" = prog && test "$pass" != link; then
2207
newlib_search_path="$newlib_search_path $ladir"
2208
deplibs="$lib $deplibs"
2211
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2212
test "$build_libtool_libs" = no; then
2217
for deplib in $dependency_libs; do
2219
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2221
# Need to link against all dependency_libs?
2222
if test "$linkalldeplibs" = yes; then
2223
deplibs="$deplib $deplibs"
2225
# Need to hardcode shared library paths
2226
# or/and link against static libraries
2227
newdependency_libs="$deplib $newdependency_libs"
2229
if test "X$duplicate_deps" = "Xyes" ; then
2230
case "$tmp_libs " in
2231
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2234
tmp_libs="$tmp_libs $deplib"
2237
fi # $linkmode = prog...
2239
if test "$linkmode,$pass" = "prog,link"; then
2240
if test -n "$library_names" &&
2241
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2242
# We need to hardcode the library path
2243
if test -n "$shlibpath_var"; then
2244
# Make sure the rpath contains only unique directories.
2245
case "$temp_rpath " in
2248
*) temp_rpath="$temp_rpath $dir" ;;
2252
# Hardcode the library path.
2253
# Skip directories that are in the system default run-time
2255
case " $sys_lib_dlsearch_path " in
2258
case "$compile_rpath " in
2260
*) compile_rpath="$compile_rpath $absdir"
2264
case " $sys_lib_dlsearch_path " in
2267
case "$finalize_rpath " in
2269
*) finalize_rpath="$finalize_rpath $libdir"
2273
fi # $linkmode,$pass = prog,link...
2275
if test "$alldeplibs" = yes &&
2276
{ test "$deplibs_check_method" = pass_all ||
2277
{ test "$build_libtool_libs" = yes &&
2278
test -n "$library_names"; }; }; then
2279
# We only need to search for static libraries
2284
link_static=no # Whether the deplib will be linked statically
2285
if test -n "$library_names" &&
2286
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2287
if test "$installed" = no; then
2288
notinst_deplibs="$notinst_deplibs $lib"
2291
# This is a shared library
2293
# Warn about portability, can't link against -module's on
2294
# some systems (darwin)
2295
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2297
if test "$linkmode" = prog; then
2298
$echo "*** Warning: Linking the executable $output against the loadable module"
2300
$echo "*** Warning: Linking the shared library $output against the loadable module"
2302
$echo "*** $linklib is not portable!"
2304
if test "$linkmode" = lib &&
2305
test "$hardcode_into_libs" = yes; then
2306
# Hardcode the library path.
2307
# Skip directories that are in the system default run-time
2309
case " $sys_lib_dlsearch_path " in
2312
case "$compile_rpath " in
2314
*) compile_rpath="$compile_rpath $absdir"
2318
case " $sys_lib_dlsearch_path " in
2321
case "$finalize_rpath " in
2323
*) finalize_rpath="$finalize_rpath $libdir"
2329
if test -n "$old_archive_from_expsyms_cmds"; then
2330
# figure out the soname
2331
set dummy $library_names
2334
libname=`eval \\$echo \"$libname_spec\"`
2335
# use dlname if we got it. it's perfectly good, no?
2336
if test -n "$dlname"; then
2338
elif test -n "$soname_spec"; then
2342
major=`expr $current - $age`
2346
eval soname=\"$soname_spec\"
2351
# Make a new name for the extract_expsyms_cmds to use
2353
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2354
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2356
# If the library has no export list, then create one now
2357
if test -f "$output_objdir/$soname-def"; then :
2359
$show "extracting exported symbol list from \`$soname'"
2360
save_ifs="$IFS"; IFS='~'
2361
cmds=$extract_expsyms_cmds
2362
for cmd in $cmds; do
2366
$run eval "$cmd" || exit $?
2372
if test -f "$output_objdir/$newlib"; then :; else
2373
$show "generating import library for \`$soname'"
2374
save_ifs="$IFS"; IFS='~'
2375
cmds=$old_archive_from_expsyms_cmds
2376
for cmd in $cmds; do
2380
$run eval "$cmd" || exit $?
2384
# make sure the library variables are pointing to the new library
2387
fi # test -n "$old_archive_from_expsyms_cmds"
2389
if test "$linkmode" = prog || test "$mode" != relink; then
2394
case $hardcode_action in
2395
immediate | unsupported)
2396
if test "$hardcode_direct" = no; then
2399
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2401
# if the lib is a module then we can not link against
2402
# it, someone is ignoring the new warnings I added
2403
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2404
$echo "** Warning, lib $linklib is a module, not a shared library"
2405
if test -z "$old_library" ; then
2407
$echo "** And there doesn't seem to be a static archive available"
2408
$echo "** The link will probably fail, sorry"
2410
add="$dir/$old_library"
2414
elif test "$hardcode_minus_L" = no; then
2416
*-*-sunos*) add_shlibpath="$dir" ;;
2420
elif test "$hardcode_shlibpath_var" = no; then
2421
add_shlibpath="$dir"
2428
if test "$hardcode_direct" = yes; then
2430
elif test "$hardcode_minus_L" = yes; then
2432
# Try looking first in the location we're being installed to.
2433
if test -n "$inst_prefix_dir"; then
2436
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2441
elif test "$hardcode_shlibpath_var" = yes; then
2442
add_shlibpath="$dir"
2451
if test "$lib_linked" != yes; then
2452
$echo "$modename: configuration error: unsupported hardcode properties"
2456
if test -n "$add_shlibpath"; then
2457
case :$compile_shlibpath: in
2458
*":$add_shlibpath:"*) ;;
2459
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2462
if test "$linkmode" = prog; then
2463
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2464
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2466
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2467
test -n "$add" && deplibs="$add $deplibs"
2468
if test "$hardcode_direct" != yes && \
2469
test "$hardcode_minus_L" != yes && \
2470
test "$hardcode_shlibpath_var" = yes; then
2471
case :$finalize_shlibpath: in
2473
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2479
if test "$linkmode" = prog || test "$mode" = relink; then
2483
# Finalize command for both is simple: just hardcode it.
2484
if test "$hardcode_direct" = yes; then
2485
add="$libdir/$linklib"
2486
elif test "$hardcode_minus_L" = yes; then
2489
elif test "$hardcode_shlibpath_var" = yes; then
2490
case :$finalize_shlibpath: in
2492
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2495
elif test "$hardcode_automatic" = yes; then
2496
if test -n "$inst_prefix_dir" &&
2497
test -f "$inst_prefix_dir$libdir/$linklib" ; then
2498
add="$inst_prefix_dir$libdir/$linklib"
2500
add="$libdir/$linklib"
2503
# We cannot seem to hardcode it, guess we'll fake it.
2505
# Try looking first in the location we're being installed to.
2506
if test -n "$inst_prefix_dir"; then
2509
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2516
if test "$linkmode" = prog; then
2517
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2518
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2520
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2521
test -n "$add" && deplibs="$add $deplibs"
2524
elif test "$linkmode" = prog; then
2525
# Here we assume that one of hardcode_direct or hardcode_minus_L
2526
# is not unsupported. This is valid on all known static and
2528
if test "$hardcode_direct" != unsupported; then
2529
test -n "$old_library" && linklib="$old_library"
2530
compile_deplibs="$dir/$linklib $compile_deplibs"
2531
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2533
compile_deplibs="-l$name -L$dir $compile_deplibs"
2534
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2536
elif test "$build_libtool_libs" = yes; then
2537
# Not a shared library
2538
if test "$deplibs_check_method" != pass_all; then
2539
# We're trying link a shared library against a static one
2540
# but the system doesn't support it.
2542
# Just print a warning and add the library to dependency_libs so
2543
# that the program can be linked against the static library.
2545
$echo "*** Warning: This system can not link to static lib archive $lib."
2546
$echo "*** I have the capability to make that library automatically link in when"
2547
$echo "*** you link to this library. But I can only do this if you have a"
2548
$echo "*** shared version of the library, which you do not appear to have."
2549
if test "$module" = yes; then
2550
$echo "*** But as you try to build a module library, libtool will still create "
2551
$echo "*** a static module, that should work as long as the dlopening application"
2552
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2553
if test -z "$global_symbol_pipe"; then
2555
$echo "*** However, this would only work if libtool was able to extract symbol"
2556
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2557
$echo "*** not find such a program. So, this module is probably useless."
2558
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2560
if test "$build_old_libs" = no; then
2561
build_libtool_libs=module
2564
build_libtool_libs=no
2568
convenience="$convenience $dir/$old_library"
2569
old_convenience="$old_convenience $dir/$old_library"
2570
deplibs="$dir/$old_library $deplibs"
2573
fi # link shared/static library?
2575
if test "$linkmode" = lib; then
2576
if test -n "$dependency_libs" &&
2577
{ test "$hardcode_into_libs" != yes ||
2578
test "$build_old_libs" = yes ||
2579
test "$link_static" = yes; }; then
2580
# Extract -R from dependency_libs
2582
for libdir in $dependency_libs; do
2584
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2586
*" $temp_xrpath "*) ;;
2587
*) xrpath="$xrpath $temp_xrpath";;
2589
*) temp_deplibs="$temp_deplibs $libdir";;
2592
dependency_libs="$temp_deplibs"
2595
newlib_search_path="$newlib_search_path $absdir"
2596
# Link against this library
2597
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2598
# ... and its dependency_libs
2600
for deplib in $dependency_libs; do
2601
newdependency_libs="$deplib $newdependency_libs"
2602
if test "X$duplicate_deps" = "Xyes" ; then
2603
case "$tmp_libs " in
2604
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2607
tmp_libs="$tmp_libs $deplib"
2610
if test "$link_all_deplibs" != no; then
2611
# Add the search paths of all dependency libraries
2612
for deplib in $dependency_libs; do
2614
-L*) path="$deplib" ;;
2616
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2617
test "X$dir" = "X$deplib" && dir="."
2618
# We need an absolute path.
2620
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2622
absdir=`cd "$dir" && pwd`
2623
if test -z "$absdir"; then
2624
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2629
if grep "^installed=no" $deplib > /dev/null; then
2630
path="$absdir/$objdir"
2632
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2633
if test -z "$libdir"; then
2634
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2637
if test "$absdir" != "$libdir"; then
2638
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2645
# we do not want to link against static libs,
2646
# but need to link against shared
2647
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2648
if test -n "$deplibrary_names" ; then
2649
for tmp in $deplibrary_names ; do
2652
if test -f "$path/$depdepl" ; then
2653
depdepl="$path/$depdepl"
2655
# do not add paths which are already there
2656
case " $newlib_search_path " in
2658
*) newlib_search_path="$newlib_search_path $path";;
2671
# Again, we only want to link against shared libraries
2672
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2673
for tmp in $newlib_search_path ; do
2674
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2675
eval depdepl="$tmp/lib$tmp_libs.dylib"
2686
case " $deplibs " in
2688
*) deplibs="$depdepl $deplibs" ;;
2690
case " $deplibs " in
2692
*) deplibs="$deplibs $path" ;;
2695
fi # link_all_deplibs != no
2697
done # for deplib in $libs
2698
dependency_libs="$newdependency_libs"
2699
if test "$pass" = dlpreopen; then
2700
# Link the dlpreopened libraries before other libraries
2701
for deplib in $save_deplibs; do
2702
deplibs="$deplib $deplibs"
2705
if test "$pass" != dlopen; then
2706
if test "$pass" != conv; then
2707
# Make sure lib_search_path contains only unique directories.
2709
for dir in $newlib_search_path; do
2710
case "$lib_search_path " in
2712
*) lib_search_path="$lib_search_path $dir" ;;
2718
if test "$linkmode,$pass" != "prog,link"; then
2721
vars="compile_deplibs finalize_deplibs"
2723
for var in $vars dependency_libs; do
2724
# Add libraries to $var in reverse order
2725
eval tmp_libs=\"\$$var\"
2727
for deplib in $tmp_libs; do
2728
# FIXME: Pedantically, this is the right thing to do, so
2729
# that some nasty dependency loop isn't accidentally
2731
#new_libs="$deplib $new_libs"
2732
# Pragmatically, this seems to cause very few problems in
2735
-L*) new_libs="$deplib $new_libs" ;;
2738
# And here is the reason: when a library appears more
2739
# than once as an explicit dependence of a library, or
2740
# is implicitly linked in more than once by the
2741
# compiler, it is considered special, and multiple
2742
# occurrences thereof are not removed. Compare this
2743
# with having the same library being listed as a
2744
# dependency of multiple other libraries: in this case,
2745
# we know (pedantically, we assume) the library does not
2746
# need to be listed more than once, so we keep only the
2747
# last copy. This is not always right, but it is rare
2748
# enough that we require users that really mean to play
2749
# such unportable linking tricks to link the library
2750
# using -Wl,-lname, so that libtool does not consider it
2751
# for duplicate removal.
2752
case " $specialdeplibs " in
2753
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2755
case " $new_libs " in
2757
*) new_libs="$deplib $new_libs" ;;
2765
for deplib in $new_libs; do
2768
case " $tmp_libs " in
2770
*) tmp_libs="$tmp_libs $deplib" ;;
2773
*) tmp_libs="$tmp_libs $deplib" ;;
2776
eval $var=\"$tmp_libs\"
2779
# Last step: remove runtime libs from dependency_libs
2780
# (they stay in deplibs)
2782
for i in $dependency_libs ; do
2783
case " $predeps $postdeps $compiler_lib_search_path " in
2788
if test -n "$i" ; then
2789
tmp_libs="$tmp_libs $i"
2792
dependency_libs=$tmp_libs
2794
if test "$linkmode" = prog; then
2795
dlfiles="$newdlfiles"
2796
dlprefiles="$newdlprefiles"
2801
if test -n "$deplibs"; then
2802
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2805
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2806
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2809
if test -n "$rpath"; then
2810
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2813
if test -n "$xrpath"; then
2814
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2817
if test -n "$vinfo"; then
2818
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2821
if test -n "$release"; then
2822
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2825
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2826
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2829
# Now set the variables for building old libraries.
2830
build_libtool_libs=no
2832
objs="$objs$old_deplibs"
2836
# Make sure we only generate libraries of the form `libNAME.la'.
2839
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2840
eval shared_ext=\"$shrext_cmds\"
2841
eval libname=\"$libname_spec\"
2844
if test "$module" = no; then
2845
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2849
if test "$need_lib_prefix" != no; then
2850
# Add the "lib" prefix for modules if required
2851
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2852
eval shared_ext=\"$shrext_cmds\"
2853
eval libname=\"$libname_spec\"
2855
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2860
if test -n "$objs"; then
2861
if test "$deplibs_check_method" != pass_all; then
2862
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2866
$echo "*** Warning: Linking the shared library $output against the non-libtool"
2867
$echo "*** objects $objs is not portable!"
2868
libobjs="$libobjs $objs"
2872
if test "$dlself" != no; then
2873
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2877
if test "$#" -gt 2; then
2878
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2883
if test -z "$rpath"; then
2884
if test "$build_libtool_libs" = yes; then
2885
# Building a libtool convenience library.
2886
# Some compilers have problems with a `.al' extension so
2887
# convenience libraries should have the same extension an
2888
# archive normally would.
2889
oldlibs="$output_objdir/$libname.$libext $oldlibs"
2890
build_libtool_libs=convenience
2894
if test -n "$vinfo"; then
2895
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2898
if test -n "$release"; then
2899
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2903
# Parse the version information argument.
2904
save_ifs="$IFS"; IFS=':'
2905
set dummy $vinfo 0 0 0
2908
if test -n "$8"; then
2909
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2914
# convert absolute version numbers to libtool ages
2915
# this retains compatibility with .la files and attempts
2916
# to make the code below a bit more comprehensible
2918
case $vinfo_number in
2922
number_revision="$4"
2924
# There are really only two kinds -- those that
2925
# use the current revision as the major version
2926
# and those that subtract age and use age as
2927
# a minor version. But, then there is irix
2928
# which has an extra 1 added just for fun
2930
case $version_type in
2931
darwin|linux|osf|windows)
2932
current=`expr $number_major + $number_minor`
2934
revision="$number_revision"
2936
freebsd-aout|freebsd-elf|sunos)
2937
current="$number_major"
2938
revision="$number_minor"
2942
current=`expr $number_major + $number_minor - 1`
2944
revision="$number_minor"
2955
# Check that each of the things are valid numbers.
2959
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2960
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2968
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2969
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2977
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2978
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2983
if test "$age" -gt "$current"; then
2984
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2985
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2989
# Calculate the version variables.
2993
case $version_type in
2997
# Like Linux, but with the current version available in
2998
# verstring for coding it into the library header
2999
major=.`expr $current - $age`
3000
versuffix="$major.$age.$revision"
3001
# Darwin ld doesn't like 0 for these options...
3002
minor_current=`expr $current + 1`
3003
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3008
versuffix=".$current.$revision";
3013
versuffix=".$current";
3017
major=`expr $current - $age + 1`
3019
case $version_type in
3020
nonstopux) verstring_prefix=nonstopux ;;
3021
*) verstring_prefix=sgi ;;
3023
verstring="$verstring_prefix$major.$revision"
3025
# Add in all the interfaces that we are compatible with.
3027
while test "$loop" -ne 0; do
3028
iface=`expr $revision - $loop`
3029
loop=`expr $loop - 1`
3030
verstring="$verstring_prefix$major.$iface:$verstring"
3033
# Before this point, $major must not contain `.'.
3035
versuffix="$major.$revision"
3039
major=.`expr $current - $age`
3040
versuffix="$major.$age.$revision"
3044
major=.`expr $current - $age`
3045
versuffix=".$current.$age.$revision"
3046
verstring="$current.$age.$revision"
3048
# Add in all the interfaces that we are compatible with.
3050
while test "$loop" -ne 0; do
3051
iface=`expr $current - $loop`
3052
loop=`expr $loop - 1`
3053
verstring="$verstring:${iface}.0"
3056
# Make executables depend on our current version.
3057
verstring="$verstring:${current}.0"
3062
versuffix=".$current.$revision"
3066
# Use '-' rather than '.', since we only want one
3067
# extension on DOS 8.3 filesystems.
3068
major=`expr $current - $age`
3073
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3074
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3079
# Clear the version info if we defaulted, and they specified a release.
3080
if test -z "$vinfo" && test -n "$release"; then
3082
case $version_type in
3084
# we can't check for "0.0" in archive_cmds due to quoting
3085
# problems, so we reset it completely
3092
if test "$need_version" = no; then
3099
# Remove version info from name if versioning should be avoided
3100
if test "$avoid_version" = yes && test "$need_version" = no; then
3106
# Check to see if the archive will have undefined symbols.
3107
if test "$allow_undefined" = yes; then
3108
if test "$allow_undefined_flag" = unsupported; then
3109
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3110
build_libtool_libs=no
3114
# Don't allow undefined symbols.
3115
allow_undefined_flag="$no_undefined_flag"
3119
if test "$mode" != relink; then
3120
# Remove our outputs, but don't remove object files since they
3121
# may have been created when compiling PIC objects.
3123
tempremovelist=`$echo "$output_objdir/*"`
3124
for p in $tempremovelist; do
3128
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3129
if test "X$precious_files_regex" != "X"; then
3130
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3135
removelist="$removelist $p"
3140
if test -n "$removelist"; then
3141
$show "${rm}r $removelist"
3142
$run ${rm}r $removelist
3146
# Now set the variables for building old libraries.
3147
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3148
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3150
# Transform .lo files to .o files.
3151
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3154
# Eliminate all temporary directories.
3155
for path in $notinst_path; do
3156
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3157
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3158
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3161
if test -n "$xrpath"; then
3162
# If the user specified any rpath flags, then add them.
3164
for libdir in $xrpath; do
3165
temp_xrpath="$temp_xrpath -R$libdir"
3166
case "$finalize_rpath " in
3168
*) finalize_rpath="$finalize_rpath $libdir" ;;
3171
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3172
dependency_libs="$temp_xrpath $dependency_libs"
3176
# Make sure dlfiles contains only unique files that won't be dlpreopened
3177
old_dlfiles="$dlfiles"
3179
for lib in $old_dlfiles; do
3180
case " $dlprefiles $dlfiles " in
3182
*) dlfiles="$dlfiles $lib" ;;
3186
# Make sure dlprefiles contains only unique files
3187
old_dlprefiles="$dlprefiles"
3189
for lib in $old_dlprefiles; do
3190
case "$dlprefiles " in
3192
*) dlprefiles="$dlprefiles $lib" ;;
3196
if test "$build_libtool_libs" = yes; then
3197
if test -n "$rpath"; then
3199
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3200
# these systems don't actually have a c library (as such)!
3202
*-*-rhapsody* | *-*-darwin1.[012])
3203
# Rhapsody C library is in the System framework
3204
deplibs="$deplibs -framework System"
3207
# Don't link with libc until the a.out ld.so is fixed.
3209
*-*-openbsd* | *-*-freebsd*)
3210
# Do not include libc due to us having libc/libc_r.
3211
test "X$arg" = "X-lc" && continue
3214
# Add libc to deplibs on all other systems if necessary.
3215
if test "$build_libtool_need_lc" = "yes"; then
3216
deplibs="$deplibs -lc"
3222
# Transform deplibs into only deplibs that can be linked in shared.
3224
libname_save=$libname
3225
release_save=$release
3226
versuffix_save=$versuffix
3228
# I'm not sure if I'm treating the release correctly. I think
3229
# release should show up in the -l (ie -lgmp5) so we don't want to
3230
# add it in twice. Is that correct?
3236
case $deplibs_check_method in
3238
# Don't check for shared/static. Everything works.
3239
# This might be a little naive. We might want to check
3240
# whether the library exists or not. But this is on
3241
# osf3 & osf4 and I'm not really sure... Just
3242
# implementing what was already the behavior.
3246
# This code stresses the "libraries are programs" paradigm to its
3247
# limits. Maybe even breaks it. We compile a program, linking it
3248
# against the deplibs as a proxy for the library. Then we can check
3249
# whether they linked in statically or dynamically with ldd.
3251
cat > conftest.c <<EOF
3252
int main() { return 0; }
3255
$LTCC -o conftest conftest.c $deplibs
3256
if test "$?" -eq 0 ; then
3257
ldd_output=`ldd conftest`
3258
for i in $deplibs; do
3259
name="`expr $i : '-l\(.*\)'`"
3260
# If $name is empty we are operating on a -L argument.
3261
if test "$name" != "" && test "$name" -ne "0"; then
3262
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3263
case " $predeps $postdeps " in
3265
newdeplibs="$newdeplibs $i"
3270
if test -n "$i" ; then
3271
libname=`eval \\$echo \"$libname_spec\"`
3272
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3273
set dummy $deplib_matches
3275
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3276
newdeplibs="$newdeplibs $i"
3280
$echo "*** Warning: dynamic linker does not accept needed library $i."
3281
$echo "*** I have the capability to make that library automatically link in when"
3282
$echo "*** you link to this library. But I can only do this if you have a"
3283
$echo "*** shared version of the library, which I believe you do not have"
3284
$echo "*** because a test_compile did reveal that the linker did not use it for"
3285
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3289
newdeplibs="$newdeplibs $i"
3293
# Error occurred in the first compile. Let's try to salvage
3294
# the situation: Compile a separate program for each library.
3295
for i in $deplibs; do
3296
name="`expr $i : '-l\(.*\)'`"
3297
# If $name is empty we are operating on a -L argument.
3298
if test "$name" != "" && test "$name" != "0"; then
3300
$LTCC -o conftest conftest.c $i
3302
if test "$?" -eq 0 ; then
3303
ldd_output=`ldd conftest`
3304
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3305
case " $predeps $postdeps " in
3307
newdeplibs="$newdeplibs $i"
3312
if test -n "$i" ; then
3313
libname=`eval \\$echo \"$libname_spec\"`
3314
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3315
set dummy $deplib_matches
3317
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3318
newdeplibs="$newdeplibs $i"
3322
$echo "*** Warning: dynamic linker does not accept needed library $i."
3323
$echo "*** I have the capability to make that library automatically link in when"
3324
$echo "*** you link to this library. But I can only do this if you have a"
3325
$echo "*** shared version of the library, which you do not appear to have"
3326
$echo "*** because a test_compile did reveal that the linker did not use this one"
3327
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3333
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3334
$echo "*** make it link in! You will probably need to install it or some"
3335
$echo "*** library that it depends on before this library will be fully"
3336
$echo "*** functional. Installing it before continuing would be even better."
3339
newdeplibs="$newdeplibs $i"
3345
set dummy $deplibs_check_method
3346
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3347
for a_deplib in $deplibs; do
3348
name="`expr $a_deplib : '-l\(.*\)'`"
3349
# If $name is empty we are operating on a -L argument.
3350
if test "$name" != "" && test "$name" != "0"; then
3351
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3352
case " $predeps $postdeps " in
3354
newdeplibs="$newdeplibs $a_deplib"
3359
if test -n "$a_deplib" ; then
3360
libname=`eval \\$echo \"$libname_spec\"`
3361
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3362
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3363
for potent_lib in $potential_libs; do
3364
# Follow soft links.
3365
if ls -lLd "$potent_lib" 2>/dev/null \
3366
| grep " -> " >/dev/null; then
3369
# The statement above tries to avoid entering an
3370
# endless loop below, in case of cyclic links.
3371
# We might still enter an endless loop, since a link
3372
# loop can be closed while we follow links,
3374
potlib="$potent_lib"
3375
while test -h "$potlib" 2>/dev/null; do
3376
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3378
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3379
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3382
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3384
| $EGREP "$file_magic_regex" > /dev/null; then
3385
newdeplibs="$newdeplibs $a_deplib"
3392
if test -n "$a_deplib" ; then
3395
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3396
$echo "*** I have the capability to make that library automatically link in when"
3397
$echo "*** you link to this library. But I can only do this if you have a"
3398
$echo "*** shared version of the library, which you do not appear to have"
3399
$echo "*** because I did check the linker path looking for a file starting"
3400
if test -z "$potlib" ; then
3401
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3403
$echo "*** with $libname and none of the candidates passed a file format test"
3404
$echo "*** using a file magic. Last file checked: $potlib"
3408
# Add a -L argument.
3409
newdeplibs="$newdeplibs $a_deplib"
3411
done # Gone through all deplibs.
3414
set dummy $deplibs_check_method
3415
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3416
for a_deplib in $deplibs; do
3417
name="`expr $a_deplib : '-l\(.*\)'`"
3418
# If $name is empty we are operating on a -L argument.
3419
if test -n "$name" && test "$name" != "0"; then
3420
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3421
case " $predeps $postdeps " in
3423
newdeplibs="$newdeplibs $a_deplib"
3428
if test -n "$a_deplib" ; then
3429
libname=`eval \\$echo \"$libname_spec\"`
3430
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3431
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3432
for potent_lib in $potential_libs; do
3433
potlib="$potent_lib" # see symlink-check above in file_magic test
3434
if eval $echo \"$potent_lib\" 2>/dev/null \
3436
| $EGREP "$match_pattern_regex" > /dev/null; then
3437
newdeplibs="$newdeplibs $a_deplib"
3444
if test -n "$a_deplib" ; then
3447
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3448
$echo "*** I have the capability to make that library automatically link in when"
3449
$echo "*** you link to this library. But I can only do this if you have a"
3450
$echo "*** shared version of the library, which you do not appear to have"
3451
$echo "*** because I did check the linker path looking for a file starting"
3452
if test -z "$potlib" ; then
3453
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3455
$echo "*** with $libname and none of the candidates passed a file format test"
3456
$echo "*** using a regex pattern. Last file checked: $potlib"
3460
# Add a -L argument.
3461
newdeplibs="$newdeplibs $a_deplib"
3463
done # Gone through all deplibs.
3467
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3468
-e 's/ -[LR][^ ]*//g'`
3469
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3470
for i in $predeps $postdeps ; do
3471
# can't use Xsed below, because $i might contain '/'
3472
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3475
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3476
| grep . >/dev/null; then
3478
if test "X$deplibs_check_method" = "Xnone"; then
3479
$echo "*** Warning: inter-library dependencies are not supported in this platform."
3481
$echo "*** Warning: inter-library dependencies are not known to be supported."
3483
$echo "*** All declared inter-library dependencies are being dropped."
3488
versuffix=$versuffix_save
3490
release=$release_save
3491
libname=$libname_save
3495
*-*-rhapsody* | *-*-darwin1.[012])
3496
# On Rhapsody replace the C library is the System framework
3497
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3501
if test "$droppeddeps" = yes; then
3502
if test "$module" = yes; then
3504
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3505
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3506
$echo "*** a static module, that should work as long as the dlopening"
3507
$echo "*** application is linked with the -dlopen flag."
3508
if test -z "$global_symbol_pipe"; then
3510
$echo "*** However, this would only work if libtool was able to extract symbol"
3511
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3512
$echo "*** not find such a program. So, this module is probably useless."
3513
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3515
if test "$build_old_libs" = no; then
3516
oldlibs="$output_objdir/$libname.$libext"
3517
build_libtool_libs=module
3520
build_libtool_libs=no
3523
$echo "*** The inter-library dependencies that have been dropped here will be"
3524
$echo "*** automatically added whenever a program is linked with this library"
3525
$echo "*** or is declared to -dlopen it."
3527
if test "$allow_undefined" = no; then
3529
$echo "*** Since this library must not contain undefined symbols,"
3530
$echo "*** because either the platform does not support them or"
3531
$echo "*** it was explicitly requested with -no-undefined,"
3532
$echo "*** libtool will only create a static version of it."
3533
if test "$build_old_libs" = no; then
3534
oldlibs="$output_objdir/$libname.$libext"
3535
build_libtool_libs=module
3538
build_libtool_libs=no
3543
# Done checking deplibs!
3547
# All the library-specific variables (install_libdir is set above).
3552
# Test again, we may have decided not to build it any more
3553
if test "$build_libtool_libs" = yes; then
3554
if test "$hardcode_into_libs" = yes; then
3555
# Hardcode the library paths
3558
rpath="$finalize_rpath"
3559
test "$mode" != relink && rpath="$compile_rpath$rpath"
3560
for libdir in $rpath; do
3561
if test -n "$hardcode_libdir_flag_spec"; then
3562
if test -n "$hardcode_libdir_separator"; then
3563
if test -z "$hardcode_libdirs"; then
3564
hardcode_libdirs="$libdir"
3566
# Just accumulate the unique libdirs.
3567
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3568
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3571
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3576
eval flag=\"$hardcode_libdir_flag_spec\"
3577
dep_rpath="$dep_rpath $flag"
3579
elif test -n "$runpath_var"; then
3580
case "$perm_rpath " in
3582
*) perm_rpath="$perm_rpath $libdir" ;;
3586
# Substitute the hardcoded libdirs into the rpath.
3587
if test -n "$hardcode_libdir_separator" &&
3588
test -n "$hardcode_libdirs"; then
3589
libdir="$hardcode_libdirs"
3590
if test -n "$hardcode_libdir_flag_spec_ld"; then
3591
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3593
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3596
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3597
# We should set the runpath_var.
3599
for dir in $perm_rpath; do
3602
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3604
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3607
shlibpath="$finalize_shlibpath"
3608
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3609
if test -n "$shlibpath"; then
3610
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3613
# Get the real and link names of the library.
3614
eval shared_ext=\"$shrext_cmds\"
3615
eval library_names=\"$library_names_spec\"
3616
set dummy $library_names
3620
if test -n "$soname_spec"; then
3621
eval soname=\"$soname_spec\"
3625
if test -z "$dlname"; then
3629
lib="$output_objdir/$realname"
3632
linknames="$linknames $link"
3635
# Use standard objects if they are pic
3636
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3638
# Prepare the list of exported symbols
3639
if test -z "$export_symbols"; then
3640
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3641
$show "generating symbol list for \`$libname.la'"
3642
export_symbols="$output_objdir/$libname.exp"
3643
$run $rm $export_symbols
3644
cmds=$export_symbols_cmds
3645
save_ifs="$IFS"; IFS='~'
3646
for cmd in $cmds; do
3649
if len=`expr "X$cmd" : ".*"` &&
3650
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3652
$run eval "$cmd" || exit $?
3653
skipped_export=false
3655
# The command line is too long to execute in one step.
3656
$show "using reloadable object file for export list..."
3661
if test -n "$export_symbols_regex"; then
3662
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3663
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3664
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3665
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3670
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3671
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3676
for test_deplib in $deplibs; do
3677
case " $convenience " in
3678
*" $test_deplib "*) ;;
3680
if test -n "$inst_prefix_dir" && (echo "$test_deplib" | grep -- "$inst_prefix_dir" >/dev/null); then
3681
inst_prefix_arg="$test_deplib"
3683
tmp_deplibs="$tmp_deplibs $test_deplib"
3688
deplibs="$tmp_deplibs"
3689
if test -n "$inst_prefix_arg"; then
3690
deplibs="$inst_prefix_arg $deplibs"
3693
if test -n "$convenience"; then
3694
if test -n "$whole_archive_flag_spec"; then
3695
save_libobjs=$libobjs
3696
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3698
gentop="$output_objdir/${outputname}x"
3699
$show "${rm}r $gentop"
3700
$run ${rm}r "$gentop"
3701
$show "$mkdir $gentop"
3702
$run $mkdir "$gentop"
3704
if test "$status" -ne 0 && test ! -d "$gentop"; then
3707
generated="$generated $gentop"
3709
for xlib in $convenience; do
3710
# Extract the objects.
3712
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3713
*) xabs=`pwd`"/$xlib" ;;
3715
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3716
xdir="$gentop/$xlib"
3718
$show "${rm}r $xdir"
3720
$show "$mkdir $xdir"
3723
if test "$status" -ne 0 && test ! -d "$xdir"; then
3726
# We will extract separately just the conflicting names and we will no
3727
# longer touch any unique names. It is faster to leave these extract
3728
# automatically by $AR in one run.
3729
$show "(cd $xdir && $AR x $xabs)"
3730
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3731
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3734
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3735
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3736
$AR t "$xabs" | sort | uniq -cd | while read -r count name
3739
while test "$i" -le "$count"
3741
# Put our $i before any first dot (extension)
3742
# Never overwrite any file
3744
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3746
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3748
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3749
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3755
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3760
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3761
eval flag=\"$thread_safe_flag_spec\"
3762
linker_flags="$linker_flags $flag"
3765
# Make a backup of the uninstalled library when relinking
3766
if test "$mode" = relink; then
3767
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3770
# Do each of the archive commands.
3771
if test "$module" = yes && test -n "$module_cmds" ; then
3772
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3773
eval test_cmds=\"$module_expsym_cmds\"
3774
cmds=$module_expsym_cmds
3776
eval test_cmds=\"$module_cmds\"
3780
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3781
eval test_cmds=\"$archive_expsym_cmds\"
3782
cmds=$archive_expsym_cmds
3784
eval test_cmds=\"$archive_cmds\"
3789
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3790
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3793
# The command line is too long to link in one step, link piecewise.
3794
$echo "creating reloadable object files..."
3796
# Save the value of $output and $libobjs because we want to
3797
# use them later. If we have whole_archive_flag_spec, we
3798
# want to use save_libobjs as it was before
3799
# whole_archive_flag_spec was expanded, because we can't
3800
# assume the linker understands whole_archive_flag_spec.
3801
# This may have to be revisited, in case too many
3802
# convenience libraries get linked in and end up exceeding
3804
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3805
save_libobjs=$libobjs
3809
# Clear the reloadable object creation command queue and
3810
# initialize k to one.
3817
output=$output_objdir/$save_output-${k}.$objext
3818
# Loop over the list of objects to be linked.
3819
for obj in $save_libobjs
3821
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3822
if test "X$objlist" = X ||
3823
{ len=`expr "X$test_cmds" : ".*"` &&
3824
test "$len" -le "$max_cmd_len"; }; then
3825
objlist="$objlist $obj"
3827
# The command $test_cmds is almost too long, add a
3828
# command to the queue.
3829
if test "$k" -eq 1 ; then
3830
# The first file doesn't have a previous command to add.
3831
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3833
# All subsequent reloadable object files will link in
3834
# the last one created.
3835
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3837
last_robj=$output_objdir/$save_output-${k}.$objext
3839
output=$output_objdir/$save_output-${k}.$objext
3844
# Handle the remaining objects by creating one last
3845
# reloadable object file. All subsequent reloadable object
3846
# files will link in the last one created.
3847
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3848
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3850
if ${skipped_export-false}; then
3851
$show "generating symbol list for \`$libname.la'"
3852
export_symbols="$output_objdir/$libname.exp"
3853
$run $rm $export_symbols
3855
# Append the command to create the export file.
3856
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3859
# Set up a command to remove the reloadale object files
3860
# after they are used.
3862
while test "$i" -lt "$k"
3865
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3868
$echo "creating a temporary reloadable object file: $output"
3870
# Loop through the commands generated above and execute them.
3871
save_ifs="$IFS"; IFS='~'
3872
for cmd in $concat_cmds; do
3875
$run eval "$cmd" || exit $?
3880
# Restore the value of output.
3883
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3884
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3886
# Expand the library linking commands again to reset the
3887
# value of $libobjs for piecewise linking.
3889
# Do each of the archive commands.
3890
if test "$module" = yes && test -n "$module_cmds" ; then
3891
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3892
cmds=$module_expsym_cmds
3897
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3898
cmds=$archive_expsym_cmds
3904
# Append the command to remove the reloadable object files
3905
# to the just-reset $cmds.
3906
eval cmds=\"\$cmds~\$rm $delfiles\"
3908
save_ifs="$IFS"; IFS='~'
3909
for cmd in $cmds; do
3913
$run eval "$cmd" || exit $?
3917
# Restore the uninstalled library and exit
3918
if test "$mode" = relink; then
3919
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3923
# Create links to the real library.
3924
for linkname in $linknames; do
3925
if test "$realname" != "$linkname"; then
3926
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3927
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3931
# If -module or -export-dynamic was specified, set the dlname.
3932
if test "$module" = yes || test "$export_dynamic" = yes; then
3933
# On all known operating systems, these are identical.
3940
if test -n "$deplibs"; then
3941
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3944
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3945
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3948
if test -n "$rpath"; then
3949
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3952
if test -n "$xrpath"; then
3953
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3956
if test -n "$vinfo"; then
3957
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3960
if test -n "$release"; then
3961
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3966
if test -n "$objs$old_deplibs"; then
3967
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3971
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3979
# Delete the old objects.
3980
$run $rm $obj $libobj
3982
# Objects from convenience libraries. This assumes
3983
# single-version convenience libraries. Whenever we create
3984
# different ones for PIC/non-PIC, this we'll have to duplicate
3988
# reload_cmds runs $LD directly, so let us get rid of
3989
# -Wl from whole_archive_flag_spec
3992
if test -n "$convenience"; then
3993
if test -n "$whole_archive_flag_spec"; then
3994
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3996
gentop="$output_objdir/${obj}x"
3997
$show "${rm}r $gentop"
3998
$run ${rm}r "$gentop"
3999
$show "$mkdir $gentop"
4000
$run $mkdir "$gentop"
4002
if test "$status" -ne 0 && test ! -d "$gentop"; then
4005
generated="$generated $gentop"
4007
for xlib in $convenience; do
4008
# Extract the objects.
4010
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4011
*) xabs=`pwd`"/$xlib" ;;
4013
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4014
xdir="$gentop/$xlib"
4016
$show "${rm}r $xdir"
4018
$show "$mkdir $xdir"
4021
if test "$status" -ne 0 && test ! -d "$xdir"; then
4024
# We will extract separately just the conflicting names and we will no
4025
# longer touch any unique names. It is faster to leave these extract
4026
# automatically by $AR in one run.
4027
$show "(cd $xdir && $AR x $xabs)"
4028
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4029
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4032
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4033
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4034
$AR t "$xabs" | sort | uniq -cd | while read -r count name
4037
while test "$i" -le "$count"
4039
# Put our $i before any first dot (extension)
4040
# Never overwrite any file
4042
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4044
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4046
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4047
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4053
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4058
# Create the old-style object.
4059
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
4063
save_ifs="$IFS"; IFS='~'
4064
for cmd in $cmds; do
4068
$run eval "$cmd" || exit $?
4072
# Exit if we aren't doing a library object file.
4073
if test -z "$libobj"; then
4074
if test -n "$gentop"; then
4075
$show "${rm}r $gentop"
4082
if test "$build_libtool_libs" != yes; then
4083
if test -n "$gentop"; then
4084
$show "${rm}r $gentop"
4088
# Create an invalid libtool object if no PIC, so that we don't
4089
# accidentally link it into a program.
4090
# $show "echo timestamp > $libobj"
4091
# $run eval "echo timestamp > $libobj" || exit $?
4095
if test -n "$pic_flag" || test "$pic_mode" != default; then
4096
# Only do commands if we really have different PIC objects.
4097
reload_objs="$libobjs $reload_conv_objs"
4100
save_ifs="$IFS"; IFS='~'
4101
for cmd in $cmds; do
4105
$run eval "$cmd" || exit $?
4110
if test -n "$gentop"; then
4111
$show "${rm}r $gentop"
4120
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4122
if test -n "$vinfo"; then
4123
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4126
if test -n "$release"; then
4127
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4130
if test "$preload" = yes; then
4131
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4132
test "$dlopen_self_static" = unknown; then
4133
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4138
*-*-rhapsody* | *-*-darwin1.[012])
4139
# On Rhapsody replace the C library is the System framework
4140
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4141
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4147
# Don't allow lazy linking, it breaks C++ global constructors
4148
if test "$tagname" = CXX ; then
4149
compile_command="$compile_command ${wl}-bind_at_load"
4150
finalize_command="$finalize_command ${wl}-bind_at_load"
4155
compile_command="$compile_command $compile_deplibs"
4156
finalize_command="$finalize_command $finalize_deplibs"
4158
if test -n "$rpath$xrpath"; then
4159
# If the user specified any rpath flags, then add them.
4160
for libdir in $rpath $xrpath; do
4161
# This is the magic to use -rpath.
4162
case "$finalize_rpath " in
4164
*) finalize_rpath="$finalize_rpath $libdir" ;;
4169
# Now hardcode the library paths
4172
for libdir in $compile_rpath $finalize_rpath; do
4173
if test -n "$hardcode_libdir_flag_spec"; then
4174
if test -n "$hardcode_libdir_separator"; then
4175
if test -z "$hardcode_libdirs"; then
4176
hardcode_libdirs="$libdir"
4178
# Just accumulate the unique libdirs.
4179
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4180
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4183
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4188
eval flag=\"$hardcode_libdir_flag_spec\"
4189
rpath="$rpath $flag"
4191
elif test -n "$runpath_var"; then
4192
case "$perm_rpath " in
4194
*) perm_rpath="$perm_rpath $libdir" ;;
4198
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4199
case :$dllsearchpath: in
4201
*) dllsearchpath="$dllsearchpath:$libdir";;
4206
# Substitute the hardcoded libdirs into the rpath.
4207
if test -n "$hardcode_libdir_separator" &&
4208
test -n "$hardcode_libdirs"; then
4209
libdir="$hardcode_libdirs"
4210
eval rpath=\" $hardcode_libdir_flag_spec\"
4212
compile_rpath="$rpath"
4216
for libdir in $finalize_rpath; do
4217
if test -n "$hardcode_libdir_flag_spec"; then
4218
if test -n "$hardcode_libdir_separator"; then
4219
if test -z "$hardcode_libdirs"; then
4220
hardcode_libdirs="$libdir"
4222
# Just accumulate the unique libdirs.
4223
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4224
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4227
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4232
eval flag=\"$hardcode_libdir_flag_spec\"
4233
rpath="$rpath $flag"
4235
elif test -n "$runpath_var"; then
4236
case "$finalize_perm_rpath " in
4238
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4242
# Substitute the hardcoded libdirs into the rpath.
4243
if test -n "$hardcode_libdir_separator" &&
4244
test -n "$hardcode_libdirs"; then
4245
libdir="$hardcode_libdirs"
4246
eval rpath=\" $hardcode_libdir_flag_spec\"
4248
finalize_rpath="$rpath"
4250
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4251
# Transform all the library objects into standard objects.
4252
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4253
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4257
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4258
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4259
dlsyms="${outputname}S.c"
4261
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4265
if test -n "$dlsyms"; then
4269
# Discover the nlist of each of the dlfiles.
4270
nlist="$output_objdir/${outputname}.nm"
4272
$show "$rm $nlist ${nlist}S ${nlist}T"
4273
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4275
# Parse the name list into a source file.
4276
$show "creating $output_objdir/$dlsyms"
4278
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4279
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4280
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4286
/* Prevent the only kind of declaration conflicts we can make. */
4287
#define lt_preloaded_symbols some_other_symbol
4289
/* External symbol declarations for the compiler. */\
4292
if test "$dlself" = yes; then
4293
$show "generating symbol list for \`$output'"
4295
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4297
# Add our own program objects to the symbol list.
4298
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4299
for arg in $progfiles; do
4300
$show "extracting global C symbols from \`$arg'"
4301
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4304
if test -n "$exclude_expsyms"; then
4305
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4306
$run eval '$mv "$nlist"T "$nlist"'
4309
if test -n "$export_symbols_regex"; then
4310
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4311
$run eval '$mv "$nlist"T "$nlist"'
4314
# Prepare the list of exported symbols
4315
if test -z "$export_symbols"; then
4316
export_symbols="$output_objdir/$output.exp"
4317
$run $rm $export_symbols
4318
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4320
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4321
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4322
$run eval 'mv "$nlist"T "$nlist"'
4326
for arg in $dlprefiles; do
4327
$show "extracting global C symbols from \`$arg'"
4328
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4329
$run eval '$echo ": $name " >> "$nlist"'
4330
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4333
if test -z "$run"; then
4334
# Make sure we have at least an empty file.
4335
test -f "$nlist" || : > "$nlist"
4337
if test -n "$exclude_expsyms"; then
4338
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4339
$mv "$nlist"T "$nlist"
4342
# Try sorting and uniquifying the output.
4343
if grep -v "^: " < "$nlist" |
4344
if sort -k 3 </dev/null >/dev/null 2>&1; then
4349
uniq > "$nlist"S; then
4352
grep -v "^: " < "$nlist" > "$nlist"S
4355
if test -f "$nlist"S; then
4356
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4358
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
4361
$echo >> "$output_objdir/$dlsyms" "\
4363
#undef lt_preloaded_symbols
4365
#if defined (__STDC__) && __STDC__
4366
# define lt_ptr void *
4368
# define lt_ptr char *
4372
/* The mapping between symbol names and symbols. */
4377
lt_preloaded_symbols[] =
4381
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4383
$echo >> "$output_objdir/$dlsyms" "\
4387
/* This works around a problem in FreeBSD linker */
4388
#ifdef FREEBSD_WORKAROUND
4389
static const void *lt_preloaded_setup() {
4390
return lt_preloaded_symbols;
4400
pic_flag_for_symtable=
4402
# compiling the symbol table file with pic_flag works around
4403
# a FreeBSD bug that causes programs to crash when -lm is
4404
# linked before any other PIC object. But we must not use
4405
# pic_flag when linking with -static. The problem exists in
4406
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4407
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4408
case "$compile_command " in
4410
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4413
case "$compile_command " in
4415
*) pic_flag_for_symtable=" $pic_flag";;
4419
# Now compile the dynamic symbol file.
4420
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4421
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4423
# Clean up the generated files.
4424
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4425
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4427
# Transform the symbol file into the correct name.
4428
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4429
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4432
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4437
# We keep going just in case the user didn't refer to
4438
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4439
# really was required.
4441
# Nullify the symbol file.
4442
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4443
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4446
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4447
# Replace the output file specification.
4448
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4449
link_command="$compile_command$compile_rpath"
4451
# We have no uninstalled library dependencies, so finalize right now.
4452
$show "$link_command"
4453
$run eval "$link_command"
4456
# Delete the generated files.
4457
if test -n "$dlsyms"; then
4458
$show "$rm $output_objdir/${outputname}S.${objext}"
4459
$run $rm "$output_objdir/${outputname}S.${objext}"
4465
if test -n "$shlibpath_var"; then
4466
# We should set the shlibpath_var
4468
for dir in $temp_rpath; do
4470
[\\/]* | [A-Za-z]:[\\/]*)
4475
# Relative path: add a thisdir entry.
4476
rpath="$rpath\$thisdir/$dir:"
4483
if test -n "$compile_shlibpath$finalize_shlibpath"; then
4484
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4486
if test -n "$finalize_shlibpath"; then
4487
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4492
if test -n "$runpath_var"; then
4493
if test -n "$perm_rpath"; then
4494
# We should set the runpath_var.
4496
for dir in $perm_rpath; do
4499
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4501
if test -n "$finalize_perm_rpath"; then
4502
# We should set the runpath_var.
4504
for dir in $finalize_perm_rpath; do
4507
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4511
if test "$no_install" = yes; then
4512
# We don't need to create a wrapper script.
4513
link_command="$compile_var$compile_command$compile_rpath"
4514
# Replace the output file specification.
4515
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4516
# Delete the old output file.
4518
# Link the executable and exit
4519
$show "$link_command"
4520
$run eval "$link_command" || exit $?
4524
if test "$hardcode_action" = relink; then
4525
# Fast installation is not supported
4526
link_command="$compile_var$compile_command$compile_rpath"
4527
relink_command="$finalize_var$finalize_command$finalize_rpath"
4529
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4530
$echo "$modename: \`$output' will be relinked during installation" 1>&2
4532
if test "$fast_install" != no; then
4533
link_command="$finalize_var$compile_command$finalize_rpath"
4534
if test "$fast_install" = yes; then
4535
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4537
# fast_install is set to needless
4541
link_command="$compile_var$compile_command$compile_rpath"
4542
relink_command="$finalize_var$finalize_command$finalize_rpath"
4546
# Replace the output file specification.
4547
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4549
# Delete the old output files.
4550
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4552
$show "$link_command"
4553
$run eval "$link_command" || exit $?
4555
# Now create the wrapper script.
4556
$show "creating $output"
4558
# Quote the relink command for shipping.
4559
if test -n "$relink_command"; then
4560
# Preserve any variables that may affect compiler behavior
4561
for var in $variables_saved_for_relink; do
4562
if eval test -z \"\${$var+set}\"; then
4563
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4564
elif eval var_value=\$$var; test -z "$var_value"; then
4565
relink_command="$var=; export $var; $relink_command"
4567
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4568
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4571
relink_command="(cd `pwd`; $relink_command)"
4572
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4575
# Quote $echo for shipping.
4576
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4578
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4579
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4581
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4583
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4586
# Only actually do things if our run command is non-null.
4587
if test -z "$run"; then
4588
# win32 will think the script is a binary if it has
4589
# a .exe suffix, so we strip it off here.
4591
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4593
# test for cygwin because mv fails w/o .exe extensions
4597
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4601
*cygwin* | *mingw* )
4602
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4603
cwrapper=`$echo ${output}.exe`
4604
$rm $cwrappersource $cwrapper
4605
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4607
cat > $cwrappersource <<EOF
4609
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4610
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4612
The $output program cannot be directly executed until all the libtool
4613
libraries that it depends on are installed.
4615
This wrapper executable should never be moved out of the build directory.
4616
If it is, it will not operate correctly.
4618
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4619
but could eventually absorb all of the scripts functionality and
4620
exec $objdir/$outputname directly.
4623
cat >> $cwrappersource<<"EOF"
4631
#if defined(PATH_MAX)
4632
# define LT_PATHMAX PATH_MAX
4633
#elif defined(MAXPATHLEN)
4634
# define LT_PATHMAX MAXPATHLEN
4636
# define LT_PATHMAX 1024
4639
#ifndef DIR_SEPARATOR
4640
#define DIR_SEPARATOR '/'
4643
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4645
#define HAVE_DOS_BASED_FILE_SYSTEM
4646
#ifndef DIR_SEPARATOR_2
4647
#define DIR_SEPARATOR_2 '\\'
4651
#ifndef DIR_SEPARATOR_2
4652
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4653
#else /* DIR_SEPARATOR_2 */
4654
# define IS_DIR_SEPARATOR(ch) \
4655
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4656
#endif /* DIR_SEPARATOR_2 */
4658
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4659
#define XFREE(stale) do { \
4660
if (stale) { free ((void *) stale); stale = 0; } \
4663
const char *program_name = NULL;
4665
void * xmalloc (size_t num);
4666
char * xstrdup (const char *string);
4667
char * basename (const char *name);
4668
char * fnqualify(const char *path);
4669
char * strendzap(char *str, const char *pat);
4670
void lt_fatal (const char *message, ...);
4673
main (int argc, char *argv[])
4678
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4679
newargz = XMALLOC(char *, argc+2);
4682
cat >> $cwrappersource <<EOF
4683
newargz[0] = "$SHELL";
4686
cat >> $cwrappersource <<"EOF"
4687
newargz[1] = fnqualify(argv[0]);
4688
/* we know the script has the same name, without the .exe */
4689
/* so make sure newargz[1] doesn't end in .exe */
4690
strendzap(newargz[1],".exe");
4691
for (i = 1; i < argc; i++)
4692
newargz[i+1] = xstrdup(argv[i]);
4693
newargz[argc+1] = NULL;
4696
cat >> $cwrappersource <<EOF
4697
execv("$SHELL",newargz);
4700
cat >> $cwrappersource <<"EOF"
4704
xmalloc (size_t num)
4706
void * p = (void *) malloc (num);
4708
lt_fatal ("Memory exhausted");
4714
xstrdup (const char *string)
4716
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4721
basename (const char *name)
4725
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4726
/* Skip over the disk name in MSDOS pathnames. */
4727
if (isalpha (name[0]) && name[1] == ':')
4731
for (base = name; *name; name++)
4732
if (IS_DIR_SEPARATOR (*name))
4734
return (char *) base;
4738
fnqualify(const char *path)
4742
char tmp[LT_PATHMAX + 1];
4744
assert(path != NULL);
4746
/* Is it qualified already? */
4747
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4748
if (isalpha (path[0]) && path[1] == ':')
4749
return xstrdup (path);
4751
if (IS_DIR_SEPARATOR (path[0]))
4752
return xstrdup (path);
4754
/* prepend the current directory */
4755
/* doesn't handle '~' */
4756
if (getcwd (tmp, LT_PATHMAX) == NULL)
4757
lt_fatal ("getcwd failed");
4758
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4759
p = XMALLOC(char, size);
4760
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4765
strendzap(char *str, const char *pat)
4769
assert(str != NULL);
4770
assert(pat != NULL);
4773
patlen = strlen(pat);
4777
str += len - patlen;
4778
if (strcmp(str, pat) == 0)
4785
lt_error_core (int exit_status, const char * mode,
4786
const char * message, va_list ap)
4788
fprintf (stderr, "%s: %s: ", program_name, mode);
4789
vfprintf (stderr, message, ap);
4790
fprintf (stderr, ".\n");
4792
if (exit_status >= 0)
4797
lt_fatal (const char *message, ...)
4800
va_start (ap, message);
4801
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4805
# we should really use a build-platform specific compiler
4806
# here, but OTOH, the wrappers (shell script and this C one)
4807
# are only useful if you want to execute the "real" binary.
4808
# Since the "real" binary is built for $host, then this
4809
# wrapper might as well be built for $host, too.
4810
$run $LTCC -s -o $cwrapper $cwrappersource
4814
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4819
# $output - temporary wrapper script for $objdir/$outputname
4820
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4822
# The $output program cannot be directly executed until all the libtool
4823
# libraries that it depends on are installed.
4825
# This wrapper script should never be moved out of the build directory.
4826
# If it is, it will not operate correctly.
4828
# Sed substitution that helps us do robust quoting. It backslashifies
4829
# metacharacters that are still active within double-quoted strings.
4830
Xsed='${SED} -e 1s/^X//'
4831
sed_quote_subst='$sed_quote_subst'
4833
# The HP-UX ksh and POSIX shell print the target directory to stdout
4835
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4837
relink_command=\"$relink_command\"
4839
# This environment variable determines our operation mode.
4840
if test \"\$libtool_install_magic\" = \"$magic\"; then
4841
# install mode needs the following variable:
4842
notinst_deplibs='$notinst_deplibs'
4844
# When we are sourced in execute mode, \$file and \$echo are already set.
4845
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4848
# Make sure echo works.
4849
if test \"X\$1\" = X--no-reexec; then
4850
# Discard the --no-reexec flag, and continue.
4852
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4853
# Yippee, \$echo works!
4856
# Restart under the correct shell, and then maybe \$echo will work.
4857
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4863
# Find the directory that this script lives in.
4864
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4865
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4867
# Follow symbolic links until we get to the real thisdir.
4868
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4869
while test -n \"\$file\"; do
4870
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4872
# If there was a directory component, then change thisdir.
4873
if test \"x\$destdir\" != \"x\$file\"; then
4874
case \"\$destdir\" in
4875
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4876
*) thisdir=\"\$thisdir/\$destdir\" ;;
4880
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4881
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4884
# Try to get the absolute directory name.
4885
absdir=\`cd \"\$thisdir\" && pwd\`
4886
test -n \"\$absdir\" && thisdir=\"\$absdir\"
4889
if test "$fast_install" = yes; then
4891
program=lt-'$outputname'$exeext
4892
progdir=\"\$thisdir/$objdir\"
4894
if test ! -f \"\$progdir/\$program\" || \\
4895
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4896
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4898
file=\"\$\$-\$program\"
4900
if test ! -d \"\$progdir\"; then
4901
$mkdir \"\$progdir\"
4903
$rm \"\$progdir/\$file\"
4908
# relink executable if necessary
4909
if test -n \"\$relink_command\"; then
4910
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4912
$echo \"\$relink_command_output\" >&2
4913
$rm \"\$progdir/\$file\"
4918
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4919
{ $rm \"\$progdir/\$program\";
4920
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4921
$rm \"\$progdir/\$file\"
4925
program='$outputname'
4926
progdir=\"\$thisdir/$objdir\"
4932
if test -f \"\$progdir/\$program\"; then"
4934
# Export our shlibpath_var if we have one.
4935
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4937
# Add our own library path to $shlibpath_var
4938
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4940
# Some systems cannot cope with colon-terminated $shlibpath_var
4941
# The second colon is a workaround for a bug in BeOS R4 sed
4942
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4944
export $shlibpath_var
4948
# fixup the dll searchpath if we need to.
4949
if test -n "$dllsearchpath"; then
4951
# Add the dll search path components to the executable PATH
4952
PATH=$dllsearchpath:\$PATH
4957
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4958
# Run the actual program with our arguments.
4961
# Backslashes separate directories on plain windows
4962
*-*-mingw | *-*-os2*)
4964
exec \$progdir\\\\\$program \${1+\"\$@\"}
4970
exec \$progdir/\$program \${1+\"\$@\"}
4975
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4979
# The program doesn't exist.
4980
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4981
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4982
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
4993
# See if we need to build an old-fashioned archive.
4994
for oldlib in $oldlibs; do
4996
if test "$build_libtool_libs" = convenience; then
4997
oldobjs="$libobjs_save"
4998
addlibs="$convenience"
4999
build_libtool_libs=no
5001
if test "$build_libtool_libs" = module; then
5002
oldobjs="$libobjs_save"
5003
build_libtool_libs=no
5005
oldobjs="$old_deplibs $non_pic_objects"
5007
addlibs="$old_convenience"
5010
if test -n "$addlibs"; then
5011
gentop="$output_objdir/${outputname}x"
5012
$show "${rm}r $gentop"
5013
$run ${rm}r "$gentop"
5014
$show "$mkdir $gentop"
5015
$run $mkdir "$gentop"
5017
if test "$status" -ne 0 && test ! -d "$gentop"; then
5020
generated="$generated $gentop"
5022
# Add in members from convenience archives.
5023
for xlib in $addlibs; do
5024
# Extract the objects.
5026
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5027
*) xabs=`pwd`"/$xlib" ;;
5029
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5030
xdir="$gentop/$xlib"
5032
$show "${rm}r $xdir"
5034
$show "$mkdir $xdir"
5037
if test "$status" -ne 0 && test ! -d "$xdir"; then
5040
# We will extract separately just the conflicting names and we will no
5041
# longer touch any unique names. It is faster to leave these extract
5042
# automatically by $AR in one run.
5043
$show "(cd $xdir && $AR x $xabs)"
5044
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5045
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5048
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5049
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5050
$AR t "$xabs" | sort | uniq -cd | while read -r count name
5053
while test "$i" -le "$count"
5055
# Put our $i before any first dot (extension)
5056
# Never overwrite any file
5058
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5060
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5062
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5063
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5069
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5073
# Do each command in the archive commands.
5074
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5075
cmds=$old_archive_from_new_cmds
5077
eval cmds=\"$old_archive_cmds\"
5079
if len=`expr "X$cmds" : ".*"` &&
5080
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5081
cmds=$old_archive_cmds
5083
# the command line is too long to link in one step, link in parts
5084
$echo "using piecewise archive linking..."
5089
save_oldobjs=$oldobjs
5090
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5091
# encoded into archives. This makes 'ar r' malfunction in
5092
# this piecewise linking case whenever conflicting object
5093
# names appear in distinct ar calls; check, warn and compensate.
5094
if (for obj in $save_oldobjs
5096
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5097
done | sort | sort -uc >/dev/null 2>&1); then
5100
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5101
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5104
# Is there a better way of finding the last object in the list?
5105
for obj in $save_oldobjs
5109
for obj in $save_oldobjs
5111
oldobjs="$objlist $obj"
5112
objlist="$objlist $obj"
5113
eval test_cmds=\"$old_archive_cmds\"
5114
if len=`expr "X$test_cmds" : ".*"` &&
5115
test "$len" -le "$max_cmd_len"; then
5118
# the above command should be used before it gets too long
5120
if test "$obj" = "$last_oldobj" ; then
5123
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5124
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5130
if test "X$oldobjs" = "X" ; then
5131
eval cmds=\"\$concat_cmds\"
5133
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5137
save_ifs="$IFS"; IFS='~'
5138
for cmd in $cmds; do
5142
$run eval "$cmd" || exit $?
5147
if test -n "$generated"; then
5148
$show "${rm}r$generated"
5149
$run ${rm}r$generated
5152
# Now create the libtool archive.
5156
test "$build_old_libs" = yes && old_library="$libname.$libext"
5157
$show "creating $output"
5159
# Preserve any variables that may affect compiler behavior
5160
for var in $variables_saved_for_relink; do
5161
if eval test -z \"\${$var+set}\"; then
5162
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5163
elif eval var_value=\$$var; test -z "$var_value"; then
5164
relink_command="$var=; export $var; $relink_command"
5166
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5167
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5170
# Quote the link command for shipping.
5171
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5172
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5173
if test "$hardcode_automatic" = yes ; then
5178
# Only create the output if not a dry run.
5179
if test -z "$run"; then
5180
for installed in no yes; do
5181
if test "$installed" = yes; then
5182
if test -z "$install_libdir"; then
5185
output="$output_objdir/$outputname"i
5186
# Replace all uninstalled libtool libraries with the installed ones
5188
for deplib in $dependency_libs; do
5191
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5192
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5193
if test -z "$libdir"; then
5194
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5197
newdependency_libs="$newdependency_libs $libdir/$name"
5199
*) newdependency_libs="$newdependency_libs $deplib" ;;
5202
dependency_libs="$newdependency_libs"
5204
for lib in $dlfiles; do
5205
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5206
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5207
if test -z "$libdir"; then
5208
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5211
newdlfiles="$newdlfiles $libdir/$name"
5213
dlfiles="$newdlfiles"
5215
for lib in $dlprefiles; do
5216
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5217
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5218
if test -z "$libdir"; then
5219
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5222
newdlprefiles="$newdlprefiles $libdir/$name"
5224
dlprefiles="$newdlprefiles"
5227
for lib in $dlfiles; do
5229
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5230
*) abs=`pwd`"/$lib" ;;
5232
newdlfiles="$newdlfiles $abs"
5234
dlfiles="$newdlfiles"
5236
for lib in $dlprefiles; do
5238
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5239
*) abs=`pwd`"/$lib" ;;
5241
newdlprefiles="$newdlprefiles $abs"
5243
dlprefiles="$newdlprefiles"
5246
# place dlname in correct position for cygwin
5248
case $host,$output,$installed,$module,$dlname in
5249
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5252
# $outputname - a libtool library file
5253
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5255
# Please DO NOT delete this file!
5256
# It is necessary for linking the library.
5258
# The name that we can dlopen(3).
5261
# Names of this library.
5262
library_names='$library_names'
5264
# The name of the static archive.
5265
old_library='$old_library'
5267
# Libraries that this one depends upon.
5268
dependency_libs='$dependency_libs'
5270
# Version information for $libname.
5275
# Is this an already installed library?
5276
installed=$installed
5278
# Should we warn about portability when linking against -modules?
5279
shouldnotlink=$module
5281
# Files to dlopen/dlpreopen
5283
dlpreopen='$dlprefiles'
5285
# Directory that this library needs to be installed in:
5286
libdir='$install_libdir'"
5287
if test "$installed" = no && test "$need_relink" = yes; then
5289
relink_command=\"$relink_command\""
5294
# Do a symbolic link so that the libtool archive can be found in
5295
# LD_LIBRARY_PATH before the program is installed.
5296
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5297
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5303
# libtool install mode
5305
modename="$modename: install"
5307
# There may be an optional sh(1) argument at the beginning of
5308
# install_prog (especially on Windows NT).
5309
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5310
# Allow the use of GNU shtool's install command.
5311
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5312
# Aesthetically quote it.
5313
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5315
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5319
install_prog="$arg "
5327
# The real first argument should be the name of the installation program.
5328
# Aesthetically quote it.
5329
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5331
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5335
install_prog="$install_prog$arg"
5337
# We need to accept at least all the BSD install flags.
5347
if test -n "$dest"; then
5348
files="$files $dest"
5366
# If the previous option needed an argument, then skip it.
5367
if test -n "$prev"; then
5376
# Aesthetically quote the argument.
5377
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5379
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5383
install_prog="$install_prog $arg"
5386
if test -z "$install_prog"; then
5387
$echo "$modename: you must specify an install program" 1>&2
5392
if test -n "$prev"; then
5393
$echo "$modename: the \`$prev' option requires an argument" 1>&2
5398
if test -z "$files"; then
5399
if test -z "$dest"; then
5400
$echo "$modename: no file or destination specified" 1>&2
5402
$echo "$modename: you must specify a destination" 1>&2
5408
# Strip any trailing slash from the destination.
5409
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5411
# Check to see that the destination is a directory.
5412
test -d "$dest" && isdir=yes
5413
if test "$isdir" = yes; then
5417
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5418
test "X$destdir" = "X$dest" && destdir=.
5419
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5421
# Not a directory, so check to see that there is only one file specified.
5423
if test "$#" -gt 2; then
5424
$echo "$modename: \`$dest' is not a directory" 1>&2
5430
[\\/]* | [A-Za-z]:[\\/]*) ;;
5432
for file in $files; do
5436
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5445
# This variable tells wrapper scripts just to set variables rather
5446
# than running their programs.
5447
libtool_install_magic="$magic"
5452
for file in $files; do
5454
# Do each installation.
5457
# Do the static libraries later.
5458
staticlibs="$staticlibs $file"
5462
# Check to see that this really is a libtool archive.
5463
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5465
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5473
# If there is no directory component, then add one.
5475
*/* | *\\*) . $file ;;
5479
# Add the libdir to current_libdirs if it is the destination.
5480
if test "X$destdir" = "X$libdir"; then
5481
case "$current_libdirs " in
5483
*) current_libdirs="$current_libdirs $libdir" ;;
5486
# Note the libdir as a future libdir.
5487
case "$future_libdirs " in
5489
*) future_libdirs="$future_libdirs $libdir" ;;
5493
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5494
test "X$dir" = "X$file/" && dir=
5497
if test -n "$relink_command"; then
5498
# Determine the prefix the user has applied to our future dir.
5499
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5501
# Don't allow the user to place us outside of our expected
5502
# location b/c this prevents finding dependent libraries that
5503
# are installed to the same prefix.
5504
# At present, this check doesn't affect windows .dll's that
5505
# are installed into $libdir/../bin (currently, that works fine)
5506
# but it's something to keep an eye on.
5507
if test "$inst_prefix_dir" = "$destdir"; then
5508
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5512
if test -n "$inst_prefix_dir"; then
5513
# Stick the inst_prefix_dir data into the link command.
5514
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5516
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5519
$echo "$modename: warning: relinking \`$file'" 1>&2
5520
$show "$relink_command"
5521
if $run eval "$relink_command"; then :
5523
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5528
# See the names of the shared library.
5529
set dummy $library_names
5530
if test -n "$2"; then
5536
test -n "$relink_command" && srcname="$realname"T
5538
# Install the shared library and build the symlinks.
5539
$show "$install_prog $dir/$srcname $destdir/$realname"
5540
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5541
if test -n "$stripme" && test -n "$striplib"; then
5542
$show "$striplib $destdir/$realname"
5543
$run eval "$striplib $destdir/$realname" || exit $?
5546
if test "$#" -gt 0; then
5547
# Delete the old symlinks, and create new ones.
5550
if test "$linkname" != "$realname"; then
5551
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5552
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5557
# Do each command in the postinstall commands.
5558
lib="$destdir/$realname"
5559
cmds=$postinstall_cmds
5560
save_ifs="$IFS"; IFS='~'
5561
for cmd in $cmds; do
5565
$run eval "$cmd" || exit $?
5570
# Install the pseudo-library for information purposes.
5571
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5572
instname="$dir/$name"i
5573
$show "$install_prog $instname $destdir/$name"
5574
$run eval "$install_prog $instname $destdir/$name" || exit $?
5576
# Maybe install the static library, too.
5577
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5581
# Install (i.e. copy) a libtool object.
5583
# Figure out destination file name, if it wasn't already specified.
5584
if test -n "$destname"; then
5585
destfile="$destdir/$destname"
5587
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5588
destfile="$destdir/$destfile"
5591
# Deduce the name of the destination old-style object file.
5594
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5597
staticdest="$destfile"
5601
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5607
# Install the libtool object if requested.
5608
if test -n "$destfile"; then
5609
$show "$install_prog $file $destfile"
5610
$run eval "$install_prog $file $destfile" || exit $?
5613
# Install the old object if enabled.
5614
if test "$build_old_libs" = yes; then
5615
# Deduce the name of the old-style object file.
5616
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5618
$show "$install_prog $staticobj $staticdest"
5619
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
5625
# Figure out destination file name, if it wasn't already specified.
5626
if test -n "$destname"; then
5627
destfile="$destdir/$destname"
5629
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5630
destfile="$destdir/$destfile"
5633
# If the file is missing, and there is a .exe on the end, strip it
5634
# because it is most likely a libtool script we actually want to
5639
if test ! -f "$file"; then
5640
file=`$echo $file|${SED} 's,.exe$,,'`
5646
# Do a test to see if this is really a libtool program.
5649
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5655
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5659
# To insure that "foo" is sourced, and not "foo.exe",
5660
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5661
# which disallows the automatic-append-.exe behavior.
5663
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5664
*) wrapperdot=${wrapper} ;;
5666
# If there is no directory component, then add one.
5668
*/* | *\\*) . ${wrapperdot} ;;
5669
*) . ./${wrapperdot} ;;
5672
# Check the variables that should have been set.
5673
if test -z "$notinst_deplibs"; then
5674
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5679
for lib in $notinst_deplibs; do
5680
# Check to see that each library is installed.
5682
if test -f "$lib"; then
5683
# If there is no directory component, then add one.
5685
*/* | *\\*) . $lib ;;
5689
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5690
if test -n "$libdir" && test ! -f "$libfile"; then
5691
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5697
# To insure that "foo" is sourced, and not "foo.exe",
5698
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5699
# which disallows the automatic-append-.exe behavior.
5701
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5702
*) wrapperdot=${wrapper} ;;
5704
# If there is no directory component, then add one.
5706
*/* | *\\*) . ${wrapperdot} ;;
5707
*) . ./${wrapperdot} ;;
5711
if test "$fast_install" = no && test -n "$relink_command"; then
5712
if test "$finalize" = yes && test -z "$run"; then
5714
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5715
tmpdir="$tmpdir/libtool-$$"
5718
if $mkdir "$tmpdir"; then
5722
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5725
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5726
outputname="$tmpdir/$file"
5727
# Replace the output file specification.
5728
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5730
$show "$relink_command"
5731
if $run eval "$relink_command"; then :
5733
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5739
$echo "$modename: warning: cannot relink \`$file'" 1>&2
5742
# Install the binary that we compiled earlier.
5743
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5747
# remove .exe since cygwin /usr/bin/install will append another
5749
case $install_prog,$host in
5750
*/usr/bin/install*,*cygwin*)
5751
case $file:$destfile in
5756
destfile=$destfile.exe
5759
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5764
$show "$install_prog$stripme $file $destfile"
5765
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5766
test -n "$outputname" && ${rm}r "$tmpdir"
5771
for file in $staticlibs; do
5772
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5774
# Set up the ranlib parameters.
5775
oldlib="$destdir/$name"
5777
$show "$install_prog $file $oldlib"
5778
$run eval "$install_prog \$file \$oldlib" || exit $?
5780
if test -n "$stripme" && test -n "$old_striplib"; then
5781
$show "$old_striplib $oldlib"
5782
$run eval "$old_striplib $oldlib" || exit $?
5785
# Do each command in the postinstall commands.
5786
cmds=$old_postinstall_cmds
5787
save_ifs="$IFS"; IFS='~'
5788
for cmd in $cmds; do
5792
$run eval "$cmd" || exit $?
5797
if test -n "$future_libdirs"; then
5798
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5801
if test -n "$current_libdirs"; then
5802
# Maybe just do a dry run.
5803
test -n "$run" && current_libdirs=" -n$current_libdirs"
5804
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5810
# libtool finish mode
5812
modename="$modename: finish"
5816
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5819
libdirs="$libdirs $dir"
5822
for libdir in $libdirs; do
5823
if test -n "$finish_cmds"; then
5824
# Do each command in the finish commands.
5826
save_ifs="$IFS"; IFS='~'
5827
for cmd in $cmds; do
5831
$run eval "$cmd" || admincmds="$admincmds
5836
if test -n "$finish_eval"; then
5837
# Do the single finish_eval.
5838
eval cmds=\"$finish_eval\"
5839
$run eval "$cmds" || admincmds="$admincmds
5845
# Exit here if they wanted silent mode.
5846
test "$show" = : && exit $EXIT_SUCCESS
5848
$echo "----------------------------------------------------------------------"
5849
$echo "Libraries have been installed in:"
5850
for libdir in $libdirs; do
5854
$echo "If you ever happen to want to link against installed libraries"
5855
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5856
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5857
$echo "flag during linking and do at least one of the following:"
5858
if test -n "$shlibpath_var"; then
5859
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5860
$echo " during execution"
5862
if test -n "$runpath_var"; then
5863
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5864
$echo " during linking"
5866
if test -n "$hardcode_libdir_flag_spec"; then
5868
eval flag=\"$hardcode_libdir_flag_spec\"
5870
$echo " - use the \`$flag' linker flag"
5872
if test -n "$admincmds"; then
5873
$echo " - have your system administrator run these commands:$admincmds"
5875
if test -f /etc/ld.so.conf; then
5876
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5879
$echo "See any operating system documentation about shared libraries for"
5880
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5881
$echo "----------------------------------------------------------------------"
5885
# libtool execute mode
5887
modename="$modename: execute"
5889
# The first argument is the command name.
5891
if test -z "$cmd"; then
5892
$echo "$modename: you must specify a COMMAND" 1>&2
5897
# Handle -dlopen flags immediately.
5898
for file in $execute_dlfiles; do
5899
if test ! -f "$file"; then
5900
$echo "$modename: \`$file' is not a file" 1>&2
5908
# Check to see that this really is a libtool archive.
5909
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5911
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5916
# Read the libtool library.
5920
# If there is no directory component, then add one.
5922
*/* | *\\*) . $file ;;
5926
# Skip this library if it cannot be dlopened.
5927
if test -z "$dlname"; then
5928
# Warn if it was a shared library.
5929
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5933
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5934
test "X$dir" = "X$file" && dir=.
5936
if test -f "$dir/$objdir/$dlname"; then
5939
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5945
# Just add the directory containing the .lo file.
5946
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5947
test "X$dir" = "X$file" && dir=.
5951
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5956
# Get the absolute pathname.
5957
absdir=`cd "$dir" && pwd`
5958
test -n "$absdir" && dir="$absdir"
5960
# Now add the directory to shlibpath_var.
5961
if eval "test -z \"\$$shlibpath_var\""; then
5962
eval "$shlibpath_var=\"\$dir\""
5964
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5968
# This variable tells wrapper scripts just to set shlibpath_var
5969
# rather than running their programs.
5970
libtool_execute_magic="$magic"
5972
# Check if any of the arguments is a wrapper script.
5979
# Do a test to see if this is really a libtool program.
5980
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5981
# If there is no directory component, then add one.
5983
*/* | *\\*) . $file ;;
5987
# Transform arg to wrapped name.
5988
file="$progdir/$program"
5992
# Quote arguments (to preserve shell metacharacters).
5993
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5994
args="$args \"$file\""
5997
if test -z "$run"; then
5998
if test -n "$shlibpath_var"; then
5999
# Export the shlibpath_var.
6000
eval "export $shlibpath_var"
6003
# Restore saved environment variables
6004
if test "${save_LC_ALL+set}" = set; then
6005
LC_ALL="$save_LC_ALL"; export LC_ALL
6007
if test "${save_LANG+set}" = set; then
6008
LANG="$save_LANG"; export LANG
6011
# Now prepare to actually exec the command.
6012
exec_cmd="\$cmd$args"
6014
# Display what would be done.
6015
if test -n "$shlibpath_var"; then
6016
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6017
$echo "export $shlibpath_var"
6024
# libtool clean and uninstall mode
6026
modename="$modename: $mode"
6032
# This variable tells wrapper scripts just to set variables rather
6033
# than running their programs.
6034
libtool_install_magic="$magic"
6039
-f) rm="$rm $arg"; rmforce=yes ;;
6040
-*) rm="$rm $arg" ;;
6041
*) files="$files $arg" ;;
6045
if test -z "$rm"; then
6046
$echo "$modename: you must specify an RM program" 1>&2
6053
origobjdir="$objdir"
6054
for file in $files; do
6055
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6056
if test "X$dir" = "X$file"; then
6058
objdir="$origobjdir"
6060
objdir="$dir/$origobjdir"
6062
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6063
test "$mode" = uninstall && objdir="$dir"
6065
# Remember objdir for removal later, being careful to avoid duplicates
6066
if test "$mode" = clean; then
6069
*) rmdirs="$rmdirs $objdir" ;;
6073
# Don't error if the file doesn't exist and rm -f was used.
6074
if (test -L "$file") >/dev/null 2>&1 \
6075
|| (test -h "$file") >/dev/null 2>&1 \
6076
|| test -f "$file"; then
6078
elif test -d "$file"; then
6081
elif test "$rmforce" = yes; then
6089
# Possibly a libtool archive, so verify it.
6090
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6093
# Delete the libtool libraries and symlinks.
6094
for n in $library_names; do
6095
rmfiles="$rmfiles $objdir/$n"
6097
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6098
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6100
if test "$mode" = uninstall; then
6101
if test -n "$library_names"; then
6102
# Do each command in the postuninstall commands.
6103
cmds=$postuninstall_cmds
6104
save_ifs="$IFS"; IFS='~'
6105
for cmd in $cmds; do
6110
if test "$?" -ne 0 && test "$rmforce" != yes; then
6117
if test -n "$old_library"; then
6118
# Do each command in the old_postuninstall commands.
6119
cmds=$old_postuninstall_cmds
6120
save_ifs="$IFS"; IFS='~'
6121
for cmd in $cmds; do
6126
if test "$?" -ne 0 && test "$rmforce" != yes; then
6132
# FIXME: should reinstall the best remaining shared library.
6138
# Possibly a libtool object, so verify it.
6139
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6144
# Add PIC object to the list of files to remove.
6145
if test -n "$pic_object" \
6146
&& test "$pic_object" != none; then
6147
rmfiles="$rmfiles $dir/$pic_object"
6150
# Add non-PIC object to the list of files to remove.
6151
if test -n "$non_pic_object" \
6152
&& test "$non_pic_object" != none; then
6153
rmfiles="$rmfiles $dir/$non_pic_object"
6159
if test "$mode" = clean ; then
6163
file=`$echo $file|${SED} 's,.exe$,,'`
6164
noexename=`$echo $name|${SED} 's,.exe$,,'`
6165
# $file with .exe has already been added to rmfiles,
6166
# add $file without .exe
6167
rmfiles="$rmfiles $file"
6170
# Do a test to see if this is a libtool program.
6171
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6175
# note $name still contains .exe if it was in $file originally
6176
# as does the version of $file that was added into $rmfiles
6177
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6178
if test "$fast_install" = yes && test -n "$relink_command"; then
6179
rmfiles="$rmfiles $objdir/lt-$name"
6181
if test "X$noexename" != "X$name" ; then
6182
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6188
$show "$rm $rmfiles"
6189
$run $rm $rmfiles || exit_status=1
6191
objdir="$origobjdir"
6193
# Try to remove the ${objdir}s in the directories where we deleted files
6194
for dir in $rmdirs; do
6195
if test -d "$dir"; then
6197
$run rmdir $dir >/dev/null 2>&1
6205
$echo "$modename: you must specify a MODE" 1>&2
6206
$echo "$generic_help" 1>&2
6211
if test -z "$exec_cmd"; then
6212
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6213
$echo "$generic_help" 1>&2
6216
fi # test -z "$show_help"
6218
if test -n "$exec_cmd"; then
6223
# We need to display help for each of the modes.
6226
"Usage: $modename [OPTION]... [MODE-ARG]...
6228
Provide generalized library-building support services.
6230
--config show all configuration variables
6231
--debug enable verbose shell tracing
6232
-n, --dry-run display commands without modifying any files
6233
--features display basic configuration information and exit
6234
--finish same as \`--mode=finish'
6235
--help display this help message and exit
6236
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6237
--quiet same as \`--silent'
6238
--silent don't print informational messages
6239
--tag=TAG use configuration variables from tag TAG
6240
--version print version information
6242
MODE must be one of the following:
6244
clean remove files from the build directory
6245
compile compile a source file into a libtool object
6246
execute automatically set library path, then run a program
6247
finish complete the installation of libtool libraries
6248
install install libraries or executables
6249
link create a library or an executable
6250
uninstall remove libraries from an installed directory
6252
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6253
a more detailed description of MODE.
6255
Report bugs to <bug-libtool@gnu.org>."
6261
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6263
Remove files from the build directory.
6265
RM is the name of the program to use to delete files associated with each FILE
6266
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6269
If FILE is a libtool library, object or program, all the files associated
6270
with it are deleted. Otherwise, only FILE itself is deleted using RM."
6275
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6277
Compile a source file into a libtool library object.
6279
This mode accepts the following additional options:
6281
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
6282
-prefer-pic try to building PIC objects only
6283
-prefer-non-pic try to building non-PIC objects only
6284
-static always build a \`.o' file suitable for static linking
6286
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6287
from the given SOURCEFILE.
6289
The output file name is determined by removing the directory component from
6290
SOURCEFILE, then substituting the C source code suffix \`.c' with the
6291
library object suffix, \`.lo'."
6296
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6298
Automatically set library path, then run a program.
6300
This mode accepts the following additional options:
6302
-dlopen FILE add the directory containing FILE to the library path
6304
This mode sets the library path environment variable according to \`-dlopen'
6307
If any of the ARGS are libtool executable wrappers, then they are translated
6308
into their corresponding uninstalled binary, and any of their required library
6309
directories are added to the library path.
6311
Then, COMMAND is executed, with ARGS as arguments."
6316
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6318
Complete the installation of libtool libraries.
6320
Each LIBDIR is a directory that contains libtool libraries.
6322
The commands that this mode executes may require superuser privileges. Use
6323
the \`--dry-run' option if you just want to see what would be executed."
6328
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6330
Install executables or libraries.
6332
INSTALL-COMMAND is the installation command. The first component should be
6333
either the \`install' or \`cp' program.
6335
The rest of the components are interpreted as arguments to that command (only
6336
BSD-compatible install options are recognized)."
6341
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6343
Link object files or libraries together to form another library, or to
6344
create an executable program.
6346
LINK-COMMAND is a command using the C compiler that you would use to create
6347
a program from several object files.
6349
The following components of LINK-COMMAND are treated specially:
6351
-all-static do not do any dynamic linking at all
6352
-avoid-version do not add a version suffix if possible
6353
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6354
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6355
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6356
-export-symbols SYMFILE
6357
try to export only the symbols listed in SYMFILE
6358
-export-symbols-regex REGEX
6359
try to export only the symbols matching REGEX
6360
-LLIBDIR search LIBDIR for required installed libraries
6361
-lNAME OUTPUT-FILE requires the installed library libNAME
6362
-module build a library that can dlopened
6363
-no-fast-install disable the fast-install mode
6364
-no-install link a not-installable executable
6365
-no-undefined declare that a library does not refer to external symbols
6366
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6367
-objectlist FILE Use a list of object files found in FILE to specify objects
6368
-precious-files-regex REGEX
6369
don't remove output files matching REGEX
6370
-release RELEASE specify package release information
6371
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6372
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6373
-static do not do any dynamic linking of libtool libraries
6374
-version-info CURRENT[:REVISION[:AGE]]
6375
specify library version info [each variable defaults to 0]
6377
All other options (arguments beginning with \`-') are ignored.
6379
Every other argument is treated as a filename. Files ending in \`.la' are
6380
treated as uninstalled libtool libraries, other files are standard or library
6383
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6384
only library objects (\`.lo' files) may be specified, and \`-rpath' is
6385
required, except when creating a convenience library.
6387
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6388
using \`ar' and \`ranlib', or on Windows using \`lib'.
6390
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6391
is created, otherwise an executable program is created."
6396
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6398
Remove libraries from an installation directory.
6400
RM is the name of the program to use to delete files associated with each FILE
6401
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6404
If FILE is a libtool library, all the files associated with it are deleted.
6405
Otherwise, only FILE itself is deleted using RM."
6409
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6416
$echo "Try \`$modename --help' for more information about other modes."
6420
# The TAGs below are defined such that we never get into a situation
6421
# in which we disable both kinds of libraries. Given conflicting
6422
# choices, we go for a static library, that is the most portable,
6423
# since we can't tell whether shared libraries were disabled because
6424
# the user asked for that or because the platform doesn't support
6425
# them. This is particularly important on AIX, because we don't
6426
# support having both static and shared libraries enabled at the same
6427
# time on that platform, so we default to a shared-only configuration.
6428
# If a disable-shared tag is given, we'll fallback to a static-only
6429
# configuration. But we'll never go from static-only to shared-only.
6431
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6432
build_libtool_libs=no
6434
# ### END LIBTOOL TAG CONFIG: disable-shared
6436
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6437
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6438
# ### END LIBTOOL TAG CONFIG: disable-static