1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
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
# The name of this program:
37
progname=`echo "$progpath" | $SED $basename`
47
TIMESTAMP=" (1.1220.2.195 2005/02/12 12:12:33)"
49
# See if we are running on zsh, and set the options which allow our
50
# commands through without removal of \ escapes.
51
if test -n "${ZSH_VERSION+set}" ; then
55
# Check that we have a working $echo.
56
if test "X$1" = X--no-reexec; then
57
# Discard the --no-reexec flag, and continue.
59
elif test "X$1" = X--fallback-echo; then
60
# Avoid inline document here, it may be left over
62
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
63
# Yippee, $echo works!
66
# Restart under the correct shell, and then maybe $echo will work.
67
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
70
if test "X$1" = X--fallback-echo; then
71
# used as fallback echo
80
help="Try \`$progname --help' for more information."
81
magic="%%%MAGIC variable%%%"
86
# Sed substitution that helps us do robust quoting. It backslashifies
87
# metacharacters that are still active within double-quoted strings.
88
Xsed="${SED}"' -e 1s/^X//'
89
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
90
# test EBCDIC or ASCII
91
case `echo A|tr A '\301'` in
92
A) # EBCDIC based system
93
SP2NL="tr '\100' '\n'"
94
NL2SP="tr '\r\n' '\100\100'"
96
*) # Assume ASCII based system
97
SP2NL="tr '\040' '\012'"
98
NL2SP="tr '\015\012' '\040\040'"
103
# Only set LANG and LC_ALL to C if already set.
104
# These must not be set unconditionally because not all systems understand
105
# e.g. LANG=C (notably SCO).
106
# We save the old values to restore during execute mode.
107
if test "${LC_ALL+set}" = set; then
108
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
110
if test "${LANG+set}" = set; then
111
save_LANG="$LANG"; LANG=C; export LANG
114
# Make sure IFS has a sensible default
118
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
119
$echo "$modename: not configured to build any kind of library" 1>&2
120
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
133
lo2o="s/\\.lo\$/.${objext}/"
134
o2lo="s/\\.${objext}\$/.lo/"
135
quote_scanset='[[~#^*{};<>?'"'"' ]'
137
#####################################
138
# Shell function definitions:
139
# This seems to be the best place for them
141
# func_win32_libid arg
142
# return the library type of file 'arg'
144
# Need a lot of goo to handle *both* DLLs and import libs
145
# Has to be a shell function in order to 'eat' the argument
146
# that is supplied when $file_magic_command is called.
149
win32_libid_type="unknown"
150
win32_fileres=`file -L $1 2>/dev/null`
151
case $win32_fileres in
152
*ar\ archive\ import\ library*) # definitely import
153
win32_libid_type="x86 archive import"
155
*ar\ archive*) # could be an import, or static
156
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
157
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
158
win32_nmres=`eval $NM -f posix -A $1 | \
159
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
160
if test "X$win32_nmres" = "Ximport" ; then
161
win32_libid_type="x86 archive import"
163
win32_libid_type="x86 archive static"
168
win32_libid_type="x86 DLL"
170
*executable*) # but shell scripts are "executable" too...
171
case $win32_fileres in
172
*MS\ Windows\ PE\ Intel*)
173
win32_libid_type="x86 DLL"
178
$echo $win32_libid_type
183
# Infer tagged configuration to use if any are available and
184
# if one wasn't chosen via the "--tag" command line option.
185
# Only attempt this if the compiler in the base compile
186
# command doesn't match the default compiler.
187
# arg is usually of the form 'gcc ...'
190
if test -n "$available_tags" && test -z "$tagname"; then
194
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
198
CC_quoted="$CC_quoted $arg"
201
# Blanks in the command may have been stripped by the calling shell,
202
# but not from the CC environment variable when configure was run.
203
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
204
# Blanks at the start of $base_compile will cause this to fail
205
# if we don't check for them as well.
207
for z in $available_tags; do
208
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
209
# Evaluate the configuration.
210
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
213
# Double-quote args containing other shell metacharacters.
215
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
219
CC_quoted="$CC_quoted $arg"
222
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
223
# The compiler in the base compile command matches
224
# the one in the tagged configuration.
225
# Assume this is the tagged configuration we want.
232
# If $tagname still isn't set, then no tagged configuration
233
# was found and let the user know that the "--tag" command
234
# line option must be used.
235
if test -z "$tagname"; then
236
$echo "$modename: unable to infer tagged configuration"
237
$echo "$modename: specify a tag with \`--tag'" 1>&2
240
# $echo "$modename: using $tagname tagged configuration"
248
# func_extract_an_archive dir oldlib
249
func_extract_an_archive ()
251
f_ex_an_ar_dir="$1"; shift
252
f_ex_an_ar_oldlib="$1"
253
f_ex_an_ar_lib=`$echo "X$f_ex_an_ar_oldlib" | $Xsed -e 's%^.*/%%'`
255
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
256
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
257
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
260
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
261
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
262
$show "cp $f_ex_an_ar_oldlib $f_ex_an_ar_dir/$f_ex_an_ar_lib"
263
$run eval "cp \$f_ex_an_ar_oldlib \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
264
$AR t "$f_ex_an_ar_oldlib" | sort | uniq -c \
265
| $EGREP -v '^[ ]*1[ ]' | while read count name
268
while test "$i" -le "$count"
270
# Put our $i before any first dot (extension)
271
# Never overwrite any file
273
while test "X$name_to" = "X$name" || test -f "$f_ex_an_ar_dir/$name_to"
275
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
277
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_lib '$name' && $mv '$name' '$name_to')"
278
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_lib '$name' && $mv '$name' '$name_to' && $AR -d \$f_ex_an_ar_lib '$name')" || exit $?
282
$show "$rm $f_ex_an_ar_dir/$f_ex_an_ar_lib"
283
$run eval "$rm \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
287
# func_extract_archives gentop oldlib ...
288
func_extract_archives ()
290
my_gentop="$1"; shift
298
$show "${rm}r $my_gentop"
299
$run ${rm}r "$my_gentop"
300
$show "$mkdir $my_gentop"
301
$run $mkdir "$my_gentop"
303
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
307
for my_xlib in $my_oldlibs; do
308
# Extract the objects.
310
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
311
*) my_xabs=`pwd`"/$my_xlib" ;;
313
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
314
my_xdir="$my_gentop/$my_xlib"
316
$show "${rm}r $my_xdir"
317
$run ${rm}r "$my_xdir"
318
$show "$mkdir $my_xdir"
319
$run $mkdir "$my_xdir"
321
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
326
$show "Extracting $my_xabs"
327
# Do not bother doing anything if just a dry run
328
if test -z "$run"; then
329
darwin_orig_dir=`pwd`
330
cd $my_xdir || exit $?
331
darwin_archive=$my_xabs
333
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
334
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
335
if test -n "$darwin_arches"; then
336
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
338
$show "$darwin_base_archive has multiple architectures $darwin_arches"
339
for darwin_arch in $darwin_arches ; do
340
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
341
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
342
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
343
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
345
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
346
done # $darwin_arches
347
## Okay now we have a bunch of thin objects, gotta fatten them up :)
348
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
351
for darwin_file in $darwin_filelist; do
352
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
353
lipo -create -output "$darwin_file" $darwin_files
354
done # $darwin_filelist
356
cd "$darwin_orig_dir"
358
cd "$darwin_orig_dir"
359
func_extract_an_archive "$my_xdir" "$my_xabs"
364
func_extract_an_archive "$my_xdir" "$my_xabs"
367
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
369
func_extract_archives_result="$my_oldobjs"
371
# End of Shell function definitions
372
#####################################
375
eval std_shrext=\"$shrext_cmds\"
377
# Parse our command line options once, thoroughly.
378
while test "$#" -gt 0
384
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
388
# If the previous option needs an argument, assign it.
389
if test -n "$prev"; then
392
execute_dlfiles="$execute_dlfiles $arg"
396
preserve_args="${preserve_args}=$arg"
398
# Check whether tagname contains only valid characters
401
$echo "$progname: invalid tag name: $tagname" 1>&2
408
# Don't test for the "default" C tag, as we know, it's there, but
409
# not specially marked.
412
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
413
taglist="$taglist $tagname"
414
# Evaluate the configuration.
415
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
417
$echo "$progname: ignoring unknown tag $tagname" 1>&2
432
# Have we seen a non-optional argument yet?
439
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
441
$echo "Copyright (C) 2005 Free Software Foundation, Inc."
442
$echo "This is free software; see the source for copying conditions. There is NO"
443
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
448
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
449
# Now print the configurations for the tags.
450
for tagname in $taglist; do
451
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
457
$echo "$progname: enabling shell trace mode"
459
preserve_args="$preserve_args $arg"
468
if test "$build_libtool_libs" = yes; then
469
$echo "enable shared libraries"
471
$echo "disable shared libraries"
473
if test "$build_old_libs" = yes; then
474
$echo "enable static libraries"
476
$echo "disable static libraries"
481
--finish) mode="finish" ;;
483
--mode) prevopt="--mode" prev=mode ;;
484
--mode=*) mode="$optarg" ;;
486
--preserve-dup-deps) duplicate_deps="yes" ;;
490
preserve_args="$preserve_args $arg"
493
--tag) prevopt="--tag" prev=tag ;;
495
set tag "$optarg" ${1+"$@"}
498
preserve_args="$preserve_args --tag"
507
$echo "$modename: unrecognized option \`$arg'" 1>&2
519
if test -n "$prevopt"; then
520
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
525
# If this variable is set in any of the actions, the command in it
526
# will be execed at the end. This prevents here-documents from being
527
# left over by shells.
530
if test -z "$show_help"; then
532
# Infer the operation mode.
533
if test -z "$mode"; then
534
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
535
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
537
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
549
*db | *dbx | *strace | *truss)
559
# If we have no mode, but dlfiles were specified, then do execute mode.
560
test -n "$execute_dlfiles" && mode=execute
562
# Just use the default operation mode.
563
if test -z "$mode"; then
564
if test -n "$nonopt"; then
565
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
567
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
574
# Only execute mode is allowed to have -dlopen flags.
575
if test -n "$execute_dlfiles" && test "$mode" != execute; then
576
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
581
# Change the help message to a mode-specific one.
583
help="Try \`$modename --help --mode=$mode' for more information."
585
# These modes are in order of execution frequency so that they run quickly.
587
# libtool compile mode
589
modename="$modename: compile"
590
# Get the compilation command and the source file.
592
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
603
# do not "continue". Instead, add this to base_compile
615
# Accept any command-line options.
618
if test -n "$libobj" ; then
619
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
626
-static | -prefer-pic | -prefer-non-pic)
637
arg_mode=arg # the next one goes into the "base_compile" arg list
638
continue # The current "srcfile" will either be retained or
639
;; # replaced later. I would guess that would be a bug.
642
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
644
save_ifs="$IFS"; IFS=','
648
# Double-quote args containing other shell metacharacters.
649
# Many Bourne shells cannot handle close brackets correctly
650
# in scan sets, so we specify it separately.
652
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
656
lastarg="$lastarg $arg"
659
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
661
# Add the arguments to base_compile.
662
base_compile="$base_compile $lastarg"
667
# Accept the current argument as the source file.
668
# The previous "srcfile" becomes the current argument.
675
esac # case $arg_mode
677
# Aesthetically quote the previous argument.
678
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
681
# Double-quote args containing other shell metacharacters.
682
# Many Bourne shells cannot handle close brackets correctly
683
# in scan sets, and some SunOS ksh mistreat backslash-escaping
684
# in scan sets (worked around with variable expansion),
685
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
686
# at all, so we specify them separately.
687
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
688
lastarg="\"$lastarg\""
692
base_compile="$base_compile $lastarg"
697
$echo "$modename: you must specify an argument for -Xcompile"
701
$echo "$modename: you must specify a target with \`-o'" 1>&2
705
# Get the name of the library object.
706
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
710
# Recognize several different file suffixes.
711
# If the user specifies -o file.o, it is replaced with file.lo
721
*.class) xform=class ;;
726
*.java) xform=java ;;
729
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
732
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
734
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
739
func_infer_tag $base_compile
741
for arg in $later; do
760
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
761
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
762
if test "X$xdir" = "X$obj"; then
767
lobj=${xdir}$objdir/$objname
769
if test -z "$base_compile"; then
770
$echo "$modename: you must specify a compilation command" 1>&2
775
# Delete any leftover library objects.
776
if test "$build_old_libs" = yes; then
777
removelist="$obj $lobj $libobj ${libobj}T"
779
removelist="$lobj $libobj ${libobj}T"
783
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
785
# On Cygwin there's no "real" PIC flag so we must build both object types
787
cygwin* | mingw* | pw32* | os2*)
791
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
792
# non-PIC code in shared libraries is not supported
796
# Calculate the filename of the output object if compiler does
797
# not support -o with -c
798
if test "$compiler_c_o" = no; then
799
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
800
lockfile="$output_obj.lock"
801
removelist="$removelist $output_obj $lockfile"
802
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
809
# Lock this critical section if it is needed
810
# We use this script file to make the link, it avoids creating a new file
811
if test "$need_locks" = yes; then
812
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
813
$show "Waiting for $lockfile to be removed"
816
elif test "$need_locks" = warn; then
817
if test -f "$lockfile"; then
819
*** ERROR, $lockfile exists and contains:
820
`cat $lockfile 2>/dev/null`
822
This indicates that another process is trying to use the same
823
temporary object file, and libtool could not work around it because
824
your compiler does not support \`-c' and \`-o' together. If you
825
repeat this compilation, it may succeed, by chance, but you had better
826
avoid parallel builds (make -j) in this platform, or get a better
832
$echo $srcfile > "$lockfile"
835
if test -n "$fix_srcfile_path"; then
836
eval srcfile=\"$fix_srcfile_path\"
839
$run $rm "$libobj" "${libobj}T"
841
# Create a libtool object file (analogous to a ".la" file),
842
# but don't create it if we're doing a dry run.
843
test -z "$run" && cat > ${libobj}T <<EOF
844
# $libobj - a libtool object file
845
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
847
# Please DO NOT delete this file!
848
# It is necessary for linking the library.
850
# Name of the PIC object.
853
# Only build a PIC object if we are building libtool libraries.
854
if test "$build_libtool_libs" = yes; then
855
# Without this assignment, base_compile gets emptied.
856
fbsd_hideous_sh_bug=$base_compile
858
if test "$pic_mode" != no; then
859
command="$base_compile $srcfile $pic_flag"
861
# Don't build PIC code
862
command="$base_compile $srcfile"
865
if test ! -d "${xdir}$objdir"; then
866
$show "$mkdir ${xdir}$objdir"
867
$run $mkdir ${xdir}$objdir
869
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
874
if test -z "$output_obj"; then
875
# Place PIC objects in $objdir
876
command="$command -o $lobj"
879
$run $rm "$lobj" "$output_obj"
882
if $run eval "$command"; then :
884
test -n "$output_obj" && $run $rm $removelist
888
if test "$need_locks" = warn &&
889
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
891
*** ERROR, $lockfile contains:
892
`cat $lockfile 2>/dev/null`
894
but it should contain:
897
This indicates that another process is trying to use the same
898
temporary object file, and libtool could not work around it because
899
your compiler does not support \`-c' and \`-o' together. If you
900
repeat this compilation, it may succeed, by chance, but you had better
901
avoid parallel builds (make -j) in this platform, or get a better
908
# Just move the object if needed, then go on to compile the next one
909
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
910
$show "$mv $output_obj $lobj"
911
if $run $mv $output_obj $lobj; then :
919
# Append the name of the PIC object to the libtool object file.
920
test -z "$run" && cat >> ${libobj}T <<EOF
921
pic_object='$objdir/$objname'
925
# Allow error messages only from the first compilation.
926
if test "$suppress_opt" = yes; then
927
suppress_output=' >/dev/null 2>&1'
930
# No PIC object so indicate it doesn't exist in the libtool
932
test -z "$run" && cat >> ${libobj}T <<EOF
938
# Only build a position-dependent object if we build old libraries.
939
if test "$build_old_libs" = yes; then
940
if test "$pic_mode" != yes; then
941
# Don't build PIC code
942
command="$base_compile $srcfile"
944
command="$base_compile $srcfile $pic_flag"
946
if test "$compiler_c_o" = yes; then
947
command="$command -o $obj"
950
# Suppress compiler output if we already did a PIC compilation.
951
command="$command$suppress_output"
952
$run $rm "$obj" "$output_obj"
954
if $run eval "$command"; then :
960
if test "$need_locks" = warn &&
961
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
963
*** ERROR, $lockfile contains:
964
`cat $lockfile 2>/dev/null`
966
but it should contain:
969
This indicates that another process is trying to use the same
970
temporary object file, and libtool could not work around it because
971
your compiler does not support \`-c' and \`-o' together. If you
972
repeat this compilation, it may succeed, by chance, but you had better
973
avoid parallel builds (make -j) in this platform, or get a better
980
# Just move the object if needed
981
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
982
$show "$mv $output_obj $obj"
983
if $run $mv $output_obj $obj; then :
991
# Append the name of the non-PIC object the libtool object file.
992
# Only append if the libtool object file exists.
993
test -z "$run" && cat >> ${libobj}T <<EOF
994
# Name of the non-PIC object.
995
non_pic_object='$objname'
999
# Append the name of the non-PIC object the libtool object file.
1000
# Only append if the libtool object file exists.
1001
test -z "$run" && cat >> ${libobj}T <<EOF
1002
# Name of the non-PIC object.
1008
$run $mv "${libobj}T" "${libobj}"
1010
# Unlock the critical section if it was locked
1011
if test "$need_locks" != no; then
1012
$run $rm "$lockfile"
1020
modename="$modename: link"
1022
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1023
# It is impossible to link a dll without this setting, and
1024
# we shouldn't force the makefile maintainer to figure out
1025
# which system we are compiling for in order to pass an extra
1026
# flag for every libtool invocation.
1027
# allow_undefined=no
1029
# FIXME: Unfortunately, there are problems with the above when trying
1030
# to make a dll which has undefined symbols, in which case not
1031
# even a static library is built. For now, we need to specify
1032
# -no-undefined on the libtool link line when we can be certain
1033
# that all symbols are satisfied, otherwise we get a static library.
1040
libtool_args="$nonopt"
1041
base_compile="$nonopt $@"
1042
compile_command="$nonopt"
1043
finalize_command="$nonopt"
1056
lib_search_path=`pwd`
1065
export_symbols_regex=
1073
precious_files_regex=
1074
prefer_static_libs=no
1087
func_infer_tag $base_compile
1089
# We need to know -static, to get the right output filenames.
1093
-all-static | -static)
1094
if test "X$arg" = "X-all-static"; then
1095
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1096
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1098
if test -n "$link_static_flag"; then
1099
dlopen_self=$dlopen_self_static
1102
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1103
dlopen_self=$dlopen_self_static
1106
build_libtool_libs=no
1108
prefer_static_libs=yes
1114
# See if our shared archives depend on static archives.
1115
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1117
# Go through the arguments, transforming them on the way.
1118
while test "$#" -gt 0; do
1122
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1123
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1127
libtool_args="$libtool_args $qarg"
1129
# If the previous option needs an argument, assign it.
1130
if test -n "$prev"; then
1133
compile_command="$compile_command @OUTPUT@"
1134
finalize_command="$finalize_command @OUTPUT@"
1140
if test "$preload" = no; then
1141
# Add the symbol object into the linking commands.
1142
compile_command="$compile_command @SYMFILE@"
1143
finalize_command="$finalize_command @SYMFILE@"
1147
*.la | *.lo) ;; # We handle these cases below.
1149
if test "$dlself" = no; then
1157
if test "$prev" = dlprefiles; then
1159
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1169
if test "$prev" = dlfiles; then
1170
dlfiles="$dlfiles $arg"
1172
dlprefiles="$dlprefiles $arg"
1180
export_symbols="$arg"
1181
if test ! -f "$arg"; then
1182
$echo "$modename: symbol file \`$arg' does not exist"
1189
export_symbols_regex="$arg"
1194
inst_prefix_dir="$arg"
1199
precious_files_regex="$arg"
1209
if test -f "$arg"; then
1212
for fil in `cat $save_arg`
1214
# moreargs="$moreargs $fil"
1216
# A libtool-controlled object.
1218
# Check to see that this really is a libtool object.
1219
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1224
# If there is no directory component, then add one.
1226
*/* | *\\*) . $arg ;;
1230
if test -z "$pic_object" || \
1231
test -z "$non_pic_object" ||
1232
test "$pic_object" = none && \
1233
test "$non_pic_object" = none; then
1234
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1238
# Extract subdirectory from the argument.
1239
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1240
if test "X$xdir" = "X$arg"; then
1246
if test "$pic_object" != none; then
1247
# Prepend the subdirectory the object is found in.
1248
pic_object="$xdir$pic_object"
1250
if test "$prev" = dlfiles; then
1251
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1252
dlfiles="$dlfiles $pic_object"
1256
# If libtool objects are unsupported, then we need to preload.
1261
# CHECK ME: I think I busted this. -Ossama
1262
if test "$prev" = dlprefiles; then
1263
# Preload the old-style object.
1264
dlprefiles="$dlprefiles $pic_object"
1269
libobjs="$libobjs $pic_object"
1274
if test "$non_pic_object" != none; then
1275
# Prepend the subdirectory the object is found in.
1276
non_pic_object="$xdir$non_pic_object"
1278
# A standard non-PIC object
1279
non_pic_objects="$non_pic_objects $non_pic_object"
1280
if test -z "$pic_object" || test "$pic_object" = none ; then
1281
arg="$non_pic_object"
1285
# Only an error if not doing a dry-run.
1286
if test -z "$run"; then
1287
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1292
# Extract subdirectory from the argument.
1293
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1294
if test "X$xdir" = "X$arg"; then
1300
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1301
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1302
libobjs="$libobjs $pic_object"
1303
non_pic_objects="$non_pic_objects $non_pic_object"
1308
$echo "$modename: link input file \`$save_arg' does not exist"
1316
# We need an absolute path.
1318
[\\/]* | [A-Za-z]:[\\/]*) ;;
1320
$echo "$modename: only absolute run-paths are allowed" 1>&2
1324
if test "$prev" = rpath; then
1327
*) rpath="$rpath $arg" ;;
1332
*) xrpath="$xrpath $arg" ;;
1339
compiler_flags="$compiler_flags $qarg"
1341
compile_command="$compile_command $qarg"
1342
finalize_command="$finalize_command $qarg"
1346
linker_flags="$linker_flags $qarg"
1347
compiler_flags="$compiler_flags $wl$qarg"
1349
compile_command="$compile_command $wl$qarg"
1350
finalize_command="$finalize_command $wl$qarg"
1354
linker_flags="$linker_flags $qarg"
1355
compiler_flags="$compiler_flags $qarg"
1357
compile_command="$compile_command $qarg"
1358
finalize_command="$finalize_command $qarg"
1367
compiler_flags="$compiler_flags $arg"
1372
eval "$prev=\"\$arg\""
1377
fi # test -n "$prev"
1383
if test -n "$link_static_flag"; then
1384
compile_command="$compile_command $link_static_flag"
1385
finalize_command="$finalize_command $link_static_flag"
1391
# FIXME: remove this flag sometime in the future.
1392
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1416
-export-symbols | -export-symbols-regex)
1417
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1418
$echo "$modename: more than one -exported-symbols argument is not allowed"
1421
if test "X$arg" = "X-export-symbols"; then
1430
prev=darwin_framework
1431
compiler_flags="$compiler_flags $arg"
1440
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1441
# so, if we see these flags be careful not to treat them like -L
1443
case $with_gcc/$host in
1444
no/*-*-irix* | /*-*-irix*)
1445
compile_command="$compile_command $arg"
1446
finalize_command="$finalize_command $arg"
1453
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1454
# We need an absolute path.
1456
[\\/]* | [A-Za-z]:[\\/]*) ;;
1458
absdir=`cd "$dir" && pwd`
1459
if test -z "$absdir"; then
1460
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1469
deplibs="$deplibs -L$dir"
1470
lib_search_path="$lib_search_path $dir"
1474
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1475
case :$dllsearchpath: in
1477
*) dllsearchpath="$dllsearchpath:$dir";;
1485
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1487
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1488
# These systems don't actually have a C or math library (as such)
1491
*-*-mingw* | *-*-os2*)
1492
# These systems don't actually have a C library (as such)
1493
test "X$arg" = "X-lc" && continue
1495
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1496
# Do not include libc due to us having libc/libc_r.
1497
test "X$arg" = "X-lc" && continue
1499
*-*-rhapsody* | *-*-darwin1.[012])
1500
# Rhapsody C and math libraries are in the System framework
1501
deplibs="$deplibs -framework System"
1504
elif test "X$arg" = "X-lc_r"; then
1506
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1507
# Do not include libc_r directly, use -pthread flag.
1512
deplibs="$deplibs $arg"
1516
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1517
# classes, name mangling, and exception handling.
1519
compile_command="$compile_command $arg"
1520
compiler_flags="$compiler_flags $arg"
1521
finalize_command="$finalize_command $arg"
1526
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1527
compiler_flags="$compiler_flags $arg"
1528
compile_command="$compile_command $arg"
1529
finalize_command="$finalize_command $arg"
1538
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1539
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1540
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1541
# +DA*, +DD* enable 64-bit mode on the HP compiler
1542
# -q* pass through compiler args for the IBM compiler
1543
# -m* pass through architecture-specific compiler args for GCC
1544
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1546
# Unknown arguments in both finalize_command and compile_command need
1547
# to be aesthetically quoted because they are evaled later.
1548
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1550
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1554
compile_command="$compile_command $arg"
1555
finalize_command="$finalize_command $arg"
1556
if test "$with_gcc" = "yes" ; then
1557
compiler_flags="$compiler_flags $arg"
1574
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1575
# The PATH hackery in wrapper scripts is required on Windows
1576
# in order for the loader to find any dlls it needs.
1577
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1578
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1581
*) no_install=yes ;;
1598
-precious-files-regex)
1619
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1620
# We need an absolute path.
1622
[\\/]* | [A-Za-z]:[\\/]*) ;;
1624
$echo "$modename: only absolute run-paths are allowed" 1>&2
1630
*) xrpath="$xrpath $dir" ;;
1636
# The effects of -static are defined in a previous loop.
1637
# We used to do the same as -all-static on platforms that
1638
# didn't have a PIC flag, but the assumption that the effects
1639
# would be equivalent was wrong. It would break on at least
1640
# Digital Unix and AIX.
1660
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1662
save_ifs="$IFS"; IFS=','
1663
for flag in $args; do
1666
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1671
compiler_flags="$compiler_flags $flag"
1674
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1678
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1680
save_ifs="$IFS"; IFS=','
1681
for flag in $args; do
1684
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1689
compiler_flags="$compiler_flags $wl$flag"
1690
linker_flags="$linker_flags $flag"
1693
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1711
# Some other compiler flag.
1713
# Unknown arguments in both finalize_command and compile_command need
1714
# to be aesthetically quoted because they are evaled later.
1715
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1717
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1724
# A standard object.
1729
# A libtool-controlled object.
1731
# Check to see that this really is a libtool object.
1732
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1737
# If there is no directory component, then add one.
1739
*/* | *\\*) . $arg ;;
1743
if test -z "$pic_object" || \
1744
test -z "$non_pic_object" ||
1745
test "$pic_object" = none && \
1746
test "$non_pic_object" = none; then
1747
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1751
# Extract subdirectory from the argument.
1752
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1753
if test "X$xdir" = "X$arg"; then
1759
if test "$pic_object" != none; then
1760
# Prepend the subdirectory the object is found in.
1761
pic_object="$xdir$pic_object"
1763
if test "$prev" = dlfiles; then
1764
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1765
dlfiles="$dlfiles $pic_object"
1769
# If libtool objects are unsupported, then we need to preload.
1774
# CHECK ME: I think I busted this. -Ossama
1775
if test "$prev" = dlprefiles; then
1776
# Preload the old-style object.
1777
dlprefiles="$dlprefiles $pic_object"
1782
libobjs="$libobjs $pic_object"
1787
if test "$non_pic_object" != none; then
1788
# Prepend the subdirectory the object is found in.
1789
non_pic_object="$xdir$non_pic_object"
1791
# A standard non-PIC object
1792
non_pic_objects="$non_pic_objects $non_pic_object"
1793
if test -z "$pic_object" || test "$pic_object" = none ; then
1794
arg="$non_pic_object"
1798
# Only an error if not doing a dry-run.
1799
if test -z "$run"; then
1800
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1805
# Extract subdirectory from the argument.
1806
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1807
if test "X$xdir" = "X$arg"; then
1813
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1814
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1815
libobjs="$libobjs $pic_object"
1816
non_pic_objects="$non_pic_objects $non_pic_object"
1823
deplibs="$deplibs $arg"
1824
old_deplibs="$old_deplibs $arg"
1829
# A libtool-controlled library.
1831
if test "$prev" = dlfiles; then
1832
# This library was specified with -dlopen.
1833
dlfiles="$dlfiles $arg"
1835
elif test "$prev" = dlprefiles; then
1836
# The library was specified with -dlpreopen.
1837
dlprefiles="$dlprefiles $arg"
1840
deplibs="$deplibs $arg"
1845
# Some other compiler argument.
1847
# Unknown arguments in both finalize_command and compile_command need
1848
# to be aesthetically quoted because they are evaled later.
1849
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1851
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1858
# Now actually substitute the argument into the commands.
1859
if test -n "$arg"; then
1860
compile_command="$compile_command $arg"
1861
finalize_command="$finalize_command $arg"
1863
done # argument parsing loop
1865
if test -n "$prev"; then
1866
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1871
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1872
eval arg=\"$export_dynamic_flag_spec\"
1873
compile_command="$compile_command $arg"
1874
finalize_command="$finalize_command $arg"
1878
# calculate the name of the file, without its directory
1879
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1880
libobjs_save="$libobjs"
1882
if test -n "$shlibpath_var"; then
1883
# get the directories listed in $shlibpath_var
1884
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1888
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1889
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1891
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1892
if test "X$output_objdir" = "X$output"; then
1893
output_objdir="$objdir"
1895
output_objdir="$output_objdir/$objdir"
1897
# Create the object directory.
1898
if test ! -d "$output_objdir"; then
1899
$show "$mkdir $output_objdir"
1900
$run $mkdir $output_objdir
1902
if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1907
# Determine the type of output
1910
$echo "$modename: you must specify an output file" 1>&2
1914
*.$libext) linkmode=oldlib ;;
1915
*.lo | *.$objext) linkmode=obj ;;
1916
*.la) linkmode=lib ;;
1917
*) linkmode=prog ;; # Anything else should be a program.
1921
*cygwin* | *mingw* | *pw32*)
1922
# don't eliminate duplications in $postdeps and $predeps
1923
duplicate_compiler_generated_deps=yes
1926
duplicate_compiler_generated_deps=$duplicate_deps
1932
# Find all interdependent deplibs by searching for libraries
1933
# that are linked more than once (e.g. -la -lb -la)
1934
for deplib in $deplibs; do
1935
if test "X$duplicate_deps" = "Xyes" ; then
1937
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1940
libs="$libs $deplib"
1943
if test "$linkmode" = lib; then
1944
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1946
# Compute libraries that are listed more than once in $predeps
1947
# $postdeps and mark them as special (i.e., whose duplicates are
1948
# not to be eliminated).
1950
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1951
for pre_post_dep in $predeps $postdeps; do
1952
case "$pre_post_deps " in
1953
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1955
pre_post_deps="$pre_post_deps $pre_post_dep"
1964
need_relink=no # whether we're linking any uninstalled libtool libraries
1965
notinst_deplibs= # not-installed libtool libraries
1966
notinst_path= # paths that contain not-installed libtool libraries
1970
for file in $dlfiles $dlprefiles; do
1974
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1986
passes="conv scan dlopen dlpreopen link"
1991
for pass in $passes; do
1992
if test "$linkmode,$pass" = "lib,link" ||
1993
test "$linkmode,$pass" = "prog,scan"; then
1997
if test "$linkmode" = prog; then
1999
dlopen) libs="$dlfiles" ;;
2000
dlpreopen) libs="$dlprefiles" ;;
2001
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2004
if test "$pass" = dlopen; then
2005
# Collect dlpreopened libraries
2006
save_deplibs="$deplibs"
2009
for deplib in $libs; do
2013
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2014
if test "$linkmode,$pass" = "prog,link"; then
2015
compile_deplibs="$deplib $compile_deplibs"
2016
finalize_deplibs="$deplib $finalize_deplibs"
2018
compiler_flags="$compiler_flags $deplib"
2023
if test "$linkmode" != lib && test "$linkmode" != prog; then
2024
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2027
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2028
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2029
for search_ext in .la $std_shrext .so .a; do
2030
# Search the libtool library
2031
lib="$searchdir/lib${name}${search_ext}"
2032
if test -f "$lib"; then
2033
if test "$search_ext" = ".la"; then
2042
if test "$found" != yes; then
2043
# deplib doesn't seem to be a libtool library
2044
if test "$linkmode,$pass" = "prog,link"; then
2045
compile_deplibs="$deplib $compile_deplibs"
2046
finalize_deplibs="$deplib $finalize_deplibs"
2048
deplibs="$deplib $deplibs"
2049
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2052
else # deplib is a libtool library
2053
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2054
# We need to do some special things here, and not later.
2055
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2056
case " $predeps $postdeps " in
2058
if (${SED} -e '2q' $lib |
2059
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2063
*/* | *\\*) . $lib ;;
2066
for l in $old_library $library_names; do
2069
if test "X$ll" = "X$old_library" ; then # only static version available
2071
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2072
test "X$ladir" = "X$lib" && ladir="."
2073
lib=$ladir/$old_library
2074
if test "$linkmode,$pass" = "prog,link"; then
2075
compile_deplibs="$deplib $compile_deplibs"
2076
finalize_deplibs="$deplib $finalize_deplibs"
2078
deplibs="$deplib $deplibs"
2079
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2093
deplibs="$deplib $deplibs"
2094
test "$pass" = conv && continue
2095
newdependency_libs="$deplib $newdependency_libs"
2096
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2099
if test "$pass" = conv; then
2100
deplibs="$deplib $deplibs"
2103
if test "$pass" = scan; then
2104
deplibs="$deplib $deplibs"
2106
compile_deplibs="$deplib $compile_deplibs"
2107
finalize_deplibs="$deplib $finalize_deplibs"
2109
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2112
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2118
if test "$pass" = link; then
2119
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2120
# Make sure the xrpath contains only unique directories.
2123
*) xrpath="$xrpath $dir" ;;
2126
deplibs="$deplib $deplibs"
2129
*.la) lib="$deplib" ;;
2131
if test "$pass" = conv; then
2132
deplibs="$deplib $deplibs"
2138
case $deplibs_check_method in
2140
set dummy $deplibs_check_method
2141
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2142
if eval $echo \"$deplib\" 2>/dev/null \
2144
| $EGREP "$match_pattern_regex" > /dev/null; then
2152
if test "$valid_a_lib" != yes; then
2154
$echo "*** Warning: Trying to link with static lib archive $deplib."
2155
$echo "*** I have the capability to make that library automatically link in when"
2156
$echo "*** you link to this library. But I can only do this if you have a"
2157
$echo "*** shared version of the library, which you do not appear to have"
2158
$echo "*** because the file extensions .$libext of this argument makes me believe"
2159
$echo "*** that it is just a static archive that I should not used here."
2162
$echo "*** Warning: Linking the shared library $output against the"
2163
$echo "*** static library $deplib is not portable!"
2164
deplibs="$deplib $deplibs"
2169
if test "$pass" != link; then
2170
deplibs="$deplib $deplibs"
2172
compile_deplibs="$deplib $compile_deplibs"
2173
finalize_deplibs="$deplib $finalize_deplibs"
2180
if test "$pass" = conv; then
2181
deplibs="$deplib $deplibs"
2182
elif test "$linkmode" = prog; then
2183
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2184
# If there is no dlopen support or we're linking statically,
2185
# we need to preload.
2186
newdlprefiles="$newdlprefiles $deplib"
2187
compile_deplibs="$deplib $compile_deplibs"
2188
finalize_deplibs="$deplib $finalize_deplibs"
2190
newdlfiles="$newdlfiles $deplib"
2200
if test "$found" = yes || test -f "$lib"; then :
2202
$echo "$modename: cannot find the library \`$lib'" 1>&2
2206
# Check to see that this really is a libtool archive.
2207
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2209
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2213
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2214
test "X$ladir" = "X$lib" && ladir="."
2222
# If the library was installed with an old release of libtool,
2223
# it will not redefine variables installed, or shouldnotlink
2231
*/* | *\\*) . $lib ;;
2235
if test "$linkmode,$pass" = "lib,link" ||
2236
test "$linkmode,$pass" = "prog,scan" ||
2237
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2238
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2239
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2242
if test "$pass" = conv; then
2243
# Only check for convenience libraries
2244
deplibs="$lib $deplibs"
2245
if test -z "$libdir"; then
2246
if test -z "$old_library"; then
2247
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2250
# It is a libtool convenience library, so add in its objects.
2251
convenience="$convenience $ladir/$objdir/$old_library"
2252
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2254
for deplib in $dependency_libs; do
2255
deplibs="$deplib $deplibs"
2256
if test "X$duplicate_deps" = "Xyes" ; then
2257
case "$tmp_libs " in
2258
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2261
tmp_libs="$tmp_libs $deplib"
2263
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2264
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2271
# Get the name of the library we link against.
2273
for l in $old_library $library_names; do
2276
if test -z "$linklib"; then
2277
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2281
# This library was specified with -dlopen.
2282
if test "$pass" = dlopen; then
2283
if test -z "$libdir"; then
2284
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2287
if test -z "$dlname" ||
2288
test "$dlopen_support" != yes ||
2289
test "$build_libtool_libs" = no; then
2290
# If there is no dlname, no dlopen support or we're linking
2291
# statically, we need to preload. We also need to preload any
2292
# dependent libraries so libltdl's deplib preloader doesn't
2293
# bomb out in the load deplibs phase.
2294
dlprefiles="$dlprefiles $lib $dependency_libs"
2296
newdlfiles="$newdlfiles $lib"
2301
# We need an absolute path.
2303
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2305
abs_ladir=`cd "$ladir" && pwd`
2306
if test -z "$abs_ladir"; then
2307
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2308
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2313
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2315
# Find the relevant object directory and library name.
2316
if test "X$installed" = Xyes; then
2317
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2318
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2326
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2328
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2331
# Remove this search path later
2332
notinst_path="$notinst_path $abs_ladir"
2334
dir="$ladir/$objdir"
2335
absdir="$abs_ladir/$objdir"
2336
# Remove this search path later
2337
notinst_path="$notinst_path $abs_ladir"
2339
fi # $installed = yes
2340
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2342
# This library was specified with -dlpreopen.
2343
if test "$pass" = dlpreopen; then
2344
if test -z "$libdir"; then
2345
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2348
# Prefer using a static library (so that no silly _DYNAMIC symbols
2349
# are required to link).
2350
if test -n "$old_library"; then
2351
newdlprefiles="$newdlprefiles $dir/$old_library"
2352
# Otherwise, use the dlname, so that lt_dlopen finds it.
2353
elif test -n "$dlname"; then
2354
newdlprefiles="$newdlprefiles $dir/$dlname"
2356
newdlprefiles="$newdlprefiles $dir/$linklib"
2358
fi # $pass = dlpreopen
2360
if test -z "$libdir"; then
2361
# Link the convenience library
2362
if test "$linkmode" = lib; then
2363
deplibs="$dir/$old_library $deplibs"
2364
elif test "$linkmode,$pass" = "prog,link"; then
2365
compile_deplibs="$dir/$old_library $compile_deplibs"
2366
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2368
deplibs="$lib $deplibs" # used for prog,scan pass
2374
if test "$linkmode" = prog && test "$pass" != link; then
2375
newlib_search_path="$newlib_search_path $ladir"
2376
deplibs="$lib $deplibs"
2379
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2380
test "$build_libtool_libs" = no; then
2385
for deplib in $dependency_libs; do
2387
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2389
# Need to link against all dependency_libs?
2390
if test "$linkalldeplibs" = yes; then
2391
deplibs="$deplib $deplibs"
2393
# Need to hardcode shared library paths
2394
# or/and link against static libraries
2395
newdependency_libs="$deplib $newdependency_libs"
2397
if test "X$duplicate_deps" = "Xyes" ; then
2398
case "$tmp_libs " in
2399
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2402
tmp_libs="$tmp_libs $deplib"
2405
fi # $linkmode = prog...
2407
if test "$linkmode,$pass" = "prog,link"; then
2408
if test -n "$library_names" &&
2409
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2410
# We need to hardcode the library path
2411
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2412
# Make sure the rpath contains only unique directories.
2413
case "$temp_rpath " in
2416
*) temp_rpath="$temp_rpath $dir" ;;
2420
# Hardcode the library path.
2421
# Skip directories that are in the system default run-time
2423
case " $sys_lib_dlsearch_path " in
2426
case "$compile_rpath " in
2428
*) compile_rpath="$compile_rpath $absdir"
2432
case " $sys_lib_dlsearch_path " in
2435
case "$finalize_rpath " in
2437
*) finalize_rpath="$finalize_rpath $libdir"
2441
fi # $linkmode,$pass = prog,link...
2443
if test "$alldeplibs" = yes &&
2444
{ test "$deplibs_check_method" = pass_all ||
2445
{ test "$build_libtool_libs" = yes &&
2446
test -n "$library_names"; }; }; then
2447
# We only need to search for static libraries
2452
link_static=no # Whether the deplib will be linked statically
2453
if test -n "$library_names" &&
2454
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2455
if test "$installed" = no; then
2456
notinst_deplibs="$notinst_deplibs $lib"
2459
# This is a shared library
2461
# Warn about portability, can't link against -module's on
2462
# some systems (darwin)
2463
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2465
if test "$linkmode" = prog; then
2466
$echo "*** Warning: Linking the executable $output against the loadable module"
2468
$echo "*** Warning: Linking the shared library $output against the loadable module"
2470
$echo "*** $linklib is not portable!"
2472
if test "$linkmode" = lib &&
2473
test "$hardcode_into_libs" = yes; then
2474
# Hardcode the library path.
2475
# Skip directories that are in the system default run-time
2477
case " $sys_lib_dlsearch_path " in
2480
case "$compile_rpath " in
2482
*) compile_rpath="$compile_rpath $absdir"
2486
case " $sys_lib_dlsearch_path " in
2489
case "$finalize_rpath " in
2491
*) finalize_rpath="$finalize_rpath $libdir"
2497
if test -n "$old_archive_from_expsyms_cmds"; then
2498
# figure out the soname
2499
set dummy $library_names
2502
libname=`eval \\$echo \"$libname_spec\"`
2503
# use dlname if we got it. it's perfectly good, no?
2504
if test -n "$dlname"; then
2506
elif test -n "$soname_spec"; then
2510
major=`expr $current - $age`
2514
eval soname=\"$soname_spec\"
2519
# Make a new name for the extract_expsyms_cmds to use
2521
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2522
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2524
# If the library has no export list, then create one now
2525
if test -f "$output_objdir/$soname-def"; then :
2527
$show "extracting exported symbol list from \`$soname'"
2528
save_ifs="$IFS"; IFS='~'
2529
cmds=$extract_expsyms_cmds
2530
for cmd in $cmds; do
2534
$run eval "$cmd" || exit $?
2540
if test -f "$output_objdir/$newlib"; then :; else
2541
$show "generating import library for \`$soname'"
2542
save_ifs="$IFS"; IFS='~'
2543
cmds=$old_archive_from_expsyms_cmds
2544
for cmd in $cmds; do
2548
$run eval "$cmd" || exit $?
2552
# make sure the library variables are pointing to the new library
2555
fi # test -n "$old_archive_from_expsyms_cmds"
2557
if test "$linkmode" = prog || test "$mode" != relink; then
2562
case $hardcode_action in
2563
immediate | unsupported)
2564
if test "$hardcode_direct" = no; then
2567
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2569
# if the lib is a module then we can not link against
2570
# it, someone is ignoring the new warnings I added
2571
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2572
$echo "** Warning, lib $linklib is a module, not a shared library"
2573
if test -z "$old_library" ; then
2575
$echo "** And there doesn't seem to be a static archive available"
2576
$echo "** The link will probably fail, sorry"
2578
add="$dir/$old_library"
2582
elif test "$hardcode_minus_L" = no; then
2584
*-*-sunos*) add_shlibpath="$dir" ;;
2588
elif test "$hardcode_shlibpath_var" = no; then
2589
add_shlibpath="$dir"
2596
if test "$hardcode_direct" = yes; then
2598
elif test "$hardcode_minus_L" = yes; then
2600
# Try looking first in the location we're being installed to.
2601
if test -n "$inst_prefix_dir"; then
2604
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2609
elif test "$hardcode_shlibpath_var" = yes; then
2610
add_shlibpath="$dir"
2619
if test "$lib_linked" != yes; then
2620
$echo "$modename: configuration error: unsupported hardcode properties"
2624
if test -n "$add_shlibpath"; then
2625
case :$compile_shlibpath: in
2626
*":$add_shlibpath:"*) ;;
2627
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2630
if test "$linkmode" = prog; then
2631
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2632
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2634
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2635
test -n "$add" && deplibs="$add $deplibs"
2636
if test "$hardcode_direct" != yes && \
2637
test "$hardcode_minus_L" != yes && \
2638
test "$hardcode_shlibpath_var" = yes; then
2639
case :$finalize_shlibpath: in
2641
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2647
if test "$linkmode" = prog || test "$mode" = relink; then
2651
# Finalize command for both is simple: just hardcode it.
2652
if test "$hardcode_direct" = yes; then
2653
add="$libdir/$linklib"
2654
elif test "$hardcode_minus_L" = yes; then
2657
elif test "$hardcode_shlibpath_var" = yes; then
2658
case :$finalize_shlibpath: in
2660
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2663
elif test "$hardcode_automatic" = yes; then
2664
if test -n "$inst_prefix_dir" &&
2665
test -f "$inst_prefix_dir$libdir/$linklib" ; then
2666
add="$inst_prefix_dir$libdir/$linklib"
2668
add="$libdir/$linklib"
2671
# We cannot seem to hardcode it, guess we'll fake it.
2673
# Try looking first in the location we're being installed to.
2674
if test -n "$inst_prefix_dir"; then
2677
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2684
if test "$linkmode" = prog; then
2685
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2686
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2688
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2689
test -n "$add" && deplibs="$add $deplibs"
2692
elif test "$linkmode" = prog; then
2693
# Here we assume that one of hardcode_direct or hardcode_minus_L
2694
# is not unsupported. This is valid on all known static and
2696
if test "$hardcode_direct" != unsupported; then
2697
test -n "$old_library" && linklib="$old_library"
2698
compile_deplibs="$dir/$linklib $compile_deplibs"
2699
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2701
compile_deplibs="-l$name -L$dir $compile_deplibs"
2702
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2704
elif test "$build_libtool_libs" = yes; then
2705
# Not a shared library
2706
if test "$deplibs_check_method" != pass_all; then
2707
# We're trying link a shared library against a static one
2708
# but the system doesn't support it.
2710
# Just print a warning and add the library to dependency_libs so
2711
# that the program can be linked against the static library.
2713
$echo "*** Warning: This system can not link to static lib archive $lib."
2714
$echo "*** I have the capability to make that library automatically link in when"
2715
$echo "*** you link to this library. But I can only do this if you have a"
2716
$echo "*** shared version of the library, which you do not appear to have."
2717
if test "$module" = yes; then
2718
$echo "*** But as you try to build a module library, libtool will still create "
2719
$echo "*** a static module, that should work as long as the dlopening application"
2720
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2721
if test -z "$global_symbol_pipe"; then
2723
$echo "*** However, this would only work if libtool was able to extract symbol"
2724
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2725
$echo "*** not find such a program. So, this module is probably useless."
2726
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2728
if test "$build_old_libs" = no; then
2729
build_libtool_libs=module
2732
build_libtool_libs=no
2736
convenience="$convenience $dir/$old_library"
2737
old_convenience="$old_convenience $dir/$old_library"
2738
deplibs="$dir/$old_library $deplibs"
2741
fi # link shared/static library?
2743
if test "$linkmode" = lib; then
2744
if test -n "$dependency_libs" &&
2745
{ test "$hardcode_into_libs" != yes ||
2746
test "$build_old_libs" = yes ||
2747
test "$link_static" = yes; }; then
2748
# Extract -R from dependency_libs
2750
for libdir in $dependency_libs; do
2752
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2754
*" $temp_xrpath "*) ;;
2755
*) xrpath="$xrpath $temp_xrpath";;
2757
*) temp_deplibs="$temp_deplibs $libdir";;
2760
dependency_libs="$temp_deplibs"
2763
newlib_search_path="$newlib_search_path $absdir"
2764
# Link against this library
2765
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2766
# ... and its dependency_libs
2768
for deplib in $dependency_libs; do
2769
newdependency_libs="$deplib $newdependency_libs"
2770
if test "X$duplicate_deps" = "Xyes" ; then
2771
case "$tmp_libs " in
2772
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2775
tmp_libs="$tmp_libs $deplib"
2778
if test "$link_all_deplibs" != no; then
2779
# Add the search paths of all dependency libraries
2780
for deplib in $dependency_libs; do
2782
-L*) path="$deplib" ;;
2784
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2785
test "X$dir" = "X$deplib" && dir="."
2786
# We need an absolute path.
2788
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2790
absdir=`cd "$dir" && pwd`
2791
if test -z "$absdir"; then
2792
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2797
if grep "^installed=no" $deplib > /dev/null; then
2798
path="$absdir/$objdir"
2800
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2801
if test -z "$libdir"; then
2802
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2805
if test "$absdir" != "$libdir"; then
2806
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2813
# we do not want to link against static libs,
2814
# but need to link against shared
2815
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2816
if test -n "$deplibrary_names" ; then
2817
for tmp in $deplibrary_names ; do
2820
if test -f "$path/$depdepl" ; then
2821
depdepl="$path/$depdepl"
2823
# do not add paths which are already there
2824
case " $newlib_search_path " in
2826
*) newlib_search_path="$newlib_search_path $path";;
2839
# Again, we only want to link against shared libraries
2840
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2841
for tmp in $newlib_search_path ; do
2842
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2843
eval depdepl="$tmp/lib$tmp_libs.dylib"
2854
case " $deplibs " in
2856
*) deplibs="$depdepl $deplibs" ;;
2858
case " $deplibs " in
2860
*) deplibs="$deplibs $path" ;;
2863
fi # link_all_deplibs != no
2865
done # for deplib in $libs
2866
dependency_libs="$newdependency_libs"
2867
if test "$pass" = dlpreopen; then
2868
# Link the dlpreopened libraries before other libraries
2869
for deplib in $save_deplibs; do
2870
deplibs="$deplib $deplibs"
2873
if test "$pass" != dlopen; then
2874
if test "$pass" != conv; then
2875
# Make sure lib_search_path contains only unique directories.
2877
for dir in $newlib_search_path; do
2878
case "$lib_search_path " in
2880
*) lib_search_path="$lib_search_path $dir" ;;
2886
if test "$linkmode,$pass" != "prog,link"; then
2889
vars="compile_deplibs finalize_deplibs"
2891
for var in $vars dependency_libs; do
2892
# Add libraries to $var in reverse order
2893
eval tmp_libs=\"\$$var\"
2895
for deplib in $tmp_libs; do
2896
# FIXME: Pedantically, this is the right thing to do, so
2897
# that some nasty dependency loop isn't accidentally
2899
#new_libs="$deplib $new_libs"
2900
# Pragmatically, this seems to cause very few problems in
2903
-L*) new_libs="$deplib $new_libs" ;;
2906
# And here is the reason: when a library appears more
2907
# than once as an explicit dependence of a library, or
2908
# is implicitly linked in more than once by the
2909
# compiler, it is considered special, and multiple
2910
# occurrences thereof are not removed. Compare this
2911
# with having the same library being listed as a
2912
# dependency of multiple other libraries: in this case,
2913
# we know (pedantically, we assume) the library does not
2914
# need to be listed more than once, so we keep only the
2915
# last copy. This is not always right, but it is rare
2916
# enough that we require users that really mean to play
2917
# such unportable linking tricks to link the library
2918
# using -Wl,-lname, so that libtool does not consider it
2919
# for duplicate removal.
2920
case " $specialdeplibs " in
2921
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2923
case " $new_libs " in
2925
*) new_libs="$deplib $new_libs" ;;
2933
for deplib in $new_libs; do
2936
case " $tmp_libs " in
2938
*) tmp_libs="$tmp_libs $deplib" ;;
2941
*) tmp_libs="$tmp_libs $deplib" ;;
2944
eval $var=\"$tmp_libs\"
2947
# Last step: remove runtime libs from dependency_libs
2948
# (they stay in deplibs)
2950
for i in $dependency_libs ; do
2951
case " $predeps $postdeps $compiler_lib_search_path " in
2956
if test -n "$i" ; then
2957
tmp_libs="$tmp_libs $i"
2960
dependency_libs=$tmp_libs
2962
if test "$linkmode" = prog; then
2963
dlfiles="$newdlfiles"
2964
dlprefiles="$newdlprefiles"
2969
if test -n "$deplibs"; then
2970
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2973
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2974
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2977
if test -n "$rpath"; then
2978
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2981
if test -n "$xrpath"; then
2982
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2985
if test -n "$vinfo"; then
2986
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2989
if test -n "$release"; then
2990
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2993
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2994
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2997
# Now set the variables for building old libraries.
2998
build_libtool_libs=no
3000
objs="$objs$old_deplibs"
3004
# Make sure we only generate libraries of the form `libNAME.la'.
3007
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3008
eval shared_ext=\"$shrext_cmds\"
3009
eval libname=\"$libname_spec\"
3012
if test "$module" = no; then
3013
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3017
if test "$need_lib_prefix" != no; then
3018
# Add the "lib" prefix for modules if required
3019
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3020
eval shared_ext=\"$shrext_cmds\"
3021
eval libname=\"$libname_spec\"
3023
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3028
if test -n "$objs"; then
3029
if test "$deplibs_check_method" != pass_all; then
3030
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3034
$echo "*** Warning: Linking the shared library $output against the non-libtool"
3035
$echo "*** objects $objs is not portable!"
3036
libobjs="$libobjs $objs"
3040
if test "$dlself" != no; then
3041
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3045
if test "$#" -gt 2; then
3046
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3051
if test -z "$rpath"; then
3052
if test "$build_libtool_libs" = yes; then
3053
# Building a libtool convenience library.
3054
# Some compilers have problems with a `.al' extension so
3055
# convenience libraries should have the same extension an
3056
# archive normally would.
3057
oldlibs="$output_objdir/$libname.$libext $oldlibs"
3058
build_libtool_libs=convenience
3062
if test -n "$vinfo"; then
3063
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3066
if test -n "$release"; then
3067
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3071
# Parse the version information argument.
3072
save_ifs="$IFS"; IFS=':'
3073
set dummy $vinfo 0 0 0
3076
if test -n "$8"; then
3077
$echo "$modename: too many parameters to \`-version-info'" 1>&2
3082
# convert absolute version numbers to libtool ages
3083
# this retains compatibility with .la files and attempts
3084
# to make the code below a bit more comprehensible
3086
case $vinfo_number in
3090
number_revision="$4"
3092
# There are really only two kinds -- those that
3093
# use the current revision as the major version
3094
# and those that subtract age and use age as
3095
# a minor version. But, then there is irix
3096
# which has an extra 1 added just for fun
3098
case $version_type in
3099
darwin|linux|osf|windows)
3100
current=`expr $number_major + $number_minor`
3102
revision="$number_revision"
3104
freebsd-aout|freebsd-elf|sunos)
3105
current="$number_major"
3106
revision="$number_minor"
3110
current=`expr $number_major + $number_minor - 1`
3112
revision="$number_minor"
3123
# Check that each of the things are valid numbers.
3125
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3127
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3128
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3134
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3136
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3137
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3143
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3145
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3146
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3151
if test "$age" -gt "$current"; then
3152
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3153
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3157
# Calculate the version variables.
3161
case $version_type in
3165
# Like Linux, but with the current version available in
3166
# verstring for coding it into the library header
3167
major=.`expr $current - $age`
3168
versuffix="$major.$age.$revision"
3169
# Darwin ld doesn't like 0 for these options...
3170
minor_current=`expr $current + 1`
3171
verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3176
versuffix=".$current.$revision";
3181
versuffix=".$current";
3185
major=`expr $current - $age + 1`
3187
case $version_type in
3188
nonstopux) verstring_prefix=nonstopux ;;
3189
*) verstring_prefix=sgi ;;
3191
verstring="$verstring_prefix$major.$revision"
3193
# Add in all the interfaces that we are compatible with.
3195
while test "$loop" -ne 0; do
3196
iface=`expr $revision - $loop`
3197
loop=`expr $loop - 1`
3198
verstring="$verstring_prefix$major.$iface:$verstring"
3201
# Before this point, $major must not contain `.'.
3203
versuffix="$major.$revision"
3207
major=.`expr $current - $age`
3208
versuffix="$major.$age.$revision"
3212
major=.`expr $current - $age`
3213
versuffix=".$current.$age.$revision"
3214
verstring="$current.$age.$revision"
3216
# Add in all the interfaces that we are compatible with.
3218
while test "$loop" -ne 0; do
3219
iface=`expr $current - $loop`
3220
loop=`expr $loop - 1`
3221
verstring="$verstring:${iface}.0"
3224
# Make executables depend on our current version.
3225
verstring="$verstring:${current}.0"
3230
versuffix=".$current.$revision"
3234
# Use '-' rather than '.', since we only want one
3235
# extension on DOS 8.3 filesystems.
3236
major=`expr $current - $age`
3241
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3242
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3247
# Clear the version info if we defaulted, and they specified a release.
3248
if test -z "$vinfo" && test -n "$release"; then
3250
case $version_type in
3252
# we can't check for "0.0" in archive_cmds due to quoting
3253
# problems, so we reset it completely
3260
if test "$need_version" = no; then
3267
# Remove version info from name if versioning should be avoided
3268
if test "$avoid_version" = yes && test "$need_version" = no; then
3274
# Check to see if the archive will have undefined symbols.
3275
if test "$allow_undefined" = yes; then
3276
if test "$allow_undefined_flag" = unsupported; then
3277
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3278
build_libtool_libs=no
3282
# Don't allow undefined symbols.
3283
allow_undefined_flag="$no_undefined_flag"
3287
if test "$mode" != relink; then
3288
# Remove our outputs, but don't remove object files since they
3289
# may have been created when compiling PIC objects.
3291
tempremovelist=`$echo "$output_objdir/*"`
3292
for p in $tempremovelist; do
3296
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3297
if test "X$precious_files_regex" != "X"; then
3298
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3303
removelist="$removelist $p"
3308
if test -n "$removelist"; then
3309
$show "${rm}r $removelist"
3310
$run ${rm}r $removelist
3314
# Now set the variables for building old libraries.
3315
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3316
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3318
# Transform .lo files to .o files.
3319
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3322
# Eliminate all temporary directories.
3323
for path in $notinst_path; do
3324
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3325
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3326
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3329
if test -n "$xrpath"; then
3330
# If the user specified any rpath flags, then add them.
3332
for libdir in $xrpath; do
3333
temp_xrpath="$temp_xrpath -R$libdir"
3334
case "$finalize_rpath " in
3336
*) finalize_rpath="$finalize_rpath $libdir" ;;
3339
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3340
dependency_libs="$temp_xrpath $dependency_libs"
3344
# Make sure dlfiles contains only unique files that won't be dlpreopened
3345
old_dlfiles="$dlfiles"
3347
for lib in $old_dlfiles; do
3348
case " $dlprefiles $dlfiles " in
3350
*) dlfiles="$dlfiles $lib" ;;
3354
# Make sure dlprefiles contains only unique files
3355
old_dlprefiles="$dlprefiles"
3357
for lib in $old_dlprefiles; do
3358
case "$dlprefiles " in
3360
*) dlprefiles="$dlprefiles $lib" ;;
3364
if test "$build_libtool_libs" = yes; then
3365
if test -n "$rpath"; then
3367
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3368
# these systems don't actually have a c library (as such)!
3370
*-*-rhapsody* | *-*-darwin1.[012])
3371
# Rhapsody C library is in the System framework
3372
deplibs="$deplibs -framework System"
3375
# Don't link with libc until the a.out ld.so is fixed.
3377
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3378
# Do not include libc due to us having libc/libc_r.
3379
test "X$arg" = "X-lc" && continue
3382
# Add libc to deplibs on all other systems if necessary.
3383
if test "$build_libtool_need_lc" = "yes"; then
3384
deplibs="$deplibs -lc"
3390
# Transform deplibs into only deplibs that can be linked in shared.
3392
libname_save=$libname
3393
release_save=$release
3394
versuffix_save=$versuffix
3396
# I'm not sure if I'm treating the release correctly. I think
3397
# release should show up in the -l (ie -lgmp5) so we don't want to
3398
# add it in twice. Is that correct?
3404
case $deplibs_check_method in
3406
# Don't check for shared/static. Everything works.
3407
# This might be a little naive. We might want to check
3408
# whether the library exists or not. But this is on
3409
# osf3 & osf4 and I'm not really sure... Just
3410
# implementing what was already the behavior.
3414
# This code stresses the "libraries are programs" paradigm to its
3415
# limits. Maybe even breaks it. We compile a program, linking it
3416
# against the deplibs as a proxy for the library. Then we can check
3417
# whether they linked in statically or dynamically with ldd.
3419
cat > conftest.c <<EOF
3420
int main() { return 0; }
3423
$LTCC -o conftest conftest.c $deplibs
3424
if test "$?" -eq 0 ; then
3425
ldd_output=`ldd conftest`
3426
for i in $deplibs; do
3427
name="`expr $i : '-l\(.*\)'`"
3428
# If $name is empty we are operating on a -L argument.
3429
if test "$name" != "" && test "$name" -ne "0"; then
3430
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3431
case " $predeps $postdeps " in
3433
newdeplibs="$newdeplibs $i"
3438
if test -n "$i" ; then
3439
libname=`eval \\$echo \"$libname_spec\"`
3440
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3441
set dummy $deplib_matches
3443
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3444
newdeplibs="$newdeplibs $i"
3448
$echo "*** Warning: dynamic linker does not accept needed library $i."
3449
$echo "*** I have the capability to make that library automatically link in when"
3450
$echo "*** you link to this library. But I can only do this if you have a"
3451
$echo "*** shared version of the library, which I believe you do not have"
3452
$echo "*** because a test_compile did reveal that the linker did not use it for"
3453
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3457
newdeplibs="$newdeplibs $i"
3461
# Error occurred in the first compile. Let's try to salvage
3462
# the situation: Compile a separate program for each library.
3463
for i in $deplibs; do
3464
name="`expr $i : '-l\(.*\)'`"
3465
# If $name is empty we are operating on a -L argument.
3466
if test "$name" != "" && test "$name" != "0"; then
3468
$LTCC -o conftest conftest.c $i
3470
if test "$?" -eq 0 ; then
3471
ldd_output=`ldd conftest`
3472
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3473
case " $predeps $postdeps " in
3475
newdeplibs="$newdeplibs $i"
3480
if test -n "$i" ; then
3481
libname=`eval \\$echo \"$libname_spec\"`
3482
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3483
set dummy $deplib_matches
3485
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3486
newdeplibs="$newdeplibs $i"
3490
$echo "*** Warning: dynamic linker does not accept needed library $i."
3491
$echo "*** I have the capability to make that library automatically link in when"
3492
$echo "*** you link to this library. But I can only do this if you have a"
3493
$echo "*** shared version of the library, which you do not appear to have"
3494
$echo "*** because a test_compile did reveal that the linker did not use this one"
3495
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3501
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3502
$echo "*** make it link in! You will probably need to install it or some"
3503
$echo "*** library that it depends on before this library will be fully"
3504
$echo "*** functional. Installing it before continuing would be even better."
3507
newdeplibs="$newdeplibs $i"
3513
set dummy $deplibs_check_method
3514
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3515
for a_deplib in $deplibs; do
3516
name="`expr $a_deplib : '-l\(.*\)'`"
3517
# If $name is empty we are operating on a -L argument.
3518
if test "$name" != "" && test "$name" != "0"; then
3519
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3520
case " $predeps $postdeps " in
3522
newdeplibs="$newdeplibs $a_deplib"
3527
if test -n "$a_deplib" ; then
3528
libname=`eval \\$echo \"$libname_spec\"`
3529
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3530
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3531
for potent_lib in $potential_libs; do
3532
# Follow soft links.
3533
if ls -lLd "$potent_lib" 2>/dev/null \
3534
| grep " -> " >/dev/null; then
3537
# The statement above tries to avoid entering an
3538
# endless loop below, in case of cyclic links.
3539
# We might still enter an endless loop, since a link
3540
# loop can be closed while we follow links,
3542
potlib="$potent_lib"
3543
while test -h "$potlib" 2>/dev/null; do
3544
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3546
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3547
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3550
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3552
| $EGREP "$file_magic_regex" > /dev/null; then
3553
newdeplibs="$newdeplibs $a_deplib"
3560
if test -n "$a_deplib" ; then
3563
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3564
$echo "*** I have the capability to make that library automatically link in when"
3565
$echo "*** you link to this library. But I can only do this if you have a"
3566
$echo "*** shared version of the library, which you do not appear to have"
3567
$echo "*** because I did check the linker path looking for a file starting"
3568
if test -z "$potlib" ; then
3569
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3571
$echo "*** with $libname and none of the candidates passed a file format test"
3572
$echo "*** using a file magic. Last file checked: $potlib"
3576
# Add a -L argument.
3577
newdeplibs="$newdeplibs $a_deplib"
3579
done # Gone through all deplibs.
3582
set dummy $deplibs_check_method
3583
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3584
for a_deplib in $deplibs; do
3585
name="`expr $a_deplib : '-l\(.*\)'`"
3586
# If $name is empty we are operating on a -L argument.
3587
if test -n "$name" && test "$name" != "0"; then
3588
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3589
case " $predeps $postdeps " in
3591
newdeplibs="$newdeplibs $a_deplib"
3596
if test -n "$a_deplib" ; then
3597
libname=`eval \\$echo \"$libname_spec\"`
3598
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3599
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3600
for potent_lib in $potential_libs; do
3601
potlib="$potent_lib" # see symlink-check above in file_magic test
3602
if eval $echo \"$potent_lib\" 2>/dev/null \
3604
| $EGREP "$match_pattern_regex" > /dev/null; then
3605
newdeplibs="$newdeplibs $a_deplib"
3612
if test -n "$a_deplib" ; then
3615
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3616
$echo "*** I have the capability to make that library automatically link in when"
3617
$echo "*** you link to this library. But I can only do this if you have a"
3618
$echo "*** shared version of the library, which you do not appear to have"
3619
$echo "*** because I did check the linker path looking for a file starting"
3620
if test -z "$potlib" ; then
3621
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3623
$echo "*** with $libname and none of the candidates passed a file format test"
3624
$echo "*** using a regex pattern. Last file checked: $potlib"
3628
# Add a -L argument.
3629
newdeplibs="$newdeplibs $a_deplib"
3631
done # Gone through all deplibs.
3635
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3636
-e 's/ -[LR][^ ]*//g'`
3637
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3638
for i in $predeps $postdeps ; do
3639
# can't use Xsed below, because $i might contain '/'
3640
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3643
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3644
| grep . >/dev/null; then
3646
if test "X$deplibs_check_method" = "Xnone"; then
3647
$echo "*** Warning: inter-library dependencies are not supported in this platform."
3649
$echo "*** Warning: inter-library dependencies are not known to be supported."
3651
$echo "*** All declared inter-library dependencies are being dropped."
3656
versuffix=$versuffix_save
3658
release=$release_save
3659
libname=$libname_save
3663
*-*-rhapsody* | *-*-darwin1.[012])
3664
# On Rhapsody replace the C library is the System framework
3665
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3669
if test "$droppeddeps" = yes; then
3670
if test "$module" = yes; then
3672
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3673
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3674
$echo "*** a static module, that should work as long as the dlopening"
3675
$echo "*** application is linked with the -dlopen flag."
3676
if test -z "$global_symbol_pipe"; then
3678
$echo "*** However, this would only work if libtool was able to extract symbol"
3679
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3680
$echo "*** not find such a program. So, this module is probably useless."
3681
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3683
if test "$build_old_libs" = no; then
3684
oldlibs="$output_objdir/$libname.$libext"
3685
build_libtool_libs=module
3688
build_libtool_libs=no
3691
$echo "*** The inter-library dependencies that have been dropped here will be"
3692
$echo "*** automatically added whenever a program is linked with this library"
3693
$echo "*** or is declared to -dlopen it."
3695
if test "$allow_undefined" = no; then
3697
$echo "*** Since this library must not contain undefined symbols,"
3698
$echo "*** because either the platform does not support them or"
3699
$echo "*** it was explicitly requested with -no-undefined,"
3700
$echo "*** libtool will only create a static version of it."
3701
if test "$build_old_libs" = no; then
3702
oldlibs="$output_objdir/$libname.$libext"
3703
build_libtool_libs=module
3706
build_libtool_libs=no
3711
# Done checking deplibs!
3715
# All the library-specific variables (install_libdir is set above).
3720
# Test again, we may have decided not to build it any more
3721
if test "$build_libtool_libs" = yes; then
3722
if test "$hardcode_into_libs" = yes; then
3723
# Hardcode the library paths
3726
rpath="$finalize_rpath"
3727
test "$mode" != relink && rpath="$compile_rpath$rpath"
3728
for libdir in $rpath; do
3729
if test -n "$hardcode_libdir_flag_spec"; then
3730
if test -n "$hardcode_libdir_separator"; then
3731
if test -z "$hardcode_libdirs"; then
3732
hardcode_libdirs="$libdir"
3734
# Just accumulate the unique libdirs.
3735
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3736
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3739
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3744
eval flag=\"$hardcode_libdir_flag_spec\"
3745
dep_rpath="$dep_rpath $flag"
3747
elif test -n "$runpath_var"; then
3748
case "$perm_rpath " in
3750
*) perm_rpath="$perm_rpath $libdir" ;;
3754
# Substitute the hardcoded libdirs into the rpath.
3755
if test -n "$hardcode_libdir_separator" &&
3756
test -n "$hardcode_libdirs"; then
3757
libdir="$hardcode_libdirs"
3758
if test -n "$hardcode_libdir_flag_spec_ld"; then
3759
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3761
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3764
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3765
# We should set the runpath_var.
3767
for dir in $perm_rpath; do
3770
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3772
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3775
shlibpath="$finalize_shlibpath"
3776
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3777
if test -n "$shlibpath"; then
3778
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3781
# Get the real and link names of the library.
3782
eval shared_ext=\"$shrext_cmds\"
3783
eval library_names=\"$library_names_spec\"
3784
set dummy $library_names
3788
if test -n "$soname_spec"; then
3789
eval soname=\"$soname_spec\"
3793
if test -z "$dlname"; then
3797
lib="$output_objdir/$realname"
3800
linknames="$linknames $link"
3803
# Use standard objects if they are pic
3804
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3806
# Prepare the list of exported symbols
3807
if test -z "$export_symbols"; then
3808
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3809
$show "generating symbol list for \`$libname.la'"
3810
export_symbols="$output_objdir/$libname.exp"
3811
$run $rm $export_symbols
3812
cmds=$export_symbols_cmds
3813
save_ifs="$IFS"; IFS='~'
3814
for cmd in $cmds; do
3817
if len=`expr "X$cmd" : ".*"` &&
3818
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3820
$run eval "$cmd" || exit $?
3821
skipped_export=false
3823
# The command line is too long to execute in one step.
3824
$show "using reloadable object file for export list..."
3829
if test -n "$export_symbols_regex"; then
3830
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3831
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3832
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3833
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3838
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3839
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3843
for test_deplib in $deplibs; do
3844
case " $convenience " in
3845
*" $test_deplib "*) ;;
3847
tmp_deplibs="$tmp_deplibs $test_deplib"
3851
deplibs="$tmp_deplibs"
3853
if test -n "$convenience"; then
3854
if test -n "$whole_archive_flag_spec"; then
3855
save_libobjs=$libobjs
3856
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3858
gentop="$output_objdir/${outputname}x"
3859
generated="$generated $gentop"
3861
func_extract_archives $gentop $convenience
3862
libobjs="$libobjs $func_extract_archives_result"
3866
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3867
eval flag=\"$thread_safe_flag_spec\"
3868
linker_flags="$linker_flags $flag"
3871
# Make a backup of the uninstalled library when relinking
3872
if test "$mode" = relink; then
3873
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3876
# Do each of the archive commands.
3877
if test "$module" = yes && test -n "$module_cmds" ; then
3878
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3879
eval test_cmds=\"$module_expsym_cmds\"
3880
cmds=$module_expsym_cmds
3882
eval test_cmds=\"$module_cmds\"
3886
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3887
eval test_cmds=\"$archive_expsym_cmds\"
3888
cmds=$archive_expsym_cmds
3890
eval test_cmds=\"$archive_cmds\"
3895
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3896
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3899
# The command line is too long to link in one step, link piecewise.
3900
$echo "creating reloadable object files..."
3902
# Save the value of $output and $libobjs because we want to
3903
# use them later. If we have whole_archive_flag_spec, we
3904
# want to use save_libobjs as it was before
3905
# whole_archive_flag_spec was expanded, because we can't
3906
# assume the linker understands whole_archive_flag_spec.
3907
# This may have to be revisited, in case too many
3908
# convenience libraries get linked in and end up exceeding
3910
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3911
save_libobjs=$libobjs
3914
output_la=`$echo "X$output" | $Xsed -e "$basename"`
3916
# Clear the reloadable object creation command queue and
3917
# initialize k to one.
3924
output=$output_objdir/$output_la-${k}.$objext
3925
# Loop over the list of objects to be linked.
3926
for obj in $save_libobjs
3928
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3929
if test "X$objlist" = X ||
3930
{ len=`expr "X$test_cmds" : ".*"` &&
3931
test "$len" -le "$max_cmd_len"; }; then
3932
objlist="$objlist $obj"
3934
# The command $test_cmds is almost too long, add a
3935
# command to the queue.
3936
if test "$k" -eq 1 ; then
3937
# The first file doesn't have a previous command to add.
3938
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3940
# All subsequent reloadable object files will link in
3941
# the last one created.
3942
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3944
last_robj=$output_objdir/$output_la-${k}.$objext
3946
output=$output_objdir/$output_la-${k}.$objext
3951
# Handle the remaining objects by creating one last
3952
# reloadable object file. All subsequent reloadable object
3953
# files will link in the last one created.
3954
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3955
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3957
if ${skipped_export-false}; then
3958
$show "generating symbol list for \`$libname.la'"
3959
export_symbols="$output_objdir/$libname.exp"
3960
$run $rm $export_symbols
3962
# Append the command to create the export file.
3963
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3966
# Set up a command to remove the reloadable object files
3967
# after they are used.
3969
while test "$i" -lt "$k"
3972
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3975
$echo "creating a temporary reloadable object file: $output"
3977
# Loop through the commands generated above and execute them.
3978
save_ifs="$IFS"; IFS='~'
3979
for cmd in $concat_cmds; do
3982
$run eval "$cmd" || exit $?
3987
# Restore the value of output.
3990
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3991
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3993
# Expand the library linking commands again to reset the
3994
# value of $libobjs for piecewise linking.
3996
# Do each of the archive commands.
3997
if test "$module" = yes && test -n "$module_cmds" ; then
3998
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3999
cmds=$module_expsym_cmds
4004
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4005
cmds=$archive_expsym_cmds
4011
# Append the command to remove the reloadable object files
4012
# to the just-reset $cmds.
4013
eval cmds=\"\$cmds~\$rm $delfiles\"
4015
save_ifs="$IFS"; IFS='~'
4016
for cmd in $cmds; do
4020
$run eval "$cmd" || exit $?
4024
# Restore the uninstalled library and exit
4025
if test "$mode" = relink; then
4026
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4030
# Create links to the real library.
4031
for linkname in $linknames; do
4032
if test "$realname" != "$linkname"; then
4033
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4034
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4038
# If -module or -export-dynamic was specified, set the dlname.
4039
if test "$module" = yes || test "$export_dynamic" = yes; then
4040
# On all known operating systems, these are identical.
4047
if test -n "$deplibs"; then
4048
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4051
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4052
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4055
if test -n "$rpath"; then
4056
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4059
if test -n "$xrpath"; then
4060
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4063
if test -n "$vinfo"; then
4064
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4067
if test -n "$release"; then
4068
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4073
if test -n "$objs$old_deplibs"; then
4074
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4078
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4086
# Delete the old objects.
4087
$run $rm $obj $libobj
4089
# Objects from convenience libraries. This assumes
4090
# single-version convenience libraries. Whenever we create
4091
# different ones for PIC/non-PIC, this we'll have to duplicate
4095
# reload_cmds runs $LD directly, so let us get rid of
4096
# -Wl from whole_archive_flag_spec
4099
if test -n "$convenience"; then
4100
if test -n "$whole_archive_flag_spec"; then
4101
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4103
gentop="$output_objdir/${obj}x"
4104
generated="$generated $gentop"
4106
func_extract_archives $gentop $convenience
4107
reload_conv_objs="$reload_objs $func_extract_archives_result"
4111
# Create the old-style object.
4112
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
4116
save_ifs="$IFS"; IFS='~'
4117
for cmd in $cmds; do
4121
$run eval "$cmd" || exit $?
4125
# Exit if we aren't doing a library object file.
4126
if test -z "$libobj"; then
4127
if test -n "$gentop"; then
4128
$show "${rm}r $gentop"
4135
if test "$build_libtool_libs" != yes; then
4136
if test -n "$gentop"; then
4137
$show "${rm}r $gentop"
4141
# Create an invalid libtool object if no PIC, so that we don't
4142
# accidentally link it into a program.
4143
# $show "echo timestamp > $libobj"
4144
# $run eval "echo timestamp > $libobj" || exit $?
4148
if test -n "$pic_flag" || test "$pic_mode" != default; then
4149
# Only do commands if we really have different PIC objects.
4150
reload_objs="$libobjs $reload_conv_objs"
4153
save_ifs="$IFS"; IFS='~'
4154
for cmd in $cmds; do
4158
$run eval "$cmd" || exit $?
4163
if test -n "$gentop"; then
4164
$show "${rm}r $gentop"
4173
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4175
if test -n "$vinfo"; then
4176
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4179
if test -n "$release"; then
4180
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4183
if test "$preload" = yes; then
4184
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4185
test "$dlopen_self_static" = unknown; then
4186
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4191
*-*-rhapsody* | *-*-darwin1.[012])
4192
# On Rhapsody replace the C library is the System framework
4193
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4194
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4200
# Don't allow lazy linking, it breaks C++ global constructors
4201
if test "$tagname" = CXX ; then
4202
compile_command="$compile_command ${wl}-bind_at_load"
4203
finalize_command="$finalize_command ${wl}-bind_at_load"
4208
compile_command="$compile_command $compile_deplibs"
4209
finalize_command="$finalize_command $finalize_deplibs"
4211
if test -n "$rpath$xrpath"; then
4212
# If the user specified any rpath flags, then add them.
4213
for libdir in $rpath $xrpath; do
4214
# This is the magic to use -rpath.
4215
case "$finalize_rpath " in
4217
*) finalize_rpath="$finalize_rpath $libdir" ;;
4222
# Now hardcode the library paths
4225
for libdir in $compile_rpath $finalize_rpath; do
4226
if test -n "$hardcode_libdir_flag_spec"; then
4227
if test -n "$hardcode_libdir_separator"; then
4228
if test -z "$hardcode_libdirs"; then
4229
hardcode_libdirs="$libdir"
4231
# Just accumulate the unique libdirs.
4232
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4233
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4236
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4241
eval flag=\"$hardcode_libdir_flag_spec\"
4242
rpath="$rpath $flag"
4244
elif test -n "$runpath_var"; then
4245
case "$perm_rpath " in
4247
*) perm_rpath="$perm_rpath $libdir" ;;
4251
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4252
case :$dllsearchpath: in
4254
*) dllsearchpath="$dllsearchpath:$libdir";;
4259
# Substitute the hardcoded libdirs into the rpath.
4260
if test -n "$hardcode_libdir_separator" &&
4261
test -n "$hardcode_libdirs"; then
4262
libdir="$hardcode_libdirs"
4263
eval rpath=\" $hardcode_libdir_flag_spec\"
4265
compile_rpath="$rpath"
4269
for libdir in $finalize_rpath; do
4270
if test -n "$hardcode_libdir_flag_spec"; then
4271
if test -n "$hardcode_libdir_separator"; then
4272
if test -z "$hardcode_libdirs"; then
4273
hardcode_libdirs="$libdir"
4275
# Just accumulate the unique libdirs.
4276
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4277
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4280
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4285
eval flag=\"$hardcode_libdir_flag_spec\"
4286
rpath="$rpath $flag"
4288
elif test -n "$runpath_var"; then
4289
case "$finalize_perm_rpath " in
4291
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4295
# Substitute the hardcoded libdirs into the rpath.
4296
if test -n "$hardcode_libdir_separator" &&
4297
test -n "$hardcode_libdirs"; then
4298
libdir="$hardcode_libdirs"
4299
eval rpath=\" $hardcode_libdir_flag_spec\"
4301
finalize_rpath="$rpath"
4303
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4304
# Transform all the library objects into standard objects.
4305
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4306
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4310
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4311
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4312
dlsyms="${outputname}S.c"
4314
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4318
if test -n "$dlsyms"; then
4322
# Discover the nlist of each of the dlfiles.
4323
nlist="$output_objdir/${outputname}.nm"
4325
$show "$rm $nlist ${nlist}S ${nlist}T"
4326
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4328
# Parse the name list into a source file.
4329
$show "creating $output_objdir/$dlsyms"
4331
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4332
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4333
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4339
/* Prevent the only kind of declaration conflicts we can make. */
4340
#define lt_preloaded_symbols some_other_symbol
4342
/* External symbol declarations for the compiler. */\
4345
if test "$dlself" = yes; then
4346
$show "generating symbol list for \`$output'"
4348
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4350
# Add our own program objects to the symbol list.
4351
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4352
for arg in $progfiles; do
4353
$show "extracting global C symbols from \`$arg'"
4354
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4357
if test -n "$exclude_expsyms"; then
4358
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4359
$run eval '$mv "$nlist"T "$nlist"'
4362
if test -n "$export_symbols_regex"; then
4363
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4364
$run eval '$mv "$nlist"T "$nlist"'
4367
# Prepare the list of exported symbols
4368
if test -z "$export_symbols"; then
4369
export_symbols="$output_objdir/$outputname.exp"
4370
$run $rm $export_symbols
4371
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4373
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4374
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4375
$run eval 'mv "$nlist"T "$nlist"'
4379
for arg in $dlprefiles; do
4380
$show "extracting global C symbols from \`$arg'"
4381
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4382
$run eval '$echo ": $name " >> "$nlist"'
4383
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4386
if test -z "$run"; then
4387
# Make sure we have at least an empty file.
4388
test -f "$nlist" || : > "$nlist"
4390
if test -n "$exclude_expsyms"; then
4391
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4392
$mv "$nlist"T "$nlist"
4395
# Try sorting and uniquifying the output.
4396
if grep -v "^: " < "$nlist" |
4397
if sort -k 3 </dev/null >/dev/null 2>&1; then
4402
uniq > "$nlist"S; then
4405
grep -v "^: " < "$nlist" > "$nlist"S
4408
if test -f "$nlist"S; then
4409
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4411
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
4414
$echo >> "$output_objdir/$dlsyms" "\
4416
#undef lt_preloaded_symbols
4418
#if defined (__STDC__) && __STDC__
4419
# define lt_ptr void *
4421
# define lt_ptr char *
4425
/* The mapping between symbol names and symbols. */
4429
*cygwin* | *mingw* )
4430
$echo >> "$output_objdir/$dlsyms" "\
4431
/* DATA imports from DLLs on WIN32 can't be const, because
4432
runtime relocations are performed -- see ld's documentation
4438
$echo >> "$output_objdir/$dlsyms" "\
4445
$echo >> "$output_objdir/$dlsyms" "\
4449
lt_preloaded_symbols[] =
4453
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4455
$echo >> "$output_objdir/$dlsyms" "\
4459
/* This works around a problem in FreeBSD linker */
4460
#ifdef FREEBSD_WORKAROUND
4461
static const void *lt_preloaded_setup() {
4462
return lt_preloaded_symbols;
4472
pic_flag_for_symtable=
4474
# compiling the symbol table file with pic_flag works around
4475
# a FreeBSD bug that causes programs to crash when -lm is
4476
# linked before any other PIC object. But we must not use
4477
# pic_flag when linking with -static. The problem exists in
4478
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4479
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4480
case "$compile_command " in
4482
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4485
case "$compile_command " in
4487
*) pic_flag_for_symtable=" $pic_flag";;
4491
# Now compile the dynamic symbol file.
4492
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4493
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4495
# Clean up the generated files.
4496
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4497
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4499
# Transform the symbol file into the correct name.
4500
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4501
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4504
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4509
# We keep going just in case the user didn't refer to
4510
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4511
# really was required.
4513
# Nullify the symbol file.
4514
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4515
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4518
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4519
# Replace the output file specification.
4520
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4521
link_command="$compile_command$compile_rpath"
4523
# We have no uninstalled library dependencies, so finalize right now.
4524
$show "$link_command"
4525
$run eval "$link_command"
4528
# Delete the generated files.
4529
if test -n "$dlsyms"; then
4530
$show "$rm $output_objdir/${outputname}S.${objext}"
4531
$run $rm "$output_objdir/${outputname}S.${objext}"
4537
if test -n "$shlibpath_var"; then
4538
# We should set the shlibpath_var
4540
for dir in $temp_rpath; do
4542
[\\/]* | [A-Za-z]:[\\/]*)
4547
# Relative path: add a thisdir entry.
4548
rpath="$rpath\$thisdir/$dir:"
4555
if test -n "$compile_shlibpath$finalize_shlibpath"; then
4556
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4558
if test -n "$finalize_shlibpath"; then
4559
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4564
if test -n "$runpath_var"; then
4565
if test -n "$perm_rpath"; then
4566
# We should set the runpath_var.
4568
for dir in $perm_rpath; do
4571
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4573
if test -n "$finalize_perm_rpath"; then
4574
# We should set the runpath_var.
4576
for dir in $finalize_perm_rpath; do
4579
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4583
if test "$no_install" = yes; then
4584
# We don't need to create a wrapper script.
4585
link_command="$compile_var$compile_command$compile_rpath"
4586
# Replace the output file specification.
4587
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4588
# Delete the old output file.
4590
# Link the executable and exit
4591
$show "$link_command"
4592
$run eval "$link_command" || exit $?
4596
if test "$hardcode_action" = relink; then
4597
# Fast installation is not supported
4598
link_command="$compile_var$compile_command$compile_rpath"
4599
relink_command="$finalize_var$finalize_command$finalize_rpath"
4601
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4602
$echo "$modename: \`$output' will be relinked during installation" 1>&2
4604
if test "$fast_install" != no; then
4605
link_command="$finalize_var$compile_command$finalize_rpath"
4606
if test "$fast_install" = yes; then
4607
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4609
# fast_install is set to needless
4613
link_command="$compile_var$compile_command$compile_rpath"
4614
relink_command="$finalize_var$finalize_command$finalize_rpath"
4618
# Replace the output file specification.
4619
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4621
# Delete the old output files.
4622
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4624
$show "$link_command"
4625
$run eval "$link_command" || exit $?
4627
# Now create the wrapper script.
4628
$show "creating $output"
4630
# Quote the relink command for shipping.
4631
if test -n "$relink_command"; then
4632
# Preserve any variables that may affect compiler behavior
4633
for var in $variables_saved_for_relink; do
4634
if eval test -z \"\${$var+set}\"; then
4635
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4636
elif eval var_value=\$$var; test -z "$var_value"; then
4637
relink_command="$var=; export $var; $relink_command"
4639
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4640
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4643
relink_command="(cd `pwd`; $relink_command)"
4644
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4647
# Quote $echo for shipping.
4648
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4650
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4651
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4653
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4655
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4658
# Only actually do things if our run command is non-null.
4659
if test -z "$run"; then
4660
# win32 will think the script is a binary if it has
4661
# a .exe suffix, so we strip it off here.
4663
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4665
# test for cygwin because mv fails w/o .exe extensions
4669
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4673
*cygwin* | *mingw* )
4674
cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4675
cwrapper=`$echo ${output}.exe`
4676
$rm $cwrappersource $cwrapper
4677
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4679
cat > $cwrappersource <<EOF
4681
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4682
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4684
The $output program cannot be directly executed until all the libtool
4685
libraries that it depends on are installed.
4687
This wrapper executable should never be moved out of the build directory.
4688
If it is, it will not operate correctly.
4690
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4691
but could eventually absorb all of the scripts functionality and
4692
exec $objdir/$outputname directly.
4695
cat >> $cwrappersource<<"EOF"
4703
#if defined(PATH_MAX)
4704
# define LT_PATHMAX PATH_MAX
4705
#elif defined(MAXPATHLEN)
4706
# define LT_PATHMAX MAXPATHLEN
4708
# define LT_PATHMAX 1024
4711
#ifndef DIR_SEPARATOR
4712
#define DIR_SEPARATOR '/'
4715
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4717
#define HAVE_DOS_BASED_FILE_SYSTEM
4718
#ifndef DIR_SEPARATOR_2
4719
#define DIR_SEPARATOR_2 '\\'
4723
#ifndef DIR_SEPARATOR_2
4724
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4725
#else /* DIR_SEPARATOR_2 */
4726
# define IS_DIR_SEPARATOR(ch) \
4727
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4728
#endif /* DIR_SEPARATOR_2 */
4730
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4731
#define XFREE(stale) do { \
4732
if (stale) { free ((void *) stale); stale = 0; } \
4735
const char *program_name = NULL;
4737
void * xmalloc (size_t num);
4738
char * xstrdup (const char *string);
4739
char * basename (const char *name);
4740
char * fnqualify(const char *path);
4741
char * strendzap(char *str, const char *pat);
4742
void lt_fatal (const char *message, ...);
4745
main (int argc, char *argv[])
4750
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4751
newargz = XMALLOC(char *, argc+2);
4754
cat >> $cwrappersource <<EOF
4755
newargz[0] = "$SHELL";
4758
cat >> $cwrappersource <<"EOF"
4759
newargz[1] = fnqualify(argv[0]);
4760
/* we know the script has the same name, without the .exe */
4761
/* so make sure newargz[1] doesn't end in .exe */
4762
strendzap(newargz[1],".exe");
4763
for (i = 1; i < argc; i++)
4764
newargz[i+1] = xstrdup(argv[i]);
4765
newargz[argc+1] = NULL;
4768
cat >> $cwrappersource <<EOF
4769
execv("$SHELL",newargz);
4772
cat >> $cwrappersource <<"EOF"
4776
xmalloc (size_t num)
4778
void * p = (void *) malloc (num);
4780
lt_fatal ("Memory exhausted");
4786
xstrdup (const char *string)
4788
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4793
basename (const char *name)
4797
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4798
/* Skip over the disk name in MSDOS pathnames. */
4799
if (isalpha (name[0]) && name[1] == ':')
4803
for (base = name; *name; name++)
4804
if (IS_DIR_SEPARATOR (*name))
4806
return (char *) base;
4810
fnqualify(const char *path)
4814
char tmp[LT_PATHMAX + 1];
4816
assert(path != NULL);
4818
/* Is it qualified already? */
4819
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4820
if (isalpha (path[0]) && path[1] == ':')
4821
return xstrdup (path);
4823
if (IS_DIR_SEPARATOR (path[0]))
4824
return xstrdup (path);
4826
/* prepend the current directory */
4827
/* doesn't handle '~' */
4828
if (getcwd (tmp, LT_PATHMAX) == NULL)
4829
lt_fatal ("getcwd failed");
4830
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4831
p = XMALLOC(char, size);
4832
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4837
strendzap(char *str, const char *pat)
4841
assert(str != NULL);
4842
assert(pat != NULL);
4845
patlen = strlen(pat);
4849
str += len - patlen;
4850
if (strcmp(str, pat) == 0)
4857
lt_error_core (int exit_status, const char * mode,
4858
const char * message, va_list ap)
4860
fprintf (stderr, "%s: %s: ", program_name, mode);
4861
vfprintf (stderr, message, ap);
4862
fprintf (stderr, ".\n");
4864
if (exit_status >= 0)
4869
lt_fatal (const char *message, ...)
4872
va_start (ap, message);
4873
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4877
# we should really use a build-platform specific compiler
4878
# here, but OTOH, the wrappers (shell script and this C one)
4879
# are only useful if you want to execute the "real" binary.
4880
# Since the "real" binary is built for $host, then this
4881
# wrapper might as well be built for $host, too.
4882
$run $LTCC -s -o $cwrapper $cwrappersource
4886
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4891
# $output - temporary wrapper script for $objdir/$outputname
4892
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4894
# The $output program cannot be directly executed until all the libtool
4895
# libraries that it depends on are installed.
4897
# This wrapper script should never be moved out of the build directory.
4898
# If it is, it will not operate correctly.
4900
# Sed substitution that helps us do robust quoting. It backslashifies
4901
# metacharacters that are still active within double-quoted strings.
4902
Xsed='${SED} -e 1s/^X//'
4903
sed_quote_subst='$sed_quote_subst'
4905
# The HP-UX ksh and POSIX shell print the target directory to stdout
4907
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4909
relink_command=\"$relink_command\"
4911
# This environment variable determines our operation mode.
4912
if test \"\$libtool_install_magic\" = \"$magic\"; then
4913
# install mode needs the following variable:
4914
notinst_deplibs='$notinst_deplibs'
4916
# When we are sourced in execute mode, \$file and \$echo are already set.
4917
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4920
# Make sure echo works.
4921
if test \"X\$1\" = X--no-reexec; then
4922
# Discard the --no-reexec flag, and continue.
4924
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4925
# Yippee, \$echo works!
4928
# Restart under the correct shell, and then maybe \$echo will work.
4929
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4935
# Find the directory that this script lives in.
4936
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4937
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4939
# Follow symbolic links until we get to the real thisdir.
4940
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4941
while test -n \"\$file\"; do
4942
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4944
# If there was a directory component, then change thisdir.
4945
if test \"x\$destdir\" != \"x\$file\"; then
4946
case \"\$destdir\" in
4947
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4948
*) thisdir=\"\$thisdir/\$destdir\" ;;
4952
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4953
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4956
# Try to get the absolute directory name.
4957
absdir=\`cd \"\$thisdir\" && pwd\`
4958
test -n \"\$absdir\" && thisdir=\"\$absdir\"
4961
if test "$fast_install" = yes; then
4963
program=lt-'$outputname'$exeext
4964
progdir=\"\$thisdir/$objdir\"
4966
if test ! -f \"\$progdir/\$program\" || \\
4967
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4968
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4970
file=\"\$\$-\$program\"
4972
if test ! -d \"\$progdir\"; then
4973
$mkdir \"\$progdir\"
4975
$rm \"\$progdir/\$file\"
4980
# relink executable if necessary
4981
if test -n \"\$relink_command\"; then
4982
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4984
$echo \"\$relink_command_output\" >&2
4985
$rm \"\$progdir/\$file\"
4990
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4991
{ $rm \"\$progdir/\$program\";
4992
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4993
$rm \"\$progdir/\$file\"
4997
program='$outputname'
4998
progdir=\"\$thisdir/$objdir\"
5004
if test -f \"\$progdir/\$program\"; then"
5006
# Export our shlibpath_var if we have one.
5007
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5009
# Add our own library path to $shlibpath_var
5010
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5012
# Some systems cannot cope with colon-terminated $shlibpath_var
5013
# The second colon is a workaround for a bug in BeOS R4 sed
5014
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5016
export $shlibpath_var
5020
# fixup the dll searchpath if we need to.
5021
if test -n "$dllsearchpath"; then
5023
# Add the dll search path components to the executable PATH
5024
PATH=$dllsearchpath:\$PATH
5029
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5030
# Run the actual program with our arguments.
5033
# Backslashes separate directories on plain windows
5034
*-*-mingw | *-*-os2*)
5036
exec \$progdir\\\\\$program \${1+\"\$@\"}
5042
exec \$progdir/\$program \${1+\"\$@\"}
5047
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5051
# The program doesn't exist.
5052
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5053
\$echo \"This script is just a wrapper for \$program.\" 1>&2
5054
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
5065
# See if we need to build an old-fashioned archive.
5066
for oldlib in $oldlibs; do
5068
if test "$build_libtool_libs" = convenience; then
5069
oldobjs="$libobjs_save"
5070
addlibs="$convenience"
5071
build_libtool_libs=no
5073
if test "$build_libtool_libs" = module; then
5074
oldobjs="$libobjs_save"
5075
build_libtool_libs=no
5077
oldobjs="$old_deplibs $non_pic_objects"
5079
addlibs="$old_convenience"
5082
if test -n "$addlibs"; then
5083
gentop="$output_objdir/${outputname}x"
5084
generated="$generated $gentop"
5086
func_extract_archives $gentop $addlibs
5087
oldobjs="$oldobjs $func_extract_archives_result"
5090
# Do each command in the archive commands.
5091
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5092
cmds=$old_archive_from_new_cmds
5094
eval cmds=\"$old_archive_cmds\"
5096
if len=`expr "X$cmds" : ".*"` &&
5097
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5098
cmds=$old_archive_cmds
5100
# the command line is too long to link in one step, link in parts
5101
$echo "using piecewise archive linking..."
5106
save_oldobjs=$oldobjs
5107
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5108
# encoded into archives. This makes 'ar r' malfunction in
5109
# this piecewise linking case whenever conflicting object
5110
# names appear in distinct ar calls; check, warn and compensate.
5111
if (for obj in $save_oldobjs
5113
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5114
done | sort | sort -uc >/dev/null 2>&1); then
5117
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5118
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5121
# Is there a better way of finding the last object in the list?
5122
for obj in $save_oldobjs
5126
for obj in $save_oldobjs
5128
oldobjs="$objlist $obj"
5129
objlist="$objlist $obj"
5130
eval test_cmds=\"$old_archive_cmds\"
5131
if len=`expr "X$test_cmds" : ".*"` &&
5132
test "$len" -le "$max_cmd_len"; then
5135
# the above command should be used before it gets too long
5137
if test "$obj" = "$last_oldobj" ; then
5140
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5141
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5147
if test "X$oldobjs" = "X" ; then
5148
eval cmds=\"\$concat_cmds\"
5150
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5154
save_ifs="$IFS"; IFS='~'
5155
for cmd in $cmds; do
5159
$run eval "$cmd" || exit $?
5164
if test -n "$generated"; then
5165
$show "${rm}r$generated"
5166
$run ${rm}r$generated
5169
# Now create the libtool archive.
5173
test "$build_old_libs" = yes && old_library="$libname.$libext"
5174
$show "creating $output"
5176
# Preserve any variables that may affect compiler behavior
5177
for var in $variables_saved_for_relink; do
5178
if eval test -z \"\${$var+set}\"; then
5179
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5180
elif eval var_value=\$$var; test -z "$var_value"; then
5181
relink_command="$var=; export $var; $relink_command"
5183
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5184
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5187
# Quote the link command for shipping.
5188
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5189
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5190
if test "$hardcode_automatic" = yes ; then
5195
# Only create the output if not a dry run.
5196
if test -z "$run"; then
5197
for installed in no yes; do
5198
if test "$installed" = yes; then
5199
if test -z "$install_libdir"; then
5202
output="$output_objdir/$outputname"i
5203
# Replace all uninstalled libtool libraries with the installed ones
5205
for deplib in $dependency_libs; do
5208
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5209
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5210
if test -z "$libdir"; then
5211
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5214
newdependency_libs="$newdependency_libs $libdir/$name"
5216
*) newdependency_libs="$newdependency_libs $deplib" ;;
5219
dependency_libs="$newdependency_libs"
5221
for lib in $dlfiles; do
5222
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5223
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5224
if test -z "$libdir"; then
5225
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5228
newdlfiles="$newdlfiles $libdir/$name"
5230
dlfiles="$newdlfiles"
5232
for lib in $dlprefiles; do
5233
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5234
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5235
if test -z "$libdir"; then
5236
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5239
newdlprefiles="$newdlprefiles $libdir/$name"
5241
dlprefiles="$newdlprefiles"
5244
for lib in $dlfiles; do
5246
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5247
*) abs=`pwd`"/$lib" ;;
5249
newdlfiles="$newdlfiles $abs"
5251
dlfiles="$newdlfiles"
5253
for lib in $dlprefiles; do
5255
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5256
*) abs=`pwd`"/$lib" ;;
5258
newdlprefiles="$newdlprefiles $abs"
5260
dlprefiles="$newdlprefiles"
5263
# place dlname in correct position for cygwin
5265
case $host,$output,$installed,$module,$dlname in
5266
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5269
# $outputname - a libtool library file
5270
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5272
# Please DO NOT delete this file!
5273
# It is necessary for linking the library.
5275
# The name that we can dlopen(3).
5278
# Names of this library.
5279
library_names='$library_names'
5281
# The name of the static archive.
5282
old_library='$old_library'
5284
# Libraries that this one depends upon.
5285
dependency_libs='$dependency_libs'
5287
# Version information for $libname.
5292
# Is this an already installed library?
5293
installed=$installed
5295
# Should we warn about portability when linking against -modules?
5296
shouldnotlink=$module
5298
# Files to dlopen/dlpreopen
5300
dlpreopen='$dlprefiles'
5302
# Directory that this library needs to be installed in:
5303
libdir='$install_libdir'"
5304
if test "$installed" = no && test "$need_relink" = yes; then
5306
relink_command=\"$relink_command\""
5311
# Do a symbolic link so that the libtool archive can be found in
5312
# LD_LIBRARY_PATH before the program is installed.
5313
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5314
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5320
# libtool install mode
5322
modename="$modename: install"
5324
# There may be an optional sh(1) argument at the beginning of
5325
# install_prog (especially on Windows NT).
5326
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5327
# Allow the use of GNU shtool's install command.
5328
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5329
# Aesthetically quote it.
5330
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5332
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5336
install_prog="$arg "
5344
# The real first argument should be the name of the installation program.
5345
# Aesthetically quote it.
5346
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5348
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5352
install_prog="$install_prog$arg"
5354
# We need to accept at least all the BSD install flags.
5364
if test -n "$dest"; then
5365
files="$files $dest"
5383
# If the previous option needed an argument, then skip it.
5384
if test -n "$prev"; then
5393
# Aesthetically quote the argument.
5394
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5396
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5400
install_prog="$install_prog $arg"
5403
if test -z "$install_prog"; then
5404
$echo "$modename: you must specify an install program" 1>&2
5409
if test -n "$prev"; then
5410
$echo "$modename: the \`$prev' option requires an argument" 1>&2
5415
if test -z "$files"; then
5416
if test -z "$dest"; then
5417
$echo "$modename: no file or destination specified" 1>&2
5419
$echo "$modename: you must specify a destination" 1>&2
5425
# Strip any trailing slash from the destination.
5426
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5428
# Check to see that the destination is a directory.
5429
test -d "$dest" && isdir=yes
5430
if test "$isdir" = yes; then
5434
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5435
test "X$destdir" = "X$dest" && destdir=.
5436
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5438
# Not a directory, so check to see that there is only one file specified.
5440
if test "$#" -gt 2; then
5441
$echo "$modename: \`$dest' is not a directory" 1>&2
5447
[\\/]* | [A-Za-z]:[\\/]*) ;;
5449
for file in $files; do
5453
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5462
# This variable tells wrapper scripts just to set variables rather
5463
# than running their programs.
5464
libtool_install_magic="$magic"
5469
for file in $files; do
5471
# Do each installation.
5474
# Do the static libraries later.
5475
staticlibs="$staticlibs $file"
5479
# Check to see that this really is a libtool archive.
5480
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5482
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5490
# If there is no directory component, then add one.
5492
*/* | *\\*) . $file ;;
5496
# Add the libdir to current_libdirs if it is the destination.
5497
if test "X$destdir" = "X$libdir"; then
5498
case "$current_libdirs " in
5500
*) current_libdirs="$current_libdirs $libdir" ;;
5503
# Note the libdir as a future libdir.
5504
case "$future_libdirs " in
5506
*) future_libdirs="$future_libdirs $libdir" ;;
5510
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5511
test "X$dir" = "X$file/" && dir=
5514
if test -n "$relink_command"; then
5515
# Determine the prefix the user has applied to our future dir.
5516
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5518
# Don't allow the user to place us outside of our expected
5519
# location b/c this prevents finding dependent libraries that
5520
# are installed to the same prefix.
5521
# At present, this check doesn't affect windows .dll's that
5522
# are installed into $libdir/../bin (currently, that works fine)
5523
# but it's something to keep an eye on.
5524
if test "$inst_prefix_dir" = "$destdir"; then
5525
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5529
if test -n "$inst_prefix_dir"; then
5530
# Stick the inst_prefix_dir data into the link command.
5531
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5533
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5536
$echo "$modename: warning: relinking \`$file'" 1>&2
5537
$show "$relink_command"
5538
if $run eval "$relink_command"; then :
5540
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5545
# See the names of the shared library.
5546
set dummy $library_names
5547
if test -n "$2"; then
5553
test -n "$relink_command" && srcname="$realname"T
5555
# Install the shared library and build the symlinks.
5556
$show "$install_prog $dir/$srcname $destdir/$realname"
5557
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5558
if test -n "$stripme" && test -n "$striplib"; then
5559
$show "$striplib $destdir/$realname"
5560
$run eval "$striplib $destdir/$realname" || exit $?
5563
if test "$#" -gt 0; then
5564
# Delete the old symlinks, and create new ones.
5567
if test "$linkname" != "$realname"; then
5568
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5569
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5574
# Do each command in the postinstall commands.
5575
lib="$destdir/$realname"
5576
cmds=$postinstall_cmds
5577
save_ifs="$IFS"; IFS='~'
5578
for cmd in $cmds; do
5582
$run eval "$cmd" || exit $?
5587
# Install the pseudo-library for information purposes.
5588
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5589
instname="$dir/$name"i
5590
$show "$install_prog $instname $destdir/$name"
5591
$run eval "$install_prog $instname $destdir/$name" || exit $?
5593
# Maybe install the static library, too.
5594
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5598
# Install (i.e. copy) a libtool object.
5600
# Figure out destination file name, if it wasn't already specified.
5601
if test -n "$destname"; then
5602
destfile="$destdir/$destname"
5604
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5605
destfile="$destdir/$destfile"
5608
# Deduce the name of the destination old-style object file.
5611
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5614
staticdest="$destfile"
5618
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5624
# Install the libtool object if requested.
5625
if test -n "$destfile"; then
5626
$show "$install_prog $file $destfile"
5627
$run eval "$install_prog $file $destfile" || exit $?
5630
# Install the old object if enabled.
5631
if test "$build_old_libs" = yes; then
5632
# Deduce the name of the old-style object file.
5633
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5635
$show "$install_prog $staticobj $staticdest"
5636
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
5642
# Figure out destination file name, if it wasn't already specified.
5643
if test -n "$destname"; then
5644
destfile="$destdir/$destname"
5646
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5647
destfile="$destdir/$destfile"
5650
# If the file is missing, and there is a .exe on the end, strip it
5651
# because it is most likely a libtool script we actually want to
5656
if test ! -f "$file"; then
5657
file=`$echo $file|${SED} 's,.exe$,,'`
5663
# Do a test to see if this is really a libtool program.
5666
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5672
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5676
# To insure that "foo" is sourced, and not "foo.exe",
5677
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5678
# which disallows the automatic-append-.exe behavior.
5680
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5681
*) wrapperdot=${wrapper} ;;
5683
# If there is no directory component, then add one.
5685
*/* | *\\*) . ${wrapperdot} ;;
5686
*) . ./${wrapperdot} ;;
5689
# Check the variables that should have been set.
5690
if test -z "$notinst_deplibs"; then
5691
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5696
for lib in $notinst_deplibs; do
5697
# Check to see that each library is installed.
5699
if test -f "$lib"; then
5700
# If there is no directory component, then add one.
5702
*/* | *\\*) . $lib ;;
5706
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5707
if test -n "$libdir" && test ! -f "$libfile"; then
5708
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5714
# To insure that "foo" is sourced, and not "foo.exe",
5715
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5716
# which disallows the automatic-append-.exe behavior.
5718
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5719
*) wrapperdot=${wrapper} ;;
5721
# If there is no directory component, then add one.
5723
*/* | *\\*) . ${wrapperdot} ;;
5724
*) . ./${wrapperdot} ;;
5728
if test "$fast_install" = no && test -n "$relink_command"; then
5729
if test "$finalize" = yes && test -z "$run"; then
5731
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5732
tmpdir="$tmpdir/libtool-$$"
5735
if $mkdir "$tmpdir"; then
5739
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5742
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5743
outputname="$tmpdir/$file"
5744
# Replace the output file specification.
5745
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5747
$show "$relink_command"
5748
if $run eval "$relink_command"; then :
5750
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5756
$echo "$modename: warning: cannot relink \`$file'" 1>&2
5759
# Install the binary that we compiled earlier.
5760
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5764
# remove .exe since cygwin /usr/bin/install will append another
5766
case $install_prog,$host in
5767
*/usr/bin/install*,*cygwin*)
5768
case $file:$destfile in
5773
destfile=$destfile.exe
5776
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5781
$show "$install_prog$stripme $file $destfile"
5782
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5783
test -n "$outputname" && ${rm}r "$tmpdir"
5788
for file in $staticlibs; do
5789
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5791
# Set up the ranlib parameters.
5792
oldlib="$destdir/$name"
5794
$show "$install_prog $file $oldlib"
5795
$run eval "$install_prog \$file \$oldlib" || exit $?
5797
if test -n "$stripme" && test -n "$old_striplib"; then
5798
$show "$old_striplib $oldlib"
5799
$run eval "$old_striplib $oldlib" || exit $?
5802
# Do each command in the postinstall commands.
5803
cmds=$old_postinstall_cmds
5804
save_ifs="$IFS"; IFS='~'
5805
for cmd in $cmds; do
5809
$run eval "$cmd" || exit $?
5814
if test -n "$future_libdirs"; then
5815
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5818
if test -n "$current_libdirs"; then
5819
# Maybe just do a dry run.
5820
test -n "$run" && current_libdirs=" -n$current_libdirs"
5821
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5827
# libtool finish mode
5829
modename="$modename: finish"
5833
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5836
libdirs="$libdirs $dir"
5839
for libdir in $libdirs; do
5840
if test -n "$finish_cmds"; then
5841
# Do each command in the finish commands.
5843
save_ifs="$IFS"; IFS='~'
5844
for cmd in $cmds; do
5848
$run eval "$cmd" || admincmds="$admincmds
5853
if test -n "$finish_eval"; then
5854
# Do the single finish_eval.
5855
eval cmds=\"$finish_eval\"
5856
$run eval "$cmds" || admincmds="$admincmds
5862
# Exit here if they wanted silent mode.
5863
test "$show" = : && exit $EXIT_SUCCESS
5865
$echo "----------------------------------------------------------------------"
5866
$echo "Libraries have been installed in:"
5867
for libdir in $libdirs; do
5871
$echo "If you ever happen to want to link against installed libraries"
5872
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5873
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5874
$echo "flag during linking and do at least one of the following:"
5875
if test -n "$shlibpath_var"; then
5876
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5877
$echo " during execution"
5879
if test -n "$runpath_var"; then
5880
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5881
$echo " during linking"
5883
if test -n "$hardcode_libdir_flag_spec"; then
5885
eval flag=\"$hardcode_libdir_flag_spec\"
5887
$echo " - use the \`$flag' linker flag"
5889
if test -n "$admincmds"; then
5890
$echo " - have your system administrator run these commands:$admincmds"
5892
if test -f /etc/ld.so.conf; then
5893
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5896
$echo "See any operating system documentation about shared libraries for"
5897
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5898
$echo "----------------------------------------------------------------------"
5902
# libtool execute mode
5904
modename="$modename: execute"
5906
# The first argument is the command name.
5908
if test -z "$cmd"; then
5909
$echo "$modename: you must specify a COMMAND" 1>&2
5914
# Handle -dlopen flags immediately.
5915
for file in $execute_dlfiles; do
5916
if test ! -f "$file"; then
5917
$echo "$modename: \`$file' is not a file" 1>&2
5925
# Check to see that this really is a libtool archive.
5926
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5928
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5933
# Read the libtool library.
5937
# If there is no directory component, then add one.
5939
*/* | *\\*) . $file ;;
5943
# Skip this library if it cannot be dlopened.
5944
if test -z "$dlname"; then
5945
# Warn if it was a shared library.
5946
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5950
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5951
test "X$dir" = "X$file" && dir=.
5953
if test -f "$dir/$objdir/$dlname"; then
5956
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5962
# Just add the directory containing the .lo file.
5963
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5964
test "X$dir" = "X$file" && dir=.
5968
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5973
# Get the absolute pathname.
5974
absdir=`cd "$dir" && pwd`
5975
test -n "$absdir" && dir="$absdir"
5977
# Now add the directory to shlibpath_var.
5978
if eval "test -z \"\$$shlibpath_var\""; then
5979
eval "$shlibpath_var=\"\$dir\""
5981
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5985
# This variable tells wrapper scripts just to set shlibpath_var
5986
# rather than running their programs.
5987
libtool_execute_magic="$magic"
5989
# Check if any of the arguments is a wrapper script.
5996
# Do a test to see if this is really a libtool program.
5997
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5998
# If there is no directory component, then add one.
6000
*/* | *\\*) . $file ;;
6004
# Transform arg to wrapped name.
6005
file="$progdir/$program"
6009
# Quote arguments (to preserve shell metacharacters).
6010
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6011
args="$args \"$file\""
6014
if test -z "$run"; then
6015
if test -n "$shlibpath_var"; then
6016
# Export the shlibpath_var.
6017
eval "export $shlibpath_var"
6020
# Restore saved environment variables
6021
if test "${save_LC_ALL+set}" = set; then
6022
LC_ALL="$save_LC_ALL"; export LC_ALL
6024
if test "${save_LANG+set}" = set; then
6025
LANG="$save_LANG"; export LANG
6028
# Now prepare to actually exec the command.
6029
exec_cmd="\$cmd$args"
6031
# Display what would be done.
6032
if test -n "$shlibpath_var"; then
6033
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6034
$echo "export $shlibpath_var"
6041
# libtool clean and uninstall mode
6043
modename="$modename: $mode"
6049
# This variable tells wrapper scripts just to set variables rather
6050
# than running their programs.
6051
libtool_install_magic="$magic"
6056
-f) rm="$rm $arg"; rmforce=yes ;;
6057
-*) rm="$rm $arg" ;;
6058
*) files="$files $arg" ;;
6062
if test -z "$rm"; then
6063
$echo "$modename: you must specify an RM program" 1>&2
6070
origobjdir="$objdir"
6071
for file in $files; do
6072
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6073
if test "X$dir" = "X$file"; then
6075
objdir="$origobjdir"
6077
objdir="$dir/$origobjdir"
6079
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6080
test "$mode" = uninstall && objdir="$dir"
6082
# Remember objdir for removal later, being careful to avoid duplicates
6083
if test "$mode" = clean; then
6086
*) rmdirs="$rmdirs $objdir" ;;
6090
# Don't error if the file doesn't exist and rm -f was used.
6091
if (test -L "$file") >/dev/null 2>&1 \
6092
|| (test -h "$file") >/dev/null 2>&1 \
6093
|| test -f "$file"; then
6095
elif test -d "$file"; then
6098
elif test "$rmforce" = yes; then
6106
# Possibly a libtool archive, so verify it.
6107
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6110
# Delete the libtool libraries and symlinks.
6111
for n in $library_names; do
6112
rmfiles="$rmfiles $objdir/$n"
6114
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6115
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6117
if test "$mode" = uninstall; then
6118
if test -n "$library_names"; then
6119
# Do each command in the postuninstall commands.
6120
cmds=$postuninstall_cmds
6121
save_ifs="$IFS"; IFS='~'
6122
for cmd in $cmds; do
6127
if test "$?" -ne 0 && test "$rmforce" != yes; then
6134
if test -n "$old_library"; then
6135
# Do each command in the old_postuninstall commands.
6136
cmds=$old_postuninstall_cmds
6137
save_ifs="$IFS"; IFS='~'
6138
for cmd in $cmds; do
6143
if test "$?" -ne 0 && test "$rmforce" != yes; then
6149
# FIXME: should reinstall the best remaining shared library.
6155
# Possibly a libtool object, so verify it.
6156
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6161
# Add PIC object to the list of files to remove.
6162
if test -n "$pic_object" \
6163
&& test "$pic_object" != none; then
6164
rmfiles="$rmfiles $dir/$pic_object"
6167
# Add non-PIC object to the list of files to remove.
6168
if test -n "$non_pic_object" \
6169
&& test "$non_pic_object" != none; then
6170
rmfiles="$rmfiles $dir/$non_pic_object"
6176
if test "$mode" = clean ; then
6180
file=`$echo $file|${SED} 's,.exe$,,'`
6181
noexename=`$echo $name|${SED} 's,.exe$,,'`
6182
# $file with .exe has already been added to rmfiles,
6183
# add $file without .exe
6184
rmfiles="$rmfiles $file"
6187
# Do a test to see if this is a libtool program.
6188
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6192
# note $name still contains .exe if it was in $file originally
6193
# as does the version of $file that was added into $rmfiles
6194
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6195
if test "$fast_install" = yes && test -n "$relink_command"; then
6196
rmfiles="$rmfiles $objdir/lt-$name"
6198
if test "X$noexename" != "X$name" ; then
6199
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6205
$show "$rm $rmfiles"
6206
$run $rm $rmfiles || exit_status=1
6208
objdir="$origobjdir"
6210
# Try to remove the ${objdir}s in the directories where we deleted files
6211
for dir in $rmdirs; do
6212
if test -d "$dir"; then
6214
$run rmdir $dir >/dev/null 2>&1
6222
$echo "$modename: you must specify a MODE" 1>&2
6223
$echo "$generic_help" 1>&2
6228
if test -z "$exec_cmd"; then
6229
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6230
$echo "$generic_help" 1>&2
6233
fi # test -z "$show_help"
6235
if test -n "$exec_cmd"; then
6240
# We need to display help for each of the modes.
6243
"Usage: $modename [OPTION]... [MODE-ARG]...
6245
Provide generalized library-building support services.
6247
--config show all configuration variables
6248
--debug enable verbose shell tracing
6249
-n, --dry-run display commands without modifying any files
6250
--features display basic configuration information and exit
6251
--finish same as \`--mode=finish'
6252
--help display this help message and exit
6253
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6254
--quiet same as \`--silent'
6255
--silent don't print informational messages
6256
--tag=TAG use configuration variables from tag TAG
6257
--version print version information
6259
MODE must be one of the following:
6261
clean remove files from the build directory
6262
compile compile a source file into a libtool object
6263
execute automatically set library path, then run a program
6264
finish complete the installation of libtool libraries
6265
install install libraries or executables
6266
link create a library or an executable
6267
uninstall remove libraries from an installed directory
6269
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6270
a more detailed description of MODE.
6272
Report bugs to <bug-libtool@gnu.org>."
6278
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6280
Remove files from the build directory.
6282
RM is the name of the program to use to delete files associated with each FILE
6283
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6286
If FILE is a libtool library, object or program, all the files associated
6287
with it are deleted. Otherwise, only FILE itself is deleted using RM."
6292
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6294
Compile a source file into a libtool library object.
6296
This mode accepts the following additional options:
6298
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
6299
-prefer-pic try to building PIC objects only
6300
-prefer-non-pic try to building non-PIC objects only
6301
-static always build a \`.o' file suitable for static linking
6303
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6304
from the given SOURCEFILE.
6306
The output file name is determined by removing the directory component from
6307
SOURCEFILE, then substituting the C source code suffix \`.c' with the
6308
library object suffix, \`.lo'."
6313
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6315
Automatically set library path, then run a program.
6317
This mode accepts the following additional options:
6319
-dlopen FILE add the directory containing FILE to the library path
6321
This mode sets the library path environment variable according to \`-dlopen'
6324
If any of the ARGS are libtool executable wrappers, then they are translated
6325
into their corresponding uninstalled binary, and any of their required library
6326
directories are added to the library path.
6328
Then, COMMAND is executed, with ARGS as arguments."
6333
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6335
Complete the installation of libtool libraries.
6337
Each LIBDIR is a directory that contains libtool libraries.
6339
The commands that this mode executes may require superuser privileges. Use
6340
the \`--dry-run' option if you just want to see what would be executed."
6345
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6347
Install executables or libraries.
6349
INSTALL-COMMAND is the installation command. The first component should be
6350
either the \`install' or \`cp' program.
6352
The rest of the components are interpreted as arguments to that command (only
6353
BSD-compatible install options are recognized)."
6358
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6360
Link object files or libraries together to form another library, or to
6361
create an executable program.
6363
LINK-COMMAND is a command using the C compiler that you would use to create
6364
a program from several object files.
6366
The following components of LINK-COMMAND are treated specially:
6368
-all-static do not do any dynamic linking at all
6369
-avoid-version do not add a version suffix if possible
6370
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6371
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6372
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6373
-export-symbols SYMFILE
6374
try to export only the symbols listed in SYMFILE
6375
-export-symbols-regex REGEX
6376
try to export only the symbols matching REGEX
6377
-LLIBDIR search LIBDIR for required installed libraries
6378
-lNAME OUTPUT-FILE requires the installed library libNAME
6379
-module build a library that can dlopened
6380
-no-fast-install disable the fast-install mode
6381
-no-install link a not-installable executable
6382
-no-undefined declare that a library does not refer to external symbols
6383
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6384
-objectlist FILE Use a list of object files found in FILE to specify objects
6385
-precious-files-regex REGEX
6386
don't remove output files matching REGEX
6387
-release RELEASE specify package release information
6388
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6389
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6390
-static do not do any dynamic linking of libtool libraries
6391
-version-info CURRENT[:REVISION[:AGE]]
6392
specify library version info [each variable defaults to 0]
6394
All other options (arguments beginning with \`-') are ignored.
6396
Every other argument is treated as a filename. Files ending in \`.la' are
6397
treated as uninstalled libtool libraries, other files are standard or library
6400
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6401
only library objects (\`.lo' files) may be specified, and \`-rpath' is
6402
required, except when creating a convenience library.
6404
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6405
using \`ar' and \`ranlib', or on Windows using \`lib'.
6407
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6408
is created, otherwise an executable program is created."
6413
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6415
Remove libraries from an installation directory.
6417
RM is the name of the program to use to delete files associated with each FILE
6418
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6421
If FILE is a libtool library, all the files associated with it are deleted.
6422
Otherwise, only FILE itself is deleted using RM."
6426
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6433
$echo "Try \`$modename --help' for more information about other modes."
6437
# The TAGs below are defined such that we never get into a situation
6438
# in which we disable both kinds of libraries. Given conflicting
6439
# choices, we go for a static library, that is the most portable,
6440
# since we can't tell whether shared libraries were disabled because
6441
# the user asked for that or because the platform doesn't support
6442
# them. This is particularly important on AIX, because we don't
6443
# support having both static and shared libraries enabled at the same
6444
# time on that platform, so we default to a shared-only configuration.
6445
# If a disable-shared tag is given, we'll fallback to a static-only
6446
# configuration. But we'll never go from static-only to shared-only.
6448
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6449
build_libtool_libs=no
6451
# ### END LIBTOOL TAG CONFIG: disable-shared
6453
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6454
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6455
# ### END LIBTOOL TAG CONFIG: disable-static