1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
5
# Free Software Foundation, Inc.
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8
# This program is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 2 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
# General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
# As a special exception to the GNU General Public License, if you
23
# distribute this file as part of a program that contains a
24
# configuration script generated by Autoconf, you may include it under
25
# the same distribution terms that you use for the rest of that program.
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30
# is ksh but when the shell is invoked as "sh" and the current value of
31
# the _XPG environment variable is not equal to 1 (one), the special
32
# positional parameter $0, within a function call, is the name of the
36
# RH: define SED for historic ltconfig's generated by Libtool 1.3
37
[ -z "$SED" ] && SED=sed
39
# The name of this program:
40
progname=`echo "$progpath" | $SED $basename`
50
TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)"
52
# See if we are running on zsh, and set the options which allow our
53
# commands through without removal of \ escapes.
54
if test -n "${ZSH_VERSION+set}" ; then
58
# Check that we have a working $echo.
59
if test "X$1" = X--no-reexec; then
60
# Discard the --no-reexec flag, and continue.
62
elif test "X$1" = X--fallback-echo; then
63
# Avoid inline document here, it may be left over
65
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
66
# Yippee, $echo works!
69
# Restart under the correct shell, and then maybe $echo will work.
70
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
73
if test "X$1" = X--fallback-echo; then
74
# used as fallback echo
83
help="Try \`$progname --help' for more information."
84
magic="%%%MAGIC variable%%%"
89
# Sed substitution that helps us do robust quoting. It backslashifies
90
# metacharacters that are still active within double-quoted strings.
91
Xsed="${SED}"' -e 1s/^X//'
92
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
93
# test EBCDIC or ASCII
94
case `echo A|tr A '\301'` in
95
A) # EBCDIC based system
96
SP2NL="tr '\100' '\n'"
97
NL2SP="tr '\r\n' '\100\100'"
99
*) # Assume ASCII based system
100
SP2NL="tr '\040' '\012'"
101
NL2SP="tr '\015\012' '\040\040'"
106
# Only set LANG and LC_ALL to C if already set.
107
# These must not be set unconditionally because not all systems understand
108
# e.g. LANG=C (notably SCO).
109
# We save the old values to restore during execute mode.
110
if test "${LC_ALL+set}" = set; then
111
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
113
if test "${LANG+set}" = set; then
114
save_LANG="$LANG"; LANG=C; export LANG
117
# Make sure IFS has a sensible default
121
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
122
$echo "$modename: not configured to build any kind of library" 1>&2
123
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
136
lo2o="s/\\.lo\$/.${objext}/"
137
o2lo="s/\\.${objext}\$/.lo/"
139
#####################################
140
# Shell function definitions:
141
# This seems to be the best place for them
143
# func_win32_libid arg
144
# return the library type of file 'arg'
146
# Need a lot of goo to handle *both* DLLs and import libs
147
# Has to be a shell function in order to 'eat' the argument
148
# that is supplied when $file_magic_command is called.
149
func_win32_libid () {
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 ...'
190
if test -n "$available_tags" && test -z "$tagname"; then
194
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
198
CC_quoted="$CC_quoted $arg"
201
# Blanks in the command may have been stripped by the calling shell,
202
# but not from the CC environment variable when configure was run.
203
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
204
# Blanks at the start of $base_compile will cause this to fail
205
# if we don't check for them as well.
207
for z in $available_tags; do
208
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
209
# Evaluate the configuration.
210
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
213
# Double-quote args containing other shell metacharacters.
215
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
219
CC_quoted="$CC_quoted $arg"
222
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
223
# The compiler in the base compile command matches
224
# the one in the tagged configuration.
225
# Assume this is the tagged configuration we want.
232
# If $tagname still isn't set, then no tagged configuration
233
# was found and let the user know that the "--tag" command
234
# line option must be used.
235
if test -z "$tagname"; then
236
$echo "$modename: unable to infer tagged configuration"
237
$echo "$modename: specify a tag with \`--tag'" 1>&2
240
# $echo "$modename: using $tagname tagged configuration"
248
# func_extract_archives gentop oldlib ...
249
func_extract_archives () {
250
my_gentop="$1"; shift
258
$show "${rm}r $my_gentop"
259
$run ${rm}r "$my_gentop"
260
$show "$mkdir $my_gentop"
261
$run $mkdir "$my_gentop"
263
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
267
for my_xlib in $my_oldlibs; do
268
# Extract the objects.
270
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
271
*) my_xabs=`pwd`"/$my_xlib" ;;
273
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
274
my_xdir="$my_gentop/$my_xlib"
276
$show "${rm}r $my_xdir"
277
$run ${rm}r "$my_xdir"
278
$show "$mkdir $my_xdir"
279
$run $mkdir "$my_xdir"
281
if test "$status" -ne 0 && test ! -d "$my_xdir"; then
286
$show "Extracting $my_xabs"
287
# Do not bother doing anything if just a dry run
288
if test -z "$run"; then
289
darwin_orig_dir=`pwd`
290
cd $my_xdir || exit $?
291
darwin_archive=$my_xabs
293
darwin_base_archive=`basename $darwin_archive`
294
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
295
if test -n "$darwin_arches"; then
296
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
298
$show "$darwin_base_archive has multiple architectures $darwin_arches"
299
for darwin_arch in $darwin_arches ; do
300
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
301
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
302
# Remove the table of contents from the thin files.
303
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
304
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
305
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
306
$AR -xo "${darwin_base_archive}"
307
rm "${darwin_base_archive}"
309
done # $darwin_arches
310
## Okay now we have a bunch of thin objects, gotta fatten them up :)
311
darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
314
for darwin_file in $darwin_filelist; do
315
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
316
lipo -create -output "$darwin_file" $darwin_files
317
done # $darwin_filelist
319
cd "$darwin_orig_dir"
322
(cd $my_xdir && $AR x $my_xabs) || exit $?
327
# We will extract separately just the conflicting names and we will
328
# no longer touch any unique names. It is faster to leave these
329
# extract automatically by $AR in one run.
330
$show "(cd $my_xdir && $AR x $my_xabs)"
331
$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
332
if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
335
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
336
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
337
$AR t "$my_xabs" | sort | uniq -cd | while read -r count name
340
while test "$i" -le "$count"
342
# Put our $i before any first dot (extension)
343
# Never overwrite any file
345
while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
347
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
349
$show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
350
$run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
357
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
360
func_extract_archives_result="$my_oldobjs"
362
# End of Shell function definitions
363
#####################################
366
eval std_shrext=\"$shrext_cmds\"
368
# Parse our command line options once, thoroughly.
369
while test "$#" -gt 0
375
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
379
# If the previous option needs an argument, assign it.
380
if test -n "$prev"; then
383
execute_dlfiles="$execute_dlfiles $arg"
387
preserve_args="${preserve_args}=$arg"
389
# Check whether tagname contains only valid characters
392
$echo "$progname: invalid tag name: $tagname" 1>&2
399
# Don't test for the "default" C tag, as we know, it's there, but
400
# not specially marked.
403
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
404
taglist="$taglist $tagname"
405
# Evaluate the configuration.
406
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
408
$echo "$progname: ignoring unknown tag $tagname" 1>&2
423
# Have we seen a non-optional argument yet?
430
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
432
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
433
$echo "This is free software; see the source for copying conditions. There is NO"
434
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
439
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
440
# Now print the configurations for the tags.
441
for tagname in $taglist; do
442
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
448
$echo "$progname: enabling shell trace mode"
450
preserve_args="$preserve_args $arg"
459
if test "$build_libtool_libs" = yes; then
460
$echo "enable shared libraries"
462
$echo "disable shared libraries"
464
if test "$build_old_libs" = yes; then
465
$echo "enable static libraries"
467
$echo "disable static libraries"
472
--finish) mode="finish" ;;
474
--mode) prevopt="--mode" prev=mode ;;
475
--mode=*) mode="$optarg" ;;
477
--preserve-dup-deps) duplicate_deps="yes" ;;
481
preserve_args="$preserve_args $arg"
484
--tag) prevopt="--tag" prev=tag ;;
486
set tag "$optarg" ${1+"$@"}
489
preserve_args="$preserve_args --tag"
498
$echo "$modename: unrecognized option \`$arg'" 1>&2
510
if test -n "$prevopt"; then
511
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
516
# If this variable is set in any of the actions, the command in it
517
# will be execed at the end. This prevents here-documents from being
518
# left over by shells.
521
if test -z "$show_help"; then
523
# Infer the operation mode.
524
if test -z "$mode"; then
525
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
526
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
528
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
540
*db | *dbx | *strace | *truss)
550
# If we have no mode, but dlfiles were specified, then do execute mode.
551
test -n "$execute_dlfiles" && mode=execute
553
# Just use the default operation mode.
554
if test -z "$mode"; then
555
if test -n "$nonopt"; then
556
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
558
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
565
# Only execute mode is allowed to have -dlopen flags.
566
if test -n "$execute_dlfiles" && test "$mode" != execute; then
567
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
572
# Change the help message to a mode-specific one.
574
help="Try \`$modename --help --mode=$mode' for more information."
576
# These modes are in order of execution frequency so that they run quickly.
578
# libtool compile mode
580
modename="$modename: compile"
581
# Get the compilation command and the source file.
583
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
594
# do not "continue". Instead, add this to base_compile
606
# Accept any command-line options.
609
if test -n "$libobj" ; then
610
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
617
-static | -prefer-pic | -prefer-non-pic)
628
arg_mode=arg # the next one goes into the "base_compile" arg list
629
continue # The current "srcfile" will either be retained or
630
;; # replaced later. I would guess that would be a bug.
633
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
635
save_ifs="$IFS"; IFS=','
639
# Double-quote args containing other shell metacharacters.
640
# Many Bourne shells cannot handle close brackets correctly
641
# in scan sets, so we specify it separately.
643
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
647
lastarg="$lastarg $arg"
650
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
652
# Add the arguments to base_compile.
653
base_compile="$base_compile $lastarg"
658
# Accept the current argument as the source file.
659
# The previous "srcfile" becomes the current argument.
666
esac # case $arg_mode
668
# Aesthetically quote the previous argument.
669
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
672
# Double-quote args containing other shell metacharacters.
673
# Many Bourne shells cannot handle close brackets correctly
674
# in scan sets, so we specify it separately.
675
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
676
lastarg="\"$lastarg\""
680
base_compile="$base_compile $lastarg"
685
$echo "$modename: you must specify an argument for -Xcompile"
689
$echo "$modename: you must specify a target with \`-o'" 1>&2
693
# Get the name of the library object.
694
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
698
# Recognize several different file suffixes.
699
# If the user specifies -o file.o, it is replaced with file.lo
709
*.class) xform=class ;;
714
*.java) xform=java ;;
717
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
720
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
722
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
727
func_infer_tag $base_compile
729
for arg in $later; do
748
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
749
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
750
if test "X$xdir" = "X$obj"; then
755
lobj=${xdir}$objdir/$objname
757
if test -z "$base_compile"; then
758
$echo "$modename: you must specify a compilation command" 1>&2
763
# Delete any leftover library objects.
764
if test "$build_old_libs" = yes; then
765
removelist="$obj $lobj $libobj ${libobj}T"
767
removelist="$lobj $libobj ${libobj}T"
771
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
773
# On Cygwin there's no "real" PIC flag so we must build both object types
775
cygwin* | mingw* | pw32* | os2*)
779
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
780
# non-PIC code in shared libraries is not supported
784
# Calculate the filename of the output object if compiler does
785
# not support -o with -c
786
if test "$compiler_c_o" = no; then
787
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
788
lockfile="$output_obj.lock"
789
removelist="$removelist $output_obj $lockfile"
790
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
797
# Lock this critical section if it is needed
798
# We use this script file to make the link, it avoids creating a new file
799
if test "$need_locks" = yes; then
800
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
801
$show "Waiting for $lockfile to be removed"
804
elif test "$need_locks" = warn; then
805
if test -f "$lockfile"; then
807
*** ERROR, $lockfile exists and contains:
808
`cat $lockfile 2>/dev/null`
810
This indicates that another process is trying to use the same
811
temporary object file, and libtool could not work around it because
812
your compiler does not support \`-c' and \`-o' together. If you
813
repeat this compilation, it may succeed, by chance, but you had better
814
avoid parallel builds (make -j) in this platform, or get a better
820
$echo $srcfile > "$lockfile"
823
if test -n "$fix_srcfile_path"; then
824
eval srcfile=\"$fix_srcfile_path\"
827
$run $rm "$libobj" "${libobj}T"
829
# Create a libtool object file (analogous to a ".la" file),
830
# but don't create it if we're doing a dry run.
831
test -z "$run" && cat > ${libobj}T <<EOF
832
# $libobj - a libtool object file
833
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
835
# Please DO NOT delete this file!
836
# It is necessary for linking the library.
838
# Name of the PIC object.
841
# Only build a PIC object if we are building libtool libraries.
842
if test "$build_libtool_libs" = yes; then
843
# Without this assignment, base_compile gets emptied.
844
fbsd_hideous_sh_bug=$base_compile
846
if test "$pic_mode" != no; then
847
command="$base_compile $srcfile $pic_flag"
849
# Don't build PIC code
850
command="$base_compile $srcfile"
853
if test ! -d "${xdir}$objdir"; then
854
$show "$mkdir ${xdir}$objdir"
855
$run $mkdir ${xdir}$objdir
857
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
862
if test -z "$output_obj"; then
863
# Place PIC objects in $objdir
864
command="$command -o $lobj"
867
$run $rm "$lobj" "$output_obj"
870
if $run eval "$command"; then :
872
test -n "$output_obj" && $run $rm $removelist
876
if test "$need_locks" = warn &&
877
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
879
*** ERROR, $lockfile contains:
880
`cat $lockfile 2>/dev/null`
882
but it should contain:
885
This indicates that another process is trying to use the same
886
temporary object file, and libtool could not work around it because
887
your compiler does not support \`-c' and \`-o' together. If you
888
repeat this compilation, it may succeed, by chance, but you had better
889
avoid parallel builds (make -j) in this platform, or get a better
896
# Just move the object if needed, then go on to compile the next one
897
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
898
$show "$mv $output_obj $lobj"
899
if $run $mv $output_obj $lobj; then :
907
# Append the name of the PIC object to the libtool object file.
908
test -z "$run" && cat >> ${libobj}T <<EOF
909
pic_object='$objdir/$objname'
913
# Allow error messages only from the first compilation.
914
if test "$suppress_opt" = yes; then
915
suppress_output=' >/dev/null 2>&1'
918
# No PIC object so indicate it doesn't exist in the libtool
920
test -z "$run" && cat >> ${libobj}T <<EOF
926
# Only build a position-dependent object if we build old libraries.
927
if test "$build_old_libs" = yes; then
928
if test "$pic_mode" != yes; then
929
# Don't build PIC code
930
command="$base_compile $srcfile"
932
command="$base_compile $srcfile $pic_flag"
934
if test "$compiler_c_o" = yes; then
935
command="$command -o $obj"
938
# Suppress compiler output if we already did a PIC compilation.
939
command="$command$suppress_output"
940
$run $rm "$obj" "$output_obj"
942
if $run eval "$command"; then :
948
if test "$need_locks" = warn &&
949
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
951
*** ERROR, $lockfile contains:
952
`cat $lockfile 2>/dev/null`
954
but it should contain:
957
This indicates that another process is trying to use the same
958
temporary object file, and libtool could not work around it because
959
your compiler does not support \`-c' and \`-o' together. If you
960
repeat this compilation, it may succeed, by chance, but you had better
961
avoid parallel builds (make -j) in this platform, or get a better
968
# Just move the object if needed
969
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
970
$show "$mv $output_obj $obj"
971
if $run $mv $output_obj $obj; then :
979
# Append the name of the non-PIC object the libtool object file.
980
# Only append if the libtool object file exists.
981
test -z "$run" && cat >> ${libobj}T <<EOF
982
# Name of the non-PIC object.
983
non_pic_object='$objname'
987
# Append the name of the non-PIC object the libtool object file.
988
# Only append if the libtool object file exists.
989
test -z "$run" && cat >> ${libobj}T <<EOF
990
# Name of the non-PIC object.
996
$run $mv "${libobj}T" "${libobj}"
998
# Unlock the critical section if it was locked
999
if test "$need_locks" != no; then
1000
$run $rm "$lockfile"
1008
modename="$modename: link"
1010
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1011
# It is impossible to link a dll without this setting, and
1012
# we shouldn't force the makefile maintainer to figure out
1013
# which system we are compiling for in order to pass an extra
1014
# flag for every libtool invocation.
1015
# allow_undefined=no
1017
# FIXME: Unfortunately, there are problems with the above when trying
1018
# to make a dll which has undefined symbols, in which case not
1019
# even a static library is built. For now, we need to specify
1020
# -no-undefined on the libtool link line when we can be certain
1021
# that all symbols are satisfied, otherwise we get a static library.
1028
libtool_args="$nonopt"
1029
base_compile="$nonopt $@"
1030
compile_command="$nonopt"
1031
finalize_command="$nonopt"
1044
lib_search_path=`pwd`
1053
export_symbols_regex=
1061
precious_files_regex=
1062
prefer_static_libs=no
1075
func_infer_tag $base_compile
1077
# We need to know -static, to get the right output filenames.
1081
-all-static | -static)
1082
if test "X$arg" = "X-all-static"; then
1083
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1084
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1086
if test -n "$link_static_flag"; then
1087
dlopen_self=$dlopen_self_static
1090
if test -z "$pic_flag" && test -n "$link_static_flag"; then
1091
dlopen_self=$dlopen_self_static
1094
build_libtool_libs=no
1096
prefer_static_libs=yes
1102
# See if our shared archives depend on static archives.
1103
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1105
# Go through the arguments, transforming them on the way.
1106
while test "$#" -gt 0; do
1110
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1111
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1115
libtool_args="$libtool_args $qarg"
1117
# If the previous option needs an argument, assign it.
1118
if test -n "$prev"; then
1121
compile_command="$compile_command @OUTPUT@"
1122
finalize_command="$finalize_command @OUTPUT@"
1128
if test "$preload" = no; then
1129
# Add the symbol object into the linking commands.
1130
compile_command="$compile_command @SYMFILE@"
1131
finalize_command="$finalize_command @SYMFILE@"
1135
*.la | *.lo) ;; # We handle these cases below.
1137
if test "$dlself" = no; then
1145
if test "$prev" = dlprefiles; then
1147
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1157
if test "$prev" = dlfiles; then
1158
dlfiles="$dlfiles $arg"
1160
dlprefiles="$dlprefiles $arg"
1168
export_symbols="$arg"
1169
if test ! -f "$arg"; then
1170
$echo "$modename: symbol file \`$arg' does not exist"
1177
export_symbols_regex="$arg"
1182
inst_prefix_dir="$arg"
1187
precious_files_regex="$arg"
1197
if test -f "$arg"; then
1200
for fil in `cat $save_arg`
1202
# moreargs="$moreargs $fil"
1204
# A libtool-controlled object.
1206
# Check to see that this really is a libtool object.
1207
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1212
# If there is no directory component, then add one.
1214
*/* | *\\*) . $arg ;;
1218
if test -z "$pic_object" || \
1219
test -z "$non_pic_object" ||
1220
test "$pic_object" = none && \
1221
test "$non_pic_object" = none; then
1222
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1226
# Extract subdirectory from the argument.
1227
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1228
if test "X$xdir" = "X$arg"; then
1234
if test "$pic_object" != none; then
1235
# Prepend the subdirectory the object is found in.
1236
pic_object="$xdir$pic_object"
1238
if test "$prev" = dlfiles; then
1239
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1240
dlfiles="$dlfiles $pic_object"
1244
# If libtool objects are unsupported, then we need to preload.
1249
# CHECK ME: I think I busted this. -Ossama
1250
if test "$prev" = dlprefiles; then
1251
# Preload the old-style object.
1252
dlprefiles="$dlprefiles $pic_object"
1257
libobjs="$libobjs $pic_object"
1262
if test "$non_pic_object" != none; then
1263
# Prepend the subdirectory the object is found in.
1264
non_pic_object="$xdir$non_pic_object"
1266
# A standard non-PIC object
1267
non_pic_objects="$non_pic_objects $non_pic_object"
1268
if test -z "$pic_object" || test "$pic_object" = none ; then
1269
arg="$non_pic_object"
1273
# Only an error if not doing a dry-run.
1274
if test -z "$run"; then
1275
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1280
# Extract subdirectory from the argument.
1281
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1282
if test "X$xdir" = "X$arg"; then
1288
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1289
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1290
libobjs="$libobjs $pic_object"
1291
non_pic_objects="$non_pic_objects $non_pic_object"
1296
$echo "$modename: link input file \`$save_arg' does not exist"
1304
# We need an absolute path.
1306
[\\/]* | [A-Za-z]:[\\/]*) ;;
1308
$echo "$modename: only absolute run-paths are allowed" 1>&2
1312
if test "$prev" = rpath; then
1315
*) rpath="$rpath $arg" ;;
1320
*) xrpath="$xrpath $arg" ;;
1327
compiler_flags="$compiler_flags $qarg"
1329
compile_command="$compile_command $qarg"
1330
finalize_command="$finalize_command $qarg"
1334
linker_flags="$linker_flags $qarg"
1335
compiler_flags="$compiler_flags $wl$qarg"
1337
compile_command="$compile_command $wl$qarg"
1338
finalize_command="$finalize_command $wl$qarg"
1342
linker_flags="$linker_flags $qarg"
1343
compiler_flags="$compiler_flags $qarg"
1345
compile_command="$compile_command $qarg"
1346
finalize_command="$finalize_command $qarg"
1355
eval "$prev=\"\$arg\""
1360
fi # test -n "$prev"
1366
if test -n "$link_static_flag"; then
1367
compile_command="$compile_command $link_static_flag"
1368
finalize_command="$finalize_command $link_static_flag"
1374
# FIXME: remove this flag sometime in the future.
1375
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1399
-export-symbols | -export-symbols-regex)
1400
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1401
$echo "$modename: more than one -exported-symbols argument is not allowed"
1404
if test "X$arg" = "X-export-symbols"; then
1417
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1418
# so, if we see these flags be careful not to treat them like -L
1420
case $with_gcc/$host in
1421
no/*-*-irix* | /*-*-irix*)
1422
compile_command="$compile_command $arg"
1423
finalize_command="$finalize_command $arg"
1430
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1431
# We need an absolute path.
1433
[\\/]* | [A-Za-z]:[\\/]*) ;;
1435
absdir=`cd "$dir" && pwd`
1436
if test -z "$absdir"; then
1437
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1446
deplibs="$deplibs -L$dir"
1447
lib_search_path="$lib_search_path $dir"
1451
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1452
case :$dllsearchpath: in
1454
*) dllsearchpath="$dllsearchpath:$dir";;
1462
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1464
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1465
# These systems don't actually have a C or math library (as such)
1468
*-*-mingw* | *-*-os2*)
1469
# These systems don't actually have a C library (as such)
1470
test "X$arg" = "X-lc" && continue
1472
*-*-openbsd* | *-*-freebsd*)
1473
# Do not include libc due to us having libc/libc_r.
1474
test "X$arg" = "X-lc" && continue
1476
*-*-rhapsody* | *-*-darwin1.[012])
1477
# Rhapsody C and math libraries are in the System framework
1478
deplibs="$deplibs -framework System"
1481
elif test "X$arg" = "X-lc_r"; then
1483
*-*-openbsd* | *-*-freebsd*)
1484
# Do not include libc_r directly, use -pthread flag.
1489
deplibs="$deplibs $arg"
1493
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1494
deplibs="$deplibs $arg"
1503
# gcc -m* arguments should be passed to the linker via $compiler_flags
1504
# in order to pass architecture information to the linker
1505
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1506
# but this is not reliable with gcc because gcc may use -mfoo to
1507
# select a different linker, different libraries, etc, while
1508
# -Wl,-mfoo simply passes -mfoo to the linker.
1510
# Unknown arguments in both finalize_command and compile_command need
1511
# to be aesthetically quoted because they are evaled later.
1512
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1514
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1518
compile_command="$compile_command $arg"
1519
finalize_command="$finalize_command $arg"
1520
if test "$with_gcc" = "yes" ; then
1521
compiler_flags="$compiler_flags $arg"
1538
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1539
# The PATH hackery in wrapper scripts is required on Windows
1540
# in order for the loader to find any dlls it needs.
1541
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1542
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1545
*) no_install=yes ;;
1562
-precious-files-regex)
1583
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1584
# We need an absolute path.
1586
[\\/]* | [A-Za-z]:[\\/]*) ;;
1588
$echo "$modename: only absolute run-paths are allowed" 1>&2
1594
*) xrpath="$xrpath $dir" ;;
1600
# The effects of -static are defined in a previous loop.
1601
# We used to do the same as -all-static on platforms that
1602
# didn't have a PIC flag, but the assumption that the effects
1603
# would be equivalent was wrong. It would break on at least
1604
# Digital Unix and AIX.
1624
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1626
save_ifs="$IFS"; IFS=','
1627
for flag in $args; do
1630
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1635
compiler_flags="$compiler_flags $flag"
1638
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1642
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1644
save_ifs="$IFS"; IFS=','
1645
for flag in $args; do
1648
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1653
compiler_flags="$compiler_flags $wl$flag"
1654
linker_flags="$linker_flags $flag"
1657
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1675
# Some other compiler flag.
1677
# Unknown arguments in both finalize_command and compile_command need
1678
# to be aesthetically quoted because they are evaled later.
1679
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1681
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1688
# A standard object.
1693
# A libtool-controlled object.
1695
# Check to see that this really is a libtool object.
1696
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1701
# If there is no directory component, then add one.
1703
*/* | *\\*) . $arg ;;
1707
if test -z "$pic_object" || \
1708
test -z "$non_pic_object" ||
1709
test "$pic_object" = none && \
1710
test "$non_pic_object" = none; then
1711
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1715
# Extract subdirectory from the argument.
1716
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1717
if test "X$xdir" = "X$arg"; then
1723
if test "$pic_object" != none; then
1724
# Prepend the subdirectory the object is found in.
1725
pic_object="$xdir$pic_object"
1727
if test "$prev" = dlfiles; then
1728
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1729
dlfiles="$dlfiles $pic_object"
1733
# If libtool objects are unsupported, then we need to preload.
1738
# CHECK ME: I think I busted this. -Ossama
1739
if test "$prev" = dlprefiles; then
1740
# Preload the old-style object.
1741
dlprefiles="$dlprefiles $pic_object"
1746
libobjs="$libobjs $pic_object"
1751
if test "$non_pic_object" != none; then
1752
# Prepend the subdirectory the object is found in.
1753
non_pic_object="$xdir$non_pic_object"
1755
# A standard non-PIC object
1756
non_pic_objects="$non_pic_objects $non_pic_object"
1757
if test -z "$pic_object" || test "$pic_object" = none ; then
1758
arg="$non_pic_object"
1762
# Only an error if not doing a dry-run.
1763
if test -z "$run"; then
1764
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1769
# Extract subdirectory from the argument.
1770
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1771
if test "X$xdir" = "X$arg"; then
1777
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1778
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1779
libobjs="$libobjs $pic_object"
1780
non_pic_objects="$non_pic_objects $non_pic_object"
1787
deplibs="$deplibs $arg"
1788
old_deplibs="$old_deplibs $arg"
1793
# A libtool-controlled library.
1795
if test "$prev" = dlfiles; then
1796
# This library was specified with -dlopen.
1797
dlfiles="$dlfiles $arg"
1799
elif test "$prev" = dlprefiles; then
1800
# The library was specified with -dlpreopen.
1801
dlprefiles="$dlprefiles $arg"
1804
deplibs="$deplibs $arg"
1809
# Some other compiler argument.
1811
# Unknown arguments in both finalize_command and compile_command need
1812
# to be aesthetically quoted because they are evaled later.
1813
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1815
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1822
# Now actually substitute the argument into the commands.
1823
if test -n "$arg"; then
1824
compile_command="$compile_command $arg"
1825
finalize_command="$finalize_command $arg"
1827
done # argument parsing loop
1829
if test -n "$prev"; then
1830
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1835
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1836
eval arg=\"$export_dynamic_flag_spec\"
1837
compile_command="$compile_command $arg"
1838
finalize_command="$finalize_command $arg"
1842
# calculate the name of the file, without its directory
1843
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1844
libobjs_save="$libobjs"
1846
if test -n "$shlibpath_var"; then
1847
# get the directories listed in $shlibpath_var
1848
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1852
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1853
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1855
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1856
if test "X$output_objdir" = "X$output"; then
1857
output_objdir="$objdir"
1859
output_objdir="$output_objdir/$objdir"
1861
# Create the object directory.
1862
if test ! -d "$output_objdir"; then
1863
$show "$mkdir $output_objdir"
1864
$run $mkdir $output_objdir
1866
if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1871
# Determine the type of output
1874
$echo "$modename: you must specify an output file" 1>&2
1878
*.$libext) linkmode=oldlib ;;
1879
*.lo | *.$objext) linkmode=obj ;;
1880
*.la) linkmode=lib ;;
1881
*) linkmode=prog ;; # Anything else should be a program.
1885
*cygwin* | *mingw* | *pw32*)
1886
# don't eliminate duplications in $postdeps and $predeps
1887
duplicate_compiler_generated_deps=yes
1890
duplicate_compiler_generated_deps=$duplicate_deps
1896
# Find all interdependent deplibs by searching for libraries
1897
# that are linked more than once (e.g. -la -lb -la)
1898
for deplib in $deplibs; do
1899
if test "X$duplicate_deps" = "Xyes" ; then
1901
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1904
libs="$libs $deplib"
1907
if test "$linkmode" = lib; then
1908
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1910
# Compute libraries that are listed more than once in $predeps
1911
# $postdeps and mark them as special (i.e., whose duplicates are
1912
# not to be eliminated).
1914
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1915
for pre_post_dep in $predeps $postdeps; do
1916
case "$pre_post_deps " in
1917
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1919
pre_post_deps="$pre_post_deps $pre_post_dep"
1928
need_relink=no # whether we're linking any uninstalled libtool libraries
1929
notinst_deplibs= # not-installed libtool libraries
1930
notinst_path= # paths that contain not-installed libtool libraries
1934
for file in $dlfiles $dlprefiles; do
1938
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1950
passes="conv scan dlopen dlpreopen link"
1955
for pass in $passes; do
1956
if test "$linkmode,$pass" = "lib,link" ||
1957
test "$linkmode,$pass" = "prog,scan"; then
1961
if test "$linkmode" = prog; then
1963
dlopen) libs="$dlfiles" ;;
1964
dlpreopen) libs="$dlprefiles" ;;
1965
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1968
if test "$pass" = dlopen; then
1969
# Collect dlpreopened libraries
1970
save_deplibs="$deplibs"
1973
for deplib in $libs; do
1977
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1978
if test "$linkmode,$pass" = "prog,link"; then
1979
compile_deplibs="$deplib $compile_deplibs"
1980
finalize_deplibs="$deplib $finalize_deplibs"
1982
deplibs="$deplib $deplibs"
1987
if test "$linkmode" != lib && test "$linkmode" != prog; then
1988
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1991
if test "$pass" = conv; then
1992
deplibs="$deplib $deplibs"
1995
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1996
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1997
for search_ext in .la $std_shrext .so .a; do
1998
# Search the libtool library
1999
lib="$searchdir/lib${name}${search_ext}"
2000
if test -f "$lib"; then
2001
if test "$search_ext" = ".la"; then
2010
if test "$found" != yes; then
2011
# deplib doesn't seem to be a libtool library
2012
if test "$linkmode,$pass" = "prog,link"; then
2013
compile_deplibs="$deplib $compile_deplibs"
2014
finalize_deplibs="$deplib $finalize_deplibs"
2016
deplibs="$deplib $deplibs"
2017
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2020
else # deplib is a libtool library
2021
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2022
# We need to do some special things here, and not later.
2023
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2024
case " $predeps $postdeps " in
2026
if (${SED} -e '2q' $lib |
2027
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2031
*/* | *\\*) . $lib ;;
2034
for l in $old_library $library_names; do
2037
if test "X$ll" = "X$old_library" ; then # only static version available
2039
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2040
test "X$ladir" = "X$lib" && ladir="."
2041
lib=$ladir/$old_library
2042
if test "$linkmode,$pass" = "prog,link"; then
2043
compile_deplibs="$deplib $compile_deplibs"
2044
finalize_deplibs="$deplib $finalize_deplibs"
2046
deplibs="$deplib $deplibs"
2047
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2061
deplibs="$deplib $deplibs"
2062
test "$pass" = conv && continue
2063
newdependency_libs="$deplib $newdependency_libs"
2064
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2067
if test "$pass" = conv; then
2068
deplibs="$deplib $deplibs"
2071
if test "$pass" = scan; then
2072
deplibs="$deplib $deplibs"
2074
compile_deplibs="$deplib $compile_deplibs"
2075
finalize_deplibs="$deplib $finalize_deplibs"
2077
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2080
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2086
if test "$pass" = link; then
2087
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2088
# Make sure the xrpath contains only unique directories.
2091
*) xrpath="$xrpath $dir" ;;
2094
deplibs="$deplib $deplibs"
2097
*.la) lib="$deplib" ;;
2099
if test "$pass" = conv; then
2100
deplibs="$deplib $deplibs"
2106
case $deplibs_check_method in
2108
set dummy $deplibs_check_method
2109
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2110
if eval $echo \"$deplib\" 2>/dev/null \
2112
| $EGREP "$match_pattern_regex" > /dev/null; then
2120
if test "$valid_a_lib" != yes; then
2122
$echo "*** Warning: Trying to link with static lib archive $deplib."
2123
$echo "*** I have the capability to make that library automatically link in when"
2124
$echo "*** you link to this library. But I can only do this if you have a"
2125
$echo "*** shared version of the library, which you do not appear to have"
2126
$echo "*** because the file extensions .$libext of this argument makes me believe"
2127
$echo "*** that it is just a static archive that I should not used here."
2130
$echo "*** Warning: Linking the shared library $output against the"
2131
$echo "*** static library $deplib is not portable!"
2132
deplibs="$deplib $deplibs"
2137
if test "$pass" != link; then
2138
deplibs="$deplib $deplibs"
2140
compile_deplibs="$deplib $compile_deplibs"
2141
finalize_deplibs="$deplib $finalize_deplibs"
2148
if test "$pass" = conv; then
2149
deplibs="$deplib $deplibs"
2150
elif test "$linkmode" = prog; then
2151
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2152
# If there is no dlopen support or we're linking statically,
2153
# we need to preload.
2154
newdlprefiles="$newdlprefiles $deplib"
2155
compile_deplibs="$deplib $compile_deplibs"
2156
finalize_deplibs="$deplib $finalize_deplibs"
2158
newdlfiles="$newdlfiles $deplib"
2168
if test "$found" = yes || test -f "$lib"; then :
2170
$echo "$modename: cannot find the library \`$lib'" 1>&2
2174
# Check to see that this really is a libtool archive.
2175
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2177
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2181
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2182
test "X$ladir" = "X$lib" && ladir="."
2190
# If the library was installed with an old release of libtool,
2191
# it will not redefine variables installed, or shouldnotlink
2197
*/* | *\\*) . $lib ;;
2201
if test "$linkmode,$pass" = "lib,link" ||
2202
test "$linkmode,$pass" = "prog,scan" ||
2203
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
2204
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2205
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2208
if test "$pass" = conv; then
2209
# Only check for convenience libraries
2210
deplibs="$lib $deplibs"
2211
if test -z "$libdir"; then
2212
if test -z "$old_library"; then
2213
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2216
# It is a libtool convenience library, so add in its objects.
2217
convenience="$convenience $ladir/$objdir/$old_library"
2218
old_convenience="$old_convenience $ladir/$objdir/$old_library"
2220
for deplib in $dependency_libs; do
2221
deplibs="$deplib $deplibs"
2222
if test "X$duplicate_deps" = "Xyes" ; then
2223
case "$tmp_libs " in
2224
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2227
tmp_libs="$tmp_libs $deplib"
2229
elif test "$linkmode" != prog && test "$linkmode" != lib; then
2230
$echo "$modename: \`$lib' is not a convenience library" 1>&2
2237
# Get the name of the library we link against.
2239
for l in $old_library $library_names; do
2242
if test -z "$linklib"; then
2243
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2247
# This library was specified with -dlopen.
2248
if test "$pass" = dlopen; then
2249
if test -z "$libdir"; then
2250
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2253
if test -z "$dlname" ||
2254
test "$dlopen_support" != yes ||
2255
test "$build_libtool_libs" = no; then
2256
# If there is no dlname, no dlopen support or we're linking
2257
# statically, we need to preload. We also need to preload any
2258
# dependent libraries so libltdl's deplib preloader doesn't
2259
# bomb out in the load deplibs phase.
2260
dlprefiles="$dlprefiles $lib $dependency_libs"
2262
newdlfiles="$newdlfiles $lib"
2267
# We need an absolute path.
2269
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2271
abs_ladir=`cd "$ladir" && pwd`
2272
if test -z "$abs_ladir"; then
2273
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2274
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2279
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2281
# Find the relevant object directory and library name.
2282
if test "X$installed" = Xyes; then
2283
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2284
$echo "$modename: warning: library \`$lib' was moved." 1>&2
2293
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2296
# Remove this search path later
2297
notinst_path="$notinst_path $abs_ladir"
2299
dir="$ladir/$objdir"
2300
absdir="$abs_ladir/$objdir"
2301
# Remove this search path later
2302
notinst_path="$notinst_path $abs_ladir"
2304
fi # $installed = yes
2305
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2307
# This library was specified with -dlpreopen.
2308
if test "$pass" = dlpreopen; then
2309
if test -z "$libdir"; then
2310
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2313
# Prefer using a static library (so that no silly _DYNAMIC symbols
2314
# are required to link).
2315
if test -n "$old_library"; then
2316
newdlprefiles="$newdlprefiles $dir/$old_library"
2317
# Otherwise, use the dlname, so that lt_dlopen finds it.
2318
elif test -n "$dlname"; then
2319
newdlprefiles="$newdlprefiles $dir/$dlname"
2321
newdlprefiles="$newdlprefiles $dir/$linklib"
2323
fi # $pass = dlpreopen
2325
if test -z "$libdir"; then
2326
# Link the convenience library
2327
if test "$linkmode" = lib; then
2328
deplibs="$dir/$old_library $deplibs"
2329
elif test "$linkmode,$pass" = "prog,link"; then
2330
compile_deplibs="$dir/$old_library $compile_deplibs"
2331
finalize_deplibs="$dir/$old_library $finalize_deplibs"
2333
deplibs="$lib $deplibs" # used for prog,scan pass
2339
if test "$linkmode" = prog && test "$pass" != link; then
2340
newlib_search_path="$newlib_search_path $ladir"
2341
deplibs="$lib $deplibs"
2344
if test "$link_all_deplibs" != no || test -z "$library_names" ||
2345
test "$build_libtool_libs" = no; then
2350
for deplib in $dependency_libs; do
2352
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2354
# Need to link against all dependency_libs?
2355
if test "$linkalldeplibs" = yes; then
2356
deplibs="$deplib $deplibs"
2358
# Need to hardcode shared library paths
2359
# or/and link against static libraries
2360
newdependency_libs="$deplib $newdependency_libs"
2362
if test "X$duplicate_deps" = "Xyes" ; then
2363
case "$tmp_libs " in
2364
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2367
tmp_libs="$tmp_libs $deplib"
2370
fi # $linkmode = prog...
2372
if test "$linkmode,$pass" = "prog,link"; then
2373
if test -n "$library_names" &&
2374
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2375
# We need to hardcode the library path
2376
if test -n "$shlibpath_var"; then
2377
# Make sure the rpath contains only unique directories.
2378
case "$temp_rpath " in
2381
*) temp_rpath="$temp_rpath $dir" ;;
2385
# Hardcode the library path.
2386
# Skip directories that are in the system default run-time
2388
case " $sys_lib_dlsearch_path " in
2391
case "$compile_rpath " in
2393
*) compile_rpath="$compile_rpath $absdir"
2397
case " $sys_lib_dlsearch_path " in
2400
case "$finalize_rpath " in
2402
*) finalize_rpath="$finalize_rpath $libdir"
2406
fi # $linkmode,$pass = prog,link...
2408
if test "$alldeplibs" = yes &&
2409
{ test "$deplibs_check_method" = pass_all ||
2410
{ test "$build_libtool_libs" = yes &&
2411
test -n "$library_names"; }; }; then
2412
# We only need to search for static libraries
2417
link_static=no # Whether the deplib will be linked statically
2418
if test -n "$library_names" &&
2419
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2420
if test "$installed" = no; then
2421
notinst_deplibs="$notinst_deplibs $lib"
2424
# This is a shared library
2426
# Warn about portability, can't link against -module's on
2427
# some systems (darwin)
2428
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2430
if test "$linkmode" = prog; then
2431
$echo "*** Warning: Linking the executable $output against the loadable module"
2433
$echo "*** Warning: Linking the shared library $output against the loadable module"
2435
$echo "*** $linklib is not portable!"
2437
if test "$linkmode" = lib &&
2438
test "$hardcode_into_libs" = yes; then
2439
# Hardcode the library path.
2440
# Skip directories that are in the system default run-time
2442
case " $sys_lib_dlsearch_path " in
2445
case "$compile_rpath " in
2447
*) compile_rpath="$compile_rpath $absdir"
2451
case " $sys_lib_dlsearch_path " in
2454
case "$finalize_rpath " in
2456
*) finalize_rpath="$finalize_rpath $libdir"
2462
if test -n "$old_archive_from_expsyms_cmds"; then
2463
# figure out the soname
2464
set dummy $library_names
2467
libname=`eval \\$echo \"$libname_spec\"`
2468
# use dlname if we got it. it's perfectly good, no?
2469
if test -n "$dlname"; then
2471
elif test -n "$soname_spec"; then
2475
major=`expr $current - $age`
2479
eval soname=\"$soname_spec\"
2484
# Make a new name for the extract_expsyms_cmds to use
2486
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2487
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2489
# If the library has no export list, then create one now
2490
if test -f "$output_objdir/$soname-def"; then :
2492
$show "extracting exported symbol list from \`$soname'"
2493
save_ifs="$IFS"; IFS='~'
2494
cmds=$extract_expsyms_cmds
2495
for cmd in $cmds; do
2499
$run eval "$cmd" || exit $?
2505
if test -f "$output_objdir/$newlib"; then :; else
2506
$show "generating import library for \`$soname'"
2507
save_ifs="$IFS"; IFS='~'
2508
cmds=$old_archive_from_expsyms_cmds
2509
for cmd in $cmds; do
2513
$run eval "$cmd" || exit $?
2517
# make sure the library variables are pointing to the new library
2520
fi # test -n "$old_archive_from_expsyms_cmds"
2522
if test "$linkmode" = prog || test "$mode" != relink; then
2527
case $hardcode_action in
2528
immediate | unsupported)
2529
if test "$hardcode_direct" = no; then
2532
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2534
# if the lib is a module then we can not link against
2535
# it, someone is ignoring the new warnings I added
2536
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2537
$echo "** Warning, lib $linklib is a module, not a shared library"
2538
if test -z "$old_library" ; then
2540
$echo "** And there doesn't seem to be a static archive available"
2541
$echo "** The link will probably fail, sorry"
2543
add="$dir/$old_library"
2547
elif test "$hardcode_minus_L" = no; then
2549
*-*-sunos*) add_shlibpath="$dir" ;;
2553
elif test "$hardcode_shlibpath_var" = no; then
2554
add_shlibpath="$dir"
2561
if test "$hardcode_direct" = yes; then
2563
elif test "$hardcode_minus_L" = yes; then
2565
# Try looking first in the location we're being installed to.
2566
if test -n "$inst_prefix_dir"; then
2569
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2574
elif test "$hardcode_shlibpath_var" = yes; then
2575
add_shlibpath="$dir"
2584
if test "$lib_linked" != yes; then
2585
$echo "$modename: configuration error: unsupported hardcode properties"
2589
if test -n "$add_shlibpath"; then
2590
case :$compile_shlibpath: in
2591
*":$add_shlibpath:"*) ;;
2592
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2595
if test "$linkmode" = prog; then
2596
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2597
test -n "$add" && compile_deplibs="$add $compile_deplibs"
2599
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2600
test -n "$add" && deplibs="$add $deplibs"
2601
if test "$hardcode_direct" != yes && \
2602
test "$hardcode_minus_L" != yes && \
2603
test "$hardcode_shlibpath_var" = yes; then
2604
case :$finalize_shlibpath: in
2606
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2612
if test "$linkmode" = prog || test "$mode" = relink; then
2616
# Finalize command for both is simple: just hardcode it.
2617
if test "$hardcode_direct" = yes; then
2618
add="$libdir/$linklib"
2619
elif test "$hardcode_minus_L" = yes; then
2622
elif test "$hardcode_shlibpath_var" = yes; then
2623
case :$finalize_shlibpath: in
2625
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2628
elif test "$hardcode_automatic" = yes; then
2629
if test -n "$inst_prefix_dir" &&
2630
test -f "$inst_prefix_dir$libdir/$linklib" ; then
2631
add="$inst_prefix_dir$libdir/$linklib"
2633
add="$libdir/$linklib"
2636
# We cannot seem to hardcode it, guess we'll fake it.
2638
# Try looking first in the location we're being installed to.
2639
if test -n "$inst_prefix_dir"; then
2642
add_dir="$add_dir -L$inst_prefix_dir$libdir"
2649
if test "$linkmode" = prog; then
2650
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2651
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2653
test -n "$add_dir" && deplibs="$add_dir $deplibs"
2654
test -n "$add" && deplibs="$add $deplibs"
2657
elif test "$linkmode" = prog; then
2658
# Here we assume that one of hardcode_direct or hardcode_minus_L
2659
# is not unsupported. This is valid on all known static and
2661
if test "$hardcode_direct" != unsupported; then
2662
test -n "$old_library" && linklib="$old_library"
2663
compile_deplibs="$dir/$linklib $compile_deplibs"
2664
finalize_deplibs="$dir/$linklib $finalize_deplibs"
2666
compile_deplibs="-l$name -L$dir $compile_deplibs"
2667
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2669
elif test "$build_libtool_libs" = yes; then
2670
# Not a shared library
2671
if test "$deplibs_check_method" != pass_all; then
2672
# We're trying link a shared library against a static one
2673
# but the system doesn't support it.
2675
# Just print a warning and add the library to dependency_libs so
2676
# that the program can be linked against the static library.
2678
$echo "*** Warning: This system can not link to static lib archive $lib."
2679
$echo "*** I have the capability to make that library automatically link in when"
2680
$echo "*** you link to this library. But I can only do this if you have a"
2681
$echo "*** shared version of the library, which you do not appear to have."
2682
if test "$module" = yes; then
2683
$echo "*** But as you try to build a module library, libtool will still create "
2684
$echo "*** a static module, that should work as long as the dlopening application"
2685
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2686
if test -z "$global_symbol_pipe"; then
2688
$echo "*** However, this would only work if libtool was able to extract symbol"
2689
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2690
$echo "*** not find such a program. So, this module is probably useless."
2691
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2693
if test "$build_old_libs" = no; then
2694
build_libtool_libs=module
2697
build_libtool_libs=no
2701
convenience="$convenience $dir/$old_library"
2702
old_convenience="$old_convenience $dir/$old_library"
2703
deplibs="$dir/$old_library $deplibs"
2706
fi # link shared/static library?
2708
if test "$linkmode" = lib; then
2709
if test -n "$dependency_libs" &&
2710
{ test "$hardcode_into_libs" != yes ||
2711
test "$build_old_libs" = yes ||
2712
test "$link_static" = yes; }; then
2713
# Extract -R from dependency_libs
2715
for libdir in $dependency_libs; do
2717
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2719
*" $temp_xrpath "*) ;;
2720
*) xrpath="$xrpath $temp_xrpath";;
2722
*) temp_deplibs="$temp_deplibs $libdir";;
2725
dependency_libs="$temp_deplibs"
2728
newlib_search_path="$newlib_search_path $absdir"
2729
# Link against this library
2730
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2731
# ... and its dependency_libs
2733
for deplib in $dependency_libs; do
2734
newdependency_libs="$deplib $newdependency_libs"
2735
if test "X$duplicate_deps" = "Xyes" ; then
2736
case "$tmp_libs " in
2737
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2740
tmp_libs="$tmp_libs $deplib"
2743
if test "$link_all_deplibs" != no; then
2744
# Add the search paths of all dependency libraries
2745
for deplib in $dependency_libs; do
2747
-L*) path="$deplib" ;;
2749
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2750
test "X$dir" = "X$deplib" && dir="."
2751
# We need an absolute path.
2753
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2755
absdir=`cd "$dir" && pwd`
2756
if test -z "$absdir"; then
2757
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2762
if grep "^installed=no" $deplib > /dev/null; then
2763
path="$absdir/$objdir"
2765
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2766
if test -z "$libdir"; then
2767
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2770
if test "$absdir" != "$libdir"; then
2771
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2778
# we do not want to link against static libs,
2779
# but need to link against shared
2780
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2781
if test -n "$deplibrary_names" ; then
2782
for tmp in $deplibrary_names ; do
2785
if test -f "$path/$depdepl" ; then
2786
depdepl="$path/$depdepl"
2788
# do not add paths which are already there
2789
case " $newlib_search_path " in
2791
*) newlib_search_path="$newlib_search_path $path";;
2804
# Again, we only want to link against shared libraries
2805
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2806
for tmp in $newlib_search_path ; do
2807
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2808
eval depdepl="$tmp/lib$tmp_libs.dylib"
2819
case " $deplibs " in
2821
*) deplibs="$depdepl $deplibs" ;;
2823
case " $deplibs " in
2825
*) deplibs="$deplibs $path" ;;
2828
fi # link_all_deplibs != no
2830
done # for deplib in $libs
2831
dependency_libs="$newdependency_libs"
2832
if test "$pass" = dlpreopen; then
2833
# Link the dlpreopened libraries before other libraries
2834
for deplib in $save_deplibs; do
2835
deplibs="$deplib $deplibs"
2838
if test "$pass" != dlopen; then
2839
if test "$pass" != conv; then
2840
# Make sure lib_search_path contains only unique directories.
2842
for dir in $newlib_search_path; do
2843
case "$lib_search_path " in
2845
*) lib_search_path="$lib_search_path $dir" ;;
2851
if test "$linkmode,$pass" != "prog,link"; then
2854
vars="compile_deplibs finalize_deplibs"
2856
for var in $vars dependency_libs; do
2857
# Add libraries to $var in reverse order
2858
eval tmp_libs=\"\$$var\"
2860
for deplib in $tmp_libs; do
2861
# FIXME: Pedantically, this is the right thing to do, so
2862
# that some nasty dependency loop isn't accidentally
2864
#new_libs="$deplib $new_libs"
2865
# Pragmatically, this seems to cause very few problems in
2868
-L*) new_libs="$deplib $new_libs" ;;
2871
# And here is the reason: when a library appears more
2872
# than once as an explicit dependence of a library, or
2873
# is implicitly linked in more than once by the
2874
# compiler, it is considered special, and multiple
2875
# occurrences thereof are not removed. Compare this
2876
# with having the same library being listed as a
2877
# dependency of multiple other libraries: in this case,
2878
# we know (pedantically, we assume) the library does not
2879
# need to be listed more than once, so we keep only the
2880
# last copy. This is not always right, but it is rare
2881
# enough that we require users that really mean to play
2882
# such unportable linking tricks to link the library
2883
# using -Wl,-lname, so that libtool does not consider it
2884
# for duplicate removal.
2885
case " $specialdeplibs " in
2886
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2888
case " $new_libs " in
2890
*) new_libs="$deplib $new_libs" ;;
2898
for deplib in $new_libs; do
2901
case " $tmp_libs " in
2903
*) tmp_libs="$tmp_libs $deplib" ;;
2906
*) tmp_libs="$tmp_libs $deplib" ;;
2909
eval $var=\"$tmp_libs\"
2912
# Last step: remove runtime libs from dependency_libs
2913
# (they stay in deplibs)
2915
for i in $dependency_libs ; do
2916
case " $predeps $postdeps $compiler_lib_search_path " in
2921
if test -n "$i" ; then
2922
tmp_libs="$tmp_libs $i"
2925
dependency_libs=$tmp_libs
2927
if test "$linkmode" = prog; then
2928
dlfiles="$newdlfiles"
2929
dlprefiles="$newdlprefiles"
2934
if test -n "$deplibs"; then
2935
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2938
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2939
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2942
if test -n "$rpath"; then
2943
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2946
if test -n "$xrpath"; then
2947
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2950
if test -n "$vinfo"; then
2951
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2954
if test -n "$release"; then
2955
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2958
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2959
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2962
# Now set the variables for building old libraries.
2963
build_libtool_libs=no
2965
objs="$objs$old_deplibs"
2969
# Make sure we only generate libraries of the form `libNAME.la'.
2972
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2973
eval shared_ext=\"$shrext_cmds\"
2974
eval libname=\"$libname_spec\"
2977
if test "$module" = no; then
2978
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2982
if test "$need_lib_prefix" != no; then
2983
# Add the "lib" prefix for modules if required
2984
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2985
eval shared_ext=\"$shrext_cmds\"
2986
eval libname=\"$libname_spec\"
2988
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2993
if test -n "$objs"; then
2994
if test "$deplibs_check_method" != pass_all; then
2995
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2999
$echo "*** Warning: Linking the shared library $output against the non-libtool"
3000
$echo "*** objects $objs is not portable!"
3001
libobjs="$libobjs $objs"
3005
if test "$dlself" != no; then
3006
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3010
if test "$#" -gt 2; then
3011
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3016
if test -z "$rpath"; then
3017
if test "$build_libtool_libs" = yes; then
3018
# Building a libtool convenience library.
3019
# Some compilers have problems with a `.al' extension so
3020
# convenience libraries should have the same extension an
3021
# archive normally would.
3022
oldlibs="$output_objdir/$libname.$libext $oldlibs"
3023
build_libtool_libs=convenience
3027
if test -n "$vinfo"; then
3028
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3031
if test -n "$release"; then
3032
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3036
# Parse the version information argument.
3037
save_ifs="$IFS"; IFS=':'
3038
set dummy $vinfo 0 0 0
3041
if test -n "$8"; then
3042
$echo "$modename: too many parameters to \`-version-info'" 1>&2
3047
# convert absolute version numbers to libtool ages
3048
# this retains compatibility with .la files and attempts
3049
# to make the code below a bit more comprehensible
3051
case $vinfo_number in
3055
number_revision="$4"
3057
# There are really only two kinds -- those that
3058
# use the current revision as the major version
3059
# and those that subtract age and use age as
3060
# a minor version. But, then there is irix
3061
# which has an extra 1 added just for fun
3063
case $version_type in
3064
darwin|linux|osf|windows)
3065
current=`expr $number_major + $number_minor`
3067
revision="$number_revision"
3069
freebsd-aout|freebsd-elf|sunos)
3070
current="$number_major"
3071
revision="$number_minor"
3075
current=`expr $number_major + $number_minor - 1`
3077
revision="$number_minor"
3088
# Check that each of the things are valid numbers.
3090
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3092
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3093
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3099
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3101
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3102
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3108
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3110
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3111
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3116
if test "$age" -gt "$current"; then
3117
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3118
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
3122
# Calculate the version variables.
3126
case $version_type in
3130
# Like Linux, but with the current version available in
3131
# verstring for coding it into the library header
3132
major=.`expr $current - $age`
3133
versuffix="$major.$age.$revision"
3134
# Darwin ld doesn't like 0 for these options...
3135
minor_current=`expr $current + 1`
3136
verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3141
versuffix=".$current.$revision";
3146
versuffix=".$current";
3150
major=`expr $current - $age + 1`
3152
case $version_type in
3153
nonstopux) verstring_prefix=nonstopux ;;
3154
*) verstring_prefix=sgi ;;
3156
verstring="$verstring_prefix$major.$revision"
3158
# Add in all the interfaces that we are compatible with.
3160
while test "$loop" -ne 0; do
3161
iface=`expr $revision - $loop`
3162
loop=`expr $loop - 1`
3163
verstring="$verstring_prefix$major.$iface:$verstring"
3166
# Before this point, $major must not contain `.'.
3168
versuffix="$major.$revision"
3172
major=.`expr $current - $age`
3173
versuffix="$major.$age.$revision"
3177
major=.`expr $current - $age`
3178
versuffix=".$current.$age.$revision"
3179
verstring="$current.$age.$revision"
3181
# Add in all the interfaces that we are compatible with.
3183
while test "$loop" -ne 0; do
3184
iface=`expr $current - $loop`
3185
loop=`expr $loop - 1`
3186
verstring="$verstring:${iface}.0"
3189
# Make executables depend on our current version.
3190
verstring="$verstring:${current}.0"
3195
versuffix=".$current.$revision"
3199
# Use '-' rather than '.', since we only want one
3200
# extension on DOS 8.3 filesystems.
3201
major=`expr $current - $age`
3206
$echo "$modename: unknown library version type \`$version_type'" 1>&2
3207
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3212
# Clear the version info if we defaulted, and they specified a release.
3213
if test -z "$vinfo" && test -n "$release"; then
3215
case $version_type in
3217
# we can't check for "0.0" in archive_cmds due to quoting
3218
# problems, so we reset it completely
3225
if test "$need_version" = no; then
3232
# Remove version info from name if versioning should be avoided
3233
if test "$avoid_version" = yes && test "$need_version" = no; then
3239
# Check to see if the archive will have undefined symbols.
3240
if test "$allow_undefined" = yes; then
3241
if test "$allow_undefined_flag" = unsupported; then
3242
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3243
build_libtool_libs=no
3247
# Don't allow undefined symbols.
3248
allow_undefined_flag="$no_undefined_flag"
3252
if test "$mode" != relink; then
3253
# Remove our outputs, but don't remove object files since they
3254
# may have been created when compiling PIC objects.
3256
tempremovelist=`$echo "$output_objdir/*"`
3257
for p in $tempremovelist; do
3261
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3262
if test "X$precious_files_regex" != "X"; then
3263
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3268
removelist="$removelist $p"
3273
if test -n "$removelist"; then
3274
$show "${rm}r $removelist"
3275
$run ${rm}r $removelist
3279
# Now set the variables for building old libraries.
3280
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3281
oldlibs="$oldlibs $output_objdir/$libname.$libext"
3283
# Transform .lo files to .o files.
3284
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3287
# Eliminate all temporary directories.
3288
for path in $notinst_path; do
3289
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3290
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3291
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3294
if test -n "$xrpath"; then
3295
# If the user specified any rpath flags, then add them.
3297
for libdir in $xrpath; do
3298
temp_xrpath="$temp_xrpath -R$libdir"
3299
case "$finalize_rpath " in
3301
*) finalize_rpath="$finalize_rpath $libdir" ;;
3304
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3305
dependency_libs="$temp_xrpath $dependency_libs"
3309
# Make sure dlfiles contains only unique files that won't be dlpreopened
3310
old_dlfiles="$dlfiles"
3312
for lib in $old_dlfiles; do
3313
case " $dlprefiles $dlfiles " in
3315
*) dlfiles="$dlfiles $lib" ;;
3319
# Make sure dlprefiles contains only unique files
3320
old_dlprefiles="$dlprefiles"
3322
for lib in $old_dlprefiles; do
3323
case "$dlprefiles " in
3325
*) dlprefiles="$dlprefiles $lib" ;;
3329
if test "$build_libtool_libs" = yes; then
3330
if test -n "$rpath"; then
3332
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3333
# these systems don't actually have a c library (as such)!
3335
*-*-rhapsody* | *-*-darwin1.[012])
3336
# Rhapsody C library is in the System framework
3337
deplibs="$deplibs -framework System"
3340
# Don't link with libc until the a.out ld.so is fixed.
3342
*-*-openbsd* | *-*-freebsd*)
3343
# Do not include libc due to us having libc/libc_r.
3344
test "X$arg" = "X-lc" && continue
3347
# Add libc to deplibs on all other systems if necessary.
3348
if test "$build_libtool_need_lc" = "yes"; then
3349
deplibs="$deplibs -lc"
3355
# Transform deplibs into only deplibs that can be linked in shared.
3357
libname_save=$libname
3358
release_save=$release
3359
versuffix_save=$versuffix
3361
# I'm not sure if I'm treating the release correctly. I think
3362
# release should show up in the -l (ie -lgmp5) so we don't want to
3363
# add it in twice. Is that correct?
3369
case $deplibs_check_method in
3371
# Don't check for shared/static. Everything works.
3372
# This might be a little naive. We might want to check
3373
# whether the library exists or not. But this is on
3374
# osf3 & osf4 and I'm not really sure... Just
3375
# implementing what was already the behavior.
3379
# This code stresses the "libraries are programs" paradigm to its
3380
# limits. Maybe even breaks it. We compile a program, linking it
3381
# against the deplibs as a proxy for the library. Then we can check
3382
# whether they linked in statically or dynamically with ldd.
3384
cat > conftest.c <<EOF
3385
int main() { return 0; }
3388
$LTCC -o conftest conftest.c $deplibs
3389
if test "$?" -eq 0 ; then
3390
ldd_output=`ldd conftest`
3391
for i in $deplibs; do
3392
name="`expr $i : '-l\(.*\)'`"
3393
# If $name is empty we are operating on a -L argument.
3394
if test "$name" != "" && test "$name" -ne "0"; then
3395
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3396
case " $predeps $postdeps " in
3398
newdeplibs="$newdeplibs $i"
3403
if test -n "$i" ; then
3404
libname=`eval \\$echo \"$libname_spec\"`
3405
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3406
set dummy $deplib_matches
3408
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3409
newdeplibs="$newdeplibs $i"
3413
$echo "*** Warning: dynamic linker does not accept needed library $i."
3414
$echo "*** I have the capability to make that library automatically link in when"
3415
$echo "*** you link to this library. But I can only do this if you have a"
3416
$echo "*** shared version of the library, which I believe you do not have"
3417
$echo "*** because a test_compile did reveal that the linker did not use it for"
3418
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3422
newdeplibs="$newdeplibs $i"
3426
# Error occurred in the first compile. Let's try to salvage
3427
# the situation: Compile a separate program for each library.
3428
for i in $deplibs; do
3429
name="`expr $i : '-l\(.*\)'`"
3430
# If $name is empty we are operating on a -L argument.
3431
if test "$name" != "" && test "$name" != "0"; then
3433
$LTCC -o conftest conftest.c $i
3435
if test "$?" -eq 0 ; then
3436
ldd_output=`ldd conftest`
3437
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3438
case " $predeps $postdeps " in
3440
newdeplibs="$newdeplibs $i"
3445
if test -n "$i" ; then
3446
libname=`eval \\$echo \"$libname_spec\"`
3447
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3448
set dummy $deplib_matches
3450
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3451
newdeplibs="$newdeplibs $i"
3455
$echo "*** Warning: dynamic linker does not accept needed library $i."
3456
$echo "*** I have the capability to make that library automatically link in when"
3457
$echo "*** you link to this library. But I can only do this if you have a"
3458
$echo "*** shared version of the library, which you do not appear to have"
3459
$echo "*** because a test_compile did reveal that the linker did not use this one"
3460
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3466
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3467
$echo "*** make it link in! You will probably need to install it or some"
3468
$echo "*** library that it depends on before this library will be fully"
3469
$echo "*** functional. Installing it before continuing would be even better."
3472
newdeplibs="$newdeplibs $i"
3478
set dummy $deplibs_check_method
3479
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3480
for a_deplib in $deplibs; do
3481
name="`expr $a_deplib : '-l\(.*\)'`"
3482
# If $name is empty we are operating on a -L argument.
3483
if test "$name" != "" && test "$name" != "0"; then
3484
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3485
case " $predeps $postdeps " in
3487
newdeplibs="$newdeplibs $a_deplib"
3492
if test -n "$a_deplib" ; then
3493
libname=`eval \\$echo \"$libname_spec\"`
3494
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3495
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3496
for potent_lib in $potential_libs; do
3497
# Follow soft links.
3498
if ls -lLd "$potent_lib" 2>/dev/null \
3499
| grep " -> " >/dev/null; then
3502
# The statement above tries to avoid entering an
3503
# endless loop below, in case of cyclic links.
3504
# We might still enter an endless loop, since a link
3505
# loop can be closed while we follow links,
3507
potlib="$potent_lib"
3508
while test -h "$potlib" 2>/dev/null; do
3509
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3511
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3512
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3515
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3517
| $EGREP "$file_magic_regex" > /dev/null; then
3518
newdeplibs="$newdeplibs $a_deplib"
3525
if test -n "$a_deplib" ; then
3528
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3529
$echo "*** I have the capability to make that library automatically link in when"
3530
$echo "*** you link to this library. But I can only do this if you have a"
3531
$echo "*** shared version of the library, which you do not appear to have"
3532
$echo "*** because I did check the linker path looking for a file starting"
3533
if test -z "$potlib" ; then
3534
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3536
$echo "*** with $libname and none of the candidates passed a file format test"
3537
$echo "*** using a file magic. Last file checked: $potlib"
3541
# Add a -L argument.
3542
newdeplibs="$newdeplibs $a_deplib"
3544
done # Gone through all deplibs.
3547
set dummy $deplibs_check_method
3548
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3549
for a_deplib in $deplibs; do
3550
name="`expr $a_deplib : '-l\(.*\)'`"
3551
# If $name is empty we are operating on a -L argument.
3552
if test -n "$name" && test "$name" != "0"; then
3553
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3554
case " $predeps $postdeps " in
3556
newdeplibs="$newdeplibs $a_deplib"
3561
if test -n "$a_deplib" ; then
3562
libname=`eval \\$echo \"$libname_spec\"`
3563
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3564
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3565
for potent_lib in $potential_libs; do
3566
potlib="$potent_lib" # see symlink-check above in file_magic test
3567
if eval $echo \"$potent_lib\" 2>/dev/null \
3569
| $EGREP "$match_pattern_regex" > /dev/null; then
3570
newdeplibs="$newdeplibs $a_deplib"
3577
if test -n "$a_deplib" ; then
3580
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3581
$echo "*** I have the capability to make that library automatically link in when"
3582
$echo "*** you link to this library. But I can only do this if you have a"
3583
$echo "*** shared version of the library, which you do not appear to have"
3584
$echo "*** because I did check the linker path looking for a file starting"
3585
if test -z "$potlib" ; then
3586
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3588
$echo "*** with $libname and none of the candidates passed a file format test"
3589
$echo "*** using a regex pattern. Last file checked: $potlib"
3593
# Add a -L argument.
3594
newdeplibs="$newdeplibs $a_deplib"
3596
done # Gone through all deplibs.
3600
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3601
-e 's/ -[LR][^ ]*//g'`
3602
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3603
for i in $predeps $postdeps ; do
3604
# can't use Xsed below, because $i might contain '/'
3605
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3608
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3609
| grep . >/dev/null; then
3611
if test "X$deplibs_check_method" = "Xnone"; then
3612
$echo "*** Warning: inter-library dependencies are not supported in this platform."
3614
$echo "*** Warning: inter-library dependencies are not known to be supported."
3616
$echo "*** All declared inter-library dependencies are being dropped."
3621
versuffix=$versuffix_save
3623
release=$release_save
3624
libname=$libname_save
3628
*-*-rhapsody* | *-*-darwin1.[012])
3629
# On Rhapsody replace the C library is the System framework
3630
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3634
if test "$droppeddeps" = yes; then
3635
if test "$module" = yes; then
3637
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3638
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3639
$echo "*** a static module, that should work as long as the dlopening"
3640
$echo "*** application is linked with the -dlopen flag."
3641
if test -z "$global_symbol_pipe"; then
3643
$echo "*** However, this would only work if libtool was able to extract symbol"
3644
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3645
$echo "*** not find such a program. So, this module is probably useless."
3646
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3648
if test "$build_old_libs" = no; then
3649
oldlibs="$output_objdir/$libname.$libext"
3650
build_libtool_libs=module
3653
build_libtool_libs=no
3656
$echo "*** The inter-library dependencies that have been dropped here will be"
3657
$echo "*** automatically added whenever a program is linked with this library"
3658
$echo "*** or is declared to -dlopen it."
3660
if test "$allow_undefined" = no; then
3662
$echo "*** Since this library must not contain undefined symbols,"
3663
$echo "*** because either the platform does not support them or"
3664
$echo "*** it was explicitly requested with -no-undefined,"
3665
$echo "*** libtool will only create a static version of it."
3666
if test "$build_old_libs" = no; then
3667
oldlibs="$output_objdir/$libname.$libext"
3668
build_libtool_libs=module
3671
build_libtool_libs=no
3676
# Done checking deplibs!
3680
# All the library-specific variables (install_libdir is set above).
3685
# Test again, we may have decided not to build it any more
3686
if test "$build_libtool_libs" = yes; then
3687
if test "$hardcode_into_libs" = yes; then
3688
# Hardcode the library paths
3691
rpath="$finalize_rpath"
3692
test "$mode" != relink && rpath="$compile_rpath$rpath"
3693
for libdir in $rpath; do
3694
if test -n "$hardcode_libdir_flag_spec"; then
3695
if test -n "$hardcode_libdir_separator"; then
3696
if test -z "$hardcode_libdirs"; then
3697
hardcode_libdirs="$libdir"
3699
# Just accumulate the unique libdirs.
3700
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3701
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3704
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3709
eval flag=\"$hardcode_libdir_flag_spec\"
3710
dep_rpath="$dep_rpath $flag"
3712
elif test -n "$runpath_var"; then
3713
case "$perm_rpath " in
3715
*) perm_rpath="$perm_rpath $libdir" ;;
3719
# Substitute the hardcoded libdirs into the rpath.
3720
if test -n "$hardcode_libdir_separator" &&
3721
test -n "$hardcode_libdirs"; then
3722
libdir="$hardcode_libdirs"
3723
if test -n "$hardcode_libdir_flag_spec_ld"; then
3724
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3726
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3729
if test -n "$runpath_var" && test -n "$perm_rpath"; then
3730
# We should set the runpath_var.
3732
for dir in $perm_rpath; do
3735
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3737
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3740
shlibpath="$finalize_shlibpath"
3741
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3742
if test -n "$shlibpath"; then
3743
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3746
# Get the real and link names of the library.
3747
eval shared_ext=\"$shrext_cmds\"
3748
eval library_names=\"$library_names_spec\"
3749
set dummy $library_names
3753
if test -n "$soname_spec"; then
3754
eval soname=\"$soname_spec\"
3758
if test -z "$dlname"; then
3762
lib="$output_objdir/$realname"
3765
linknames="$linknames $link"
3768
# Use standard objects if they are pic
3769
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3771
# Prepare the list of exported symbols
3772
if test -z "$export_symbols"; then
3773
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3774
$show "generating symbol list for \`$libname.la'"
3775
export_symbols="$output_objdir/$libname.exp"
3776
$run $rm $export_symbols
3777
cmds=$export_symbols_cmds
3778
save_ifs="$IFS"; IFS='~'
3779
for cmd in $cmds; do
3782
if len=`expr "X$cmd" : ".*"` &&
3783
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3785
$run eval "$cmd" || exit $?
3786
skipped_export=false
3788
# The command line is too long to execute in one step.
3789
$show "using reloadable object file for export list..."
3794
if test -n "$export_symbols_regex"; then
3795
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3796
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3797
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
3798
$run eval '$mv "${export_symbols}T" "$export_symbols"'
3803
if test -n "$export_symbols" && test -n "$include_expsyms"; then
3804
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3808
for test_deplib in $deplibs; do
3809
case " $convenience " in
3810
*" $test_deplib "*) ;;
3812
tmp_deplibs="$tmp_deplibs $test_deplib"
3816
deplibs="$tmp_deplibs"
3818
if test -n "$convenience"; then
3819
if test -n "$whole_archive_flag_spec"; then
3820
save_libobjs=$libobjs
3821
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3823
gentop="$output_objdir/${outputname}x"
3824
generated="$generated $gentop"
3826
func_extract_archives $gentop $convenience
3827
libobjs="$libobjs $func_extract_archives_result"
3831
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3832
eval flag=\"$thread_safe_flag_spec\"
3833
linker_flags="$linker_flags $flag"
3836
# Make a backup of the uninstalled library when relinking
3837
if test "$mode" = relink; then
3838
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3841
# Do each of the archive commands.
3842
if test "$module" = yes && test -n "$module_cmds" ; then
3843
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3844
eval test_cmds=\"$module_expsym_cmds\"
3845
cmds=$module_expsym_cmds
3847
eval test_cmds=\"$module_cmds\"
3851
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3852
eval test_cmds=\"$archive_expsym_cmds\"
3853
cmds=$archive_expsym_cmds
3855
eval test_cmds=\"$archive_cmds\"
3860
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3861
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3864
# The command line is too long to link in one step, link piecewise.
3865
$echo "creating reloadable object files..."
3867
# Save the value of $output and $libobjs because we want to
3868
# use them later. If we have whole_archive_flag_spec, we
3869
# want to use save_libobjs as it was before
3870
# whole_archive_flag_spec was expanded, because we can't
3871
# assume the linker understands whole_archive_flag_spec.
3872
# This may have to be revisited, in case too many
3873
# convenience libraries get linked in and end up exceeding
3875
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3876
save_libobjs=$libobjs
3880
# Clear the reloadable object creation command queue and
3881
# initialize k to one.
3888
output=$output_objdir/$save_output-${k}.$objext
3889
# Loop over the list of objects to be linked.
3890
for obj in $save_libobjs
3892
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3893
if test "X$objlist" = X ||
3894
{ len=`expr "X$test_cmds" : ".*"` &&
3895
test "$len" -le "$max_cmd_len"; }; then
3896
objlist="$objlist $obj"
3898
# The command $test_cmds is almost too long, add a
3899
# command to the queue.
3900
if test "$k" -eq 1 ; then
3901
# The first file doesn't have a previous command to add.
3902
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3904
# All subsequent reloadable object files will link in
3905
# the last one created.
3906
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3908
last_robj=$output_objdir/$save_output-${k}.$objext
3910
output=$output_objdir/$save_output-${k}.$objext
3915
# Handle the remaining objects by creating one last
3916
# reloadable object file. All subsequent reloadable object
3917
# files will link in the last one created.
3918
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3919
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3921
if ${skipped_export-false}; then
3922
$show "generating symbol list for \`$libname.la'"
3923
export_symbols="$output_objdir/$libname.exp"
3924
$run $rm $export_symbols
3926
# Append the command to create the export file.
3927
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3930
# Set up a command to remove the reloadale object files
3931
# after they are used.
3933
while test "$i" -lt "$k"
3936
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3939
$echo "creating a temporary reloadable object file: $output"
3941
# Loop through the commands generated above and execute them.
3942
save_ifs="$IFS"; IFS='~'
3943
for cmd in $concat_cmds; do
3946
$run eval "$cmd" || exit $?
3951
# Restore the value of output.
3954
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3955
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3957
# Expand the library linking commands again to reset the
3958
# value of $libobjs for piecewise linking.
3960
# Do each of the archive commands.
3961
if test "$module" = yes && test -n "$module_cmds" ; then
3962
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3963
cmds=$module_expsym_cmds
3968
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3969
cmds=$archive_expsym_cmds
3975
# Append the command to remove the reloadable object files
3976
# to the just-reset $cmds.
3977
eval cmds=\"\$cmds~\$rm $delfiles\"
3979
save_ifs="$IFS"; IFS='~'
3980
for cmd in $cmds; do
3984
$run eval "$cmd" || exit $?
3988
# Restore the uninstalled library and exit
3989
if test "$mode" = relink; then
3990
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3994
# Create links to the real library.
3995
for linkname in $linknames; do
3996
if test "$realname" != "$linkname"; then
3997
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3998
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4002
# If -module or -export-dynamic was specified, set the dlname.
4003
if test "$module" = yes || test "$export_dynamic" = yes; then
4004
# On all known operating systems, these are identical.
4011
if test -n "$deplibs"; then
4012
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4015
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4016
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4019
if test -n "$rpath"; then
4020
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4023
if test -n "$xrpath"; then
4024
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4027
if test -n "$vinfo"; then
4028
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4031
if test -n "$release"; then
4032
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4037
if test -n "$objs$old_deplibs"; then
4038
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4042
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4050
# Delete the old objects.
4051
$run $rm $obj $libobj
4053
# Objects from convenience libraries. This assumes
4054
# single-version convenience libraries. Whenever we create
4055
# different ones for PIC/non-PIC, this we'll have to duplicate
4059
# reload_cmds runs $LD directly, so let us get rid of
4060
# -Wl from whole_archive_flag_spec
4063
if test -n "$convenience"; then
4064
if test -n "$whole_archive_flag_spec"; then
4065
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4067
gentop="$output_objdir/${obj}x"
4068
generated="$generated $gentop"
4070
func_extract_archives $gentop $convenience
4071
reload_conv_objs="$reload_objs $func_extract_archives_result"
4075
# Create the old-style object.
4076
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
4080
save_ifs="$IFS"; IFS='~'
4081
for cmd in $cmds; do
4085
$run eval "$cmd" || exit $?
4089
# Exit if we aren't doing a library object file.
4090
if test -z "$libobj"; then
4091
if test -n "$gentop"; then
4092
$show "${rm}r $gentop"
4099
if test "$build_libtool_libs" != yes; then
4100
if test -n "$gentop"; then
4101
$show "${rm}r $gentop"
4105
# Create an invalid libtool object if no PIC, so that we don't
4106
# accidentally link it into a program.
4107
# $show "echo timestamp > $libobj"
4108
# $run eval "echo timestamp > $libobj" || exit $?
4112
if test -n "$pic_flag" || test "$pic_mode" != default; then
4113
# Only do commands if we really have different PIC objects.
4114
reload_objs="$libobjs $reload_conv_objs"
4117
save_ifs="$IFS"; IFS='~'
4118
for cmd in $cmds; do
4122
$run eval "$cmd" || exit $?
4127
if test -n "$gentop"; then
4128
$show "${rm}r $gentop"
4137
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4139
if test -n "$vinfo"; then
4140
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4143
if test -n "$release"; then
4144
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4147
if test "$preload" = yes; then
4148
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4149
test "$dlopen_self_static" = unknown; then
4150
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4155
*-*-rhapsody* | *-*-darwin1.[012])
4156
# On Rhapsody replace the C library is the System framework
4157
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4158
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4164
# Don't allow lazy linking, it breaks C++ global constructors
4165
if test "$tagname" = CXX ; then
4166
compile_command="$compile_command ${wl}-bind_at_load"
4167
finalize_command="$finalize_command ${wl}-bind_at_load"
4172
compile_command="$compile_command $compile_deplibs"
4173
finalize_command="$finalize_command $finalize_deplibs"
4175
if test -n "$rpath$xrpath"; then
4176
# If the user specified any rpath flags, then add them.
4177
for libdir in $rpath $xrpath; do
4178
# This is the magic to use -rpath.
4179
case "$finalize_rpath " in
4181
*) finalize_rpath="$finalize_rpath $libdir" ;;
4186
# Now hardcode the library paths
4189
for libdir in $compile_rpath $finalize_rpath; do
4190
if test -n "$hardcode_libdir_flag_spec"; then
4191
if test -n "$hardcode_libdir_separator"; then
4192
if test -z "$hardcode_libdirs"; then
4193
hardcode_libdirs="$libdir"
4195
# Just accumulate the unique libdirs.
4196
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4197
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4200
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4205
eval flag=\"$hardcode_libdir_flag_spec\"
4206
rpath="$rpath $flag"
4208
elif test -n "$runpath_var"; then
4209
case "$perm_rpath " in
4211
*) perm_rpath="$perm_rpath $libdir" ;;
4215
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4216
case :$dllsearchpath: in
4218
*) dllsearchpath="$dllsearchpath:$libdir";;
4223
# Substitute the hardcoded libdirs into the rpath.
4224
if test -n "$hardcode_libdir_separator" &&
4225
test -n "$hardcode_libdirs"; then
4226
libdir="$hardcode_libdirs"
4227
eval rpath=\" $hardcode_libdir_flag_spec\"
4229
compile_rpath="$rpath"
4233
for libdir in $finalize_rpath; do
4234
if test -n "$hardcode_libdir_flag_spec"; then
4235
if test -n "$hardcode_libdir_separator"; then
4236
if test -z "$hardcode_libdirs"; then
4237
hardcode_libdirs="$libdir"
4239
# Just accumulate the unique libdirs.
4240
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4241
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4244
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4249
eval flag=\"$hardcode_libdir_flag_spec\"
4250
rpath="$rpath $flag"
4252
elif test -n "$runpath_var"; then
4253
case "$finalize_perm_rpath " in
4255
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4259
# Substitute the hardcoded libdirs into the rpath.
4260
if test -n "$hardcode_libdir_separator" &&
4261
test -n "$hardcode_libdirs"; then
4262
libdir="$hardcode_libdirs"
4263
eval rpath=\" $hardcode_libdir_flag_spec\"
4265
finalize_rpath="$rpath"
4267
if test -n "$libobjs" && test "$build_old_libs" = yes; then
4268
# Transform all the library objects into standard objects.
4269
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4270
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4274
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4275
if test -n "$NM" && test -n "$global_symbol_pipe"; then
4276
dlsyms="${outputname}S.c"
4278
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4282
if test -n "$dlsyms"; then
4286
# Discover the nlist of each of the dlfiles.
4287
nlist="$output_objdir/${outputname}.nm"
4289
$show "$rm $nlist ${nlist}S ${nlist}T"
4290
$run $rm "$nlist" "${nlist}S" "${nlist}T"
4292
# Parse the name list into a source file.
4293
$show "creating $output_objdir/$dlsyms"
4295
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4296
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4297
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4303
/* Prevent the only kind of declaration conflicts we can make. */
4304
#define lt_preloaded_symbols some_other_symbol
4306
/* External symbol declarations for the compiler. */\
4309
if test "$dlself" = yes; then
4310
$show "generating symbol list for \`$output'"
4312
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4314
# Add our own program objects to the symbol list.
4315
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4316
for arg in $progfiles; do
4317
$show "extracting global C symbols from \`$arg'"
4318
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4321
if test -n "$exclude_expsyms"; then
4322
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4323
$run eval '$mv "$nlist"T "$nlist"'
4326
if test -n "$export_symbols_regex"; then
4327
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4328
$run eval '$mv "$nlist"T "$nlist"'
4331
# Prepare the list of exported symbols
4332
if test -z "$export_symbols"; then
4333
export_symbols="$output_objdir/$output.exp"
4334
$run $rm $export_symbols
4335
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4337
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4338
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4339
$run eval 'mv "$nlist"T "$nlist"'
4343
for arg in $dlprefiles; do
4344
$show "extracting global C symbols from \`$arg'"
4345
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4346
$run eval '$echo ": $name " >> "$nlist"'
4347
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4350
if test -z "$run"; then
4351
# Make sure we have at least an empty file.
4352
test -f "$nlist" || : > "$nlist"
4354
if test -n "$exclude_expsyms"; then
4355
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4356
$mv "$nlist"T "$nlist"
4359
# Try sorting and uniquifying the output.
4360
if grep -v "^: " < "$nlist" |
4361
if sort -k 3 </dev/null >/dev/null 2>&1; then
4366
uniq > "$nlist"S; then
4369
grep -v "^: " < "$nlist" > "$nlist"S
4372
if test -f "$nlist"S; then
4373
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4375
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
4378
$echo >> "$output_objdir/$dlsyms" "\
4380
#undef lt_preloaded_symbols
4382
#if defined (__STDC__) && __STDC__
4383
# define lt_ptr void *
4385
# define lt_ptr char *
4389
/* The mapping between symbol names and symbols. */
4394
lt_preloaded_symbols[] =
4398
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4400
$echo >> "$output_objdir/$dlsyms" "\
4404
/* This works around a problem in FreeBSD linker */
4405
#ifdef FREEBSD_WORKAROUND
4406
static const void *lt_preloaded_setup() {
4407
return lt_preloaded_symbols;
4417
pic_flag_for_symtable=
4419
# compiling the symbol table file with pic_flag works around
4420
# a FreeBSD bug that causes programs to crash when -lm is
4421
# linked before any other PIC object. But we must not use
4422
# pic_flag when linking with -static. The problem exists in
4423
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4424
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4425
case "$compile_command " in
4427
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4430
case "$compile_command " in
4432
*) pic_flag_for_symtable=" $pic_flag";;
4436
# Now compile the dynamic symbol file.
4437
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4438
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4440
# Clean up the generated files.
4441
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4442
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4444
# Transform the symbol file into the correct name.
4445
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4446
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4449
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4454
# We keep going just in case the user didn't refer to
4455
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4456
# really was required.
4458
# Nullify the symbol file.
4459
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4460
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4463
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4464
# Replace the output file specification.
4465
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4466
link_command="$compile_command$compile_rpath"
4468
# We have no uninstalled library dependencies, so finalize right now.
4469
$show "$link_command"
4470
$run eval "$link_command"
4473
# Delete the generated files.
4474
if test -n "$dlsyms"; then
4475
$show "$rm $output_objdir/${outputname}S.${objext}"
4476
$run $rm "$output_objdir/${outputname}S.${objext}"
4482
if test -n "$shlibpath_var"; then
4483
# We should set the shlibpath_var
4485
for dir in $temp_rpath; do
4487
[\\/]* | [A-Za-z]:[\\/]*)
4492
# Relative path: add a thisdir entry.
4493
rpath="$rpath\$thisdir/$dir:"
4500
if test -n "$compile_shlibpath$finalize_shlibpath"; then
4501
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4503
if test -n "$finalize_shlibpath"; then
4504
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4509
if test -n "$runpath_var"; then
4510
if test -n "$perm_rpath"; then
4511
# We should set the runpath_var.
4513
for dir in $perm_rpath; do
4516
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4518
if test -n "$finalize_perm_rpath"; then
4519
# We should set the runpath_var.
4521
for dir in $finalize_perm_rpath; do
4524
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4528
if test "$no_install" = yes; then
4529
# We don't need to create a wrapper script.
4530
link_command="$compile_var$compile_command$compile_rpath"
4531
# Replace the output file specification.
4532
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4533
# Delete the old output file.
4535
# Link the executable and exit
4536
$show "$link_command"
4537
$run eval "$link_command" || exit $?
4541
if test "$hardcode_action" = relink; then
4542
# Fast installation is not supported
4543
link_command="$compile_var$compile_command$compile_rpath"
4544
relink_command="$finalize_var$finalize_command$finalize_rpath"
4546
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4547
$echo "$modename: \`$output' will be relinked during installation" 1>&2
4549
if test "$fast_install" != no; then
4550
link_command="$finalize_var$compile_command$finalize_rpath"
4551
if test "$fast_install" = yes; then
4552
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4554
# fast_install is set to needless
4558
link_command="$compile_var$compile_command$compile_rpath"
4559
relink_command="$finalize_var$finalize_command$finalize_rpath"
4563
# Replace the output file specification.
4564
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4566
# Delete the old output files.
4567
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4569
$show "$link_command"
4570
$run eval "$link_command" || exit $?
4572
# Now create the wrapper script.
4573
$show "creating $output"
4575
# Quote the relink command for shipping.
4576
if test -n "$relink_command"; then
4577
# Preserve any variables that may affect compiler behavior
4578
for var in $variables_saved_for_relink; do
4579
if eval test -z \"\${$var+set}\"; then
4580
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4581
elif eval var_value=\$$var; test -z "$var_value"; then
4582
relink_command="$var=; export $var; $relink_command"
4584
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4585
relink_command="$var=\"$var_value\"; export $var; $relink_command"
4588
relink_command="(cd `pwd`; $relink_command)"
4589
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4592
# Quote $echo for shipping.
4593
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4595
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4596
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4598
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4600
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4603
# Only actually do things if our run command is non-null.
4604
if test -z "$run"; then
4605
# win32 will think the script is a binary if it has
4606
# a .exe suffix, so we strip it off here.
4608
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4610
# test for cygwin because mv fails w/o .exe extensions
4614
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4618
*cygwin* | *mingw* )
4619
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4620
cwrapper=`$echo ${output}.exe`
4621
$rm $cwrappersource $cwrapper
4622
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4624
cat > $cwrappersource <<EOF
4626
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4627
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4629
The $output program cannot be directly executed until all the libtool
4630
libraries that it depends on are installed.
4632
This wrapper executable should never be moved out of the build directory.
4633
If it is, it will not operate correctly.
4635
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4636
but could eventually absorb all of the scripts functionality and
4637
exec $objdir/$outputname directly.
4640
cat >> $cwrappersource<<"EOF"
4648
#if defined(PATH_MAX)
4649
# define LT_PATHMAX PATH_MAX
4650
#elif defined(MAXPATHLEN)
4651
# define LT_PATHMAX MAXPATHLEN
4653
# define LT_PATHMAX 1024
4656
#ifndef DIR_SEPARATOR
4657
#define DIR_SEPARATOR '/'
4660
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4662
#define HAVE_DOS_BASED_FILE_SYSTEM
4663
#ifndef DIR_SEPARATOR_2
4664
#define DIR_SEPARATOR_2 '\\'
4668
#ifndef DIR_SEPARATOR_2
4669
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4670
#else /* DIR_SEPARATOR_2 */
4671
# define IS_DIR_SEPARATOR(ch) \
4672
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4673
#endif /* DIR_SEPARATOR_2 */
4675
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4676
#define XFREE(stale) do { \
4677
if (stale) { free ((void *) stale); stale = 0; } \
4680
const char *program_name = NULL;
4682
void * xmalloc (size_t num);
4683
char * xstrdup (const char *string);
4684
char * basename (const char *name);
4685
char * fnqualify(const char *path);
4686
char * strendzap(char *str, const char *pat);
4687
void lt_fatal (const char *message, ...);
4690
main (int argc, char *argv[])
4695
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4696
newargz = XMALLOC(char *, argc+2);
4699
cat >> $cwrappersource <<EOF
4700
newargz[0] = "$SHELL";
4703
cat >> $cwrappersource <<"EOF"
4704
newargz[1] = fnqualify(argv[0]);
4705
/* we know the script has the same name, without the .exe */
4706
/* so make sure newargz[1] doesn't end in .exe */
4707
strendzap(newargz[1],".exe");
4708
for (i = 1; i < argc; i++)
4709
newargz[i+1] = xstrdup(argv[i]);
4710
newargz[argc+1] = NULL;
4713
cat >> $cwrappersource <<EOF
4714
execv("$SHELL",newargz);
4717
cat >> $cwrappersource <<"EOF"
4721
xmalloc (size_t num)
4723
void * p = (void *) malloc (num);
4725
lt_fatal ("Memory exhausted");
4731
xstrdup (const char *string)
4733
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4738
basename (const char *name)
4742
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4743
/* Skip over the disk name in MSDOS pathnames. */
4744
if (isalpha (name[0]) && name[1] == ':')
4748
for (base = name; *name; name++)
4749
if (IS_DIR_SEPARATOR (*name))
4751
return (char *) base;
4755
fnqualify(const char *path)
4759
char tmp[LT_PATHMAX + 1];
4761
assert(path != NULL);
4763
/* Is it qualified already? */
4764
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4765
if (isalpha (path[0]) && path[1] == ':')
4766
return xstrdup (path);
4768
if (IS_DIR_SEPARATOR (path[0]))
4769
return xstrdup (path);
4771
/* prepend the current directory */
4772
/* doesn't handle '~' */
4773
if (getcwd (tmp, LT_PATHMAX) == NULL)
4774
lt_fatal ("getcwd failed");
4775
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4776
p = XMALLOC(char, size);
4777
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4782
strendzap(char *str, const char *pat)
4786
assert(str != NULL);
4787
assert(pat != NULL);
4790
patlen = strlen(pat);
4794
str += len - patlen;
4795
if (strcmp(str, pat) == 0)
4802
lt_error_core (int exit_status, const char * mode,
4803
const char * message, va_list ap)
4805
fprintf (stderr, "%s: %s: ", program_name, mode);
4806
vfprintf (stderr, message, ap);
4807
fprintf (stderr, ".\n");
4809
if (exit_status >= 0)
4814
lt_fatal (const char *message, ...)
4817
va_start (ap, message);
4818
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4822
# we should really use a build-platform specific compiler
4823
# here, but OTOH, the wrappers (shell script and this C one)
4824
# are only useful if you want to execute the "real" binary.
4825
# Since the "real" binary is built for $host, then this
4826
# wrapper might as well be built for $host, too.
4827
$run $LTCC -s -o $cwrapper $cwrappersource
4831
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4836
# $output - temporary wrapper script for $objdir/$outputname
4837
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4839
# The $output program cannot be directly executed until all the libtool
4840
# libraries that it depends on are installed.
4842
# This wrapper script should never be moved out of the build directory.
4843
# If it is, it will not operate correctly.
4845
# Sed substitution that helps us do robust quoting. It backslashifies
4846
# metacharacters that are still active within double-quoted strings.
4847
Xsed='${SED} -e 1s/^X//'
4848
sed_quote_subst='$sed_quote_subst'
4850
# The HP-UX ksh and POSIX shell print the target directory to stdout
4852
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4854
relink_command=\"$relink_command\"
4856
# This environment variable determines our operation mode.
4857
if test \"\$libtool_install_magic\" = \"$magic\"; then
4858
# install mode needs the following variable:
4859
notinst_deplibs='$notinst_deplibs'
4861
# When we are sourced in execute mode, \$file and \$echo are already set.
4862
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4865
# Make sure echo works.
4866
if test \"X\$1\" = X--no-reexec; then
4867
# Discard the --no-reexec flag, and continue.
4869
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4870
# Yippee, \$echo works!
4873
# Restart under the correct shell, and then maybe \$echo will work.
4874
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4880
# Find the directory that this script lives in.
4881
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4882
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4884
# Follow symbolic links until we get to the real thisdir.
4885
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4886
while test -n \"\$file\"; do
4887
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4889
# If there was a directory component, then change thisdir.
4890
if test \"x\$destdir\" != \"x\$file\"; then
4891
case \"\$destdir\" in
4892
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4893
*) thisdir=\"\$thisdir/\$destdir\" ;;
4897
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4898
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4901
# Try to get the absolute directory name.
4902
absdir=\`cd \"\$thisdir\" && pwd\`
4903
test -n \"\$absdir\" && thisdir=\"\$absdir\"
4906
if test "$fast_install" = yes; then
4908
program=lt-'$outputname'$exeext
4909
progdir=\"\$thisdir/$objdir\"
4911
if test ! -f \"\$progdir/\$program\" || \\
4912
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4913
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4915
file=\"\$\$-\$program\"
4917
if test ! -d \"\$progdir\"; then
4918
$mkdir \"\$progdir\"
4920
$rm \"\$progdir/\$file\"
4925
# relink executable if necessary
4926
if test -n \"\$relink_command\"; then
4927
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4929
$echo \"\$relink_command_output\" >&2
4930
$rm \"\$progdir/\$file\"
4935
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4936
{ $rm \"\$progdir/\$program\";
4937
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4938
$rm \"\$progdir/\$file\"
4942
program='$outputname'
4943
progdir=\"\$thisdir/$objdir\"
4949
if test -f \"\$progdir/\$program\"; then"
4951
# Export our shlibpath_var if we have one.
4952
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4954
# Add our own library path to $shlibpath_var
4955
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4957
# Some systems cannot cope with colon-terminated $shlibpath_var
4958
# The second colon is a workaround for a bug in BeOS R4 sed
4959
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4961
export $shlibpath_var
4965
# fixup the dll searchpath if we need to.
4966
if test -n "$dllsearchpath"; then
4968
# Add the dll search path components to the executable PATH
4969
PATH=$dllsearchpath:\$PATH
4974
if test \"\$libtool_execute_magic\" != \"$magic\"; then
4975
# Run the actual program with our arguments.
4978
# Backslashes separate directories on plain windows
4979
*-*-mingw | *-*-os2*)
4981
exec \$progdir\\\\\$program \${1+\"\$@\"}
4987
exec \$progdir/\$program \${1+\"\$@\"}
4992
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4996
# The program doesn't exist.
4997
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4998
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4999
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
5010
# See if we need to build an old-fashioned archive.
5011
for oldlib in $oldlibs; do
5013
if test "$build_libtool_libs" = convenience; then
5014
oldobjs="$libobjs_save"
5015
addlibs="$convenience"
5016
build_libtool_libs=no
5018
if test "$build_libtool_libs" = module; then
5019
oldobjs="$libobjs_save"
5020
build_libtool_libs=no
5022
oldobjs="$old_deplibs $non_pic_objects"
5024
addlibs="$old_convenience"
5027
if test -n "$addlibs"; then
5028
gentop="$output_objdir/${outputname}x"
5029
generated="$generated $gentop"
5031
func_extract_archives $gentop $addlibs
5032
oldobjs="$oldobjs $func_extract_archives_result"
5035
# Do each command in the archive commands.
5036
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5037
cmds=$old_archive_from_new_cmds
5039
eval cmds=\"$old_archive_cmds\"
5041
if len=`expr "X$cmds" : ".*"` &&
5042
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5043
cmds=$old_archive_cmds
5045
# the command line is too long to link in one step, link in parts
5046
$echo "using piecewise archive linking..."
5051
save_oldobjs=$oldobjs
5052
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5053
# encoded into archives. This makes 'ar r' malfunction in
5054
# this piecewise linking case whenever conflicting object
5055
# names appear in distinct ar calls; check, warn and compensate.
5056
if (for obj in $save_oldobjs
5058
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5059
done | sort | sort -uc >/dev/null 2>&1); then
5062
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5063
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5066
# Is there a better way of finding the last object in the list?
5067
for obj in $save_oldobjs
5071
for obj in $save_oldobjs
5073
oldobjs="$objlist $obj"
5074
objlist="$objlist $obj"
5075
eval test_cmds=\"$old_archive_cmds\"
5076
if len=`expr "X$test_cmds" : ".*"` &&
5077
test "$len" -le "$max_cmd_len"; then
5080
# the above command should be used before it gets too long
5082
if test "$obj" = "$last_oldobj" ; then
5085
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5086
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5092
if test "X$oldobjs" = "X" ; then
5093
eval cmds=\"\$concat_cmds\"
5095
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5099
save_ifs="$IFS"; IFS='~'
5100
for cmd in $cmds; do
5104
$run eval "$cmd" || exit $?
5109
if test -n "$generated"; then
5110
$show "${rm}r$generated"
5111
$run ${rm}r$generated
5114
# Now create the libtool archive.
5118
test "$build_old_libs" = yes && old_library="$libname.$libext"
5119
$show "creating $output"
5121
# Preserve any variables that may affect compiler behavior
5122
for var in $variables_saved_for_relink; do
5123
if eval test -z \"\${$var+set}\"; then
5124
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5125
elif eval var_value=\$$var; test -z "$var_value"; then
5126
relink_command="$var=; export $var; $relink_command"
5128
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5129
relink_command="$var=\"$var_value\"; export $var; $relink_command"
5132
# Quote the link command for shipping.
5133
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5134
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5135
if test "$hardcode_automatic" = yes ; then
5140
# Only create the output if not a dry run.
5141
if test -z "$run"; then
5142
for installed in no yes; do
5143
if test "$installed" = yes; then
5144
if test -z "$install_libdir"; then
5147
output="$output_objdir/$outputname"i
5148
# Replace all uninstalled libtool libraries with the installed ones
5150
for deplib in $dependency_libs; do
5153
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5154
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5155
if test -z "$libdir"; then
5156
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5159
newdependency_libs="$newdependency_libs $libdir/$name"
5161
*) newdependency_libs="$newdependency_libs $deplib" ;;
5164
dependency_libs="$newdependency_libs"
5166
for lib in $dlfiles; do
5167
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5168
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5169
if test -z "$libdir"; then
5170
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5173
newdlfiles="$newdlfiles $libdir/$name"
5175
dlfiles="$newdlfiles"
5177
for lib in $dlprefiles; do
5178
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5179
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5180
if test -z "$libdir"; then
5181
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5184
newdlprefiles="$newdlprefiles $libdir/$name"
5186
dlprefiles="$newdlprefiles"
5189
for lib in $dlfiles; do
5191
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5192
*) abs=`pwd`"/$lib" ;;
5194
newdlfiles="$newdlfiles $abs"
5196
dlfiles="$newdlfiles"
5198
for lib in $dlprefiles; do
5200
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5201
*) abs=`pwd`"/$lib" ;;
5203
newdlprefiles="$newdlprefiles $abs"
5205
dlprefiles="$newdlprefiles"
5208
# place dlname in correct position for cygwin
5210
case $host,$output,$installed,$module,$dlname in
5211
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5214
# $outputname - a libtool library file
5215
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5217
# Please DO NOT delete this file!
5218
# It is necessary for linking the library.
5220
# The name that we can dlopen(3).
5223
# Names of this library.
5224
library_names='$library_names'
5226
# The name of the static archive.
5227
old_library='$old_library'
5229
# Libraries that this one depends upon.
5230
dependency_libs='$dependency_libs'
5232
# Version information for $libname.
5237
# Is this an already installed library?
5238
installed=$installed
5240
# Should we warn about portability when linking against -modules?
5241
shouldnotlink=$module
5243
# Files to dlopen/dlpreopen
5245
dlpreopen='$dlprefiles'
5247
# Directory that this library needs to be installed in:
5248
libdir='$install_libdir'"
5249
if test "$installed" = no && test "$need_relink" = yes; then
5251
relink_command=\"$relink_command\""
5256
# Do a symbolic link so that the libtool archive can be found in
5257
# LD_LIBRARY_PATH before the program is installed.
5258
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5259
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5265
# libtool install mode
5267
modename="$modename: install"
5269
# There may be an optional sh(1) argument at the beginning of
5270
# install_prog (especially on Windows NT).
5271
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5272
# Allow the use of GNU shtool's install command.
5273
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5274
# Aesthetically quote it.
5275
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5277
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5281
install_prog="$arg "
5289
# The real first argument should be the name of the installation program.
5290
# Aesthetically quote it.
5291
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5293
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5297
install_prog="$install_prog$arg"
5299
# We need to accept at least all the BSD install flags.
5309
if test -n "$dest"; then
5310
files="$files $dest"
5328
# If the previous option needed an argument, then skip it.
5329
if test -n "$prev"; then
5338
# Aesthetically quote the argument.
5339
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5341
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5345
install_prog="$install_prog $arg"
5348
if test -z "$install_prog"; then
5349
$echo "$modename: you must specify an install program" 1>&2
5354
if test -n "$prev"; then
5355
$echo "$modename: the \`$prev' option requires an argument" 1>&2
5360
if test -z "$files"; then
5361
if test -z "$dest"; then
5362
$echo "$modename: no file or destination specified" 1>&2
5364
$echo "$modename: you must specify a destination" 1>&2
5370
# Strip any trailing slash from the destination.
5371
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5373
# Check to see that the destination is a directory.
5374
test -d "$dest" && isdir=yes
5375
if test "$isdir" = yes; then
5379
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5380
test "X$destdir" = "X$dest" && destdir=.
5381
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5383
# Not a directory, so check to see that there is only one file specified.
5385
if test "$#" -gt 2; then
5386
$echo "$modename: \`$dest' is not a directory" 1>&2
5392
[\\/]* | [A-Za-z]:[\\/]*) ;;
5394
for file in $files; do
5398
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5407
# This variable tells wrapper scripts just to set variables rather
5408
# than running their programs.
5409
libtool_install_magic="$magic"
5414
for file in $files; do
5416
# Do each installation.
5419
# Do the static libraries later.
5420
staticlibs="$staticlibs $file"
5424
# Check to see that this really is a libtool archive.
5425
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5427
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5435
# If there is no directory component, then add one.
5437
*/* | *\\*) . $file ;;
5441
# Add the libdir to current_libdirs if it is the destination.
5442
if test "X$destdir" = "X$libdir"; then
5443
case "$current_libdirs " in
5445
*) current_libdirs="$current_libdirs $libdir" ;;
5448
# Note the libdir as a future libdir.
5449
case "$future_libdirs " in
5451
*) future_libdirs="$future_libdirs $libdir" ;;
5455
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5456
test "X$dir" = "X$file/" && dir=
5459
if test -n "$relink_command"; then
5460
# Determine the prefix the user has applied to our future dir.
5461
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5463
# Don't allow the user to place us outside of our expected
5464
# location b/c this prevents finding dependent libraries that
5465
# are installed to the same prefix.
5466
# At present, this check doesn't affect windows .dll's that
5467
# are installed into $libdir/../bin (currently, that works fine)
5468
# but it's something to keep an eye on.
5469
if test "$inst_prefix_dir" = "$destdir"; then
5470
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5474
if test -n "$inst_prefix_dir"; then
5475
# Stick the inst_prefix_dir data into the link command.
5476
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5478
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5481
$echo "$modename: warning: relinking \`$file'" 1>&2
5482
$show "$relink_command"
5483
if $run eval "$relink_command"; then :
5485
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5490
# See the names of the shared library.
5491
set dummy $library_names
5492
if test -n "$2"; then
5498
test -n "$relink_command" && srcname="$realname"T
5500
# Install the shared library and build the symlinks.
5501
$show "$install_prog $dir/$srcname $destdir/$realname"
5502
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5503
if test -n "$stripme" && test -n "$striplib"; then
5504
$show "$striplib $destdir/$realname"
5505
$run eval "$striplib $destdir/$realname" || exit $?
5508
if test "$#" -gt 0; then
5509
# Delete the old symlinks, and create new ones.
5512
if test "$linkname" != "$realname"; then
5513
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5514
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5519
# Do each command in the postinstall commands.
5520
lib="$destdir/$realname"
5521
cmds=$postinstall_cmds
5522
save_ifs="$IFS"; IFS='~'
5523
for cmd in $cmds; do
5527
$run eval "$cmd" || exit $?
5532
# Install the pseudo-library for information purposes.
5533
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5534
instname="$dir/$name"i
5535
$show "$install_prog $instname $destdir/$name"
5536
$run eval "$install_prog $instname $destdir/$name" || exit $?
5538
# Maybe install the static library, too.
5539
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5543
# Install (i.e. copy) a libtool object.
5545
# Figure out destination file name, if it wasn't already specified.
5546
if test -n "$destname"; then
5547
destfile="$destdir/$destname"
5549
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5550
destfile="$destdir/$destfile"
5553
# Deduce the name of the destination old-style object file.
5556
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5559
staticdest="$destfile"
5563
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5569
# Install the libtool object if requested.
5570
if test -n "$destfile"; then
5571
$show "$install_prog $file $destfile"
5572
$run eval "$install_prog $file $destfile" || exit $?
5575
# Install the old object if enabled.
5576
if test "$build_old_libs" = yes; then
5577
# Deduce the name of the old-style object file.
5578
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5580
$show "$install_prog $staticobj $staticdest"
5581
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
5587
# Figure out destination file name, if it wasn't already specified.
5588
if test -n "$destname"; then
5589
destfile="$destdir/$destname"
5591
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5592
destfile="$destdir/$destfile"
5595
# If the file is missing, and there is a .exe on the end, strip it
5596
# because it is most likely a libtool script we actually want to
5601
if test ! -f "$file"; then
5602
file=`$echo $file|${SED} 's,.exe$,,'`
5608
# Do a test to see if this is really a libtool program.
5611
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5617
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5621
# To insure that "foo" is sourced, and not "foo.exe",
5622
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5623
# which disallows the automatic-append-.exe behavior.
5625
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5626
*) wrapperdot=${wrapper} ;;
5628
# If there is no directory component, then add one.
5630
*/* | *\\*) . ${wrapperdot} ;;
5631
*) . ./${wrapperdot} ;;
5634
# Check the variables that should have been set.
5635
if test -z "$notinst_deplibs"; then
5636
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5641
for lib in $notinst_deplibs; do
5642
# Check to see that each library is installed.
5644
if test -f "$lib"; then
5645
# If there is no directory component, then add one.
5647
*/* | *\\*) . $lib ;;
5651
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5652
if test -n "$libdir" && test ! -f "$libfile"; then
5653
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5659
# To insure that "foo" is sourced, and not "foo.exe",
5660
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5661
# which disallows the automatic-append-.exe behavior.
5663
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5664
*) wrapperdot=${wrapper} ;;
5666
# If there is no directory component, then add one.
5668
*/* | *\\*) . ${wrapperdot} ;;
5669
*) . ./${wrapperdot} ;;
5673
if test "$fast_install" = no && test -n "$relink_command"; then
5674
if test "$finalize" = yes && test -z "$run"; then
5676
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5677
tmpdir="$tmpdir/libtool-$$"
5680
if $mkdir "$tmpdir"; then
5684
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5687
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5688
outputname="$tmpdir/$file"
5689
# Replace the output file specification.
5690
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5692
$show "$relink_command"
5693
if $run eval "$relink_command"; then :
5695
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5701
$echo "$modename: warning: cannot relink \`$file'" 1>&2
5704
# Install the binary that we compiled earlier.
5705
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5709
# remove .exe since cygwin /usr/bin/install will append another
5711
case $install_prog,$host in
5712
*/usr/bin/install*,*cygwin*)
5713
case $file:$destfile in
5718
destfile=$destfile.exe
5721
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5726
$show "$install_prog$stripme $file $destfile"
5727
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5728
test -n "$outputname" && ${rm}r "$tmpdir"
5733
for file in $staticlibs; do
5734
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5736
# Set up the ranlib parameters.
5737
oldlib="$destdir/$name"
5739
$show "$install_prog $file $oldlib"
5740
$run eval "$install_prog \$file \$oldlib" || exit $?
5742
if test -n "$stripme" && test -n "$old_striplib"; then
5743
$show "$old_striplib $oldlib"
5744
$run eval "$old_striplib $oldlib" || exit $?
5747
# Do each command in the postinstall commands.
5748
cmds=$old_postinstall_cmds
5749
save_ifs="$IFS"; IFS='~'
5750
for cmd in $cmds; do
5754
$run eval "$cmd" || exit $?
5759
if test -n "$future_libdirs"; then
5760
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5763
if test -n "$current_libdirs"; then
5764
# Maybe just do a dry run.
5765
test -n "$run" && current_libdirs=" -n$current_libdirs"
5766
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5772
# libtool finish mode
5774
modename="$modename: finish"
5778
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5781
libdirs="$libdirs $dir"
5784
for libdir in $libdirs; do
5785
if test -n "$finish_cmds"; then
5786
# Do each command in the finish commands.
5788
save_ifs="$IFS"; IFS='~'
5789
for cmd in $cmds; do
5793
$run eval "$cmd" || admincmds="$admincmds
5798
if test -n "$finish_eval"; then
5799
# Do the single finish_eval.
5800
eval cmds=\"$finish_eval\"
5801
$run eval "$cmds" || admincmds="$admincmds
5807
# Exit here if they wanted silent mode.
5808
test "$show" = : && exit $EXIT_SUCCESS
5810
$echo "----------------------------------------------------------------------"
5811
$echo "Libraries have been installed in:"
5812
for libdir in $libdirs; do
5816
$echo "If you ever happen to want to link against installed libraries"
5817
$echo "in a given directory, LIBDIR, you must either use libtool, and"
5818
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5819
$echo "flag during linking and do at least one of the following:"
5820
if test -n "$shlibpath_var"; then
5821
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5822
$echo " during execution"
5824
if test -n "$runpath_var"; then
5825
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5826
$echo " during linking"
5828
if test -n "$hardcode_libdir_flag_spec"; then
5830
eval flag=\"$hardcode_libdir_flag_spec\"
5832
$echo " - use the \`$flag' linker flag"
5834
if test -n "$admincmds"; then
5835
$echo " - have your system administrator run these commands:$admincmds"
5837
if test -f /etc/ld.so.conf; then
5838
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5841
$echo "See any operating system documentation about shared libraries for"
5842
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
5843
$echo "----------------------------------------------------------------------"
5847
# libtool execute mode
5849
modename="$modename: execute"
5851
# The first argument is the command name.
5853
if test -z "$cmd"; then
5854
$echo "$modename: you must specify a COMMAND" 1>&2
5859
# Handle -dlopen flags immediately.
5860
for file in $execute_dlfiles; do
5861
if test ! -f "$file"; then
5862
$echo "$modename: \`$file' is not a file" 1>&2
5870
# Check to see that this really is a libtool archive.
5871
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5873
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5878
# Read the libtool library.
5882
# If there is no directory component, then add one.
5884
*/* | *\\*) . $file ;;
5888
# Skip this library if it cannot be dlopened.
5889
if test -z "$dlname"; then
5890
# Warn if it was a shared library.
5891
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5895
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5896
test "X$dir" = "X$file" && dir=.
5898
if test -f "$dir/$objdir/$dlname"; then
5901
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5907
# Just add the directory containing the .lo file.
5908
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5909
test "X$dir" = "X$file" && dir=.
5913
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5918
# Get the absolute pathname.
5919
absdir=`cd "$dir" && pwd`
5920
test -n "$absdir" && dir="$absdir"
5922
# Now add the directory to shlibpath_var.
5923
if eval "test -z \"\$$shlibpath_var\""; then
5924
eval "$shlibpath_var=\"\$dir\""
5926
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5930
# This variable tells wrapper scripts just to set shlibpath_var
5931
# rather than running their programs.
5932
libtool_execute_magic="$magic"
5934
# Check if any of the arguments is a wrapper script.
5941
# Do a test to see if this is really a libtool program.
5942
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5943
# If there is no directory component, then add one.
5945
*/* | *\\*) . $file ;;
5949
# Transform arg to wrapped name.
5950
file="$progdir/$program"
5954
# Quote arguments (to preserve shell metacharacters).
5955
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5956
args="$args \"$file\""
5959
if test -z "$run"; then
5960
if test -n "$shlibpath_var"; then
5961
# Export the shlibpath_var.
5962
eval "export $shlibpath_var"
5965
# Restore saved environment variables
5966
if test "${save_LC_ALL+set}" = set; then
5967
LC_ALL="$save_LC_ALL"; export LC_ALL
5969
if test "${save_LANG+set}" = set; then
5970
LANG="$save_LANG"; export LANG
5973
# Now prepare to actually exec the command.
5974
exec_cmd="\$cmd$args"
5976
# Display what would be done.
5977
if test -n "$shlibpath_var"; then
5978
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5979
$echo "export $shlibpath_var"
5986
# libtool clean and uninstall mode
5988
modename="$modename: $mode"
5994
# This variable tells wrapper scripts just to set variables rather
5995
# than running their programs.
5996
libtool_install_magic="$magic"
6001
-f) rm="$rm $arg"; rmforce=yes ;;
6002
-*) rm="$rm $arg" ;;
6003
*) files="$files $arg" ;;
6007
if test -z "$rm"; then
6008
$echo "$modename: you must specify an RM program" 1>&2
6015
origobjdir="$objdir"
6016
for file in $files; do
6017
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6018
if test "X$dir" = "X$file"; then
6020
objdir="$origobjdir"
6022
objdir="$dir/$origobjdir"
6024
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6025
test "$mode" = uninstall && objdir="$dir"
6027
# Remember objdir for removal later, being careful to avoid duplicates
6028
if test "$mode" = clean; then
6031
*) rmdirs="$rmdirs $objdir" ;;
6035
# Don't error if the file doesn't exist and rm -f was used.
6036
if (test -L "$file") >/dev/null 2>&1 \
6037
|| (test -h "$file") >/dev/null 2>&1 \
6038
|| test -f "$file"; then
6040
elif test -d "$file"; then
6043
elif test "$rmforce" = yes; then
6051
# Possibly a libtool archive, so verify it.
6052
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6055
# Delete the libtool libraries and symlinks.
6056
for n in $library_names; do
6057
rmfiles="$rmfiles $objdir/$n"
6059
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6060
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6062
if test "$mode" = uninstall; then
6063
if test -n "$library_names"; then
6064
# Do each command in the postuninstall commands.
6065
cmds=$postuninstall_cmds
6066
save_ifs="$IFS"; IFS='~'
6067
for cmd in $cmds; do
6072
if test "$?" -ne 0 && test "$rmforce" != yes; then
6079
if test -n "$old_library"; then
6080
# Do each command in the old_postuninstall commands.
6081
cmds=$old_postuninstall_cmds
6082
save_ifs="$IFS"; IFS='~'
6083
for cmd in $cmds; do
6088
if test "$?" -ne 0 && test "$rmforce" != yes; then
6094
# FIXME: should reinstall the best remaining shared library.
6100
# Possibly a libtool object, so verify it.
6101
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6106
# Add PIC object to the list of files to remove.
6107
if test -n "$pic_object" \
6108
&& test "$pic_object" != none; then
6109
rmfiles="$rmfiles $dir/$pic_object"
6112
# Add non-PIC object to the list of files to remove.
6113
if test -n "$non_pic_object" \
6114
&& test "$non_pic_object" != none; then
6115
rmfiles="$rmfiles $dir/$non_pic_object"
6121
if test "$mode" = clean ; then
6125
file=`$echo $file|${SED} 's,.exe$,,'`
6126
noexename=`$echo $name|${SED} 's,.exe$,,'`
6127
# $file with .exe has already been added to rmfiles,
6128
# add $file without .exe
6129
rmfiles="$rmfiles $file"
6132
# Do a test to see if this is a libtool program.
6133
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6137
# note $name still contains .exe if it was in $file originally
6138
# as does the version of $file that was added into $rmfiles
6139
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6140
if test "$fast_install" = yes && test -n "$relink_command"; then
6141
rmfiles="$rmfiles $objdir/lt-$name"
6143
if test "X$noexename" != "X$name" ; then
6144
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6150
$show "$rm $rmfiles"
6151
$run $rm $rmfiles || exit_status=1
6153
objdir="$origobjdir"
6155
# Try to remove the ${objdir}s in the directories where we deleted files
6156
for dir in $rmdirs; do
6157
if test -d "$dir"; then
6159
$run rmdir $dir >/dev/null 2>&1
6167
$echo "$modename: you must specify a MODE" 1>&2
6168
$echo "$generic_help" 1>&2
6173
if test -z "$exec_cmd"; then
6174
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6175
$echo "$generic_help" 1>&2
6178
fi # test -z "$show_help"
6180
if test -n "$exec_cmd"; then
6185
# We need to display help for each of the modes.
6188
"Usage: $modename [OPTION]... [MODE-ARG]...
6190
Provide generalized library-building support services.
6192
--config show all configuration variables
6193
--debug enable verbose shell tracing
6194
-n, --dry-run display commands without modifying any files
6195
--features display basic configuration information and exit
6196
--finish same as \`--mode=finish'
6197
--help display this help message and exit
6198
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6199
--quiet same as \`--silent'
6200
--silent don't print informational messages
6201
--tag=TAG use configuration variables from tag TAG
6202
--version print version information
6204
MODE must be one of the following:
6206
clean remove files from the build directory
6207
compile compile a source file into a libtool object
6208
execute automatically set library path, then run a program
6209
finish complete the installation of libtool libraries
6210
install install libraries or executables
6211
link create a library or an executable
6212
uninstall remove libraries from an installed directory
6214
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6215
a more detailed description of MODE.
6217
Report bugs to <bug-libtool@gnu.org>."
6223
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6225
Remove files from the build directory.
6227
RM is the name of the program to use to delete files associated with each FILE
6228
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6231
If FILE is a libtool library, object or program, all the files associated
6232
with it are deleted. Otherwise, only FILE itself is deleted using RM."
6237
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6239
Compile a source file into a libtool library object.
6241
This mode accepts the following additional options:
6243
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
6244
-prefer-pic try to building PIC objects only
6245
-prefer-non-pic try to building non-PIC objects only
6246
-static always build a \`.o' file suitable for static linking
6248
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6249
from the given SOURCEFILE.
6251
The output file name is determined by removing the directory component from
6252
SOURCEFILE, then substituting the C source code suffix \`.c' with the
6253
library object suffix, \`.lo'."
6258
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6260
Automatically set library path, then run a program.
6262
This mode accepts the following additional options:
6264
-dlopen FILE add the directory containing FILE to the library path
6266
This mode sets the library path environment variable according to \`-dlopen'
6269
If any of the ARGS are libtool executable wrappers, then they are translated
6270
into their corresponding uninstalled binary, and any of their required library
6271
directories are added to the library path.
6273
Then, COMMAND is executed, with ARGS as arguments."
6278
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6280
Complete the installation of libtool libraries.
6282
Each LIBDIR is a directory that contains libtool libraries.
6284
The commands that this mode executes may require superuser privileges. Use
6285
the \`--dry-run' option if you just want to see what would be executed."
6290
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6292
Install executables or libraries.
6294
INSTALL-COMMAND is the installation command. The first component should be
6295
either the \`install' or \`cp' program.
6297
The rest of the components are interpreted as arguments to that command (only
6298
BSD-compatible install options are recognized)."
6303
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6305
Link object files or libraries together to form another library, or to
6306
create an executable program.
6308
LINK-COMMAND is a command using the C compiler that you would use to create
6309
a program from several object files.
6311
The following components of LINK-COMMAND are treated specially:
6313
-all-static do not do any dynamic linking at all
6314
-avoid-version do not add a version suffix if possible
6315
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6316
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6317
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6318
-export-symbols SYMFILE
6319
try to export only the symbols listed in SYMFILE
6320
-export-symbols-regex REGEX
6321
try to export only the symbols matching REGEX
6322
-LLIBDIR search LIBDIR for required installed libraries
6323
-lNAME OUTPUT-FILE requires the installed library libNAME
6324
-module build a library that can dlopened
6325
-no-fast-install disable the fast-install mode
6326
-no-install link a not-installable executable
6327
-no-undefined declare that a library does not refer to external symbols
6328
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6329
-objectlist FILE Use a list of object files found in FILE to specify objects
6330
-precious-files-regex REGEX
6331
don't remove output files matching REGEX
6332
-release RELEASE specify package release information
6333
-rpath LIBDIR the created library will eventually be installed in LIBDIR
6334
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6335
-static do not do any dynamic linking of libtool libraries
6336
-version-info CURRENT[:REVISION[:AGE]]
6337
specify library version info [each variable defaults to 0]
6339
All other options (arguments beginning with \`-') are ignored.
6341
Every other argument is treated as a filename. Files ending in \`.la' are
6342
treated as uninstalled libtool libraries, other files are standard or library
6345
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6346
only library objects (\`.lo' files) may be specified, and \`-rpath' is
6347
required, except when creating a convenience library.
6349
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6350
using \`ar' and \`ranlib', or on Windows using \`lib'.
6352
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6353
is created, otherwise an executable program is created."
6358
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6360
Remove libraries from an installation directory.
6362
RM is the name of the program to use to delete files associated with each FILE
6363
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6366
If FILE is a libtool library, all the files associated with it are deleted.
6367
Otherwise, only FILE itself is deleted using RM."
6371
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6378
$echo "Try \`$modename --help' for more information about other modes."
6382
# The TAGs below are defined such that we never get into a situation
6383
# in which we disable both kinds of libraries. Given conflicting
6384
# choices, we go for a static library, that is the most portable,
6385
# since we can't tell whether shared libraries were disabled because
6386
# the user asked for that or because the platform doesn't support
6387
# them. This is particularly important on AIX, because we don't
6388
# support having both static and shared libraries enabled at the same
6389
# time on that platform, so we default to a shared-only configuration.
6390
# If a disable-shared tag is given, we'll fallback to a static-only
6391
# configuration. But we'll never go from static-only to shared-only.
6393
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6394
build_libtool_libs=no
6396
# ### END LIBTOOL TAG CONFIG: disable-shared
6398
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6399
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6400
# ### END LIBTOOL TAG CONFIG: disable-static