18
18
# You should have received a copy of the GNU General Public License
19
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.
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
22
# As a special exception to the GNU General Public License, if you
23
23
# distribute this file as part of a program that contains a
24
24
# configuration script generated by Autoconf, you may include it under
25
25
# the same distribution terms that you use for the rest of that program.
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30
# is ksh but when the shell is invoked as "sh" and the current value of
31
# the _XPG environment variable is not equal to 1 (one), the special
32
# positional parameter $0, within a function call, is the name of the
36
# The name of this program:
37
progname=`echo "$progpath" | $SED $basename`
47
TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)"
49
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
50
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
53
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
54
# is contrary to our usage. Disable this feature.
55
alias -g '${1+"$@"}'='"$@"'
58
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
60
BIN_SH=xpg4; export BIN_SH # for Tru64
61
DUALCASE=1; export DUALCASE # for MKS sh
27
63
# Check that we have a working $echo.
28
64
if test "X$1" = X--no-reexec; then
29
65
# Discard the --no-reexec flag, and continue.
114
147
lo2o="s/\\.lo\$/.${objext}/"
115
148
o2lo="s/\\.${objext}\$/.lo/"
152
#####################################
153
# Shell function definitions:
154
# This seems to be the best place for them
156
# func_mktempdir [string]
157
# Make a temporary directory that won't clash with other running
158
# libtool processes, and avoids race conditions if possible. If
159
# given, STRING is the basename for that directory.
162
my_template="${TMPDIR-/tmp}/${1-$progname}"
164
if test "$run" = ":"; then
165
# Return a directory name, but don't create it in dry-run mode
166
my_tmpdir="${my_template}-$$"
169
# If mktemp works, use that first and foremost
170
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
172
if test ! -d "$my_tmpdir"; then
173
# Failing that, at least try and use $RANDOM to avoid a race
174
my_tmpdir="${my_template}-${RANDOM-0}$$"
176
save_mktempdir_umask=`umask`
179
umask $save_mktempdir_umask
182
# If we're not in dry-run mode, bomb out on failure
183
test -d "$my_tmpdir" || {
184
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
189
$echo "X$my_tmpdir" | $Xsed
193
# func_win32_libid arg
194
# return the library type of file 'arg'
196
# Need a lot of goo to handle *both* DLLs and import libs
197
# Has to be a shell function in order to 'eat' the argument
198
# that is supplied when $file_magic_command is called.
201
win32_libid_type="unknown"
202
win32_fileres=`file -L $1 2>/dev/null`
203
case $win32_fileres in
204
*ar\ archive\ import\ library*) # definitely import
205
win32_libid_type="x86 archive import"
207
*ar\ archive*) # could be an import, or static
208
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
209
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
210
win32_nmres=`eval $NM -f posix -A $1 | \
219
import*) win32_libid_type="x86 archive import";;
220
*) win32_libid_type="x86 archive static";;
225
win32_libid_type="x86 DLL"
227
*executable*) # but shell scripts are "executable" too...
228
case $win32_fileres in
229
*MS\ Windows\ PE\ Intel*)
230
win32_libid_type="x86 DLL"
235
$echo $win32_libid_type
240
# Infer tagged configuration to use if any are available and
241
# if one wasn't chosen via the "--tag" command line option.
242
# Only attempt this if the compiler in the base compile
243
# command doesn't match the default compiler.
244
# arg is usually of the form 'gcc ...'
247
if test -n "$available_tags" && test -z "$tagname"; then
251
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
255
CC_quoted="$CC_quoted $arg"
258
# Blanks in the command may have been stripped by the calling shell,
259
# but not from the CC environment variable when configure was run.
260
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
261
# Blanks at the start of $base_compile will cause this to fail
262
# if we don't check for them as well.
264
for z in $available_tags; do
265
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
266
# Evaluate the configuration.
267
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
270
# Double-quote args containing other shell metacharacters.
272
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
276
CC_quoted="$CC_quoted $arg"
279
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
280
# The compiler in the base compile command matches
281
# the one in the tagged configuration.
282
# Assume this is the tagged configuration we want.
289
# If $tagname still isn't set, then no tagged configuration
290
# was found and let the user know that the "--tag" command
291
# line option must be used.
292
if test -z "$tagname"; then
293
$echo "$modename: unable to infer tagged configuration"
294
$echo "$modename: specify a tag with \`--tag'" 1>&2
297
# $echo "$modename: using $tagname tagged configuration"
305
# func_extract_an_archive dir oldlib
306
func_extract_an_archive ()
308
f_ex_an_ar_dir="$1"; shift
309
f_ex_an_ar_oldlib="$1"
311
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
312
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
313
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
316
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
321
# func_extract_archives gentop oldlib ...
322
func_extract_archives ()
324
my_gentop="$1"; shift
332
$show "${rm}r $my_gentop"
333
$run ${rm}r "$my_gentop"
334
$show "$mkdir $my_gentop"
335
$run $mkdir "$my_gentop"
337
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
341
for my_xlib in $my_oldlibs; do
342
# Extract the objects.
344
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
345
*) my_xabs=`pwd`"/$my_xlib" ;;
347
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
350
case " $extracted_archives " in
352
extracted_serial=`expr $extracted_serial + 1`
353
my_xlib_u=lt$extracted_serial-$my_xlib ;;
357
extracted_archives="$extracted_archives $my_xlib_u"
358
my_xdir="$my_gentop/$my_xlib_u"
360
$show "${rm}r $my_xdir"
361
$run ${rm}r "$my_xdir"
362
$show "$mkdir $my_xdir"
363
$run $mkdir "$my_xdir"
365
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
370
$show "Extracting $my_xabs"
371
# Do not bother doing anything if just a dry run
372
if test -z "$run"; then
373
darwin_orig_dir=`pwd`
374
cd $my_xdir || exit $?
375
darwin_archive=$my_xabs
377
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
378
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
379
if test -n "$darwin_arches"; then
380
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
382
$show "$darwin_base_archive has multiple architectures $darwin_arches"
383
for darwin_arch in $darwin_arches ; do
384
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
385
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
386
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
387
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
389
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
390
done # $darwin_arches
391
## Okay now we have a bunch of thin objects, gotta fatten them up :)
392
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
395
for darwin_file in $darwin_filelist; do
396
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
397
lipo -create -output "$darwin_file" $darwin_files
398
done # $darwin_filelist
400
cd "$darwin_orig_dir"
402
cd "$darwin_orig_dir"
403
func_extract_an_archive "$my_xdir" "$my_xabs"
408
func_extract_an_archive "$my_xdir" "$my_xabs"
411
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
413
func_extract_archives_result="$my_oldobjs"
415
# End of Shell function definitions
416
#####################################
419
eval std_shrext=\"$shrext_cmds\"
117
423
# Parse our command line options once, thoroughly.
424
while test "$#" -gt 0
281
652
modename="$modename: compile"
282
653
# Get the compilation command and the source file.
655
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
295
# Aesthetically quote the previous argument.
297
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
300
# Double-quote args containing other shell metacharacters.
301
# Many Bourne shells cannot handle close brackets correctly
302
# in scan sets, so we specify it separately.
303
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
308
# Add the previous argument to base_compile.
309
if test -z "$base_compile"; then
310
base_compile="$lastarg"
312
base_compile="$base_compile $lastarg"
318
# Accept any command-line options.
321
if test "$user_target" != "no"; then
322
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
349
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
351
save_ifs="$IFS"; IFS=','
355
# Double-quote args containing other shell metacharacters.
356
# Many Bourne shells cannot handle close brackets correctly
357
# in scan sets, so we specify it separately.
359
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
363
lastarg="$lastarg $arg"
366
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
368
# Add the arguments to base_compile.
369
if test -z "$base_compile"; then
370
base_compile="$lastarg"
372
base_compile="$base_compile $lastarg"
380
# The next one is the -o target name
385
# We got the output file
666
# do not "continue". Instead, add this to base_compile
392
# Accept the current argument as the source file.
678
# Accept any command-line options.
681
if test -n "$libobj" ; then
682
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
689
-static | -prefer-pic | -prefer-non-pic)
700
arg_mode=arg # the next one goes into the "base_compile" arg list
701
continue # The current "srcfile" will either be retained or
702
;; # replaced later. I would guess that would be a bug.
705
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
707
save_ifs="$IFS"; IFS=','
711
# Double-quote args containing other shell metacharacters.
712
# Many Bourne shells cannot handle close brackets correctly
713
# in scan sets, so we specify it separately.
715
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
719
lastarg="$lastarg $arg"
722
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
724
# Add the arguments to base_compile.
725
base_compile="$base_compile $lastarg"
730
# Accept the current argument as the source file.
731
# The previous "srcfile" becomes the current argument.
738
esac # case $arg_mode
396
740
# Aesthetically quote the previous argument.
398
# Backslashify any backslashes, double quotes, and dollar signs.
399
# These are the only characters that are still specially
400
# interpreted inside of double-quoted scrings.
401
741
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
403
744
# Double-quote args containing other shell metacharacters.
404
745
# Many Bourne shells cannot handle close brackets correctly
405
# in scan sets, so we specify it separately.
746
# in scan sets, and some SunOS ksh mistreat backslash-escaping
747
# in scan sets (worked around with variable expansion),
748
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
749
# at all, so we specify them separately.
407
750
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
408
751
lastarg="\"$lastarg\""
412
# Add the previous argument to base_compile.
413
if test -z "$base_compile"; then
414
base_compile="$lastarg"
416
base_compile="$base_compile $lastarg"
755
base_compile="$base_compile $lastarg"
760
$echo "$modename: you must specify an argument for -Xcompile"
764
$echo "$modename: you must specify a target with \`-o'" 1>&2
424
768
# Get the name of the library object.
425
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
428
$echo "$modename: you must specify a target with \`-o'" 1>&2
769
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
433
773
# Recognize several different file suffixes.
434
774
# If the user specifies -o file.o, it is replaced with file.lo
437
777
*.ada) xform=ada ;;
438
778
*.adb) xform=adb ;;
594
981
$run $rm $removelist
598
985
# Just move the object if needed, then go on to compile the next one
599
if test x"$output_obj" != x"$libobj"; then
600
$show "$mv $output_obj $libobj"
601
if $run $mv $output_obj $libobj; then :
609
# If we have no pic_flag, then copy the object into place and finish.
610
if (test -z "$pic_flag" || test "$pic_mode" != default) &&
611
test "$build_old_libs" = yes; then
612
# Rename the .lo from within objdir to obj
613
if test -f $obj; then
618
$show "$mv $libobj $obj"
619
if $run $mv $libobj $obj; then :
626
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
627
if test "X$xdir" = "X$obj"; then
632
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
633
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
634
# Now arrange that obj and lo_libobj become the same file
635
$show "(cd $xdir && $LN_S $baseobj $libobj)"
636
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
637
# Unlock the critical section if it was locked
638
if test "$need_locks" != no; then
986
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
987
$show "$mv $output_obj $lobj"
988
if $run $mv $output_obj $lobj; then :
996
# Append the name of the PIC object to the libtool object file.
997
test -z "$run" && cat >> ${libobj}T <<EOF
998
pic_object='$objdir/$objname'
649
1002
# Allow error messages only from the first compilation.
650
suppress_output=' >/dev/null 2>&1'
1003
if test "$suppress_opt" = yes; then
1004
suppress_output=' >/dev/null 2>&1'
1007
# No PIC object so indicate it doesn't exist in the libtool
1009
test -z "$run" && cat >> ${libobj}T <<EOF
653
1015
# Only build a position-dependent object if we build old libraries.
654
1016
if test "$build_old_libs" = yes; then
655
1017
if test "$pic_mode" != yes; then
656
1018
# Don't build PIC code
657
command="$base_compile $srcfile"
1019
command="$base_compile $qsrcfile"
659
# All platforms use -DPIC, to notify preprocessed assembler code.
660
command="$base_compile $srcfile $pic_flag -DPIC"
1021
command="$base_compile $qsrcfile $pic_flag"
662
1023
if test "$compiler_c_o" = yes; then
663
1024
command="$command -o $obj"
667
1027
# Suppress compiler output if we already did a PIC compilation.
668
1028
command="$command$suppress_output"
669
$run $rm "$output_obj"
1029
$run $rm "$obj" "$output_obj"
670
1030
$show "$command"
671
1031
if $run eval "$command"; then :
673
1033
$run $rm $removelist
677
1037
if test "$need_locks" = warn &&
678
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
1038
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
680
1040
*** ERROR, $lockfile contains:
681
1041
`cat $lockfile 2>/dev/null`
1282
inst_prefix_dir="$arg"
1287
precious_files_regex="$arg"
1297
if test -f "$arg"; then
1300
for fil in `cat $save_arg`
1302
# moreargs="$moreargs $fil"
1304
# A libtool-controlled object.
1306
# Check to see that this really is a libtool object.
1307
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1312
# If there is no directory component, then add one.
1314
*/* | *\\*) . $arg ;;
1318
if test -z "$pic_object" || \
1319
test -z "$non_pic_object" ||
1320
test "$pic_object" = none && \
1321
test "$non_pic_object" = none; then
1322
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1326
# Extract subdirectory from the argument.
1327
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1328
if test "X$xdir" = "X$arg"; then
1334
if test "$pic_object" != none; then
1335
# Prepend the subdirectory the object is found in.
1336
pic_object="$xdir$pic_object"
1338
if test "$prev" = dlfiles; then
1339
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1340
dlfiles="$dlfiles $pic_object"
1344
# If libtool objects are unsupported, then we need to preload.
1349
# CHECK ME: I think I busted this. -Ossama
1350
if test "$prev" = dlprefiles; then
1351
# Preload the old-style object.
1352
dlprefiles="$dlprefiles $pic_object"
1357
libobjs="$libobjs $pic_object"
1362
if test "$non_pic_object" != none; then
1363
# Prepend the subdirectory the object is found in.
1364
non_pic_object="$xdir$non_pic_object"
1366
# A standard non-PIC object
1367
non_pic_objects="$non_pic_objects $non_pic_object"
1368
if test -z "$pic_object" || test "$pic_object" = none ; then
1369
arg="$non_pic_object"
1372
# If the PIC object exists, use it instead.
1373
# $xdir was prepended to $pic_object above.
1374
non_pic_object="$pic_object"
1375
non_pic_objects="$non_pic_objects $non_pic_object"
1378
# Only an error if not doing a dry-run.
1379
if test -z "$run"; then
1380
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1385
# Extract subdirectory from the argument.
1386
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1387
if test "X$xdir" = "X$arg"; then
1393
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1394
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1395
libobjs="$libobjs $pic_object"
1396
non_pic_objects="$non_pic_objects $non_pic_object"
1401
$echo "$modename: link input file \`$save_arg' does not exist"
907
1409
# We need an absolute path.
909
1411
[\\/]* | [A-Za-z]:[\\/]*) ;;
911
1413
$echo "$modename: only absolute run-paths are allowed" 1>&2
915
1417
if test "$prev" = rpath; then
1047
1592
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1049
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1594
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1050
1595
# These systems don't actually have a C or math library (as such)
1053
*-*-mingw* | *-*-os2*)
1054
1599
# These systems don't actually have a C library (as such)
1055
1600
test "X$arg" = "X-lc" && continue
1057
*-*-openbsd* | *-*-freebsd*)
1602
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1058
1603
# Do not include libc due to us having libc/libc_r.
1059
1604
test "X$arg" = "X-lc" && continue
1062
elif test "X$arg" = "X-lc_r"; then
1064
*-*-openbsd* | *-*-freebsd*)
1065
# Do not include libc_r directly, use -pthread flag.
1606
*-*-rhapsody* | *-*-darwin1.[012])
1607
# Rhapsody C and math libraries are in the System framework
1608
deplibs="$deplibs -framework System"
1611
*-*-sco3.2v5* | *-*-sco5v6*)
1612
# Causes problems with __ctype
1613
test "X$arg" = "X-lc" && continue
1615
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1616
# Compiler inserts libc in the correct place for threads to work
1617
test "X$arg" = "X-lc" && continue
1620
elif test "X$arg" = "X-lc_r"; then
1622
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1623
# Do not include libc_r directly, use -pthread flag.
1070
1628
deplibs="$deplibs $arg"
1632
# Tru64 UNIX uses -model [arg] to determine the layout of C++
1633
# classes, name mangling, and exception handling.
1635
compile_command="$compile_command $arg"
1636
compiler_flags="$compiler_flags $arg"
1637
finalize_command="$finalize_command $arg"
1642
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1643
compiler_flags="$compiler_flags $arg"
1644
compile_command="$compile_command $arg"
1645
finalize_command="$finalize_command $arg"
1654
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1655
# -r[0-9][0-9]* specifies the processor on the SGI compiler
1656
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1657
# +DA*, +DD* enable 64-bit mode on the HP compiler
1658
# -q* pass through compiler args for the IBM compiler
1659
# -m* pass through architecture-specific compiler args for GCC
1660
# -m*, -t[45]*, -txscale* pass through architecture-specific
1661
# compiler args for GCC
1662
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1663
# -F/path gives path to uninstalled frameworks, gcc on darwin
1664
# @file GCC response files
1665
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
1666
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
1668
# Unknown arguments in both finalize_command and compile_command need
1669
# to be aesthetically quoted because they are evaled later.
1670
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1672
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1676
compile_command="$compile_command $arg"
1677
finalize_command="$finalize_command $arg"
1678
compiler_flags="$compiler_flags $arg"
1079
1687
-no-fast-install)
1080
1688
fast_install=no
1216
# A library or standard object.
1217
if test "$prev" = dlfiles; then
1218
# This file was specified with -dlopen.
1219
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1220
dlfiles="$dlfiles $arg"
1224
# If libtool objects are unsupported, then we need to preload.
1229
if test "$prev" = dlprefiles; then
1230
# Preload the old-style object.
1231
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1844
# A standard object.
1849
# A libtool-controlled object.
1851
# Check to see that this really is a libtool object.
1852
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1857
# If there is no directory component, then add one.
1235
*.lo) libobjs="$libobjs $arg" ;;
1236
*) objs="$objs $arg" ;;
1859
*/* | *\\*) . $arg ;;
1863
if test -z "$pic_object" || \
1864
test -z "$non_pic_object" ||
1865
test "$pic_object" = none && \
1866
test "$non_pic_object" = none; then
1867
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1871
# Extract subdirectory from the argument.
1872
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1873
if test "X$xdir" = "X$arg"; then
1879
if test "$pic_object" != none; then
1880
# Prepend the subdirectory the object is found in.
1881
pic_object="$xdir$pic_object"
1883
if test "$prev" = dlfiles; then
1884
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1885
dlfiles="$dlfiles $pic_object"
1889
# If libtool objects are unsupported, then we need to preload.
1894
# CHECK ME: I think I busted this. -Ossama
1895
if test "$prev" = dlprefiles; then
1896
# Preload the old-style object.
1897
dlprefiles="$dlprefiles $pic_object"
1902
libobjs="$libobjs $pic_object"
1907
if test "$non_pic_object" != none; then
1908
# Prepend the subdirectory the object is found in.
1909
non_pic_object="$xdir$non_pic_object"
1911
# A standard non-PIC object
1912
non_pic_objects="$non_pic_objects $non_pic_object"
1913
if test -z "$pic_object" || test "$pic_object" = none ; then
1914
arg="$non_pic_object"
1917
# If the PIC object exists, use it instead.
1918
# $xdir was prepended to $pic_object above.
1919
non_pic_object="$pic_object"
1920
non_pic_objects="$non_pic_objects $non_pic_object"
1923
# Only an error if not doing a dry-run.
1924
if test -z "$run"; then
1925
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1930
# Extract subdirectory from the argument.
1931
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1932
if test "X$xdir" = "X$arg"; then
1938
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1939
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1940
libobjs="$libobjs $pic_object"
1941
non_pic_objects="$non_pic_objects $non_pic_object"
1381
2115
for pass in $passes; do
1382
if test $linkmode = prog; then
1383
# Determine which files to process
2116
if test "$linkmode,$pass" = "lib,link" ||
2117
test "$linkmode,$pass" = "prog,scan"; then
2121
if test "$linkmode" = prog; then
1387
save_deplibs="$deplibs" # Collect dlpreopened libraries
2123
dlopen) libs="$dlfiles" ;;
1390
2124
dlpreopen) libs="$dlprefiles" ;;
1391
2125
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2128
if test "$pass" = dlopen; then
2129
# Collect dlpreopened libraries
2130
save_deplibs="$deplibs"
1394
2133
for deplib in $libs; do
1397
2136
case $deplib in
2137
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2138
if test "$linkmode,$pass" = "prog,link"; then
2139
compile_deplibs="$deplib $compile_deplibs"
2140
finalize_deplibs="$deplib $finalize_deplibs"
2142
compiler_flags="$compiler_flags $deplib"
1399
if test $linkmode = oldlib && test $linkmode = obj; then
1400
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1403
if test $pass = conv; then
1404
deplibs="$deplib $deplibs"
2147
if test "$linkmode" != lib && test "$linkmode" != prog; then
2148
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1407
2151
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1408
2152
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1409
# Search the libtool library
1410
lib="$searchdir/lib${name}.la"
1411
if test -f "$lib"; then
2153
for search_ext in .la $std_shrext .so .a; do
2154
# Search the libtool library
2155
lib="$searchdir/lib${name}${search_ext}"
2156
if test -f "$lib"; then
2157
if test "$search_ext" = ".la"; then
1416
2166
if test "$found" != yes; then
1417
2167
# deplib doesn't seem to be a libtool library
1420
2170
finalize_deplibs="$deplib $finalize_deplibs"
1422
2172
deplibs="$deplib $deplibs"
1423
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
2173
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2176
else # deplib is a libtool library
2177
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2178
# We need to do some special things here, and not later.
2179
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2180
case " $predeps $postdeps " in
2182
if (${SED} -e '2q' $lib |
2183
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2187
*/* | *\\*) . $lib ;;
2190
for l in $old_library $library_names; do
2193
if test "X$ll" = "X$old_library" ; then # only static version available
2195
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2196
test "X$ladir" = "X$lib" && ladir="."
2197
lib=$ladir/$old_library
2198
if test "$linkmode,$pass" = "prog,link"; then
2199
compile_deplibs="$deplib $compile_deplibs"
2200
finalize_deplibs="$deplib $finalize_deplibs"
2202
deplibs="$deplib $deplibs"
2203
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1429
2215
case $linkmode in
1431
2217
deplibs="$deplib $deplibs"
1432
test $pass = conv && continue
2218
test "$pass" = conv && continue
1433
2219
newdependency_libs="$deplib $newdependency_libs"
1434
2220
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1437
if test $pass = conv; then
2223
if test "$pass" = conv; then
1438
2224
deplibs="$deplib $deplibs"
1441
if test $pass = scan; then
2227
if test "$pass" = scan; then
1442
2228
deplibs="$deplib $deplibs"
1443
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1445
2230
compile_deplibs="$deplib $compile_deplibs"
1446
2231
finalize_deplibs="$deplib $finalize_deplibs"
2233
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1450
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
2236
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1452
2238
esac # linkmode
1456
if test $pass = link; then
2242
if test "$pass" = link; then
1457
2243
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1458
2244
# Make sure the xrpath contains only unique directories.
1459
2245
case "$xrpath " in
1467
2253
*.la) lib="$deplib" ;;
1469
if test $pass = conv; then
2255
if test "$pass" = conv; then
1470
2256
deplibs="$deplib $deplibs"
1473
2259
case $linkmode in
1475
if test "$deplibs_check_method" != pass_all; then
1477
echo "*** Warning: Trying to link with static lib archive $deplib."
1478
echo "*** I have the capability to make that library automatically link in when"
1479
echo "*** you link to this library. But I can only do this if you have a"
1480
echo "*** shared version of the library, which you do not appear to have"
1481
echo "*** because the file extensions .$libext of this argument makes me believe"
1482
echo "*** that it is just a static archive that I should not used here."
2262
case $deplibs_check_method in
2264
set dummy $deplibs_check_method
2265
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2266
if eval $echo \"$deplib\" 2>/dev/null \
2268
| $EGREP "$match_pattern_regex" > /dev/null; then
2276
if test "$valid_a_lib" != yes; then
2278
$echo "*** Warning: Trying to link with static lib archive $deplib."
2279
$echo "*** I have the capability to make that library automatically link in when"
2280
$echo "*** you link to this library. But I can only do this if you have a"
2281
$echo "*** shared version of the library, which you do not appear to have"
2282
$echo "*** because the file extensions .$libext of this argument makes me believe"
2283
$echo "*** that it is just a static archive that I should not used here."
1485
echo "*** Warning: Linking the shared library $output against the"
1486
echo "*** static library $deplib is not portable!"
2286
$echo "*** Warning: Linking the shared library $output against the"
2287
$echo "*** static library $deplib is not portable!"
1487
2288
deplibs="$deplib $deplibs"
1492
if test $pass != link; then
2293
if test "$pass" != link; then
1493
2294
deplibs="$deplib $deplibs"
1495
2296
compile_deplibs="$deplib $compile_deplibs"
1708
2529
fi # $linkmode = prog...
2531
if test "$linkmode,$pass" = "prog,link"; then
2532
if test -n "$library_names" &&
2533
{ { test "$prefer_static_libs" = no ||
2534
test "$prefer_static_libs,$installed" = "built,yes"; } ||
2535
test -z "$old_library"; }; then
2536
# We need to hardcode the library path
2537
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2538
# Make sure the rpath contains only unique directories.
2539
case "$temp_rpath " in
2542
*) temp_rpath="$temp_rpath $absdir" ;;
2546
# Hardcode the library path.
2547
# Skip directories that are in the system default run-time
2549
case " $sys_lib_dlsearch_path " in
2552
case "$compile_rpath " in
2554
*) compile_rpath="$compile_rpath $absdir"
2558
case " $sys_lib_dlsearch_path " in
2561
case "$finalize_rpath " in
2563
*) finalize_rpath="$finalize_rpath $libdir"
2567
fi # $linkmode,$pass = prog,link...
2569
if test "$alldeplibs" = yes &&
2570
{ test "$deplibs_check_method" = pass_all ||
2571
{ test "$build_libtool_libs" = yes &&
2572
test -n "$library_names"; }; }; then
2573
# We only need to search for static libraries
1710
2578
link_static=no # Whether the deplib will be linked statically
2579
use_static_libs=$prefer_static_libs
2580
if test "$use_static_libs" = built && test "$installed" = yes ; then
1711
2583
if test -n "$library_names" &&
1712
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1713
# Link against this shared library
1715
if test "$linkmode,$pass" = "prog,link" ||
1716
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1717
# Hardcode the library path.
1718
# Skip directories that are in the system default run-time
1720
case " $sys_lib_dlsearch_path " in
1723
case "$compile_rpath " in
1725
*) compile_rpath="$compile_rpath $absdir"
1729
case " $sys_lib_dlsearch_path " in
1732
case "$finalize_rpath " in
1734
*) finalize_rpath="$finalize_rpath $libdir"
1738
if test $linkmode = prog; then
1739
# We need to hardcode the library path
1740
if test -n "$shlibpath_var"; then
1741
# Make sure the rpath contains only unique directories.
1742
case "$temp_rpath " in
1745
*) temp_rpath="$temp_rpath $dir" ;;
1749
fi # $linkmode,$pass = prog,link...
1751
if test "$alldeplibs" = yes &&
1752
{ test "$deplibs_check_method" = pass_all ||
1753
{ test "$build_libtool_libs" = yes &&
1754
test -n "$library_names"; }; }; then
1755
# We only need to search for static libraries
2584
{ test "$use_static_libs" = no || test -z "$old_library"; }; then
1759
2585
if test "$installed" = no; then
1760
2586
notinst_deplibs="$notinst_deplibs $lib"
1761
2587
need_relink=yes
2589
# This is a shared library
2591
# Warn about portability, can't link against -module's on
2592
# some systems (darwin)
2593
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2595
if test "$linkmode" = prog; then
2596
$echo "*** Warning: Linking the executable $output against the loadable module"
2598
$echo "*** Warning: Linking the shared library $output against the loadable module"
2600
$echo "*** $linklib is not portable!"
2602
if test "$linkmode" = lib &&
2603
test "$hardcode_into_libs" = yes; then
2604
# Hardcode the library path.
2605
# Skip directories that are in the system default run-time
2607
case " $sys_lib_dlsearch_path " in
2610
case "$compile_rpath " in
2612
*) compile_rpath="$compile_rpath $absdir"
2616
case " $sys_lib_dlsearch_path " in
2619
case "$finalize_rpath " in
2621
*) finalize_rpath="$finalize_rpath $libdir"
1764
2627
if test -n "$old_archive_from_expsyms_cmds"; then
1765
2628
# figure out the soname
1945
2844
# Just print a warning and add the library to dependency_libs so
1946
2845
# that the program can be linked against the static library.
1948
echo "*** Warning: This system can not link to static lib archive $lib."
1949
echo "*** I have the capability to make that library automatically link in when"
1950
echo "*** you link to this library. But I can only do this if you have a"
1951
echo "*** shared version of the library, which you do not appear to have."
2847
$echo "*** Warning: This system can not link to static lib archive $lib."
2848
$echo "*** I have the capability to make that library automatically link in when"
2849
$echo "*** you link to this library. But I can only do this if you have a"
2850
$echo "*** shared version of the library, which you do not appear to have."
1952
2851
if test "$module" = yes; then
1953
echo "*** But as you try to build a module library, libtool will still create "
1954
echo "*** a static module, that should work as long as the dlopening application"
1955
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2852
$echo "*** But as you try to build a module library, libtool will still create "
2853
$echo "*** a static module, that should work as long as the dlopening application"
2854
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1956
2855
if test -z "$global_symbol_pipe"; then
1958
echo "*** However, this would only work if libtool was able to extract symbol"
1959
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1960
echo "*** not find such a program. So, this module is probably useless."
1961
echo "*** \`nm' from GNU binutils and a full rebuild may help."
2857
$echo "*** However, this would only work if libtool was able to extract symbol"
2858
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2859
$echo "*** not find such a program. So, this module is probably useless."
2860
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1963
2862
if test "$build_old_libs" = no; then
1964
2863
build_libtool_libs=module
2031
2929
if grep "^installed=no" $deplib > /dev/null; then
2032
path="-L$absdir/$objdir"
2930
path="$absdir/$objdir"
2034
2932
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2035
2933
if test -z "$libdir"; then
2036
2934
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2039
2937
if test "$absdir" != "$libdir"; then
2040
2938
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2945
# we do not want to link against static libs,
2946
# but need to link against shared
2947
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2948
if test -n "$deplibrary_names" ; then
2949
for tmp in $deplibrary_names ; do
2952
if test -f "$path/$depdepl" ; then
2953
depdepl="$path/$depdepl"
2955
# do not add paths which are already there
2956
case " $newlib_search_path " in
2958
*) newlib_search_path="$newlib_search_path $path";;
2971
# Again, we only want to link against shared libraries
2972
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2973
for tmp in $newlib_search_path ; do
2974
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2975
eval depdepl="$tmp/lib$tmp_libs.dylib"
2047
2986
case " $deplibs " in
2048
2987
*" $path "*) ;;
2049
*) deplibs="$deplibs $path" ;;
2988
*) deplibs="$path $deplibs" ;;
2990
case " $deplibs " in
2992
*) deplibs="$depdepl $deplibs" ;;
2052
2995
fi # link_all_deplibs != no
2053
2996
fi # linkmode = lib
2054
2997
done # for deplib in $libs
2055
if test $pass = dlpreopen; then
2998
dependency_libs="$newdependency_libs"
2999
if test "$pass" = dlpreopen; then
2056
3000
# Link the dlpreopened libraries before other libraries
2057
3001
for deplib in $save_deplibs; do
2058
3002
deplibs="$deplib $deplibs"
2061
if test $pass != dlopen; then
2062
test $pass != scan && dependency_libs="$newdependency_libs"
2063
if test $pass != conv; then
3005
if test "$pass" != dlopen; then
3006
if test "$pass" != conv; then
2064
3007
# Make sure lib_search_path contains only unique directories.
2065
3008
lib_search_path=
2066
3009
for dir in $newlib_search_path; do
2227
3208
if test -n "$8"; then
2228
3209
$echo "$modename: too many parameters to \`-version-info'" 1>&2
2229
3210
$echo "$help" 1>&2
3214
# convert absolute version numbers to libtool ages
3215
# this retains compatibility with .la files and attempts
3216
# to make the code below a bit more comprehensible
3218
case $vinfo_number in
3222
number_revision="$4"
3224
# There are really only two kinds -- those that
3225
# use the current revision as the major version
3226
# and those that subtract age and use age as
3227
# a minor version. But, then there is irix
3228
# which has an extra 1 added just for fun
3230
case $version_type in
3231
darwin|linux|osf|windows|none)
3232
current=`expr $number_major + $number_minor`
3234
revision="$number_revision"
3236
freebsd-aout|freebsd-elf|sunos)
3237
current="$number_major"
3238
revision="$number_minor"
3242
current=`expr $number_major + $number_minor`
3244
revision="$number_minor"
3245
lt_irix_increment=no
2237
3256
# Check that each of the things are valid numbers.
2238
3257
case $current in
2239
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3258
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2241
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3260
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2242
3261
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2247
3266
case $revision in
2248
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3267
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2250
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3269
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2251
3270
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2257
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3276
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2259
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3278
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2260
3279
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2265
if test $age -gt $current; then
3284
if test "$age" -gt "$current"; then
2266
3285
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2267
3286
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2271
3290
# Calculate the version variables.
2513
3562
int main() { return 0; }
2516
$CC -o conftest conftest.c $deplibs
2517
if test $? -eq 0 ; then
3565
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
2518
3566
ldd_output=`ldd conftest`
2519
3567
for i in $deplibs; do
2520
name="`expr $i : '-l\(.*\)'`"
3568
name=`expr $i : '-l\(.*\)'`
2521
3569
# If $name is empty we are operating on a -L argument.
2522
if test -n "$name" && test "$name" != "0"; then
2523
libname=`eval \\$echo \"$libname_spec\"`
2524
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2525
set dummy $deplib_matches
2527
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2528
newdeplibs="$newdeplibs $i"
2532
echo "*** Warning: dynamic linker does not accept needed library $i."
2533
echo "*** I have the capability to make that library automatically link in when"
2534
echo "*** you link to this library. But I can only do this if you have a"
2535
echo "*** shared version of the library, which I believe you do not have"
2536
echo "*** because a test_compile did reveal that the linker did not use it for"
2537
echo "*** its dynamic dependency list that programs get resolved with at runtime."
2540
newdeplibs="$newdeplibs $i"
2544
# Error occured in the first compile. Let's try to salvage
2545
# the situation: Compile a separate program for each library.
2546
for i in $deplibs; do
2547
name="`expr $i : '-l\(.*\)'`"
2548
# If $name is empty we are operating on a -L argument.
2549
if test -n "$name" && test "$name" != "0"; then
2551
$CC -o conftest conftest.c $i
2553
if test $? -eq 0 ; then
2554
ldd_output=`ldd conftest`
3570
if test "$name" != "" && test "$name" != "0"; then
3571
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3572
case " $predeps $postdeps " in
3574
newdeplibs="$newdeplibs $i"
3579
if test -n "$i" ; then
2555
3580
libname=`eval \\$echo \"$libname_spec\"`
2556
3581
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2557
3582
set dummy $deplib_matches
2560
3585
newdeplibs="$newdeplibs $i"
2562
3587
droppeddeps=yes
2564
echo "*** Warning: dynamic linker does not accept needed library $i."
2565
echo "*** I have the capability to make that library automatically link in when"
2566
echo "*** you link to this library. But I can only do this if you have a"
2567
echo "*** shared version of the library, which you do not appear to have"
2568
echo "*** because a test_compile did reveal that the linker did not use this one"
2569
echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3589
$echo "*** Warning: dynamic linker does not accept needed library $i."
3590
$echo "*** I have the capability to make that library automatically link in when"
3591
$echo "*** you link to this library. But I can only do this if you have a"
3592
$echo "*** shared version of the library, which I believe you do not have"
3593
$echo "*** because a test_compile did reveal that the linker did not use it for"
3594
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3598
newdeplibs="$newdeplibs $i"
3602
# Error occurred in the first compile. Let's try to salvage
3603
# the situation: Compile a separate program for each library.
3604
for i in $deplibs; do
3605
name=`expr $i : '-l\(.*\)'`
3606
# If $name is empty we are operating on a -L argument.
3607
if test "$name" != "" && test "$name" != "0"; then
3609
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3610
ldd_output=`ldd conftest`
3611
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3612
case " $predeps $postdeps " in
3614
newdeplibs="$newdeplibs $i"
3619
if test -n "$i" ; then
3620
libname=`eval \\$echo \"$libname_spec\"`
3621
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3622
set dummy $deplib_matches
3624
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3625
newdeplibs="$newdeplibs $i"
3629
$echo "*** Warning: dynamic linker does not accept needed library $i."
3630
$echo "*** I have the capability to make that library automatically link in when"
3631
$echo "*** you link to this library. But I can only do this if you have a"
3632
$echo "*** shared version of the library, which you do not appear to have"
3633
$echo "*** because a test_compile did reveal that the linker did not use this one"
3634
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2572
3638
droppeddeps=yes
2574
echo "*** Warning! Library $i is needed by this library but I was not able to"
2575
echo "*** make it link in! You will probably need to install it or some"
2576
echo "*** library that it depends on before this library will be fully"
2577
echo "*** functional. Installing it before continuing would be even better."
3640
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3641
$echo "*** make it link in! You will probably need to install it or some"
3642
$echo "*** library that it depends on before this library will be fully"
3643
$echo "*** functional. Installing it before continuing would be even better."
2580
3646
newdeplibs="$newdeplibs $i"
2645
3721
set dummy $deplibs_check_method
2646
3722
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2647
3723
for a_deplib in $deplibs; do
2648
name="`expr $a_deplib : '-l\(.*\)'`"
3724
name=`expr $a_deplib : '-l\(.*\)'`
2649
3725
# If $name is empty we are operating on a -L argument.
2650
3726
if test -n "$name" && test "$name" != "0"; then
2651
libname=`eval \\$echo \"$libname_spec\"`
2652
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2653
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2654
for potent_lib in $potential_libs; do
2655
potlib="$potent_lib" # see symlink-check below in file_magic test
2656
if eval echo \"$potent_lib\" 2>/dev/null \
2658
| egrep "$match_pattern_regex" > /dev/null; then
2659
newdeplibs="$newdeplibs $a_deplib"
3727
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3728
case " $predeps $postdeps " in
3730
newdeplibs="$newdeplibs $a_deplib"
3735
if test -n "$a_deplib" ; then
3736
libname=`eval \\$echo \"$libname_spec\"`
3737
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3738
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3739
for potent_lib in $potential_libs; do
3740
potlib="$potent_lib" # see symlink-check above in file_magic test
3741
if eval $echo \"$potent_lib\" 2>/dev/null \
3743
| $EGREP "$match_pattern_regex" > /dev/null; then
3744
newdeplibs="$newdeplibs $a_deplib"
2665
3751
if test -n "$a_deplib" ; then
2666
3752
droppeddeps=yes
2668
echo "*** Warning: linker path does not have real file for library $a_deplib."
2669
echo "*** I have the capability to make that library automatically link in when"
2670
echo "*** you link to this library. But I can only do this if you have a"
2671
echo "*** shared version of the library, which you do not appear to have"
2672
echo "*** because I did check the linker path looking for a file starting"
3754
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3755
$echo "*** I have the capability to make that library automatically link in when"
3756
$echo "*** you link to this library. But I can only do this if you have a"
3757
$echo "*** shared version of the library, which you do not appear to have"
3758
$echo "*** because I did check the linker path looking for a file starting"
2673
3759
if test -z "$potlib" ; then
2674
echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3760
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2676
echo "*** with $libname and none of the candidates passed a file format test"
2677
echo "*** using a regex pattern. Last file checked: $potlib"
3762
$echo "*** with $libname and none of the candidates passed a file format test"
3763
$echo "*** using a regex pattern. Last file checked: $potlib"
2939
4051
# Do each of the archive commands.
4052
if test "$module" = yes && test -n "$module_cmds" ; then
4053
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4054
eval test_cmds=\"$module_expsym_cmds\"
4055
cmds=$module_expsym_cmds
4057
eval test_cmds=\"$module_cmds\"
2940
4061
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2941
eval cmds=\"$archive_expsym_cmds\"
2943
save_deplibs="$deplibs"
2944
for conv in $convenience; do
2946
for test_deplib in $deplibs; do
2947
if test "$test_deplib" != "$conv"; then
2948
tmp_deplibs="$tmp_deplibs $test_deplib"
4062
eval test_cmds=\"$archive_expsym_cmds\"
4063
cmds=$archive_expsym_cmds
4065
eval test_cmds=\"$archive_cmds\"
4070
if test "X$skipped_export" != "X:" &&
4071
len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4072
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4075
# The command line is too long to link in one step, link piecewise.
4076
$echo "creating reloadable object files..."
4078
# Save the value of $output and $libobjs because we want to
4079
# use them later. If we have whole_archive_flag_spec, we
4080
# want to use save_libobjs as it was before
4081
# whole_archive_flag_spec was expanded, because we can't
4082
# assume the linker understands whole_archive_flag_spec.
4083
# This may have to be revisited, in case too many
4084
# convenience libraries get linked in and end up exceeding
4086
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4087
save_libobjs=$libobjs
4090
output_la=`$echo "X$output" | $Xsed -e "$basename"`
4092
# Clear the reloadable object creation command queue and
4093
# initialize k to one.
4100
output=$output_objdir/$output_la-${k}.$objext
4101
# Loop over the list of objects to be linked.
4102
for obj in $save_libobjs
4104
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4105
if test "X$objlist" = X ||
4106
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4107
test "$len" -le "$max_cmd_len"; }; then
4108
objlist="$objlist $obj"
4110
# The command $test_cmds is almost too long, add a
4111
# command to the queue.
4112
if test "$k" -eq 1 ; then
4113
# The first file doesn't have a previous command to add.
4114
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4116
# All subsequent reloadable object files will link in
4117
# the last one created.
4118
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
2951
deplibs="$tmp_deplibs"
2953
eval cmds=\"$archive_cmds\"
2954
deplibs="$save_deplibs"
4120
last_robj=$output_objdir/$output_la-${k}.$objext
4122
output=$output_objdir/$output_la-${k}.$objext
4127
# Handle the remaining objects by creating one last
4128
# reloadable object file. All subsequent reloadable object
4129
# files will link in the last one created.
4130
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4131
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4133
if ${skipped_export-false}; then
4134
$show "generating symbol list for \`$libname.la'"
4135
export_symbols="$output_objdir/$libname.exp"
4136
$run $rm $export_symbols
4138
# Append the command to create the export file.
4139
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4142
# Set up a command to remove the reloadable object files
4143
# after they are used.
4145
while test "$i" -lt "$k"
4148
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4151
$echo "creating a temporary reloadable object file: $output"
4153
# Loop through the commands generated above and execute them.
4154
save_ifs="$IFS"; IFS='~'
4155
for cmd in $concat_cmds; do
4158
$run eval "$cmd" || exit $?
4163
# Restore the value of output.
4166
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4167
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4169
# Expand the library linking commands again to reset the
4170
# value of $libobjs for piecewise linking.
4172
# Do each of the archive commands.
4173
if test "$module" = yes && test -n "$module_cmds" ; then
4174
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4175
cmds=$module_expsym_cmds
4180
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4181
cmds=$archive_expsym_cmds
4187
# Append the command to remove the reloadable object files
4188
# to the just-reset $cmds.
4189
eval cmds=\"\$cmds~\$rm $delfiles\"
2956
4191
save_ifs="$IFS"; IFS='~'
2957
4192
for cmd in $cmds; do
2958
4193
IFS="$save_ifs"
2960
$run eval "$cmd" || exit $?
4196
$run eval "$cmd" || {
4199
# Restore the uninstalled library and exit
4200
if test "$mode" = relink; then
4201
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
2962
4207
IFS="$save_ifs"
2964
4209
# Restore the uninstalled library and exit
2965
4210
if test "$mode" = relink; then
2966
4211
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4213
if test -n "$convenience"; then
4214
if test -z "$whole_archive_flag_spec"; then
4215
$show "${rm}r $gentop"
4216
$run ${rm}r "$gentop"
2970
4223
# Create links to the real library.
3618
4914
# win32 will think the script is a binary if it has
3619
4915
# a .exe suffix, so we strip it off here.
3620
4916
case $output in
3621
*.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4917
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3623
4919
# test for cygwin because mv fails w/o .exe extensions
3625
*cygwin*) exeext=.exe ;;
4923
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
3629
trap "$rm $output; exit 1" 1 2 15
4927
*cygwin* | *mingw* )
4928
output_name=`basename $output`
4929
output_path=`dirname $output`
4930
cwrappersource="$output_path/$objdir/lt-$output_name.c"
4931
cwrapper="$output_path/$output_name.exe"
4932
$rm $cwrappersource $cwrapper
4933
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4935
cat > $cwrappersource <<EOF
4937
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4938
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4940
The $output program cannot be directly executed until all the libtool
4941
libraries that it depends on are installed.
4943
This wrapper executable should never be moved out of the build directory.
4944
If it is, it will not operate correctly.
4946
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4947
but could eventually absorb all of the scripts functionality and
4948
exec $objdir/$outputname directly.
4951
cat >> $cwrappersource<<"EOF"
4960
#include <sys/stat.h>
4962
#if defined(PATH_MAX)
4963
# define LT_PATHMAX PATH_MAX
4964
#elif defined(MAXPATHLEN)
4965
# define LT_PATHMAX MAXPATHLEN
4967
# define LT_PATHMAX 1024
4970
#ifndef DIR_SEPARATOR
4971
# define DIR_SEPARATOR '/'
4972
# define PATH_SEPARATOR ':'
4975
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4977
# define HAVE_DOS_BASED_FILE_SYSTEM
4978
# ifndef DIR_SEPARATOR_2
4979
# define DIR_SEPARATOR_2 '\\'
4981
# ifndef PATH_SEPARATOR_2
4982
# define PATH_SEPARATOR_2 ';'
4986
#ifndef DIR_SEPARATOR_2
4987
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4988
#else /* DIR_SEPARATOR_2 */
4989
# define IS_DIR_SEPARATOR(ch) \
4990
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4991
#endif /* DIR_SEPARATOR_2 */
4993
#ifndef PATH_SEPARATOR_2
4994
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4995
#else /* PATH_SEPARATOR_2 */
4996
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4997
#endif /* PATH_SEPARATOR_2 */
4999
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5000
#define XFREE(stale) do { \
5001
if (stale) { free ((void *) stale); stale = 0; } \
5004
/* -DDEBUG is fairly common in CFLAGS. */
5006
#if defined DEBUGWRAPPER
5007
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5009
# define DEBUG(format, ...)
5012
const char *program_name = NULL;
5014
void * xmalloc (size_t num);
5015
char * xstrdup (const char *string);
5016
const char * base_name (const char *name);
5017
char * find_executable(const char *wrapper);
5018
int check_executable(const char *path);
5019
char * strendzap(char *str, const char *pat);
5020
void lt_fatal (const char *message, ...);
5023
main (int argc, char *argv[])
5028
program_name = (char *) xstrdup (base_name (argv[0]));
5029
DEBUG("(main) argv[0] : %s\n",argv[0]);
5030
DEBUG("(main) program_name : %s\n",program_name);
5031
newargz = XMALLOC(char *, argc+2);
5034
cat >> $cwrappersource <<EOF
5035
newargz[0] = (char *) xstrdup("$SHELL");
5038
cat >> $cwrappersource <<"EOF"
5039
newargz[1] = find_executable(argv[0]);
5040
if (newargz[1] == NULL)
5041
lt_fatal("Couldn't find %s", argv[0]);
5042
DEBUG("(main) found exe at : %s\n",newargz[1]);
5043
/* we know the script has the same name, without the .exe */
5044
/* so make sure newargz[1] doesn't end in .exe */
5045
strendzap(newargz[1],".exe");
5046
for (i = 1; i < argc; i++)
5047
newargz[i+1] = xstrdup(argv[i]);
5048
newargz[argc+1] = NULL;
5050
for (i=0; i<argc+1; i++)
5052
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5060
cat >> $cwrappersource <<EOF
5061
execv("$SHELL",(char const **)newargz);
5065
cat >> $cwrappersource <<EOF
5066
execv("$SHELL",newargz);
5071
cat >> $cwrappersource <<"EOF"
5076
xmalloc (size_t num)
5078
void * p = (void *) malloc (num);
5080
lt_fatal ("Memory exhausted");
5086
xstrdup (const char *string)
5088
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5093
base_name (const char *name)
5097
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5098
/* Skip over the disk name in MSDOS pathnames. */
5099
if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5103
for (base = name; *name; name++)
5104
if (IS_DIR_SEPARATOR (*name))
5110
check_executable(const char * path)
5114
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5115
if ((!path) || (!*path))
5118
if ((stat (path, &st) >= 0) &&
5120
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5121
#if defined (S_IXOTH)
5122
((st.st_mode & S_IXOTH) == S_IXOTH) ||
5124
#if defined (S_IXGRP)
5125
((st.st_mode & S_IXGRP) == S_IXGRP) ||
5127
((st.st_mode & S_IXUSR) == S_IXUSR))
5134
/* Searches for the full path of the wrapper. Returns
5135
newly allocated full path name if found, NULL otherwise */
5137
find_executable (const char* wrapper)
5142
/* static buffer for getcwd */
5143
char tmp[LT_PATHMAX + 1];
5147
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5149
if ((wrapper == NULL) || (*wrapper == '\0'))
5152
/* Absolute path? */
5153
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5154
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5156
concat_name = xstrdup (wrapper);
5157
if (check_executable(concat_name))
5164
if (IS_DIR_SEPARATOR (wrapper[0]))
5166
concat_name = xstrdup (wrapper);
5167
if (check_executable(concat_name))
5171
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5175
for (p = wrapper; *p; p++)
5183
/* no slashes; search PATH */
5184
const char* path = getenv ("PATH");
5187
for (p = path; *p; p = p_next)
5191
for (q = p; *q; q++)
5192
if (IS_PATH_SEPARATOR(*q))
5195
p_next = (*q == '\0' ? q : q + 1);
5198
/* empty path: current directory */
5199
if (getcwd (tmp, LT_PATHMAX) == NULL)
5200
lt_fatal ("getcwd failed");
5201
tmp_len = strlen(tmp);
5202
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5203
memcpy (concat_name, tmp, tmp_len);
5204
concat_name[tmp_len] = '/';
5205
strcpy (concat_name + tmp_len + 1, wrapper);
5209
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5210
memcpy (concat_name, p, p_len);
5211
concat_name[p_len] = '/';
5212
strcpy (concat_name + p_len + 1, wrapper);
5214
if (check_executable(concat_name))
5219
/* not found in PATH; assume curdir */
5221
/* Relative path | not found in path: prepend cwd */
5222
if (getcwd (tmp, LT_PATHMAX) == NULL)
5223
lt_fatal ("getcwd failed");
5224
tmp_len = strlen(tmp);
5225
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5226
memcpy (concat_name, tmp, tmp_len);
5227
concat_name[tmp_len] = '/';
5228
strcpy (concat_name + tmp_len + 1, wrapper);
5230
if (check_executable(concat_name))
5237
strendzap(char *str, const char *pat)
5241
assert(str != NULL);
5242
assert(pat != NULL);
5245
patlen = strlen(pat);
5249
str += len - patlen;
5250
if (strcmp(str, pat) == 0)
5257
lt_error_core (int exit_status, const char * mode,
5258
const char * message, va_list ap)
5260
fprintf (stderr, "%s: %s: ", program_name, mode);
5261
vfprintf (stderr, message, ap);
5262
fprintf (stderr, ".\n");
5264
if (exit_status >= 0)
5269
lt_fatal (const char *message, ...)
5272
va_start (ap, message);
5273
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5277
# we should really use a build-platform specific compiler
5278
# here, but OTOH, the wrappers (shell script and this C one)
5279
# are only useful if you want to execute the "real" binary.
5280
# Since the "real" binary is built for $host, then this
5281
# wrapper might as well be built for $host, too.
5282
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5286
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3631
5288
$echo > $output "\
3829
5488
oldobjs="$libobjs_save"
3830
5489
build_libtool_libs=no
3832
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
5491
oldobjs="$old_deplibs $non_pic_objects"
3834
5493
addlibs="$old_convenience"
3837
5496
if test -n "$addlibs"; then
3838
5497
gentop="$output_objdir/${outputname}x"
3839
$show "${rm}r $gentop"
3840
$run ${rm}r "$gentop"
3841
$show "mkdir $gentop"
3842
$run mkdir "$gentop"
3844
if test $status -ne 0 && test ! -d "$gentop"; then
3847
5498
generated="$generated $gentop"
3849
# Add in members from convenience archives.
3850
for xlib in $addlibs; do
3851
# Extract the objects.
3853
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3854
*) xabs=`pwd`"/$xlib" ;;
3856
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3857
xdir="$gentop/$xlib"
3859
$show "${rm}r $xdir"
3864
if test $status -ne 0 && test ! -d "$xdir"; then
3867
$show "(cd $xdir && $AR x $xabs)"
3868
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3870
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5500
func_extract_archives $gentop $addlibs
5501
oldobjs="$oldobjs $func_extract_archives_result"
3874
5504
# Do each command in the archive commands.
3875
5505
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3876
eval cmds=\"$old_archive_from_new_cmds\"
5506
cmds=$old_archive_from_new_cmds
3878
# Ensure that we have .o objects in place in case we decided
3879
# not to build a shared library, and have fallen back to building
3880
# static libs even though --disable-static was passed!
3881
for oldobj in $oldobjs; do
3882
if test ! -f $oldobj; then
3883
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3884
if test "X$xdir" = "X$oldobj"; then
5508
# POSIX demands no paths to be encoded in archives. We have
5509
# to avoid creating archives with duplicate basenames if we
5510
# might have to extract them afterwards, e.g., when creating a
5511
# static archive out of a convenience library, or when linking
5512
# the entirety of a libtool archive into another (currently
5513
# not supported by libtool).
5514
if (for obj in $oldobjs
5516
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5517
done | sort | sort -uc >/dev/null 2>&1); then
5520
$echo "copying selected object files to avoid basename conflicts..."
5522
if test -z "$gentop"; then
5523
gentop="$output_objdir/${outputname}x"
5524
generated="$generated $gentop"
5526
$show "${rm}r $gentop"
5527
$run ${rm}r "$gentop"
5528
$show "$mkdir $gentop"
5529
$run $mkdir "$gentop"
5531
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
3889
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3890
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3891
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
3892
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
5536
save_oldobjs=$oldobjs
5539
for obj in $save_oldobjs
5541
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5542
case " $oldobjs " in
5543
" ") oldobjs=$obj ;;
5546
# Make sure we don't pick an alternate name that also
5548
newobj=lt$counter-$objbase
5549
counter=`expr $counter + 1`
5550
case " $oldobjs " in
5551
*[\ /]"$newobj "*) ;;
5552
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5555
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5556
$run ln "$obj" "$gentop/$newobj" ||
5557
$run cp "$obj" "$gentop/$newobj"
5558
oldobjs="$oldobjs $gentop/$newobj"
5560
*) oldobjs="$oldobjs $obj" ;;
3896
5565
eval cmds=\"$old_archive_cmds\"
5567
if len=`expr "X$cmds" : ".*"` &&
5568
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5569
cmds=$old_archive_cmds
5571
# the command line is too long to link in one step, link in parts
5572
$echo "using piecewise archive linking..."
5577
save_oldobjs=$oldobjs
5579
# Is there a better way of finding the last object in the list?
5580
for obj in $save_oldobjs
5584
for obj in $save_oldobjs
5586
oldobjs="$objlist $obj"
5587
objlist="$objlist $obj"
5588
eval test_cmds=\"$old_archive_cmds\"
5589
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5590
test "$len" -le "$max_cmd_len"; then
5593
# the above command should be used before it gets too long
5595
if test "$obj" = "$last_oldobj" ; then
5598
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5599
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5605
if test "X$oldobjs" = "X" ; then
5606
eval cmds=\"\$concat_cmds\"
5608
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3898
5612
save_ifs="$IFS"; IFS='~'
3899
5613
for cmd in $cmds; do
3900
5615
IFS="$save_ifs"
3902
5617
$run eval "$cmd" || exit $?
4524
6320
# Exit here if they wanted silent mode.
4525
test "$show" = ":" && exit 0
6321
test "$show" = : && exit $EXIT_SUCCESS
4527
echo "----------------------------------------------------------------------"
4528
echo "Libraries have been installed in:"
6323
$echo "X----------------------------------------------------------------------" | $Xsed
6324
$echo "Libraries have been installed in:"
4529
6325
for libdir in $libdirs; do
4533
echo "If you ever happen to want to link against installed libraries"
4534
echo "in a given directory, LIBDIR, you must either use libtool, and"
4535
echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4536
echo "flag during linking and do at least one of the following:"
6329
$echo "If you ever happen to want to link against installed libraries"
6330
$echo "in a given directory, LIBDIR, you must either use libtool, and"
6331
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6332
$echo "flag during linking and do at least one of the following:"
4537
6333
if test -n "$shlibpath_var"; then
4538
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4539
echo " during execution"
6334
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6335
$echo " during execution"
4541
6337
if test -n "$runpath_var"; then
4542
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4543
echo " during linking"
6338
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
6339
$echo " during linking"
4545
6341
if test -n "$hardcode_libdir_flag_spec"; then
4547
6343
eval flag=\"$hardcode_libdir_flag_spec\"
4549
echo " - use the \`$flag' linker flag"
6345
$echo " - use the \`$flag' linker flag"
4551
6347
if test -n "$admincmds"; then
4552
echo " - have your system administrator run these commands:$admincmds"
6348
$echo " - have your system administrator run these commands:$admincmds"
4554
6350
if test -f /etc/ld.so.conf; then
4555
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6351
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4558
echo "See any operating system documentation about shared libraries for"
4559
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4560
echo "----------------------------------------------------------------------"
6354
$echo "See any operating system documentation about shared libraries for"
6355
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
6356
$echo "X----------------------------------------------------------------------" | $Xsed
4564
6360
# libtool execute mode
4794
6602
if test -n "$old_library"; then
4795
6603
# Do each command in the old_postuninstall commands.
4796
eval cmds=\"$old_postuninstall_cmds\"
6604
cmds=$old_postuninstall_cmds
4797
6605
save_ifs="$IFS"; IFS='~'
4798
6606
for cmd in $cmds; do
4799
6607
IFS="$save_ifs"
4801
6610
$run eval "$cmd"
4802
if test $? != 0 && test "$rmforce" != yes; then
6611
if test "$?" -ne 0 && test "$rmforce" != yes; then
4806
6615
IFS="$save_ifs"
4808
6617
# FIXME: should reinstall the best remaining shared library.
4814
if test "$build_old_libs" = yes; then
4815
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4816
rmfiles="$rmfiles $dir/$oldobj"
6624
# Possibly a libtool object, so verify it.
6625
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6630
# Add PIC object to the list of files to remove.
6631
if test -n "$pic_object" \
6632
&& test "$pic_object" != none; then
6633
rmfiles="$rmfiles $dir/$pic_object"
6636
# Add non-PIC object to the list of files to remove.
6637
if test -n "$non_pic_object" \
6638
&& test "$non_pic_object" != none; then
6639
rmfiles="$rmfiles $dir/$non_pic_object"
4821
# Do a test to see if this is a libtool program.
4822
if test $mode = clean &&
4823
(${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6645
if test "$mode" = clean ; then
6649
file=`$echo $file|${SED} 's,.exe$,,'`
6650
noexename=`$echo $name|${SED} 's,.exe$,,'`
6651
# $file with .exe has already been added to rmfiles,
6652
# add $file without .exe
6653
rmfiles="$rmfiles $file"
6656
# Do a test to see if this is a libtool program.
6657
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4827
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4828
if test "$fast_install" = yes && test -n "$relink_command"; then
4829
rmfiles="$rmfiles $objdir/lt-$name"
6661
# note $name still contains .exe if it was in $file originally
6662
# as does the version of $file that was added into $rmfiles
6663
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6664
if test "$fast_install" = yes && test -n "$relink_command"; then
6665
rmfiles="$rmfiles $objdir/lt-$name"
6667
if test "X$noexename" != "X$name" ; then
6668
rmfiles="$rmfiles $objdir/lt-${noexename}.c"