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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.245 2005/05/16 08:55:27)"
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
119
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
120
$echo "$modename: not configured to build any kind of library" 1>&2
121
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
134
lo2o="s/\\.lo\$/.${objext}/"
135
o2lo="s/\\.${objext}\$/.lo/"
136
quote_scanset='[[~#^*{};<>?'"'"' ]'
138
#####################################
139
# Shell function definitions:
140
# This seems to be the best place for them
142
# func_win32_libid arg
143
# return the library type of file 'arg'
145
# Need a lot of goo to handle *both* DLLs and import libs
146
# Has to be a shell function in order to 'eat' the argument
147
# that is supplied when $file_magic_command is called.
150
win32_libid_type="unknown"
151
win32_fileres=`file -L $1 2>/dev/null`
152
case $win32_fileres in
153
*ar\ archive\ import\ library*) # definitely import
154
win32_libid_type="x86 archive import"
156
*ar\ archive*) # could be an import, or static
157
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
158
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
159
win32_nmres=`eval $NM -f posix -A $1 | \
160
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
161
if test "X$win32_nmres" = "Ximport" ; then
162
win32_libid_type="x86 archive import"
164
win32_libid_type="x86 archive static"
169
win32_libid_type="x86 DLL"
171
*executable*) # but shell scripts are "executable" too...
172
case $win32_fileres in
173
*MS\ Windows\ PE\ Intel*)
174
win32_libid_type="x86 DLL"
179
$echo $win32_libid_type
184
# Infer tagged configuration to use if any are available and
185
# if one wasn't chosen via the "--tag" command line option.
186
# Only attempt this if the compiler in the base compile
187
# command doesn't match the default compiler.
188
# arg is usually of the form 'gcc ...'
191
if test -n "$available_tags" && test -z "$tagname"; then
195
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
199
CC_quoted="$CC_quoted $arg"
202
# Blanks in the command may have been stripped by the calling shell,
203
# but not from the CC environment variable when configure was run.
204
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
205
# Blanks at the start of $base_compile will cause this to fail
206
# if we don't check for them as well.
208
for z in $available_tags; do
209
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
210
# Evaluate the configuration.
211
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
214
# Double-quote args containing other shell metacharacters.
216
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
220
CC_quoted="$CC_quoted $arg"
223
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
224
# The compiler in the base compile command matches
225
# the one in the tagged configuration.
226
# Assume this is the tagged configuration we want.
233
# If $tagname still isn't set, then no tagged configuration
234
# was found and let the user know that the "--tag" command
235
# line option must be used.
236
if test -z "$tagname"; then
237
$echo "$modename: unable to infer tagged configuration"
238
$echo "$modename: specify a tag with \`--tag'" 1>&2
241
# $echo "$modename: using $tagname tagged configuration"
249
# func_extract_an_archive dir oldlib
250
func_extract_an_archive ()
252
f_ex_an_ar_dir="$1"; shift
253
f_ex_an_ar_oldlib="$1"
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: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
265
# func_extract_archives gentop oldlib ...
266
func_extract_archives ()
268
my_gentop="$1"; shift
276
$show "${rm}r $my_gentop"
277
$run ${rm}r "$my_gentop"
278
$show "$mkdir $my_gentop"
279
$run $mkdir "$my_gentop"
281
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
285
for my_xlib in $my_oldlibs; do
286
# Extract the objects.
288
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
289
*) my_xabs=`pwd`"/$my_xlib" ;;
291
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
292
my_xdir="$my_gentop/$my_xlib"
294
$show "${rm}r $my_xdir"
295
$run ${rm}r "$my_xdir"
296
$show "$mkdir $my_xdir"
297
$run $mkdir "$my_xdir"
299
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
304
$show "Extracting $my_xabs"
305
# Do not bother doing anything if just a dry run
306
if test -z "$run"; then
307
darwin_orig_dir=`pwd`
308
cd $my_xdir || exit $?
309
darwin_archive=$my_xabs
311
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
312
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
313
if test -n "$darwin_arches"; then
314
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
316
$show "$darwin_base_archive has multiple architectures $darwin_arches"
317
for darwin_arch in $darwin_arches ; do
318
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
319
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
320
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
321
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
323
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
324
done # $darwin_arches
325
## Okay now we have a bunch of thin objects, gotta fatten them up :)
326
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
329
for darwin_file in $darwin_filelist; do
330
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
331
lipo -create -output "$darwin_file" $darwin_files
332
done # $darwin_filelist
334
cd "$darwin_orig_dir"
336
cd "$darwin_orig_dir"
337
func_extract_an_archive "$my_xdir" "$my_xabs"
342
func_extract_an_archive "$my_xdir" "$my_xabs"
345
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
347
func_extract_archives_result="$my_oldobjs"
349
# End of Shell function definitions
350
#####################################
353
eval std_shrext=\"$shrext_cmds\"
355
# Parse our command line options once, thoroughly.
356
while test "$#" -gt 0
362
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
366
# If the previous option needs an argument, assign it.
367
if test -n "$prev"; then
370
execute_dlfiles="$execute_dlfiles $arg"
374
preserve_args="${preserve_args}=$arg"
376
# Check whether tagname contains only valid characters
379
$echo "$progname: invalid tag name: $tagname" 1>&2
386
# Don't test for the "default" C tag, as we know, it's there, but
387
# not specially marked.
390
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
391
taglist="$taglist $tagname"
392
# Evaluate the configuration.
393
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
395
$echo "$progname: ignoring unknown tag $tagname" 1>&2
410
# Have we seen a non-optional argument yet?
417
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
419
$echo "Copyright (C) 2005 Free Software Foundation, Inc."
420
$echo "This is free software; see the source for copying conditions. There is NO"
421
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
426
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
427
# Now print the configurations for the tags.
428
for tagname in $taglist; do
429
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
435
$echo "$progname: enabling shell trace mode"
437
preserve_args="$preserve_args $arg"
446
if test "$build_libtool_libs" = yes; then
447
$echo "enable shared libraries"
449
$echo "disable shared libraries"
451
if test "$build_old_libs" = yes; then
452
$echo "enable static libraries"
454
$echo "disable static libraries"
459
--finish) mode="finish" ;;
461
--mode) prevopt="--mode" prev=mode ;;
462
--mode=*) mode="$optarg" ;;
464
--preserve-dup-deps) duplicate_deps="yes" ;;
468
preserve_args="$preserve_args $arg"
471
--tag) prevopt="--tag" prev=tag ;;
473
set tag "$optarg" ${1+"$@"}
476
preserve_args="$preserve_args --tag"
485
$echo "$modename: unrecognized option \`$arg'" 1>&2
497
if test -n "$prevopt"; then
498
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
503
# If this variable is set in any of the actions, the command in it
504
# will be execed at the end. This prevents here-documents from being
505
# left over by shells.
508
if test -z "$show_help"; then
510
# Infer the operation mode.
511
if test -z "$mode"; then
512
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
513
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
515
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
527
*db | *dbx | *strace | *truss)
537
# If we have no mode, but dlfiles were specified, then do execute mode.
538
test -n "$execute_dlfiles" && mode=execute
540
# Just use the default operation mode.
541
if test -z "$mode"; then
542
if test -n "$nonopt"; then
543
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
545
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
552
# Only execute mode is allowed to have -dlopen flags.
553
if test -n "$execute_dlfiles" && test "$mode" != execute; then
554
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
559
# Change the help message to a mode-specific one.
561
help="Try \`$modename --help --mode=$mode' for more information."
563
# These modes are in order of execution frequency so that they run quickly.
565
# libtool compile mode
567
modename="$modename: compile"
568
# Get the compilation command and the source file.
570
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
581
# do not "continue". Instead, add this to base_compile
593
# Accept any command-line options.
596
if test -n "$libobj" ; then
597
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
604
-static | -prefer-pic | -prefer-non-pic)
615
arg_mode=arg # the next one goes into the "base_compile" arg list
616
continue # The current "srcfile" will either be retained or
617
;; # replaced later. I would guess that would be a bug.
620
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
622
save_ifs="$IFS"; IFS=','
626
# Double-quote args containing other shell metacharacters.
627
# Many Bourne shells cannot handle close brackets correctly
628
# in scan sets, so we specify it separately.
630
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
634
lastarg="$lastarg $arg"
637
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
639
# Add the arguments to base_compile.
640
base_compile="$base_compile $lastarg"
645
# Accept the current argument as the source file.
646
# The previous "srcfile" becomes the current argument.
653
esac # case $arg_mode
655
# Aesthetically quote the previous argument.
656
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
659
# Double-quote args containing other shell metacharacters.
660
# Many Bourne shells cannot handle close brackets correctly
661
# in scan sets, and some SunOS ksh mistreat backslash-escaping
662
# in scan sets (worked around with variable expansion),
663
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
664
# at all, so we specify them separately.
665
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
666
lastarg="\"$lastarg\""
670
base_compile="$base_compile $lastarg"
675
$echo "$modename: you must specify an argument for -Xcompile"
679
$echo "$modename: you must specify a target with \`-o'" 1>&2
683
# Get the name of the library object.
684
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
688
# Recognize several different file suffixes.
689
# If the user specifies -o file.o, it is replaced with file.lo
699
*.class) xform=class ;;
704
*.java) xform=java ;;
707
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
710
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
712
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
717
func_infer_tag $base_compile
719
for arg in $later; do
738
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
740
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
741
qlibobj="\"$qlibobj\"" ;;
743
if test "X$libobj" != "X$qlibobj"; then
744
$echo "$modename: libobj name \`$libobj' may not contain shell special characters."
747
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
748
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
749
if test "X$xdir" = "X$obj"; then
754
lobj=${xdir}$objdir/$objname
756
if test -z "$base_compile"; then
757
$echo "$modename: you must specify a compilation command" 1>&2
762
# Delete any leftover library objects.
763
if test "$build_old_libs" = yes; then
764
removelist="$obj $lobj $libobj ${libobj}T"
766
removelist="$lobj $libobj ${libobj}T"
770
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
772
# On Cygwin there's no "real" PIC flag so we must build both object types
774
cygwin* | mingw* | pw32* | os2*)
778
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
779
# non-PIC code in shared libraries is not supported
783
# Calculate the filename of the output object if compiler does
784
# not support -o with -c
785
if test "$compiler_c_o" = no; then
786
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
787
lockfile="$output_obj.lock"
788
removelist="$removelist $output_obj $lockfile"
789
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
796
# Lock this critical section if it is needed
797
# We use this script file to make the link, it avoids creating a new file
798
if test "$need_locks" = yes; then
799
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
800
$show "Waiting for $lockfile to be removed"
803
elif test "$need_locks" = warn; then
804
if test -f "$lockfile"; then
806
*** ERROR, $lockfile exists and contains:
807
`cat $lockfile 2>/dev/null`
809
This indicates that another process is trying to use the same
810
temporary object file, and libtool could not work around it because
811
your compiler does not support \`-c' and \`-o' together. If you
812
repeat this compilation, it may succeed, by chance, but you had better
813
avoid parallel builds (make -j) in this platform, or get a better
819
$echo "$srcfile" > "$lockfile"
822
if test -n "$fix_srcfile_path"; then
823
eval srcfile=\"$fix_srcfile_path\"
825
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
827
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
828
qsrcfile="\"$qsrcfile\"" ;;
831
$run $rm "$libobj" "${libobj}T"
833
# Create a libtool object file (analogous to a ".la" file),
834
# but don't create it if we're doing a dry run.
835
test -z "$run" && cat > ${libobj}T <<EOF
836
# $libobj - a libtool object file
837
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
839
# Please DO NOT delete this file!
840
# It is necessary for linking the library.
842
# Name of the PIC object.
845
# Only build a PIC object if we are building libtool libraries.
846
if test "$build_libtool_libs" = yes; then
847
# Without this assignment, base_compile gets emptied.
848
fbsd_hideous_sh_bug=$base_compile
850
if test "$pic_mode" != no; then
851
command="$base_compile $qsrcfile $pic_flag"
853
# Don't build PIC code
854
command="$base_compile $qsrcfile"
857
if test ! -d "${xdir}$objdir"; then
858
$show "$mkdir ${xdir}$objdir"
859
$run $mkdir ${xdir}$objdir
861
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
866
if test -z "$output_obj"; then
867
# Place PIC objects in $objdir
868
command="$command -o $lobj"
871
$run $rm "$lobj" "$output_obj"
874
if $run eval "$command"; then :
876
test -n "$output_obj" && $run $rm $removelist
880
if test "$need_locks" = warn &&
881
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
883
*** ERROR, $lockfile contains:
884
`cat $lockfile 2>/dev/null`
886
but it should contain:
889
This indicates that another process is trying to use the same
890
temporary object file, and libtool could not work around it because
891
your compiler does not support \`-c' and \`-o' together. If you
892
repeat this compilation, it may succeed, by chance, but you had better
893
avoid parallel builds (make -j) in this platform, or get a better
900
# Just move the object if needed, then go on to compile the next one
901
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
902
$show "$mv $output_obj $lobj"
903
if $run $mv $output_obj $lobj; then :
911
# Append the name of the PIC object to the libtool object file.
912
test -z "$run" && cat >> ${libobj}T <<EOF
913
pic_object='$objdir/$objname'
917
# Allow error messages only from the first compilation.
918
if test "$suppress_opt" = yes; then
919
suppress_output=' >/dev/null 2>&1'
922
# No PIC object so indicate it doesn't exist in the libtool
924
test -z "$run" && cat >> ${libobj}T <<EOF
930
# Only build a position-dependent object if we build old libraries.
931
if test "$build_old_libs" = yes; then
932
if test "$pic_mode" != yes; then
933
# Don't build PIC code
934
command="$base_compile $qsrcfile"
936
command="$base_compile $qsrcfile $pic_flag"
938
if test "$compiler_c_o" = yes; then
939
command="$command -o $obj"
942
# Suppress compiler output if we already did a PIC compilation.
943
command="$command$suppress_output"
944
$run $rm "$obj" "$output_obj"
946
if $run eval "$command"; then :
952
if test "$need_locks" = warn &&
953
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
955
*** ERROR, $lockfile contains:
956
`cat $lockfile 2>/dev/null`
958
but it should contain:
961
This indicates that another process is trying to use the same
962
temporary object file, and libtool could not work around it because
963
your compiler does not support \`-c' and \`-o' together. If you
964
repeat this compilation, it may succeed, by chance, but you had better
965
avoid parallel builds (make -j) in this platform, or get a better
972
# Just move the object if needed
973
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
974
$show "$mv $output_obj $obj"
975
if $run $mv $output_obj $obj; then :
983
# Append the name of the non-PIC object the libtool object file.
984
# Only append if the libtool object file exists.
985
test -z "$run" && cat >> ${libobj}T <<EOF
986
# Name of the non-PIC object.
987
non_pic_object='$objname'
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.
1000
$run $mv "${libobj}T" "${libobj}"
1002
# Unlock the critical section if it was locked
1003
if test "$need_locks" != no; then
1004
$run $rm "$lockfile"
1012
modename="$modename: link"
1014
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1015
# It is impossible to link a dll without this setting, and
1016
# we shouldn't force the makefile maintainer to figure out
1017
# which system we are compiling for in order to pass an extra
1018
# flag for every libtool invocation.
1019
# allow_undefined=no
1021
# FIXME: Unfortunately, there are problems with the above when trying
1022
# to make a dll which has undefined symbols, in which case not
1023
# even a static library is built. For now, we need to specify
1024
# -no-undefined on the libtool link line when we can be certain
1025
# that all symbols are satisfied, otherwise we get a static library.
1032
libtool_args="$nonopt"
1033
base_compile="$nonopt $@"
1034
compile_command="$nonopt"
1035
finalize_command="$nonopt"
1048
lib_search_path=`pwd`
1057
export_symbols_regex=
1065
precious_files_regex=
1066
prefer_static_libs=no
1079
func_infer_tag $base_compile
1081
# We need to know -static, to get the right output filenames.
1085
-all-static | -static)
1086
if test "X$arg" = "X-all-static"; then
1087
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1088
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1090
if test -n "$link_static_flag"; then
1091
dlopen_self=$dlopen_self_static
1094
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1095
dlopen_self=$dlopen_self_static
1098
build_libtool_libs=no
1100
prefer_static_libs=yes
1106
# See if our shared archives depend on static archives.
1107
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1109
# Go through the arguments, transforming them on the way.
1110
while test "$#" -gt 0; do
1114
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1115
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1119
libtool_args="$libtool_args $qarg"
1121
# If the previous option needs an argument, assign it.
1122
if test -n "$prev"; then
1125
compile_command="$compile_command @OUTPUT@"
1126
finalize_command="$finalize_command @OUTPUT@"
1132
if test "$preload" = no; then
1133
# Add the symbol object into the linking commands.
1134
compile_command="$compile_command @SYMFILE@"
1135
finalize_command="$finalize_command @SYMFILE@"
1139
*.la | *.lo) ;; # We handle these cases below.
1141
if test "$dlself" = no; then
1149
if test "$prev" = dlprefiles; then
1151
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1161
if test "$prev" = dlfiles; then
1162
dlfiles="$dlfiles $arg"
1164
dlprefiles="$dlprefiles $arg"
1172
export_symbols="$arg"
1173
if test ! -f "$arg"; then
1174
$echo "$modename: symbol file \`$arg' does not exist"
1181
export_symbols_regex="$arg"
1186
inst_prefix_dir="$arg"
1191
precious_files_regex="$arg"
1201
if test -f "$arg"; then
1204
for fil in `cat $save_arg`
1206
# moreargs="$moreargs $fil"
1208
# A libtool-controlled object.
1210
# Check to see that this really is a libtool object.
1211
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1216
# If there is no directory component, then add one.
1218
*/* | *\\*) . $arg ;;
1222
if test -z "$pic_object" || \
1223
test -z "$non_pic_object" ||
1224
test "$pic_object" = none && \
1225
test "$non_pic_object" = none; then
1226
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1230
# Extract subdirectory from the argument.
1231
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1232
if test "X$xdir" = "X$arg"; then
1238
if test "$pic_object" != none; then
1239
# Prepend the subdirectory the object is found in.
1240
pic_object="$xdir$pic_object"
1242
if test "$prev" = dlfiles; then
1243
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1244
dlfiles="$dlfiles $pic_object"
1248
# If libtool objects are unsupported, then we need to preload.
1253
# CHECK ME: I think I busted this. -Ossama
1254
if test "$prev" = dlprefiles; then
1255
# Preload the old-style object.
1256
dlprefiles="$dlprefiles $pic_object"
1261
libobjs="$libobjs $pic_object"
1266
if test "$non_pic_object" != none; then
1267
# Prepend the subdirectory the object is found in.
1268
non_pic_object="$xdir$non_pic_object"
1270
# A standard non-PIC object
1271
non_pic_objects="$non_pic_objects $non_pic_object"
1272
if test -z "$pic_object" || test "$pic_object" = none ; then
1273
arg="$non_pic_object"
1277
# Only an error if not doing a dry-run.
1278
if test -z "$run"; then
1279
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1284
# Extract subdirectory from the argument.
1285
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1286
if test "X$xdir" = "X$arg"; then
1292
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1293
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1294
libobjs="$libobjs $pic_object"
1295
non_pic_objects="$non_pic_objects $non_pic_object"
1300
$echo "$modename: link input file \`$save_arg' does not exist"
1308
# We need an absolute path.
1310
[\\/]* | [A-Za-z]:[\\/]*) ;;
1312
$echo "$modename: only absolute run-paths are allowed" 1>&2
1316
if test "$prev" = rpath; then
1319
*) rpath="$rpath $arg" ;;
1324
*) xrpath="$xrpath $arg" ;;
1331
compiler_flags="$compiler_flags $qarg"
1333
compile_command="$compile_command $qarg"
1334
finalize_command="$finalize_command $qarg"
1338
linker_flags="$linker_flags $qarg"
1339
compiler_flags="$compiler_flags $wl$qarg"
1341
compile_command="$compile_command $wl$qarg"
1342
finalize_command="$finalize_command $wl$qarg"
1346
linker_flags="$linker_flags $qarg"
1347
compiler_flags="$compiler_flags $qarg"
1349
compile_command="$compile_command $qarg"
1350
finalize_command="$finalize_command $qarg"
1359
compiler_flags="$compiler_flags $arg"
1360
compile_command="$compile_command $arg"
1361
finalize_command="$finalize_command $arg"
1366
eval "$prev=\"\$arg\""
1371
fi # test -n "$prev"
1377
if test -n "$link_static_flag"; then
1378
compile_command="$compile_command $link_static_flag"
1379
finalize_command="$finalize_command $link_static_flag"
1385
# FIXME: remove this flag sometime in the future.
1386
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1410
-export-symbols | -export-symbols-regex)
1411
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1412
$echo "$modename: more than one -exported-symbols argument is not allowed"
1415
if test "X$arg" = "X-export-symbols"; then
1424
prev=darwin_framework
1425
compiler_flags="$compiler_flags $arg"
1426
compile_command="$compile_command $arg"
1427
finalize_command="$finalize_command $arg"
1436
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1437
# so, if we see these flags be careful not to treat them like -L
1439
case $with_gcc/$host in
1440
no/*-*-irix* | /*-*-irix*)
1441
compile_command="$compile_command $arg"
1442
finalize_command="$finalize_command $arg"
1449
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1450
# We need an absolute path.
1452
[\\/]* | [A-Za-z]:[\\/]*) ;;
1454
absdir=`cd "$dir" && pwd`
1455
if test -z "$absdir"; then
1456
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1465
deplibs="$deplibs -L$dir"
1466
lib_search_path="$lib_search_path $dir"
1470
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1471
case :$dllsearchpath: in
1473
*) dllsearchpath="$dllsearchpath:$dir";;
1481
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1483
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1484
# These systems don't actually have a C or math library (as such)
1487
*-*-mingw* | *-*-os2*)
1488
# These systems don't actually have a C library (as such)
1489
test "X$arg" = "X-lc" && continue
1491
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1492
# Do not include libc due to us having libc/libc_r.
1493
test "X$arg" = "X-lc" && continue
1495
*-*-rhapsody* | *-*-darwin1.[012])
1496
# Rhapsody C and math libraries are in the System framework
1497
deplibs="$deplibs -framework System"
1500
elif test "X$arg" = "X-lc_r"; then
1502
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1503
# Do not include libc_r directly, use -pthread flag.
1508
deplibs="$deplibs $arg"
1512
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1513
# classes, name mangling, and exception handling.
1515
compile_command="$compile_command $arg"
1516
compiler_flags="$compiler_flags $arg"
1517
finalize_command="$finalize_command $arg"
1522
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1523
compiler_flags="$compiler_flags $arg"
1524
compile_command="$compile_command $arg"
1525
finalize_command="$finalize_command $arg"
1534
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1535
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1536
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1537
# +DA*, +DD* enable 64-bit mode on the HP compiler
1538
# -q* pass through compiler args for the IBM compiler
1539
# -m* pass through architecture-specific compiler args for GCC
1540
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1542
# Unknown arguments in both finalize_command and compile_command need
1543
# to be aesthetically quoted because they are evaled later.
1544
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1546
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1550
compile_command="$compile_command $arg"
1551
finalize_command="$finalize_command $arg"
1552
if test "$with_gcc" = "yes" ; then
1553
compiler_flags="$compiler_flags $arg"
1570
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1571
# The PATH hackery in wrapper scripts is required on Windows
1572
# in order for the loader to find any dlls it needs.
1573
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1574
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1577
*) no_install=yes ;;
1594
-precious-files-regex)
1615
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1616
# We need an absolute path.
1618
[\\/]* | [A-Za-z]:[\\/]*) ;;
1620
$echo "$modename: only absolute run-paths are allowed" 1>&2
1626
*) xrpath="$xrpath $dir" ;;
1632
# The effects of -static are defined in a previous loop.
1633
# We used to do the same as -all-static on platforms that
1634
# didn't have a PIC flag, but the assumption that the effects
1635
# would be equivalent was wrong. It would break on at least
1636
# Digital Unix and AIX.
1656
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1658
save_ifs="$IFS"; IFS=','
1659
for flag in $args; do
1662
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1667
compiler_flags="$compiler_flags $flag"
1670
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1674
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1676
save_ifs="$IFS"; IFS=','
1677
for flag in $args; do
1680
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1685
compiler_flags="$compiler_flags $wl$flag"
1686
linker_flags="$linker_flags $flag"
1689
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1707
# Some other compiler flag.
1709
# Unknown arguments in both finalize_command and compile_command need
1710
# to be aesthetically quoted because they are evaled later.
1711
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1713
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1720
# A standard object.
1725
# A libtool-controlled object.
1727
# Check to see that this really is a libtool object.
1728
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1733
# If there is no directory component, then add one.
1735
*/* | *\\*) . $arg ;;
1739
if test -z "$pic_object" || \
1740
test -z "$non_pic_object" ||
1741
test "$pic_object" = none && \
1742
test "$non_pic_object" = none; then
1743
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1747
# Extract subdirectory from the argument.
1748
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1749
if test "X$xdir" = "X$arg"; then
1755
if test "$pic_object" != none; then
1756
# Prepend the subdirectory the object is found in.
1757
pic_object="$xdir$pic_object"
1759
if test "$prev" = dlfiles; then
1760
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1761
dlfiles="$dlfiles $pic_object"
1765
# If libtool objects are unsupported, then we need to preload.
1770
# CHECK ME: I think I busted this. -Ossama
1771
if test "$prev" = dlprefiles; then
1772
# Preload the old-style object.
1773
dlprefiles="$dlprefiles $pic_object"
1778
libobjs="$libobjs $pic_object"
1783
if test "$non_pic_object" != none; then
1784
# Prepend the subdirectory the object is found in.
1785
non_pic_object="$xdir$non_pic_object"
1787
# A standard non-PIC object
1788
non_pic_objects="$non_pic_objects $non_pic_object"
1789
if test -z "$pic_object" || test "$pic_object" = none ; then
1790
arg="$non_pic_object"
1794
# Only an error if not doing a dry-run.
1795
if test -z "$run"; then
1796
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1801
# Extract subdirectory from the argument.
1802
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1803
if test "X$xdir" = "X$arg"; then
1809
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1810
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1811
libobjs="$libobjs $pic_object"
1812
non_pic_objects="$non_pic_objects $non_pic_object"
1819
deplibs="$deplibs $arg"
1820
old_deplibs="$old_deplibs $arg"
1825
# A libtool-controlled library.
1827
if test "$prev" = dlfiles; then
1828
# This library was specified with -dlopen.
1829
dlfiles="$dlfiles $arg"
1831
elif test "$prev" = dlprefiles; then
1832
# The library was specified with -dlpreopen.
1833
dlprefiles="$dlprefiles $arg"
1836
deplibs="$deplibs $arg"
1841
# Some other compiler argument.
1843
# Unknown arguments in both finalize_command and compile_command need
1844
# to be aesthetically quoted because they are evaled later.
1845
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1847
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1854
# Now actually substitute the argument into the commands.
1855
if test -n "$arg"; then
1856
compile_command="$compile_command $arg"
1857
finalize_command="$finalize_command $arg"
1859
done # argument parsing loop
1861
if test -n "$prev"; then
1862
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1867
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1868
eval arg=\"$export_dynamic_flag_spec\"
1869
compile_command="$compile_command $arg"
1870
finalize_command="$finalize_command $arg"
1874
# calculate the name of the file, without its directory
1875
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1876
libobjs_save="$libobjs"
1878
if test -n "$shlibpath_var"; then
1879
# get the directories listed in $shlibpath_var
1880
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1884
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1885
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1887
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1888
if test "X$output_objdir" = "X$output"; then
1889
output_objdir="$objdir"
1891
output_objdir="$output_objdir/$objdir"
1893
# Create the object directory.
1894
if test ! -d "$output_objdir"; then
1895
$show "$mkdir $output_objdir"
1896
$run $mkdir $output_objdir
1898
if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1903
# Determine the type of output
1906
$echo "$modename: you must specify an output file" 1>&2
1910
*.$libext) linkmode=oldlib ;;
1911
*.lo | *.$objext) linkmode=obj ;;
1912
*.la) linkmode=lib ;;
1913
*) linkmode=prog ;; # Anything else should be a program.
1917
*cygwin* | *mingw* | *pw32*)
1918
# don't eliminate duplications in $postdeps and $predeps
1919
duplicate_compiler_generated_deps=yes
1922
duplicate_compiler_generated_deps=$duplicate_deps
1928
# Find all interdependent deplibs by searching for libraries
1929
# that are linked more than once (e.g. -la -lb -la)
1930
for deplib in $deplibs; do
1931
if test "X$duplicate_deps" = "Xyes" ; then
1933
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1936
libs="$libs $deplib"
1939
if test "$linkmode" = lib; then
1940
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1942
# Compute libraries that are listed more than once in $predeps
1943
# $postdeps and mark them as special (i.e., whose duplicates are
1944
# not to be eliminated).
1946
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1947
for pre_post_dep in $predeps $postdeps; do
1948
case "$pre_post_deps " in
1949
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1951
pre_post_deps="$pre_post_deps $pre_post_dep"
1960
need_relink=no # whether we're linking any uninstalled libtool libraries
1961
notinst_deplibs= # not-installed libtool libraries
1962
notinst_path= # paths that contain not-installed libtool libraries
1966
for file in $dlfiles $dlprefiles; do
1970
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1982
passes="conv scan dlopen dlpreopen link"
1987
for pass in $passes; do
1988
if test "$linkmode,$pass" = "lib,link" ||
1989
test "$linkmode,$pass" = "prog,scan"; then
1993
if test "$linkmode" = prog; then
1995
dlopen) libs="$dlfiles" ;;
1996
dlpreopen) libs="$dlprefiles" ;;
1997
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2000
if test "$pass" = dlopen; then
2001
# Collect dlpreopened libraries
2002
save_deplibs="$deplibs"
2005
for deplib in $libs; do
2009
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2010
if test "$linkmode,$pass" = "prog,link"; then
2011
compile_deplibs="$deplib $compile_deplibs"
2012
finalize_deplibs="$deplib $finalize_deplibs"
2014
compiler_flags="$compiler_flags $deplib"
2019
if test "$linkmode" != lib && test "$linkmode" != prog; then
2020
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2023
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2024
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2025
for search_ext in .la $std_shrext .so .a; do
2026
# Search the libtool library
2027
lib="$searchdir/lib${name}${search_ext}"
2028
if test -f "$lib"; then
2029
if test "$search_ext" = ".la"; then
2038
if test "$found" != yes; then
2039
# deplib doesn't seem to be a libtool library
2040
if test "$linkmode,$pass" = "prog,link"; then
2041
compile_deplibs="$deplib $compile_deplibs"
2042
finalize_deplibs="$deplib $finalize_deplibs"
2044
deplibs="$deplib $deplibs"
2045
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2048
else # deplib is a libtool library
2049
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2050
# We need to do some special things here, and not later.
2051
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2052
case " $predeps $postdeps " in
2054
if (${SED} -e '2q' $lib |
2055
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2059
*/* | *\\*) . $lib ;;
2062
for l in $old_library $library_names; do
2065
if test "X$ll" = "X$old_library" ; then # only static version available
2067
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2068
test "X$ladir" = "X$lib" && ladir="."
2069
lib=$ladir/$old_library
2070
if test "$linkmode,$pass" = "prog,link"; then
2071
compile_deplibs="$deplib $compile_deplibs"
2072
finalize_deplibs="$deplib $finalize_deplibs"
2074
deplibs="$deplib $deplibs"
2075
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2089
deplibs="$deplib $deplibs"
2090
test "$pass" = conv && continue
2091
newdependency_libs="$deplib $newdependency_libs"
2092
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2095
if test "$pass" = conv; then
2096
deplibs="$deplib $deplibs"
2099
if test "$pass" = scan; then
2100
deplibs="$deplib $deplibs"
2102
compile_deplibs="$deplib $compile_deplibs"
2103
finalize_deplibs="$deplib $finalize_deplibs"
2105
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2108
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2114
if test "$pass" = link; then
2115
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2116
# Make sure the xrpath contains only unique directories.
2119
*) xrpath="$xrpath $dir" ;;
2122
deplibs="$deplib $deplibs"
2125
*.la) lib="$deplib" ;;
2127
if test "$pass" = conv; then
2128
deplibs="$deplib $deplibs"
2134
case $deplibs_check_method in
2136
set dummy $deplibs_check_method
2137
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2138
if eval $echo \"$deplib\" 2>/dev/null \
2140
| $EGREP "$match_pattern_regex" > /dev/null; then
2148
if test "$valid_a_lib" != yes; then
2150
$echo "*** Warning: Trying to link with static lib archive $deplib."
2151
$echo "*** I have the capability to make that library automatically link in when"
2152
$echo "*** you link to this library. But I can only do this if you have a"
2153
$echo "*** shared version of the library, which you do not appear to have"
2154
$echo "*** because the file extensions .$libext of this argument makes me believe"
2155
$echo "*** that it is just a static archive that I should not used here."
2158
$echo "*** Warning: Linking the shared library $output against the"
2159
$echo "*** static library $deplib is not portable!"
2160
deplibs="$deplib $deplibs"
2165
if test "$pass" != link; then
2166
deplibs="$deplib $deplibs"
2168
compile_deplibs="$deplib $compile_deplibs"
2169
finalize_deplibs="$deplib $finalize_deplibs"
2176
if test "$pass" = conv; then
2177
deplibs="$deplib $deplibs"
2178
elif test "$linkmode" = prog; then
2179
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2180
# If there is no dlopen support or we're linking statically,
2181
# we need to preload.
2182
newdlprefiles="$newdlprefiles $deplib"
2183
compile_deplibs="$deplib $compile_deplibs"
2184
finalize_deplibs="$deplib $finalize_deplibs"
2186
newdlfiles="$newdlfiles $deplib"
2196
if test "$found" = yes || test -f "$lib"; then :
2198
$echo "$modename: cannot find the library \`$lib'" 1>&2
2202
# Check to see that this really is a libtool archive.
2203
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2205
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2209
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2210
test "X$ladir" = "X$lib" && ladir="."
2218
# If the library was installed with an old release of libtool,
2219
# it will not redefine variables installed, or shouldnotlink
2227
*/* | *\\*) . $lib ;;
2231
if test "$linkmode,$pass" = "lib,link" ||
2232
test "$linkmode,$pass" = "prog,scan" ||
2233
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2234
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2235
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2238
if test "$pass" = conv; then
2239
# Only check for convenience libraries
2240
deplibs="$lib $deplibs"
2241
if test -z "$libdir"; then
2242
if test -z "$old_library"; then
2243
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2246
# It is a libtool convenience library, so add in its objects.
2247
convenience="$convenience $ladir/$objdir/$old_library"
2248
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2250
for deplib in $dependency_libs; do
2251
deplibs="$deplib $deplibs"
2252
if test "X$duplicate_deps" = "Xyes" ; then
2253
case "$tmp_libs " in
2254
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2257
tmp_libs="$tmp_libs $deplib"
2259
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2260
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2267
# Get the name of the library we link against.
2269
for l in $old_library $library_names; do
2272
if test -z "$linklib"; then
2273
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2277
# This library was specified with -dlopen.
2278
if test "$pass" = dlopen; then
2279
if test -z "$libdir"; then
2280
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2283
if test -z "$dlname" ||
2284
test "$dlopen_support" != yes ||
2285
test "$build_libtool_libs" = no; then
2286
# If there is no dlname, no dlopen support or we're linking
2287
# statically, we need to preload. We also need to preload any
2288
# dependent libraries so libltdl's deplib preloader doesn't
2289
# bomb out in the load deplibs phase.
2290
dlprefiles="$dlprefiles $lib $dependency_libs"
2292
newdlfiles="$newdlfiles $lib"
2297
# We need an absolute path.
2299
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2301
abs_ladir=`cd "$ladir" && pwd`
2302
if test -z "$abs_ladir"; then
2303
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2304
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2309
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2311
# Find the relevant object directory and library name.
2312
if test "X$installed" = Xyes; then
2313
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2314
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2322
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2324
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2327
# Remove this search path later
2328
notinst_path="$notinst_path $abs_ladir"
2330
dir="$ladir/$objdir"
2331
absdir="$abs_ladir/$objdir"
2332
# Remove this search path later
2333
notinst_path="$notinst_path $abs_ladir"
2335
fi # $installed = yes
2336
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2338
# This library was specified with -dlpreopen.
2339
if test "$pass" = dlpreopen; then
2340
if test -z "$libdir"; then
2341
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2344
# Prefer using a static library (so that no silly _DYNAMIC symbols
2345
# are required to link).
2346
if test -n "$old_library"; then
2347
newdlprefiles="$newdlprefiles $dir/$old_library"
2348
# Otherwise, use the dlname, so that lt_dlopen finds it.
2349
elif test -n "$dlname"; then
2350
newdlprefiles="$newdlprefiles $dir/$dlname"
2352
newdlprefiles="$newdlprefiles $dir/$linklib"
2354
fi # $pass = dlpreopen
2356
if test -z "$libdir"; then
2357
# Link the convenience library
2358
if test "$linkmode" = lib; then
2359
deplibs="$dir/$old_library $deplibs"
2360
elif test "$linkmode,$pass" = "prog,link"; then
2361
compile_deplibs="$dir/$old_library $compile_deplibs"
2362
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2364
deplibs="$lib $deplibs" # used for prog,scan pass
2370
if test "$linkmode" = prog && test "$pass" != link; then
2371
newlib_search_path="$newlib_search_path $ladir"
2372
deplibs="$lib $deplibs"
2375
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2376
test "$build_libtool_libs" = no; then
2381
for deplib in $dependency_libs; do
2383
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2385
# Need to link against all dependency_libs?
2386
if test "$linkalldeplibs" = yes; then
2387
deplibs="$deplib $deplibs"
2389
# Need to hardcode shared library paths
2390
# or/and link against static libraries
2391
newdependency_libs="$deplib $newdependency_libs"
2393
if test "X$duplicate_deps" = "Xyes" ; then
2394
case "$tmp_libs " in
2395
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2398
tmp_libs="$tmp_libs $deplib"
2401
fi # $linkmode = prog...
2403
if test "$linkmode,$pass" = "prog,link"; then
2404
if test -n "$library_names" &&
2405
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2406
# We need to hardcode the library path
2407
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2408
# Make sure the rpath contains only unique directories.
2409
case "$temp_rpath " in
2412
*) temp_rpath="$temp_rpath $dir" ;;
2416
# Hardcode the library path.
2417
# Skip directories that are in the system default run-time
2419
case " $sys_lib_dlsearch_path " in
2422
case "$compile_rpath " in
2424
*) compile_rpath="$compile_rpath $absdir"
2428
case " $sys_lib_dlsearch_path " in
2431
case "$finalize_rpath " in
2433
*) finalize_rpath="$finalize_rpath $libdir"
2437
fi # $linkmode,$pass = prog,link...
2439
if test "$alldeplibs" = yes &&
2440
{ test "$deplibs_check_method" = pass_all ||
2441
{ test "$build_libtool_libs" = yes &&
2442
test -n "$library_names"; }; }; then
2443
# We only need to search for static libraries
2448
link_static=no # Whether the deplib will be linked statically
2449
if test -n "$library_names" &&
2450
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2451
if test "$installed" = no; then
2452
notinst_deplibs="$notinst_deplibs $lib"
2455
# This is a shared library
2457
# Warn about portability, can't link against -module's on
2458
# some systems (darwin)
2459
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2461
if test "$linkmode" = prog; then
2462
$echo "*** Warning: Linking the executable $output against the loadable module"
2464
$echo "*** Warning: Linking the shared library $output against the loadable module"
2466
$echo "*** $linklib is not portable!"
2468
if test "$linkmode" = lib &&
2469
test "$hardcode_into_libs" = yes; then
2470
# Hardcode the library path.
2471
# Skip directories that are in the system default run-time
2473
case " $sys_lib_dlsearch_path " in
2476
case "$compile_rpath " in
2478
*) compile_rpath="$compile_rpath $absdir"
2482
case " $sys_lib_dlsearch_path " in
2485
case "$finalize_rpath " in
2487
*) finalize_rpath="$finalize_rpath $libdir"
2493
if test -n "$old_archive_from_expsyms_cmds"; then
2494
# figure out the soname
2495
set dummy $library_names
2498
libname=`eval \\$echo \"$libname_spec\"`
2499
# use dlname if we got it. it's perfectly good, no?
2500
if test -n "$dlname"; then
2502
elif test -n "$soname_spec"; then
2506
major=`expr $current - $age`
2510
eval soname=\"$soname_spec\"
2515
# Make a new name for the extract_expsyms_cmds to use
2517
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2518
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2520
# If the library has no export list, then create one now
2521
if test -f "$output_objdir/$soname-def"; then :
2523
$show "extracting exported symbol list from \`$soname'"
2524
save_ifs="$IFS"; IFS='~'
2525
cmds=$extract_expsyms_cmds
2526
for cmd in $cmds; do
2530
$run eval "$cmd" || exit $?
2536
if test -f "$output_objdir/$newlib"; then :; else
2537
$show "generating import library for \`$soname'"
2538
save_ifs="$IFS"; IFS='~'
2539
cmds=$old_archive_from_expsyms_cmds
2540
for cmd in $cmds; do
2544
$run eval "$cmd" || exit $?
2548
# make sure the library variables are pointing to the new library
2551
fi # test -n "$old_archive_from_expsyms_cmds"
2553
if test "$linkmode" = prog || test "$mode" != relink; then
2558
case $hardcode_action in
2559
immediate | unsupported)
2560
if test "$hardcode_direct" = no; then
2563
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2565
# if the lib is a module then we can not link against
2566
# it, someone is ignoring the new warnings I added
2567
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2568
$echo "** Warning, lib $linklib is a module, not a shared library"
2569
if test -z "$old_library" ; then
2571
$echo "** And there doesn't seem to be a static archive available"
2572
$echo "** The link will probably fail, sorry"
2574
add="$dir/$old_library"
2578
elif test "$hardcode_minus_L" = no; then
2580
*-*-sunos*) add_shlibpath="$dir" ;;
2584
elif test "$hardcode_shlibpath_var" = no; then
2585
add_shlibpath="$dir"
2592
if test "$hardcode_direct" = yes; then
2594
elif test "$hardcode_minus_L" = yes; then
2596
# Try looking first in the location we're being installed to.
2597
if test -n "$inst_prefix_dir"; then
2600
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2605
elif test "$hardcode_shlibpath_var" = yes; then
2606
add_shlibpath="$dir"
2615
if test "$lib_linked" != yes; then
2616
$echo "$modename: configuration error: unsupported hardcode properties"
2620
if test -n "$add_shlibpath"; then
2621
case :$compile_shlibpath: in
2622
*":$add_shlibpath:"*) ;;
2623
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2626
if test "$linkmode" = prog; then
2627
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2628
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2630
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2631
test -n "$add" && deplibs="$add $deplibs"
2632
if test "$hardcode_direct" != yes && \
2633
test "$hardcode_minus_L" != yes && \
2634
test "$hardcode_shlibpath_var" = yes; then
2635
case :$finalize_shlibpath: in
2637
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2643
if test "$linkmode" = prog || test "$mode" = relink; then
2647
# Finalize command for both is simple: just hardcode it.
2648
if test "$hardcode_direct" = yes; then
2649
add="$libdir/$linklib"
2650
elif test "$hardcode_minus_L" = yes; then
2653
elif test "$hardcode_shlibpath_var" = yes; then
2654
case :$finalize_shlibpath: in
2656
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2659
elif test "$hardcode_automatic" = yes; then
2660
if test -n "$inst_prefix_dir" &&
2661
test -f "$inst_prefix_dir$libdir/$linklib" ; then
2662
add="$inst_prefix_dir$libdir/$linklib"
2664
add="$libdir/$linklib"
2667
# We cannot seem to hardcode it, guess we'll fake it.
2669
# Try looking first in the location we're being installed to.
2670
if test -n "$inst_prefix_dir"; then
2673
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2680
if test "$linkmode" = prog; then
2681
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2682
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2684
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2685
test -n "$add" && deplibs="$add $deplibs"
2688
elif test "$linkmode" = prog; then
2689
# Here we assume that one of hardcode_direct or hardcode_minus_L
2690
# is not unsupported. This is valid on all known static and
2692
if test "$hardcode_direct" != unsupported; then
2693
test -n "$old_library" && linklib="$old_library"
2694
compile_deplibs="$dir/$linklib $compile_deplibs"
2695
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2697
compile_deplibs="-l$name -L$dir $compile_deplibs"
2698
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2700
elif test "$build_libtool_libs" = yes; then
2701
# Not a shared library
2702
if test "$deplibs_check_method" != pass_all; then
2703
# We're trying link a shared library against a static one
2704
# but the system doesn't support it.
2706
# Just print a warning and add the library to dependency_libs so
2707
# that the program can be linked against the static library.
2709
$echo "*** Warning: This system can not link to static lib archive $lib."
2710
$echo "*** I have the capability to make that library automatically link in when"
2711
$echo "*** you link to this library. But I can only do this if you have a"
2712
$echo "*** shared version of the library, which you do not appear to have."
2713
if test "$module" = yes; then
2714
$echo "*** But as you try to build a module library, libtool will still create "
2715
$echo "*** a static module, that should work as long as the dlopening application"
2716
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2717
if test -z "$global_symbol_pipe"; then
2719
$echo "*** However, this would only work if libtool was able to extract symbol"
2720
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2721
$echo "*** not find such a program. So, this module is probably useless."
2722
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2724
if test "$build_old_libs" = no; then
2725
build_libtool_libs=module
2728
build_libtool_libs=no
2732
convenience="$convenience $dir/$old_library"
2733
old_convenience="$old_convenience $dir/$old_library"
2734
deplibs="$dir/$old_library $deplibs"
2737
fi # link shared/static library?
2739
if test "$linkmode" = lib; then
2740
if test -n "$dependency_libs" &&
2741
{ test "$hardcode_into_libs" != yes ||
2742
test "$build_old_libs" = yes ||
2743
test "$link_static" = yes; }; then
2744
# Extract -R from dependency_libs
2746
for libdir in $dependency_libs; do
2748
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2750
*" $temp_xrpath "*) ;;
2751
*) xrpath="$xrpath $temp_xrpath";;
2753
*) temp_deplibs="$temp_deplibs $libdir";;
2756
dependency_libs="$temp_deplibs"
2759
newlib_search_path="$newlib_search_path $absdir"
2760
# Link against this library
2761
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2762
# ... and its dependency_libs
2764
for deplib in $dependency_libs; do
2765
newdependency_libs="$deplib $newdependency_libs"
2766
if test "X$duplicate_deps" = "Xyes" ; then
2767
case "$tmp_libs " in
2768
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2771
tmp_libs="$tmp_libs $deplib"
2774
if test "$link_all_deplibs" != no; then
2775
# Add the search paths of all dependency libraries
2776
for deplib in $dependency_libs; do
2778
-L*) path="$deplib" ;;
2780
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2781
test "X$dir" = "X$deplib" && dir="."
2782
# We need an absolute path.
2784
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2786
absdir=`cd "$dir" && pwd`
2787
if test -z "$absdir"; then
2788
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2793
if grep "^installed=no" $deplib > /dev/null; then
2794
path="$absdir/$objdir"
2796
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2797
if test -z "$libdir"; then
2798
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2801
if test "$absdir" != "$libdir"; then
2802
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2809
# we do not want to link against static libs,
2810
# but need to link against shared
2811
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2812
if test -n "$deplibrary_names" ; then
2813
for tmp in $deplibrary_names ; do
2816
if test -f "$path/$depdepl" ; then
2817
depdepl="$path/$depdepl"
2819
# do not add paths which are already there
2820
case " $newlib_search_path " in
2822
*) newlib_search_path="$newlib_search_path $path";;
2835
# Again, we only want to link against shared libraries
2836
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2837
for tmp in $newlib_search_path ; do
2838
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2839
eval depdepl="$tmp/lib$tmp_libs.dylib"
2850
case " $deplibs " in
2852
*) deplibs="$path $deplibs" ;;
2854
case " $deplibs " in
2856
*) deplibs="$depdepl $deplibs" ;;
2859
fi # link_all_deplibs != no
2861
done # for deplib in $libs
2862
dependency_libs="$newdependency_libs"
2863
if test "$pass" = dlpreopen; then
2864
# Link the dlpreopened libraries before other libraries
2865
for deplib in $save_deplibs; do
2866
deplibs="$deplib $deplibs"
2869
if test "$pass" != dlopen; then
2870
if test "$pass" != conv; then
2871
# Make sure lib_search_path contains only unique directories.
2873
for dir in $newlib_search_path; do
2874
case "$lib_search_path " in
2876
*) lib_search_path="$lib_search_path $dir" ;;
2882
if test "$linkmode,$pass" != "prog,link"; then
2885
vars="compile_deplibs finalize_deplibs"
2887
for var in $vars dependency_libs; do
2888
# Add libraries to $var in reverse order
2889
eval tmp_libs=\"\$$var\"
2891
for deplib in $tmp_libs; do
2892
# FIXME: Pedantically, this is the right thing to do, so
2893
# that some nasty dependency loop isn't accidentally
2895
#new_libs="$deplib $new_libs"
2896
# Pragmatically, this seems to cause very few problems in
2899
-L*) new_libs="$deplib $new_libs" ;;
2902
# And here is the reason: when a library appears more
2903
# than once as an explicit dependence of a library, or
2904
# is implicitly linked in more than once by the
2905
# compiler, it is considered special, and multiple
2906
# occurrences thereof are not removed. Compare this
2907
# with having the same library being listed as a
2908
# dependency of multiple other libraries: in this case,
2909
# we know (pedantically, we assume) the library does not
2910
# need to be listed more than once, so we keep only the
2911
# last copy. This is not always right, but it is rare
2912
# enough that we require users that really mean to play
2913
# such unportable linking tricks to link the library
2914
# using -Wl,-lname, so that libtool does not consider it
2915
# for duplicate removal.
2916
case " $specialdeplibs " in
2917
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2919
case " $new_libs " in
2921
*) new_libs="$deplib $new_libs" ;;
2929
for deplib in $new_libs; do
2932
case " $tmp_libs " in
2934
*) tmp_libs="$tmp_libs $deplib" ;;
2937
*) tmp_libs="$tmp_libs $deplib" ;;
2940
eval $var=\"$tmp_libs\"
2943
# Last step: remove runtime libs from dependency_libs
2944
# (they stay in deplibs)
2946
for i in $dependency_libs ; do
2947
case " $predeps $postdeps $compiler_lib_search_path " in
2952
if test -n "$i" ; then
2953
tmp_libs="$tmp_libs $i"
2956
dependency_libs=$tmp_libs
2958
if test "$linkmode" = prog; then
2959
dlfiles="$newdlfiles"
2960
dlprefiles="$newdlprefiles"
2965
if test -n "$deplibs"; then
2966
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2969
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2970
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2973
if test -n "$rpath"; then
2974
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2977
if test -n "$xrpath"; then
2978
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2981
if test -n "$vinfo"; then
2982
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2985
if test -n "$release"; then
2986
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2989
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2990
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2993
# Now set the variables for building old libraries.
2994
build_libtool_libs=no
2996
objs="$objs$old_deplibs"
3000
# Make sure we only generate libraries of the form `libNAME.la'.
3003
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3004
eval shared_ext=\"$shrext_cmds\"
3005
eval libname=\"$libname_spec\"
3008
if test "$module" = no; then
3009
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3013
if test "$need_lib_prefix" != no; then
3014
# Add the "lib" prefix for modules if required
3015
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3016
eval shared_ext=\"$shrext_cmds\"
3017
eval libname=\"$libname_spec\"
3019
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3024
if test -n "$objs"; then
3025
if test "$deplibs_check_method" != pass_all; then
3026
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3030
$echo "*** Warning: Linking the shared library $output against the non-libtool"
3031
$echo "*** objects $objs is not portable!"
3032
libobjs="$libobjs $objs"
3036
if test "$dlself" != no; then
3037
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3041
if test "$#" -gt 2; then
3042
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3047
if test -z "$rpath"; then
3048
if test "$build_libtool_libs" = yes; then
3049
# Building a libtool convenience library.
3050
# Some compilers have problems with a `.al' extension so
3051
# convenience libraries should have the same extension an
3052
# archive normally would.
3053
oldlibs="$output_objdir/$libname.$libext $oldlibs"
3054
build_libtool_libs=convenience
3058
if test -n "$vinfo"; then
3059
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3062
if test -n "$release"; then
3063
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3067
# Parse the version information argument.
3068
save_ifs="$IFS"; IFS=':'
3069
set dummy $vinfo 0 0 0
3072
if test -n "$8"; then
3073
$echo "$modename: too many parameters to \`-version-info'" 1>&2
3078
# convert absolute version numbers to libtool ages
3079
# this retains compatibility with .la files and attempts
3080
# to make the code below a bit more comprehensible
3082
case $vinfo_number in
3086
number_revision="$4"
3088
# There are really only two kinds -- those that
3089
# use the current revision as the major version
3090
# and those that subtract age and use age as
3091
# a minor version. But, then there is irix
3092
# which has an extra 1 added just for fun
3094
case $version_type in
3095
darwin|linux|osf|windows)
3096
current=`expr $number_major + $number_minor`
3098
revision="$number_revision"
3100
freebsd-aout|freebsd-elf|sunos)
3101
current="$number_major"
3102
revision="$number_minor"
3106
current=`expr $number_major + $number_minor - 1`
3108
revision="$number_minor"
3119
# Check that each of the things are valid numbers.
3121
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]) ;;
3123
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3124
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3130
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]) ;;
3132
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3133
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3139
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]) ;;
3141
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3142
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3147
if test "$age" -gt "$current"; then
3148
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3149
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3153
# Calculate the version variables.
3157
case $version_type in
3161
# Like Linux, but with the current version available in
3162
# verstring for coding it into the library header
3163
major=.`expr $current - $age`
3164
versuffix="$major.$age.$revision"
3165
# Darwin ld doesn't like 0 for these options...
3166
minor_current=`expr $current + 1`
3167
verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3172
versuffix=".$current.$revision";
3177
versuffix=".$current";
3181
major=`expr $current - $age + 1`
3183
case $version_type in
3184
nonstopux) verstring_prefix=nonstopux ;;
3185
*) verstring_prefix=sgi ;;
3187
verstring="$verstring_prefix$major.$revision"
3189
# Add in all the interfaces that we are compatible with.
3191
while test "$loop" -ne 0; do
3192
iface=`expr $revision - $loop`
3193
loop=`expr $loop - 1`
3194
verstring="$verstring_prefix$major.$iface:$verstring"
3197
# Before this point, $major must not contain `.'.
3199
versuffix="$major.$revision"
3203
major=.`expr $current - $age`
3204
versuffix="$major.$age.$revision"
3208
major=.`expr $current - $age`
3209
versuffix=".$current.$age.$revision"
3210
verstring="$current.$age.$revision"
3212
# Add in all the interfaces that we are compatible with.
3214
while test "$loop" -ne 0; do
3215
iface=`expr $current - $loop`
3216
loop=`expr $loop - 1`
3217
verstring="$verstring:${iface}.0"
3220
# Make executables depend on our current version.
3221
verstring="$verstring:${current}.0"
3226
versuffix=".$current.$revision"
3230
# Use '-' rather than '.', since we only want one
3231
# extension on DOS 8.3 filesystems.
3232
major=`expr $current - $age`
3237
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3238
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3243
# Clear the version info if we defaulted, and they specified a release.
3244
if test -z "$vinfo" && test -n "$release"; then
3246
case $version_type in
3248
# we can't check for "0.0" in archive_cmds due to quoting
3249
# problems, so we reset it completely
3256
if test "$need_version" = no; then
3263
# Remove version info from name if versioning should be avoided
3264
if test "$avoid_version" = yes && test "$need_version" = no; then
3270
# Check to see if the archive will have undefined symbols.
3271
if test "$allow_undefined" = yes; then
3272
if test "$allow_undefined_flag" = unsupported; then
3273
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3274
build_libtool_libs=no
3278
# Don't allow undefined symbols.
3279
allow_undefined_flag="$no_undefined_flag"
3283
if test "$mode" != relink; then
3284
# Remove our outputs, but don't remove object files since they
3285
# may have been created when compiling PIC objects.
3287
tempremovelist=`$echo "$output_objdir/*"`
3288
for p in $tempremovelist; do
3292
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3293
if test "X$precious_files_regex" != "X"; then
3294
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3299
removelist="$removelist $p"
3304
if test -n "$removelist"; then
3305
$show "${rm}r $removelist"
3306
$run ${rm}r $removelist
3310
# Now set the variables for building old libraries.
3311
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3312
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3314
# Transform .lo files to .o files.
3315
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3318
# Eliminate all temporary directories.
3319
for path in $notinst_path; do
3320
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3321
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3322
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3325
if test -n "$xrpath"; then
3326
# If the user specified any rpath flags, then add them.
3328
for libdir in $xrpath; do
3329
temp_xrpath="$temp_xrpath -R$libdir"
3330
case "$finalize_rpath " in
3332
*) finalize_rpath="$finalize_rpath $libdir" ;;
3335
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3336
dependency_libs="$temp_xrpath $dependency_libs"
3340
# Make sure dlfiles contains only unique files that won't be dlpreopened
3341
old_dlfiles="$dlfiles"
3343
for lib in $old_dlfiles; do
3344
case " $dlprefiles $dlfiles " in
3346
*) dlfiles="$dlfiles $lib" ;;
3350
# Make sure dlprefiles contains only unique files
3351
old_dlprefiles="$dlprefiles"
3353
for lib in $old_dlprefiles; do
3354
case "$dlprefiles " in
3356
*) dlprefiles="$dlprefiles $lib" ;;
3360
if test "$build_libtool_libs" = yes; then
3361
if test -n "$rpath"; then
3363
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3364
# these systems don't actually have a c library (as such)!
3366
*-*-rhapsody* | *-*-darwin1.[012])
3367
# Rhapsody C library is in the System framework
3368
deplibs="$deplibs -framework System"
3371
# Don't link with libc until the a.out ld.so is fixed.
3373
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3374
# Do not include libc due to us having libc/libc_r.
3375
test "X$arg" = "X-lc" && continue
3378
# Add libc to deplibs on all other systems if necessary.
3379
if test "$build_libtool_need_lc" = "yes"; then
3380
deplibs="$deplibs -lc"
3386
# Transform deplibs into only deplibs that can be linked in shared.
3388
libname_save=$libname
3389
release_save=$release
3390
versuffix_save=$versuffix
3392
# I'm not sure if I'm treating the release correctly. I think
3393
# release should show up in the -l (ie -lgmp5) so we don't want to
3394
# add it in twice. Is that correct?
3400
case $deplibs_check_method in
3402
# Don't check for shared/static. Everything works.
3403
# This might be a little naive. We might want to check
3404
# whether the library exists or not. But this is on
3405
# osf3 & osf4 and I'm not really sure... Just
3406
# implementing what was already the behavior.
3410
# This code stresses the "libraries are programs" paradigm to its
3411
# limits. Maybe even breaks it. We compile a program, linking it
3412
# against the deplibs as a proxy for the library. Then we can check
3413
# whether they linked in statically or dynamically with ldd.
3415
cat > conftest.c <<EOF
3416
int main() { return 0; }
3419
$LTCC -o conftest conftest.c $deplibs
3420
if test "$?" -eq 0 ; then
3421
ldd_output=`ldd conftest`
3422
for i in $deplibs; do
3423
name="`expr $i : '-l\(.*\)'`"
3424
# If $name is empty we are operating on a -L argument.
3425
if test "$name" != "" && test "$name" -ne "0"; then
3426
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3427
case " $predeps $postdeps " in
3429
newdeplibs="$newdeplibs $i"
3434
if test -n "$i" ; then
3435
libname=`eval \\$echo \"$libname_spec\"`
3436
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3437
set dummy $deplib_matches
3439
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3440
newdeplibs="$newdeplibs $i"
3444
$echo "*** Warning: dynamic linker does not accept needed library $i."
3445
$echo "*** I have the capability to make that library automatically link in when"
3446
$echo "*** you link to this library. But I can only do this if you have a"
3447
$echo "*** shared version of the library, which I believe you do not have"
3448
$echo "*** because a test_compile did reveal that the linker did not use it for"
3449
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3453
newdeplibs="$newdeplibs $i"
3457
# Error occurred in the first compile. Let's try to salvage
3458
# the situation: Compile a separate program for each library.
3459
for i in $deplibs; do
3460
name="`expr $i : '-l\(.*\)'`"
3461
# If $name is empty we are operating on a -L argument.
3462
if test "$name" != "" && test "$name" != "0"; then
3464
$LTCC -o conftest conftest.c $i
3466
if test "$?" -eq 0 ; then
3467
ldd_output=`ldd conftest`
3468
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3469
case " $predeps $postdeps " in
3471
newdeplibs="$newdeplibs $i"
3476
if test -n "$i" ; then
3477
libname=`eval \\$echo \"$libname_spec\"`
3478
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3479
set dummy $deplib_matches
3481
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3482
newdeplibs="$newdeplibs $i"
3486
$echo "*** Warning: dynamic linker does not accept needed library $i."
3487
$echo "*** I have the capability to make that library automatically link in when"
3488
$echo "*** you link to this library. But I can only do this if you have a"
3489
$echo "*** shared version of the library, which you do not appear to have"
3490
$echo "*** because a test_compile did reveal that the linker did not use this one"
3491
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3497
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3498
$echo "*** make it link in! You will probably need to install it or some"
3499
$echo "*** library that it depends on before this library will be fully"
3500
$echo "*** functional. Installing it before continuing would be even better."
3503
newdeplibs="$newdeplibs $i"
3509
set dummy $deplibs_check_method
3510
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3511
for a_deplib in $deplibs; do
3512
name="`expr $a_deplib : '-l\(.*\)'`"
3513
# If $name is empty we are operating on a -L argument.
3514
if test "$name" != "" && test "$name" != "0"; then
3515
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3516
case " $predeps $postdeps " in
3518
newdeplibs="$newdeplibs $a_deplib"
3523
if test -n "$a_deplib" ; then
3524
libname=`eval \\$echo \"$libname_spec\"`
3525
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3526
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3527
for potent_lib in $potential_libs; do
3528
# Follow soft links.
3529
if ls -lLd "$potent_lib" 2>/dev/null \
3530
| grep " -> " >/dev/null; then
3533
# The statement above tries to avoid entering an
3534
# endless loop below, in case of cyclic links.
3535
# We might still enter an endless loop, since a link
3536
# loop can be closed while we follow links,
3538
potlib="$potent_lib"
3539
while test -h "$potlib" 2>/dev/null; do
3540
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3542
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3543
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3546
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3548
| $EGREP "$file_magic_regex" > /dev/null; then
3549
newdeplibs="$newdeplibs $a_deplib"
3556
if test -n "$a_deplib" ; then
3559
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3560
$echo "*** I have the capability to make that library automatically link in when"
3561
$echo "*** you link to this library. But I can only do this if you have a"
3562
$echo "*** shared version of the library, which you do not appear to have"
3563
$echo "*** because I did check the linker path looking for a file starting"
3564
if test -z "$potlib" ; then
3565
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3567
$echo "*** with $libname and none of the candidates passed a file format test"
3568
$echo "*** using a file magic. Last file checked: $potlib"
3572
# Add a -L argument.
3573
newdeplibs="$newdeplibs $a_deplib"
3575
done # Gone through all deplibs.
3578
set dummy $deplibs_check_method
3579
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3580
for a_deplib in $deplibs; do
3581
name="`expr $a_deplib : '-l\(.*\)'`"
3582
# If $name is empty we are operating on a -L argument.
3583
if test -n "$name" && test "$name" != "0"; then
3584
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3585
case " $predeps $postdeps " in
3587
newdeplibs="$newdeplibs $a_deplib"
3592
if test -n "$a_deplib" ; then
3593
libname=`eval \\$echo \"$libname_spec\"`
3594
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3595
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3596
for potent_lib in $potential_libs; do
3597
potlib="$potent_lib" # see symlink-check above in file_magic test
3598
if eval $echo \"$potent_lib\" 2>/dev/null \
3600
| $EGREP "$match_pattern_regex" > /dev/null; then
3601
newdeplibs="$newdeplibs $a_deplib"
3608
if test -n "$a_deplib" ; then
3611
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3612
$echo "*** I have the capability to make that library automatically link in when"
3613
$echo "*** you link to this library. But I can only do this if you have a"
3614
$echo "*** shared version of the library, which you do not appear to have"
3615
$echo "*** because I did check the linker path looking for a file starting"
3616
if test -z "$potlib" ; then
3617
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3619
$echo "*** with $libname and none of the candidates passed a file format test"
3620
$echo "*** using a regex pattern. Last file checked: $potlib"
3624
# Add a -L argument.
3625
newdeplibs="$newdeplibs $a_deplib"
3627
done # Gone through all deplibs.
3631
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3632
-e 's/ -[LR][^ ]*//g'`
3633
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3634
for i in $predeps $postdeps ; do
3635
# can't use Xsed below, because $i might contain '/'
3636
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3639
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3640
| grep . >/dev/null; then
3642
if test "X$deplibs_check_method" = "Xnone"; then
3643
$echo "*** Warning: inter-library dependencies are not supported in this platform."
3645
$echo "*** Warning: inter-library dependencies are not known to be supported."
3647
$echo "*** All declared inter-library dependencies are being dropped."
3652
versuffix=$versuffix_save
3654
release=$release_save
3655
libname=$libname_save
3659
*-*-rhapsody* | *-*-darwin1.[012])
3660
# On Rhapsody replace the C library is the System framework
3661
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3665
if test "$droppeddeps" = yes; then
3666
if test "$module" = yes; then
3668
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3669
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3670
$echo "*** a static module, that should work as long as the dlopening"
3671
$echo "*** application is linked with the -dlopen flag."
3672
if test -z "$global_symbol_pipe"; then
3674
$echo "*** However, this would only work if libtool was able to extract symbol"
3675
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3676
$echo "*** not find such a program. So, this module is probably useless."
3677
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3679
if test "$build_old_libs" = no; then
3680
oldlibs="$output_objdir/$libname.$libext"
3681
build_libtool_libs=module
3684
build_libtool_libs=no
3687
$echo "*** The inter-library dependencies that have been dropped here will be"
3688
$echo "*** automatically added whenever a program is linked with this library"
3689
$echo "*** or is declared to -dlopen it."
3691
if test "$allow_undefined" = no; then
3693
$echo "*** Since this library must not contain undefined symbols,"
3694
$echo "*** because either the platform does not support them or"
3695
$echo "*** it was explicitly requested with -no-undefined,"
3696
$echo "*** libtool will only create a static version of it."
3697
if test "$build_old_libs" = no; then
3698
oldlibs="$output_objdir/$libname.$libext"
3699
build_libtool_libs=module
3702
build_libtool_libs=no
3707
# Done checking deplibs!
3711
# All the library-specific variables (install_libdir is set above).
3716
# Test again, we may have decided not to build it any more
3717
if test "$build_libtool_libs" = yes; then
3718
if test "$hardcode_into_libs" = yes; then
3719
# Hardcode the library paths
3722
rpath="$finalize_rpath"
3723
test "$mode" != relink && rpath="$compile_rpath$rpath"
3724
for libdir in $rpath; do
3725
if test -n "$hardcode_libdir_flag_spec"; then
3726
if test -n "$hardcode_libdir_separator"; then
3727
if test -z "$hardcode_libdirs"; then
3728
hardcode_libdirs="$libdir"
3730
# Just accumulate the unique libdirs.
3731
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3732
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3735
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3740
eval flag=\"$hardcode_libdir_flag_spec\"
3741
dep_rpath="$dep_rpath $flag"
3743
elif test -n "$runpath_var"; then
3744
case "$perm_rpath " in
3746
*) perm_rpath="$perm_rpath $libdir" ;;
3750
# Substitute the hardcoded libdirs into the rpath.
3751
if test -n "$hardcode_libdir_separator" &&
3752
test -n "$hardcode_libdirs"; then
3753
libdir="$hardcode_libdirs"
3754
if test -n "$hardcode_libdir_flag_spec_ld"; then
3755
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3757
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3760
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3761
# We should set the runpath_var.
3763
for dir in $perm_rpath; do
3766
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3768
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3771
shlibpath="$finalize_shlibpath"
3772
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3773
if test -n "$shlibpath"; then
3774
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3777
# Get the real and link names of the library.
3778
eval shared_ext=\"$shrext_cmds\"
3779
eval library_names=\"$library_names_spec\"
3780
set dummy $library_names
3784
if test -n "$soname_spec"; then
3785
eval soname=\"$soname_spec\"
3789
if test -z "$dlname"; then
3793
lib="$output_objdir/$realname"
3796
linknames="$linknames $link"
3799
# Use standard objects if they are pic
3800
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3802
# Prepare the list of exported symbols
3803
if test -z "$export_symbols"; then
3804
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3805
$show "generating symbol list for \`$libname.la'"
3806
export_symbols="$output_objdir/$libname.exp"
3807
$run $rm $export_symbols
3808
cmds=$export_symbols_cmds
3809
save_ifs="$IFS"; IFS='~'
3810
for cmd in $cmds; do
3813
if len=`expr "X$cmd" : ".*"` &&
3814
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3816
$run eval "$cmd" || exit $?
3817
skipped_export=false
3819
# The command line is too long to execute in one step.
3820
$show "using reloadable object file for export list..."
3825
if test -n "$export_symbols_regex"; then
3826
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3827
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3828
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3829
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3834
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3835
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3839
for test_deplib in $deplibs; do
3840
case " $convenience " in
3841
*" $test_deplib "*) ;;
3843
tmp_deplibs="$tmp_deplibs $test_deplib"
3847
deplibs="$tmp_deplibs"
3849
if test -n "$convenience"; then
3850
if test -n "$whole_archive_flag_spec"; then
3851
save_libobjs=$libobjs
3852
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3854
gentop="$output_objdir/${outputname}x"
3855
generated="$generated $gentop"
3857
func_extract_archives $gentop $convenience
3858
libobjs="$libobjs $func_extract_archives_result"
3862
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3863
eval flag=\"$thread_safe_flag_spec\"
3864
linker_flags="$linker_flags $flag"
3867
# Make a backup of the uninstalled library when relinking
3868
if test "$mode" = relink; then
3869
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3872
# Do each of the archive commands.
3873
if test "$module" = yes && test -n "$module_cmds" ; then
3874
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3875
eval test_cmds=\"$module_expsym_cmds\"
3876
cmds=$module_expsym_cmds
3878
eval test_cmds=\"$module_cmds\"
3882
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3883
eval test_cmds=\"$archive_expsym_cmds\"
3884
cmds=$archive_expsym_cmds
3886
eval test_cmds=\"$archive_cmds\"
3891
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3892
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3895
# The command line is too long to link in one step, link piecewise.
3896
$echo "creating reloadable object files..."
3898
# Save the value of $output and $libobjs because we want to
3899
# use them later. If we have whole_archive_flag_spec, we
3900
# want to use save_libobjs as it was before
3901
# whole_archive_flag_spec was expanded, because we can't
3902
# assume the linker understands whole_archive_flag_spec.
3903
# This may have to be revisited, in case too many
3904
# convenience libraries get linked in and end up exceeding
3906
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3907
save_libobjs=$libobjs
3910
output_la=`$echo "X$output" | $Xsed -e "$basename"`
3912
# Clear the reloadable object creation command queue and
3913
# initialize k to one.
3920
output=$output_objdir/$output_la-${k}.$objext
3921
# Loop over the list of objects to be linked.
3922
for obj in $save_libobjs
3924
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3925
if test "X$objlist" = X ||
3926
{ len=`expr "X$test_cmds" : ".*"` &&
3927
test "$len" -le "$max_cmd_len"; }; then
3928
objlist="$objlist $obj"
3930
# The command $test_cmds is almost too long, add a
3931
# command to the queue.
3932
if test "$k" -eq 1 ; then
3933
# The first file doesn't have a previous command to add.
3934
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3936
# All subsequent reloadable object files will link in
3937
# the last one created.
3938
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3940
last_robj=$output_objdir/$output_la-${k}.$objext
3942
output=$output_objdir/$output_la-${k}.$objext
3947
# Handle the remaining objects by creating one last
3948
# reloadable object file. All subsequent reloadable object
3949
# files will link in the last one created.
3950
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3951
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3953
if ${skipped_export-false}; then
3954
$show "generating symbol list for \`$libname.la'"
3955
export_symbols="$output_objdir/$libname.exp"
3956
$run $rm $export_symbols
3958
# Append the command to create the export file.
3959
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3962
# Set up a command to remove the reloadable object files
3963
# after they are used.
3965
while test "$i" -lt "$k"
3968
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3971
$echo "creating a temporary reloadable object file: $output"
3973
# Loop through the commands generated above and execute them.
3974
save_ifs="$IFS"; IFS='~'
3975
for cmd in $concat_cmds; do
3978
$run eval "$cmd" || exit $?
3983
# Restore the value of output.
3986
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3987
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3989
# Expand the library linking commands again to reset the
3990
# value of $libobjs for piecewise linking.
3992
# Do each of the archive commands.
3993
if test "$module" = yes && test -n "$module_cmds" ; then
3994
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3995
cmds=$module_expsym_cmds
4000
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4001
cmds=$archive_expsym_cmds
4007
# Append the command to remove the reloadable object files
4008
# to the just-reset $cmds.
4009
eval cmds=\"\$cmds~\$rm $delfiles\"
4011
save_ifs="$IFS"; IFS='~'
4012
for cmd in $cmds; do
4016
$run eval "$cmd" || exit $?
4020
# Restore the uninstalled library and exit
4021
if test "$mode" = relink; then
4022
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4026
# Create links to the real library.
4027
for linkname in $linknames; do
4028
if test "$realname" != "$linkname"; then
4029
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4030
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4034
# If -module or -export-dynamic was specified, set the dlname.
4035
if test "$module" = yes || test "$export_dynamic" = yes; then
4036
# On all known operating systems, these are identical.
4043
if test -n "$deplibs"; then
4044
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4047
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4048
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4051
if test -n "$rpath"; then
4052
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4055
if test -n "$xrpath"; then
4056
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4059
if test -n "$vinfo"; then
4060
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4063
if test -n "$release"; then
4064
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4069
if test -n "$objs$old_deplibs"; then
4070
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4074
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4082
# Delete the old objects.
4083
$run $rm $obj $libobj
4085
# Objects from convenience libraries. This assumes
4086
# single-version convenience libraries. Whenever we create
4087
# different ones for PIC/non-PIC, this we'll have to duplicate
4091
# reload_cmds runs $LD directly, so let us get rid of
4092
# -Wl from whole_archive_flag_spec
4095
if test -n "$convenience"; then
4096
if test -n "$whole_archive_flag_spec"; then
4097
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4099
gentop="$output_objdir/${obj}x"
4100
generated="$generated $gentop"
4102
func_extract_archives $gentop $convenience
4103
reload_conv_objs="$reload_objs $func_extract_archives_result"
4107
# Create the old-style object.
4108
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
4112
save_ifs="$IFS"; IFS='~'
4113
for cmd in $cmds; do
4117
$run eval "$cmd" || exit $?
4121
# Exit if we aren't doing a library object file.
4122
if test -z "$libobj"; then
4123
if test -n "$gentop"; then
4124
$show "${rm}r $gentop"
4131
if test "$build_libtool_libs" != yes; then
4132
if test -n "$gentop"; then
4133
$show "${rm}r $gentop"
4137
# Create an invalid libtool object if no PIC, so that we don't
4138
# accidentally link it into a program.
4139
# $show "echo timestamp > $libobj"
4140
# $run eval "echo timestamp > $libobj" || exit $?
4144
if test -n "$pic_flag" || test "$pic_mode" != default; then
4145
# Only do commands if we really have different PIC objects.
4146
reload_objs="$libobjs $reload_conv_objs"
4149
save_ifs="$IFS"; IFS='~'
4150
for cmd in $cmds; do
4154
$run eval "$cmd" || exit $?
4159
if test -n "$gentop"; then
4160
$show "${rm}r $gentop"
4169
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4171
if test -n "$vinfo"; then
4172
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4175
if test -n "$release"; then
4176
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4179
if test "$preload" = yes; then
4180
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4181
test "$dlopen_self_static" = unknown; then
4182
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4187
*-*-rhapsody* | *-*-darwin1.[012])
4188
# On Rhapsody replace the C library is the System framework
4189
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4190
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4196
# Don't allow lazy linking, it breaks C++ global constructors
4197
if test "$tagname" = CXX ; then
4198
compile_command="$compile_command ${wl}-bind_at_load"
4199
finalize_command="$finalize_command ${wl}-bind_at_load"
4204
compile_command="$compile_command $compile_deplibs"
4205
finalize_command="$finalize_command $finalize_deplibs"
4207
if test -n "$rpath$xrpath"; then
4208
# If the user specified any rpath flags, then add them.
4209
for libdir in $rpath $xrpath; do
4210
# This is the magic to use -rpath.
4211
case "$finalize_rpath " in
4213
*) finalize_rpath="$finalize_rpath $libdir" ;;
4218
# Now hardcode the library paths
4221
for libdir in $compile_rpath $finalize_rpath; do
4222
if test -n "$hardcode_libdir_flag_spec"; then
4223
if test -n "$hardcode_libdir_separator"; then
4224
if test -z "$hardcode_libdirs"; then
4225
hardcode_libdirs="$libdir"
4227
# Just accumulate the unique libdirs.
4228
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4229
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4232
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4237
eval flag=\"$hardcode_libdir_flag_spec\"
4238
rpath="$rpath $flag"
4240
elif test -n "$runpath_var"; then
4241
case "$perm_rpath " in
4243
*) perm_rpath="$perm_rpath $libdir" ;;
4247
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4248
case :$dllsearchpath: in
4250
*) dllsearchpath="$dllsearchpath:$libdir";;
4255
# Substitute the hardcoded libdirs into the rpath.
4256
if test -n "$hardcode_libdir_separator" &&
4257
test -n "$hardcode_libdirs"; then
4258
libdir="$hardcode_libdirs"
4259
eval rpath=\" $hardcode_libdir_flag_spec\"
4261
compile_rpath="$rpath"
4265
for libdir in $finalize_rpath; do
4266
if test -n "$hardcode_libdir_flag_spec"; then
4267
if test -n "$hardcode_libdir_separator"; then
4268
if test -z "$hardcode_libdirs"; then
4269
hardcode_libdirs="$libdir"
4271
# Just accumulate the unique libdirs.
4272
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4273
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4276
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4281
eval flag=\"$hardcode_libdir_flag_spec\"
4282
rpath="$rpath $flag"
4284
elif test -n "$runpath_var"; then
4285
case "$finalize_perm_rpath " in
4287
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4291
# Substitute the hardcoded libdirs into the rpath.
4292
if test -n "$hardcode_libdir_separator" &&
4293
test -n "$hardcode_libdirs"; then
4294
libdir="$hardcode_libdirs"
4295
eval rpath=\" $hardcode_libdir_flag_spec\"
4297
finalize_rpath="$rpath"
4299
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4300
# Transform all the library objects into standard objects.
4301
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4302
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4306
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4307
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4308
dlsyms="${outputname}S.c"
4310
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4314
if test -n "$dlsyms"; then
4318
# Discover the nlist of each of the dlfiles.
4319
nlist="$output_objdir/${outputname}.nm"
4321
$show "$rm $nlist ${nlist}S ${nlist}T"
4322
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4324
# Parse the name list into a source file.
4325
$show "creating $output_objdir/$dlsyms"
4327
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4328
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4329
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4335
/* Prevent the only kind of declaration conflicts we can make. */
4336
#define lt_preloaded_symbols some_other_symbol
4338
/* External symbol declarations for the compiler. */\
4341
if test "$dlself" = yes; then
4342
$show "generating symbol list for \`$output'"
4344
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4346
# Add our own program objects to the symbol list.
4347
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4348
for arg in $progfiles; do
4349
$show "extracting global C symbols from \`$arg'"
4350
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4353
if test -n "$exclude_expsyms"; then
4354
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4355
$run eval '$mv "$nlist"T "$nlist"'
4358
if test -n "$export_symbols_regex"; then
4359
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4360
$run eval '$mv "$nlist"T "$nlist"'
4363
# Prepare the list of exported symbols
4364
if test -z "$export_symbols"; then
4365
export_symbols="$output_objdir/$outputname.exp"
4366
$run $rm $export_symbols
4367
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4369
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4370
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4371
$run eval 'mv "$nlist"T "$nlist"'
4375
for arg in $dlprefiles; do
4376
$show "extracting global C symbols from \`$arg'"
4377
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4378
$run eval '$echo ": $name " >> "$nlist"'
4379
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4382
if test -z "$run"; then
4383
# Make sure we have at least an empty file.
4384
test -f "$nlist" || : > "$nlist"
4386
if test -n "$exclude_expsyms"; then
4387
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4388
$mv "$nlist"T "$nlist"
4391
# Try sorting and uniquifying the output.
4392
if grep -v "^: " < "$nlist" |
4393
if sort -k 3 </dev/null >/dev/null 2>&1; then
4398
uniq > "$nlist"S; then
4401
grep -v "^: " < "$nlist" > "$nlist"S
4404
if test -f "$nlist"S; then
4405
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4407
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
4410
$echo >> "$output_objdir/$dlsyms" "\
4412
#undef lt_preloaded_symbols
4414
#if defined (__STDC__) && __STDC__
4415
# define lt_ptr void *
4417
# define lt_ptr char *
4421
/* The mapping between symbol names and symbols. */
4425
*cygwin* | *mingw* )
4426
$echo >> "$output_objdir/$dlsyms" "\
4427
/* DATA imports from DLLs on WIN32 can't be const, because
4428
runtime relocations are performed -- see ld's documentation
4434
$echo >> "$output_objdir/$dlsyms" "\
4441
$echo >> "$output_objdir/$dlsyms" "\
4445
lt_preloaded_symbols[] =
4449
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4451
$echo >> "$output_objdir/$dlsyms" "\
4455
/* This works around a problem in FreeBSD linker */
4456
#ifdef FREEBSD_WORKAROUND
4457
static const void *lt_preloaded_setup() {
4458
return lt_preloaded_symbols;
4468
pic_flag_for_symtable=
4470
# compiling the symbol table file with pic_flag works around
4471
# a FreeBSD bug that causes programs to crash when -lm is
4472
# linked before any other PIC object. But we must not use
4473
# pic_flag when linking with -static. The problem exists in
4474
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4475
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4476
case "$compile_command " in
4478
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4481
case "$compile_command " in
4483
*) pic_flag_for_symtable=" $pic_flag";;
4487
# Now compile the dynamic symbol file.
4488
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4489
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4491
# Clean up the generated files.
4492
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4493
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4495
# Transform the symbol file into the correct name.
4496
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4497
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4500
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4505
# We keep going just in case the user didn't refer to
4506
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4507
# really was required.
4509
# Nullify the symbol file.
4510
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4511
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4514
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4515
# Replace the output file specification.
4516
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4517
link_command="$compile_command$compile_rpath"
4519
# We have no uninstalled library dependencies, so finalize right now.
4520
$show "$link_command"
4521
$run eval "$link_command"
4524
# Delete the generated files.
4525
if test -n "$dlsyms"; then
4526
$show "$rm $output_objdir/${outputname}S.${objext}"
4527
$run $rm "$output_objdir/${outputname}S.${objext}"
4533
if test -n "$shlibpath_var"; then
4534
# We should set the shlibpath_var
4536
for dir in $temp_rpath; do
4538
[\\/]* | [A-Za-z]:[\\/]*)
4543
# Relative path: add a thisdir entry.
4544
rpath="$rpath\$thisdir/$dir:"
4551
if test -n "$compile_shlibpath$finalize_shlibpath"; then
4552
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4554
if test -n "$finalize_shlibpath"; then
4555
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4560
if test -n "$runpath_var"; then
4561
if test -n "$perm_rpath"; then
4562
# We should set the runpath_var.
4564
for dir in $perm_rpath; do
4567
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4569
if test -n "$finalize_perm_rpath"; then
4570
# We should set the runpath_var.
4572
for dir in $finalize_perm_rpath; do
4575
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4579
if test "$no_install" = yes; then
4580
# We don't need to create a wrapper script.
4581
link_command="$compile_var$compile_command$compile_rpath"
4582
# Replace the output file specification.
4583
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4584
# Delete the old output file.
4586
# Link the executable and exit
4587
$show "$link_command"
4588
$run eval "$link_command" || exit $?
4592
if test "$hardcode_action" = relink; then
4593
# Fast installation is not supported
4594
link_command="$compile_var$compile_command$compile_rpath"
4595
relink_command="$finalize_var$finalize_command$finalize_rpath"
4597
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4598
$echo "$modename: \`$output' will be relinked during installation" 1>&2
4600
if test "$fast_install" != no; then
4601
link_command="$finalize_var$compile_command$finalize_rpath"
4602
if test "$fast_install" = yes; then
4603
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4605
# fast_install is set to needless
4609
link_command="$compile_var$compile_command$compile_rpath"
4610
relink_command="$finalize_var$finalize_command$finalize_rpath"
4614
# Replace the output file specification.
4615
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4617
# Delete the old output files.
4618
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4620
$show "$link_command"
4621
$run eval "$link_command" || exit $?
4623
# Now create the wrapper script.
4624
$show "creating $output"
4626
# Quote the relink command for shipping.
4627
if test -n "$relink_command"; then
4628
# Preserve any variables that may affect compiler behavior
4629
for var in $variables_saved_for_relink; do
4630
if eval test -z \"\${$var+set}\"; then
4631
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4632
elif eval var_value=\$$var; test -z "$var_value"; then
4633
relink_command="$var=; export $var; $relink_command"
4635
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4636
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4639
relink_command="(cd `pwd`; $relink_command)"
4640
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4643
# Quote $echo for shipping.
4644
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4646
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4647
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4649
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4651
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4654
# Only actually do things if our run command is non-null.
4655
if test -z "$run"; then
4656
# win32 will think the script is a binary if it has
4657
# a .exe suffix, so we strip it off here.
4659
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4661
# test for cygwin because mv fails w/o .exe extensions
4665
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4669
*cygwin* | *mingw* )
4670
cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4671
cwrapper=`$echo ${output}.exe`
4672
$rm $cwrappersource $cwrapper
4673
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4675
cat > $cwrappersource <<EOF
4677
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4678
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4680
The $output program cannot be directly executed until all the libtool
4681
libraries that it depends on are installed.
4683
This wrapper executable should never be moved out of the build directory.
4684
If it is, it will not operate correctly.
4686
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4687
but could eventually absorb all of the scripts functionality and
4688
exec $objdir/$outputname directly.
4691
cat >> $cwrappersource<<"EOF"
4699
#if defined(PATH_MAX)
4700
# define LT_PATHMAX PATH_MAX
4701
#elif defined(MAXPATHLEN)
4702
# define LT_PATHMAX MAXPATHLEN
4704
# define LT_PATHMAX 1024
4707
#ifndef DIR_SEPARATOR
4708
#define DIR_SEPARATOR '/'
4711
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4713
#define HAVE_DOS_BASED_FILE_SYSTEM
4714
#ifndef DIR_SEPARATOR_2
4715
#define DIR_SEPARATOR_2 '\\'
4719
#ifndef DIR_SEPARATOR_2
4720
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4721
#else /* DIR_SEPARATOR_2 */
4722
# define IS_DIR_SEPARATOR(ch) \
4723
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4724
#endif /* DIR_SEPARATOR_2 */
4726
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4727
#define XFREE(stale) do { \
4728
if (stale) { free ((void *) stale); stale = 0; } \
4731
const char *program_name = NULL;
4733
void * xmalloc (size_t num);
4734
char * xstrdup (const char *string);
4735
char * basename (const char *name);
4736
char * fnqualify(const char *path);
4737
char * strendzap(char *str, const char *pat);
4738
void lt_fatal (const char *message, ...);
4741
main (int argc, char *argv[])
4746
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4747
newargz = XMALLOC(char *, argc+2);
4750
cat >> $cwrappersource <<EOF
4751
newargz[0] = "$SHELL";
4754
cat >> $cwrappersource <<"EOF"
4755
newargz[1] = fnqualify(argv[0]);
4756
/* we know the script has the same name, without the .exe */
4757
/* so make sure newargz[1] doesn't end in .exe */
4758
strendzap(newargz[1],".exe");
4759
for (i = 1; i < argc; i++)
4760
newargz[i+1] = xstrdup(argv[i]);
4761
newargz[argc+1] = NULL;
4764
cat >> $cwrappersource <<EOF
4765
execv("$SHELL",newargz);
4768
cat >> $cwrappersource <<"EOF"
4772
xmalloc (size_t num)
4774
void * p = (void *) malloc (num);
4776
lt_fatal ("Memory exhausted");
4782
xstrdup (const char *string)
4784
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4789
basename (const char *name)
4793
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4794
/* Skip over the disk name in MSDOS pathnames. */
4795
if (isalpha (name[0]) && name[1] == ':')
4799
for (base = name; *name; name++)
4800
if (IS_DIR_SEPARATOR (*name))
4802
return (char *) base;
4806
fnqualify(const char *path)
4810
char tmp[LT_PATHMAX + 1];
4812
assert(path != NULL);
4814
/* Is it qualified already? */
4815
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4816
if (isalpha (path[0]) && path[1] == ':')
4817
return xstrdup (path);
4819
if (IS_DIR_SEPARATOR (path[0]))
4820
return xstrdup (path);
4822
/* prepend the current directory */
4823
/* doesn't handle '~' */
4824
if (getcwd (tmp, LT_PATHMAX) == NULL)
4825
lt_fatal ("getcwd failed");
4826
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4827
p = XMALLOC(char, size);
4828
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4833
strendzap(char *str, const char *pat)
4837
assert(str != NULL);
4838
assert(pat != NULL);
4841
patlen = strlen(pat);
4845
str += len - patlen;
4846
if (strcmp(str, pat) == 0)
4853
lt_error_core (int exit_status, const char * mode,
4854
const char * message, va_list ap)
4856
fprintf (stderr, "%s: %s: ", program_name, mode);
4857
vfprintf (stderr, message, ap);
4858
fprintf (stderr, ".\n");
4860
if (exit_status >= 0)
4865
lt_fatal (const char *message, ...)
4868
va_start (ap, message);
4869
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4873
# we should really use a build-platform specific compiler
4874
# here, but OTOH, the wrappers (shell script and this C one)
4875
# are only useful if you want to execute the "real" binary.
4876
# Since the "real" binary is built for $host, then this
4877
# wrapper might as well be built for $host, too.
4878
$run $LTCC -s -o $cwrapper $cwrappersource
4882
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4887
# $output - temporary wrapper script for $objdir/$outputname
4888
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4890
# The $output program cannot be directly executed until all the libtool
4891
# libraries that it depends on are installed.
4893
# This wrapper script should never be moved out of the build directory.
4894
# If it is, it will not operate correctly.
4896
# Sed substitution that helps us do robust quoting. It backslashifies
4897
# metacharacters that are still active within double-quoted strings.
4898
Xsed='${SED} -e 1s/^X//'
4899
sed_quote_subst='$sed_quote_subst'
4901
# The HP-UX ksh and POSIX shell print the target directory to stdout
4903
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4905
relink_command=\"$relink_command\"
4907
# This environment variable determines our operation mode.
4908
if test \"\$libtool_install_magic\" = \"$magic\"; then
4909
# install mode needs the following variable:
4910
notinst_deplibs='$notinst_deplibs'
4912
# When we are sourced in execute mode, \$file and \$echo are already set.
4913
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4916
# Make sure echo works.
4917
if test \"X\$1\" = X--no-reexec; then
4918
# Discard the --no-reexec flag, and continue.
4920
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4921
# Yippee, \$echo works!
4924
# Restart under the correct shell, and then maybe \$echo will work.
4925
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4931
# Find the directory that this script lives in.
4932
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4933
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4935
# Follow symbolic links until we get to the real thisdir.
4936
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4937
while test -n \"\$file\"; do
4938
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4940
# If there was a directory component, then change thisdir.
4941
if test \"x\$destdir\" != \"x\$file\"; then
4942
case \"\$destdir\" in
4943
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4944
*) thisdir=\"\$thisdir/\$destdir\" ;;
4948
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4949
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4952
# Try to get the absolute directory name.
4953
absdir=\`cd \"\$thisdir\" && pwd\`
4954
test -n \"\$absdir\" && thisdir=\"\$absdir\"
4957
if test "$fast_install" = yes; then
4959
program=lt-'$outputname'$exeext
4960
progdir=\"\$thisdir/$objdir\"
4962
if test ! -f \"\$progdir/\$program\" || \\
4963
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4964
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4966
file=\"\$\$-\$program\"
4968
if test ! -d \"\$progdir\"; then
4969
$mkdir \"\$progdir\"
4971
$rm \"\$progdir/\$file\"
4976
# relink executable if necessary
4977
if test -n \"\$relink_command\"; then
4978
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4980
$echo \"\$relink_command_output\" >&2
4981
$rm \"\$progdir/\$file\"
4986
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4987
{ $rm \"\$progdir/\$program\";
4988
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4989
$rm \"\$progdir/\$file\"
4993
program='$outputname'
4994
progdir=\"\$thisdir/$objdir\"
5000
if test -f \"\$progdir/\$program\"; then"
5002
# Export our shlibpath_var if we have one.
5003
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5005
# Add our own library path to $shlibpath_var
5006
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5008
# Some systems cannot cope with colon-terminated $shlibpath_var
5009
# The second colon is a workaround for a bug in BeOS R4 sed
5010
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5012
export $shlibpath_var
5016
# fixup the dll searchpath if we need to.
5017
if test -n "$dllsearchpath"; then
5019
# Add the dll search path components to the executable PATH
5020
PATH=$dllsearchpath:\$PATH
5025
if test \"\$libtool_execute_magic\" != \"$magic\"; then
5026
# Run the actual program with our arguments.
5029
# Backslashes separate directories on plain windows
5030
*-*-mingw | *-*-os2*)
5032
exec \$progdir\\\\\$program \${1+\"\$@\"}
5038
exec \$progdir/\$program \${1+\"\$@\"}
5043
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5047
# The program doesn't exist.
5048
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5049
\$echo \"This script is just a wrapper for \$program.\" 1>&2
5050
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
5061
# See if we need to build an old-fashioned archive.
5062
for oldlib in $oldlibs; do
5064
if test "$build_libtool_libs" = convenience; then
5065
oldobjs="$libobjs_save"
5066
addlibs="$convenience"
5067
build_libtool_libs=no
5069
if test "$build_libtool_libs" = module; then
5070
oldobjs="$libobjs_save"
5071
build_libtool_libs=no
5073
oldobjs="$old_deplibs $non_pic_objects"
5075
addlibs="$old_convenience"
5078
if test -n "$addlibs"; then
5079
gentop="$output_objdir/${outputname}x"
5080
generated="$generated $gentop"
5082
func_extract_archives $gentop $addlibs
5083
oldobjs="$oldobjs $func_extract_archives_result"
5086
# Do each command in the archive commands.
5087
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5088
cmds=$old_archive_from_new_cmds
5090
# POSIX demands no paths to be encoded in archives. We have
5091
# to avoid creating archives with duplicate basenames if we
5092
# might have to extract them afterwards, e.g., when creating a
5093
# static archive out of a convenience library, or when linking
5094
# the entirety of a libtool archive into another (currently
5095
# not supported by libtool).
5096
if (for obj in $oldobjs
5098
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5099
done | sort | sort -uc >/dev/null 2>&1); then
5102
$echo "copying selected object files to avoid basename conflicts..."
5104
if test -z "$gentop"; then
5105
gentop="$output_objdir/${outputname}x"
5106
generated="$generated $gentop"
5108
$show "${rm}r $gentop"
5109
$run ${rm}r "$gentop"
5110
$show "$mkdir $gentop"
5111
$run $mkdir "$gentop"
5113
if test "$status" -ne 0 && test ! -d "$gentop"; then
5118
save_oldobjs=$oldobjs
5121
for obj in $save_oldobjs
5123
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5124
case " $oldobjs " in
5125
" ") oldobjs=$obj ;;
5128
# Make sure we don't pick an alternate name that also
5130
newobj=lt$counter-$objbase
5131
counter=`expr $counter + 1`
5132
case " $oldobjs " in
5133
*[\ /]"$newobj "*) ;;
5134
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5137
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5138
$run ln "$obj" "$gentop/$newobj" ||
5139
$run cp "$obj" "$gentop/$newobj"
5140
oldobjs="$oldobjs $gentop/$newobj"
5142
*) oldobjs="$oldobjs $obj" ;;
5147
eval cmds=\"$old_archive_cmds\"
5149
if len=`expr "X$cmds" : ".*"` &&
5150
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5151
cmds=$old_archive_cmds
5153
# the command line is too long to link in one step, link in parts
5154
$echo "using piecewise archive linking..."
5159
save_oldobjs=$oldobjs
5161
# Is there a better way of finding the last object in the list?
5162
for obj in $save_oldobjs
5166
for obj in $save_oldobjs
5168
oldobjs="$objlist $obj"
5169
objlist="$objlist $obj"
5170
eval test_cmds=\"$old_archive_cmds\"
5171
if len=`expr "X$test_cmds" : ".*"` &&
5172
test "$len" -le "$max_cmd_len"; then
5175
# the above command should be used before it gets too long
5177
if test "$obj" = "$last_oldobj" ; then
5180
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5181
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5187
if test "X$oldobjs" = "X" ; then
5188
eval cmds=\"\$concat_cmds\"
5190
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5194
save_ifs="$IFS"; IFS='~'
5195
for cmd in $cmds; do
5199
$run eval "$cmd" || exit $?
5204
if test -n "$generated"; then
5205
$show "${rm}r$generated"
5206
$run ${rm}r$generated
5209
# Now create the libtool archive.
5213
test "$build_old_libs" = yes && old_library="$libname.$libext"
5214
$show "creating $output"
5216
# Preserve any variables that may affect compiler behavior
5217
for var in $variables_saved_for_relink; do
5218
if eval test -z \"\${$var+set}\"; then
5219
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5220
elif eval var_value=\$$var; test -z "$var_value"; then
5221
relink_command="$var=; export $var; $relink_command"
5223
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5224
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5227
# Quote the link command for shipping.
5228
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5229
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5230
if test "$hardcode_automatic" = yes ; then
5235
# Only create the output if not a dry run.
5236
if test -z "$run"; then
5237
for installed in no yes; do
5238
if test "$installed" = yes; then
5239
if test -z "$install_libdir"; then
5242
output="$output_objdir/$outputname"i
5243
# Replace all uninstalled libtool libraries with the installed ones
5245
for deplib in $dependency_libs; do
5248
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5249
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5250
if test -z "$libdir"; then
5251
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5254
newdependency_libs="$newdependency_libs $libdir/$name"
5256
*) newdependency_libs="$newdependency_libs $deplib" ;;
5259
dependency_libs="$newdependency_libs"
5261
for lib in $dlfiles; do
5262
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5263
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5264
if test -z "$libdir"; then
5265
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5268
newdlfiles="$newdlfiles $libdir/$name"
5270
dlfiles="$newdlfiles"
5272
for lib in $dlprefiles; do
5273
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5274
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5275
if test -z "$libdir"; then
5276
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5279
newdlprefiles="$newdlprefiles $libdir/$name"
5281
dlprefiles="$newdlprefiles"
5284
for lib in $dlfiles; do
5286
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5287
*) abs=`pwd`"/$lib" ;;
5289
newdlfiles="$newdlfiles $abs"
5291
dlfiles="$newdlfiles"
5293
for lib in $dlprefiles; do
5295
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5296
*) abs=`pwd`"/$lib" ;;
5298
newdlprefiles="$newdlprefiles $abs"
5300
dlprefiles="$newdlprefiles"
5303
# place dlname in correct position for cygwin
5305
case $host,$output,$installed,$module,$dlname in
5306
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5309
# $outputname - a libtool library file
5310
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5312
# Please DO NOT delete this file!
5313
# It is necessary for linking the library.
5315
# The name that we can dlopen(3).
5318
# Names of this library.
5319
library_names='$library_names'
5321
# The name of the static archive.
5322
old_library='$old_library'
5324
# Libraries that this one depends upon.
5325
dependency_libs='$dependency_libs'
5327
# Version information for $libname.
5332
# Is this an already installed library?
5333
installed=$installed
5335
# Should we warn about portability when linking against -modules?
5336
shouldnotlink=$module
5338
# Files to dlopen/dlpreopen
5340
dlpreopen='$dlprefiles'
5342
# Directory that this library needs to be installed in:
5343
libdir='$install_libdir'"
5344
if test "$installed" = no && test "$need_relink" = yes; then
5346
relink_command=\"$relink_command\""
5351
# Do a symbolic link so that the libtool archive can be found in
5352
# LD_LIBRARY_PATH before the program is installed.
5353
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5354
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5360
# libtool install mode
5362
modename="$modename: install"
5364
# There may be an optional sh(1) argument at the beginning of
5365
# install_prog (especially on Windows NT).
5366
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5367
# Allow the use of GNU shtool's install command.
5368
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5369
# Aesthetically quote it.
5370
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5372
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5376
install_prog="$arg "
5384
# The real first argument should be the name of the installation program.
5385
# Aesthetically quote it.
5386
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5388
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5392
install_prog="$install_prog$arg"
5394
# We need to accept at least all the BSD install flags.
5404
if test -n "$dest"; then
5405
files="$files $dest"
5423
# If the previous option needed an argument, then skip it.
5424
if test -n "$prev"; then
5433
# Aesthetically quote the argument.
5434
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5436
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5440
install_prog="$install_prog $arg"
5443
if test -z "$install_prog"; then
5444
$echo "$modename: you must specify an install program" 1>&2
5449
if test -n "$prev"; then
5450
$echo "$modename: the \`$prev' option requires an argument" 1>&2
5455
if test -z "$files"; then
5456
if test -z "$dest"; then
5457
$echo "$modename: no file or destination specified" 1>&2
5459
$echo "$modename: you must specify a destination" 1>&2
5465
# Strip any trailing slash from the destination.
5466
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5468
# Check to see that the destination is a directory.
5469
test -d "$dest" && isdir=yes
5470
if test "$isdir" = yes; then
5474
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5475
test "X$destdir" = "X$dest" && destdir=.
5476
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5478
# Not a directory, so check to see that there is only one file specified.
5480
if test "$#" -gt 2; then
5481
$echo "$modename: \`$dest' is not a directory" 1>&2
5487
[\\/]* | [A-Za-z]:[\\/]*) ;;
5489
for file in $files; do
5493
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5502
# This variable tells wrapper scripts just to set variables rather
5503
# than running their programs.
5504
libtool_install_magic="$magic"
5509
for file in $files; do
5511
# Do each installation.
5514
# Do the static libraries later.
5515
staticlibs="$staticlibs $file"
5519
# Check to see that this really is a libtool archive.
5520
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5522
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5530
# If there is no directory component, then add one.
5532
*/* | *\\*) . $file ;;
5536
# Add the libdir to current_libdirs if it is the destination.
5537
if test "X$destdir" = "X$libdir"; then
5538
case "$current_libdirs " in
5540
*) current_libdirs="$current_libdirs $libdir" ;;
5543
# Note the libdir as a future libdir.
5544
case "$future_libdirs " in
5546
*) future_libdirs="$future_libdirs $libdir" ;;
5550
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5551
test "X$dir" = "X$file/" && dir=
5554
if test -n "$relink_command"; then
5555
# Determine the prefix the user has applied to our future dir.
5556
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5558
# Don't allow the user to place us outside of our expected
5559
# location b/c this prevents finding dependent libraries that
5560
# are installed to the same prefix.
5561
# At present, this check doesn't affect windows .dll's that
5562
# are installed into $libdir/../bin (currently, that works fine)
5563
# but it's something to keep an eye on.
5564
if test "$inst_prefix_dir" = "$destdir"; then
5565
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5569
if test -n "$inst_prefix_dir"; then
5570
# Stick the inst_prefix_dir data into the link command.
5571
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5573
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5576
$echo "$modename: warning: relinking \`$file'" 1>&2
5577
$show "$relink_command"
5578
if $run eval "$relink_command"; then :
5580
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5585
# See the names of the shared library.
5586
set dummy $library_names
5587
if test -n "$2"; then
5593
test -n "$relink_command" && srcname="$realname"T
5595
# Install the shared library and build the symlinks.
5596
$show "$install_prog $dir/$srcname $destdir/$realname"
5597
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5598
if test -n "$stripme" && test -n "$striplib"; then
5599
$show "$striplib $destdir/$realname"
5600
$run eval "$striplib $destdir/$realname" || exit $?
5603
if test "$#" -gt 0; then
5604
# Delete the old symlinks, and create new ones.
5607
if test "$linkname" != "$realname"; then
5608
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5609
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5614
# Do each command in the postinstall commands.
5615
lib="$destdir/$realname"
5616
cmds=$postinstall_cmds
5617
save_ifs="$IFS"; IFS='~'
5618
for cmd in $cmds; do
5622
$run eval "$cmd" || exit $?
5627
# Install the pseudo-library for information purposes.
5628
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5629
instname="$dir/$name"i
5630
$show "$install_prog $instname $destdir/$name"
5631
$run eval "$install_prog $instname $destdir/$name" || exit $?
5633
# Maybe install the static library, too.
5634
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5638
# Install (i.e. copy) a libtool object.
5640
# Figure out destination file name, if it wasn't already specified.
5641
if test -n "$destname"; then
5642
destfile="$destdir/$destname"
5644
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5645
destfile="$destdir/$destfile"
5648
# Deduce the name of the destination old-style object file.
5651
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5654
staticdest="$destfile"
5658
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5664
# Install the libtool object if requested.
5665
if test -n "$destfile"; then
5666
$show "$install_prog $file $destfile"
5667
$run eval "$install_prog $file $destfile" || exit $?
5670
# Install the old object if enabled.
5671
if test "$build_old_libs" = yes; then
5672
# Deduce the name of the old-style object file.
5673
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5675
$show "$install_prog $staticobj $staticdest"
5676
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
5682
# Figure out destination file name, if it wasn't already specified.
5683
if test -n "$destname"; then
5684
destfile="$destdir/$destname"
5686
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5687
destfile="$destdir/$destfile"
5690
# If the file is missing, and there is a .exe on the end, strip it
5691
# because it is most likely a libtool script we actually want to
5696
if test ! -f "$file"; then
5697
file=`$echo $file|${SED} 's,.exe$,,'`
5703
# Do a test to see if this is really a libtool program.
5706
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5712
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5716
# To insure that "foo" is sourced, and not "foo.exe",
5717
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5718
# which disallows the automatic-append-.exe behavior.
5720
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5721
*) wrapperdot=${wrapper} ;;
5723
# If there is no directory component, then add one.
5725
*/* | *\\*) . ${wrapperdot} ;;
5726
*) . ./${wrapperdot} ;;
5729
# Check the variables that should have been set.
5730
if test -z "$notinst_deplibs"; then
5731
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5736
for lib in $notinst_deplibs; do
5737
# Check to see that each library is installed.
5739
if test -f "$lib"; then
5740
# If there is no directory component, then add one.
5742
*/* | *\\*) . $lib ;;
5746
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5747
if test -n "$libdir" && test ! -f "$libfile"; then
5748
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5754
# To insure that "foo" is sourced, and not "foo.exe",
5755
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5756
# which disallows the automatic-append-.exe behavior.
5758
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5759
*) wrapperdot=${wrapper} ;;
5761
# If there is no directory component, then add one.
5763
*/* | *\\*) . ${wrapperdot} ;;
5764
*) . ./${wrapperdot} ;;
5768
if test "$fast_install" = no && test -n "$relink_command"; then
5769
if test "$finalize" = yes && test -z "$run"; then
5771
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5772
tmpdir="$tmpdir/libtool-$$"
5775
if $mkdir "$tmpdir"; then
5779
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5782
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5783
outputname="$tmpdir/$file"
5784
# Replace the output file specification.
5785
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5787
$show "$relink_command"
5788
if $run eval "$relink_command"; then :
5790
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5796
$echo "$modename: warning: cannot relink \`$file'" 1>&2
5799
# Install the binary that we compiled earlier.
5800
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5804
# remove .exe since cygwin /usr/bin/install will append another
5806
case $install_prog,$host in
5807
*/usr/bin/install*,*cygwin*)
5808
case $file:$destfile in
5813
destfile=$destfile.exe
5816
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5821
$show "$install_prog$stripme $file $destfile"
5822
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5823
test -n "$outputname" && ${rm}r "$tmpdir"
5828
for file in $staticlibs; do
5829
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5831
# Set up the ranlib parameters.
5832
oldlib="$destdir/$name"
5834
$show "$install_prog $file $oldlib"
5835
$run eval "$install_prog \$file \$oldlib" || exit $?
5837
if test -n "$stripme" && test -n "$old_striplib"; then
5838
$show "$old_striplib $oldlib"
5839
$run eval "$old_striplib $oldlib" || exit $?
5842
# Do each command in the postinstall commands.
5843
cmds=$old_postinstall_cmds
5844
save_ifs="$IFS"; IFS='~'
5845
for cmd in $cmds; do
5849
$run eval "$cmd" || exit $?
5854
if test -n "$future_libdirs"; then
5855
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5858
if test -n "$current_libdirs"; then
5859
# Maybe just do a dry run.
5860
test -n "$run" && current_libdirs=" -n$current_libdirs"
5861
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5867
# libtool finish mode
5869
modename="$modename: finish"
5873
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5876
libdirs="$libdirs $dir"
5879
for libdir in $libdirs; do
5880
if test -n "$finish_cmds"; then
5881
# Do each command in the finish commands.
5883
save_ifs="$IFS"; IFS='~'
5884
for cmd in $cmds; do
5888
$run eval "$cmd" || admincmds="$admincmds
5893
if test -n "$finish_eval"; then
5894
# Do the single finish_eval.
5895
eval cmds=\"$finish_eval\"
5896
$run eval "$cmds" || admincmds="$admincmds
5902
# Exit here if they wanted silent mode.
5903
test "$show" = : && exit $EXIT_SUCCESS
5905
$echo "----------------------------------------------------------------------"
5906
$echo "Libraries have been installed in:"
5907
for libdir in $libdirs; do
5911
$echo "If you ever happen to want to link against installed libraries"
5912
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5913
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5914
$echo "flag during linking and do at least one of the following:"
5915
if test -n "$shlibpath_var"; then
5916
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5917
$echo " during execution"
5919
if test -n "$runpath_var"; then
5920
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5921
$echo " during linking"
5923
if test -n "$hardcode_libdir_flag_spec"; then
5925
eval flag=\"$hardcode_libdir_flag_spec\"
5927
$echo " - use the \`$flag' linker flag"
5929
if test -n "$admincmds"; then
5930
$echo " - have your system administrator run these commands:$admincmds"
5932
if test -f /etc/ld.so.conf; then
5933
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5936
$echo "See any operating system documentation about shared libraries for"
5937
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5938
$echo "----------------------------------------------------------------------"
5942
# libtool execute mode
5944
modename="$modename: execute"
5946
# The first argument is the command name.
5948
if test -z "$cmd"; then
5949
$echo "$modename: you must specify a COMMAND" 1>&2
5954
# Handle -dlopen flags immediately.
5955
for file in $execute_dlfiles; do
5956
if test ! -f "$file"; then
5957
$echo "$modename: \`$file' is not a file" 1>&2
5965
# Check to see that this really is a libtool archive.
5966
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5968
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5973
# Read the libtool library.
5977
# If there is no directory component, then add one.
5979
*/* | *\\*) . $file ;;
5983
# Skip this library if it cannot be dlopened.
5984
if test -z "$dlname"; then
5985
# Warn if it was a shared library.
5986
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5990
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5991
test "X$dir" = "X$file" && dir=.
5993
if test -f "$dir/$objdir/$dlname"; then
5996
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6002
# Just add the directory containing the .lo file.
6003
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6004
test "X$dir" = "X$file" && dir=.
6008
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6013
# Get the absolute pathname.
6014
absdir=`cd "$dir" && pwd`
6015
test -n "$absdir" && dir="$absdir"
6017
# Now add the directory to shlibpath_var.
6018
if eval "test -z \"\$$shlibpath_var\""; then
6019
eval "$shlibpath_var=\"\$dir\""
6021
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6025
# This variable tells wrapper scripts just to set shlibpath_var
6026
# rather than running their programs.
6027
libtool_execute_magic="$magic"
6029
# Check if any of the arguments is a wrapper script.
6036
# Do a test to see if this is really a libtool program.
6037
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6038
# If there is no directory component, then add one.
6040
*/* | *\\*) . $file ;;
6044
# Transform arg to wrapped name.
6045
file="$progdir/$program"
6049
# Quote arguments (to preserve shell metacharacters).
6050
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6051
args="$args \"$file\""
6054
if test -z "$run"; then
6055
if test -n "$shlibpath_var"; then
6056
# Export the shlibpath_var.
6057
eval "export $shlibpath_var"
6060
# Restore saved environment variables
6061
if test "${save_LC_ALL+set}" = set; then
6062
LC_ALL="$save_LC_ALL"; export LC_ALL
6064
if test "${save_LANG+set}" = set; then
6065
LANG="$save_LANG"; export LANG
6068
# Now prepare to actually exec the command.
6069
exec_cmd="\$cmd$args"
6071
# Display what would be done.
6072
if test -n "$shlibpath_var"; then
6073
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6074
$echo "export $shlibpath_var"
6081
# libtool clean and uninstall mode
6083
modename="$modename: $mode"
6089
# This variable tells wrapper scripts just to set variables rather
6090
# than running their programs.
6091
libtool_install_magic="$magic"
6096
-f) rm="$rm $arg"; rmforce=yes ;;
6097
-*) rm="$rm $arg" ;;
6098
*) files="$files $arg" ;;
6102
if test -z "$rm"; then
6103
$echo "$modename: you must specify an RM program" 1>&2
6110
origobjdir="$objdir"
6111
for file in $files; do
6112
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6113
if test "X$dir" = "X$file"; then
6115
objdir="$origobjdir"
6117
objdir="$dir/$origobjdir"
6119
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6120
test "$mode" = uninstall && objdir="$dir"
6122
# Remember objdir for removal later, being careful to avoid duplicates
6123
if test "$mode" = clean; then
6126
*) rmdirs="$rmdirs $objdir" ;;
6130
# Don't error if the file doesn't exist and rm -f was used.
6131
if (test -L "$file") >/dev/null 2>&1 \
6132
|| (test -h "$file") >/dev/null 2>&1 \
6133
|| test -f "$file"; then
6135
elif test -d "$file"; then
6138
elif test "$rmforce" = yes; then
6146
# Possibly a libtool archive, so verify it.
6147
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6150
# Delete the libtool libraries and symlinks.
6151
for n in $library_names; do
6152
rmfiles="$rmfiles $objdir/$n"
6154
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6155
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6157
if test "$mode" = uninstall; then
6158
if test -n "$library_names"; then
6159
# Do each command in the postuninstall commands.
6160
cmds=$postuninstall_cmds
6161
save_ifs="$IFS"; IFS='~'
6162
for cmd in $cmds; do
6167
if test "$?" -ne 0 && test "$rmforce" != yes; then
6174
if test -n "$old_library"; then
6175
# Do each command in the old_postuninstall commands.
6176
cmds=$old_postuninstall_cmds
6177
save_ifs="$IFS"; IFS='~'
6178
for cmd in $cmds; do
6183
if test "$?" -ne 0 && test "$rmforce" != yes; then
6189
# FIXME: should reinstall the best remaining shared library.
6195
# Possibly a libtool object, so verify it.
6196
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6201
# Add PIC object to the list of files to remove.
6202
if test -n "$pic_object" \
6203
&& test "$pic_object" != none; then
6204
rmfiles="$rmfiles $dir/$pic_object"
6207
# Add non-PIC object to the list of files to remove.
6208
if test -n "$non_pic_object" \
6209
&& test "$non_pic_object" != none; then
6210
rmfiles="$rmfiles $dir/$non_pic_object"
6216
if test "$mode" = clean ; then
6220
file=`$echo $file|${SED} 's,.exe$,,'`
6221
noexename=`$echo $name|${SED} 's,.exe$,,'`
6222
# $file with .exe has already been added to rmfiles,
6223
# add $file without .exe
6224
rmfiles="$rmfiles $file"
6227
# Do a test to see if this is a libtool program.
6228
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6232
# note $name still contains .exe if it was in $file originally
6233
# as does the version of $file that was added into $rmfiles
6234
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6235
if test "$fast_install" = yes && test -n "$relink_command"; then
6236
rmfiles="$rmfiles $objdir/lt-$name"
6238
if test "X$noexename" != "X$name" ; then
6239
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6245
$show "$rm $rmfiles"
6246
$run $rm $rmfiles || exit_status=1
6248
objdir="$origobjdir"
6250
# Try to remove the ${objdir}s in the directories where we deleted files
6251
for dir in $rmdirs; do
6252
if test -d "$dir"; then
6254
$run rmdir $dir >/dev/null 2>&1
6262
$echo "$modename: you must specify a MODE" 1>&2
6263
$echo "$generic_help" 1>&2
6268
if test -z "$exec_cmd"; then
6269
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6270
$echo "$generic_help" 1>&2
6273
fi # test -z "$show_help"
6275
if test -n "$exec_cmd"; then
6280
# We need to display help for each of the modes.
6283
"Usage: $modename [OPTION]... [MODE-ARG]...
6285
Provide generalized library-building support services.
6287
--config show all configuration variables
6288
--debug enable verbose shell tracing
6289
-n, --dry-run display commands without modifying any files
6290
--features display basic configuration information and exit
6291
--finish same as \`--mode=finish'
6292
--help display this help message and exit
6293
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6294
--quiet same as \`--silent'
6295
--silent don't print informational messages
6296
--tag=TAG use configuration variables from tag TAG
6297
--version print version information
6299
MODE must be one of the following:
6301
clean remove files from the build directory
6302
compile compile a source file into a libtool object
6303
execute automatically set library path, then run a program
6304
finish complete the installation of libtool libraries
6305
install install libraries or executables
6306
link create a library or an executable
6307
uninstall remove libraries from an installed directory
6309
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6310
a more detailed description of MODE.
6312
Report bugs to <bug-libtool@gnu.org>."
6318
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6320
Remove files from the build directory.
6322
RM is the name of the program to use to delete files associated with each FILE
6323
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6326
If FILE is a libtool library, object or program, all the files associated
6327
with it are deleted. Otherwise, only FILE itself is deleted using RM."
6332
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6334
Compile a source file into a libtool library object.
6336
This mode accepts the following additional options:
6338
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
6339
-prefer-pic try to building PIC objects only
6340
-prefer-non-pic try to building non-PIC objects only
6341
-static always build a \`.o' file suitable for static linking
6343
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6344
from the given SOURCEFILE.
6346
The output file name is determined by removing the directory component from
6347
SOURCEFILE, then substituting the C source code suffix \`.c' with the
6348
library object suffix, \`.lo'."
6353
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6355
Automatically set library path, then run a program.
6357
This mode accepts the following additional options:
6359
-dlopen FILE add the directory containing FILE to the library path
6361
This mode sets the library path environment variable according to \`-dlopen'
6364
If any of the ARGS are libtool executable wrappers, then they are translated
6365
into their corresponding uninstalled binary, and any of their required library
6366
directories are added to the library path.
6368
Then, COMMAND is executed, with ARGS as arguments."
6373
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6375
Complete the installation of libtool libraries.
6377
Each LIBDIR is a directory that contains libtool libraries.
6379
The commands that this mode executes may require superuser privileges. Use
6380
the \`--dry-run' option if you just want to see what would be executed."
6385
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6387
Install executables or libraries.
6389
INSTALL-COMMAND is the installation command. The first component should be
6390
either the \`install' or \`cp' program.
6392
The rest of the components are interpreted as arguments to that command (only
6393
BSD-compatible install options are recognized)."
6398
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6400
Link object files or libraries together to form another library, or to
6401
create an executable program.
6403
LINK-COMMAND is a command using the C compiler that you would use to create
6404
a program from several object files.
6406
The following components of LINK-COMMAND are treated specially:
6408
-all-static do not do any dynamic linking at all
6409
-avoid-version do not add a version suffix if possible
6410
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6411
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6412
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6413
-export-symbols SYMFILE
6414
try to export only the symbols listed in SYMFILE
6415
-export-symbols-regex REGEX
6416
try to export only the symbols matching REGEX
6417
-LLIBDIR search LIBDIR for required installed libraries
6418
-lNAME OUTPUT-FILE requires the installed library libNAME
6419
-module build a library that can dlopened
6420
-no-fast-install disable the fast-install mode
6421
-no-install link a not-installable executable
6422
-no-undefined declare that a library does not refer to external symbols
6423
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6424
-objectlist FILE Use a list of object files found in FILE to specify objects
6425
-precious-files-regex REGEX
6426
don't remove output files matching REGEX
6427
-release RELEASE specify package release information
6428
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6429
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6430
-static do not do any dynamic linking of libtool libraries
6431
-version-info CURRENT[:REVISION[:AGE]]
6432
specify library version info [each variable defaults to 0]
6434
All other options (arguments beginning with \`-') are ignored.
6436
Every other argument is treated as a filename. Files ending in \`.la' are
6437
treated as uninstalled libtool libraries, other files are standard or library
6440
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6441
only library objects (\`.lo' files) may be specified, and \`-rpath' is
6442
required, except when creating a convenience library.
6444
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6445
using \`ar' and \`ranlib', or on Windows using \`lib'.
6447
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6448
is created, otherwise an executable program is created."
6453
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6455
Remove libraries from an installation directory.
6457
RM is the name of the program to use to delete files associated with each FILE
6458
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6461
If FILE is a libtool library, all the files associated with it are deleted.
6462
Otherwise, only FILE itself is deleted using RM."
6466
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6473
$echo "Try \`$modename --help' for more information about other modes."
6477
# The TAGs below are defined such that we never get into a situation
6478
# in which we disable both kinds of libraries. Given conflicting
6479
# choices, we go for a static library, that is the most portable,
6480
# since we can't tell whether shared libraries were disabled because
6481
# the user asked for that or because the platform doesn't support
6482
# them. This is particularly important on AIX, because we don't
6483
# support having both static and shared libraries enabled at the same
6484
# time on that platform, so we default to a shared-only configuration.
6485
# If a disable-shared tag is given, we'll fallback to a static-only
6486
# configuration. But we'll never go from static-only to shared-only.
6488
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6489
build_libtool_libs=no
6491
# ### END LIBTOOL TAG CONFIG: disable-shared
6493
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6494
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6495
# ### END LIBTOOL TAG CONFIG: disable-static