108
114
lo2o="s/\\.lo\$/.${objext}/"
109
115
o2lo="s/\\.${objext}\$/.lo/"
117
#####################################
118
# Shell function definitions:
119
# This seems to be the best place for them
121
# Need a lot of goo to handle *both* DLLs and import libs
122
# Has to be a shell function in order to 'eat' the argument
123
# that is supplied when $file_magic_command is called.
125
win32_libid_type="unknown"
126
win32_fileres=`file -L $1 2>/dev/null`
127
case $win32_fileres in
128
*ar\ archive\ import\ library*) # definitely import
129
win32_libid_type="x86 archive import"
131
*ar\ archive*) # could be an import, or static
132
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
133
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
134
win32_nmres=`eval $NM -f posix -A $1 | \
135
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
136
if test "X$win32_nmres" = "Ximport" ; then
137
win32_libid_type="x86 archive import"
139
win32_libid_type="x86 archive static"
144
win32_libid_type="x86 DLL"
146
*executable*) # but shell scripts are "executable" too...
147
case $win32_fileres in
148
*MS\ Windows\ PE\ Intel*)
149
win32_libid_type="x86 DLL"
154
$echo $win32_libid_type
157
# End of Shell function definitions
158
#####################################
111
160
# Parse our command line options once, thoroughly.
161
while test "$#" -gt 0
298
368
modename="$modename: compile"
299
369
# Get the compilation command and the source file.
371
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
312
# Aesthetically quote the previous argument.
314
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
317
# Double-quote args containing other shell metacharacters.
318
# Many Bourne shells cannot handle close brackets correctly
319
# in scan sets, so we specify it separately.
320
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
325
# Add the previous argument to base_compile.
326
if test -z "$base_compile"; then
327
base_compile="$lastarg"
329
base_compile="$base_compile $lastarg"
335
# Accept any command-line options.
338
if test "$user_target" != "no"; then
339
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
366
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
368
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
372
# Double-quote args containing other shell metacharacters.
373
# Many Bourne shells cannot handle close brackets correctly
374
# in scan sets, so we specify it separately.
376
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
380
lastarg="$lastarg $arg"
383
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
385
# Add the arguments to base_compile.
386
if test -z "$base_compile"; then
387
base_compile="$lastarg"
389
base_compile="$base_compile $lastarg"
397
# The next one is the -o target name
402
# We got the output file
380
# do not "continue". Instead, add this to base_compile
409
# Accept the current argument as the source file.
392
# Accept any command-line options.
395
if test -n "$libobj" ; then
396
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
419
arg_mode=arg # the next one goes into the "base_compile" arg list
420
continue # The current "srcfile" will either be retained or
421
;; # replaced later. I would guess that would be a bug.
424
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
426
save_ifs="$IFS"; IFS=','
430
# Double-quote args containing other shell metacharacters.
431
# Many Bourne shells cannot handle close brackets correctly
432
# in scan sets, so we specify it separately.
434
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
438
lastarg="$lastarg $arg"
441
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
443
# Add the arguments to base_compile.
444
base_compile="$base_compile $lastarg"
449
# Accept the current argument as the source file.
450
# The previous "srcfile" becomes the current argument.
457
esac # case $arg_mode
413
459
# Aesthetically quote the previous argument.
415
# Backslashify any backslashes, double quotes, and dollar signs.
416
# These are the only characters that are still specially
417
# interpreted inside of double-quoted scrings.
418
460
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
420
463
# Double-quote args containing other shell metacharacters.
421
464
# Many Bourne shells cannot handle close brackets correctly
422
465
# in scan sets, so we specify it separately.
424
466
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
425
467
lastarg="\"$lastarg\""
429
# Add the previous argument to base_compile.
430
if test -z "$base_compile"; then
431
base_compile="$lastarg"
433
base_compile="$base_compile $lastarg"
471
base_compile="$base_compile $lastarg"
476
$echo "$modename: you must specify an argument for -Xcompile"
480
$echo "$modename: you must specify a target with \`-o'" 1>&2
441
484
# Get the name of the library object.
442
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
445
$echo "$modename: you must specify a target with \`-o'" 1>&2
485
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
450
489
# Recognize several different file suffixes.
451
490
# If the user specifies -o file.o, it is replaced with file.lo
454
493
*.ada) xform=ada ;;
455
494
*.adb) xform=adb ;;
481
521
# command doesn't match the default compiler.
482
522
if test -n "$available_tags" && test -z "$tagname"; then
483
523
case $base_compile in
485
524
# Blanks in the command may have been stripped by the calling shell,
486
# but not from the CC environment variable when ltconfig was run.
525
# but not from the CC environment variable when configure was run.
526
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
527
# Blanks at the start of $base_compile will cause this to fail
528
# if we don't check for them as well.
489
for z in $available_tags; do
490
if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
530
for z in $available_tags; do
531
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
491
532
# Evaluate the configuration.
492
eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
493
case $base_compile in
495
# The compiler in the base compile command matches
496
# the one in the tagged configuration.
497
# Assume this is the tagged configuration we want.
533
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
534
case "$base_compile " in
535
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
536
# The compiler in the base compile command matches
537
# the one in the tagged configuration.
538
# Assume this is the tagged configuration we want.
508
# If $tagname still isn't set, then no tagged configuration
509
# was found and let the user know that the "--tag" command
510
# line option must be used.
511
if test -z "$tagname"; then
512
echo "$modename: unable to infer tagged configuration"
513
echo "$modename: specify a tag with \`--tag'" 1>&2
545
# If $tagname still isn't set, then no tagged configuration
546
# was found and let the user know that the "--tag" command
547
# line option must be used.
548
if test -z "$tagname"; then
549
$echo "$modename: unable to infer tagged configuration"
550
$echo "$modename: specify a tag with \`--tag'" 1>&2
516
# echo "$modename: using $tagname tagged configuration"
553
# $echo "$modename: using $tagname tagged configuration"
955
1000
if test -f "$arg"; then
958
1003
for fil in `cat $save_arg`
960
1005
# moreargs="$moreargs $fil"
962
# A libtool-controlled object.
1007
# A libtool-controlled object.
964
1009
# Check to see that this really is a libtool object.
965
if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
970
# If there is no directory component, then add one.
972
*/* | *\\*) . $arg ;;
976
if test -z "$pic_object" || \
977
test -z "$non_pic_object" ||
978
test "$pic_object" = none && \
979
test "$non_pic_object" = none; then
980
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
984
# Extract subdirectory from the argument.
985
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
986
if test "X$xdir" = "X$arg"; then
992
if test "$pic_object" != none; then
993
# Prepend the subdirectory the object is found in.
994
pic_object="$xdir$pic_object"
996
if test "$prev" = dlfiles; then
997
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
998
dlfiles="$dlfiles $pic_object"
1002
# If libtool objects are unsupported, then we need to preload.
1007
# CHECK ME: I think I busted this. -Ossama
1008
if test "$prev" = dlprefiles; then
1009
# Preload the old-style object.
1010
dlprefiles="$dlprefiles $pic_object"
1015
libobjs="$libobjs $pic_object"
1020
if test "$non_pic_object" != none; then
1021
# Prepend the subdirectory the object is found in.
1022
non_pic_object="$xdir$non_pic_object"
1024
# A standard non-PIC object
1025
non_pic_objects="$non_pic_objects $non_pic_object"
1026
if test -z "$pic_object" || test "$pic_object" = none ; then
1027
arg="$non_pic_object"
1031
# Only an error if not doing a dry-run.
1032
if test -z "$run"; then
1033
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1038
# Extract subdirectory from the argument.
1039
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1040
if test "X$xdir" = "X$arg"; then
1046
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1047
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1048
libobjs="$libobjs $pic_object"
1049
non_pic_objects="$non_pic_objects $non_pic_object"
1010
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1015
# If there is no directory component, then add one.
1017
*/* | *\\*) . $arg ;;
1021
if test -z "$pic_object" || \
1022
test -z "$non_pic_object" ||
1023
test "$pic_object" = none && \
1024
test "$non_pic_object" = none; then
1025
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1029
# Extract subdirectory from the argument.
1030
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1031
if test "X$xdir" = "X$arg"; then
1037
if test "$pic_object" != none; then
1038
# Prepend the subdirectory the object is found in.
1039
pic_object="$xdir$pic_object"
1041
if test "$prev" = dlfiles; then
1042
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1043
dlfiles="$dlfiles $pic_object"
1047
# If libtool objects are unsupported, then we need to preload.
1052
# CHECK ME: I think I busted this. -Ossama
1053
if test "$prev" = dlprefiles; then
1054
# Preload the old-style object.
1055
dlprefiles="$dlprefiles $pic_object"
1060
libobjs="$libobjs $pic_object"
1065
if test "$non_pic_object" != none; then
1066
# Prepend the subdirectory the object is found in.
1067
non_pic_object="$xdir$non_pic_object"
1069
# A standard non-PIC object
1070
non_pic_objects="$non_pic_objects $non_pic_object"
1071
if test -z "$pic_object" || test "$pic_object" = none ; then
1072
arg="$non_pic_object"
1076
# Only an error if not doing a dry-run.
1077
if test -z "$run"; then
1078
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1083
# Extract subdirectory from the argument.
1084
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1085
if test "X$xdir" = "X$arg"; then
1091
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1092
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1093
libobjs="$libobjs $pic_object"
1094
non_pic_objects="$non_pic_objects $non_pic_object"
1054
1099
$echo "$modename: link input file \`$save_arg' does not exist"
1202
if test "$arg" = "-lc"; then
1204
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
1205
# These systems don't actually have c library (as such)
1208
*-*-rhapsody* | *-*-darwin1.[012])
1209
# Rhapsody C library is in the System framework
1210
deplibs="$deplibs -framework System"
1214
elif test "$arg" = "-lm"; then
1273
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1216
1275
*-*-cygwin* | *-*-pw32* | *-*-beos*)
1217
# These systems don't actually have math library (as such)
1276
# These systems don't actually have a C or math library (as such)
1280
# prevent being parsed by the freebsd regexp below
1282
*-*-mingw* | *-*-os2*)
1283
# These systems don't actually have a C library (as such)
1284
test "X$arg" = "X-lc" && continue
1286
*-*-openbsd* | *-*-freebsd*)
1287
# Do not include libc due to us having libc/libc_r.
1288
test "X$arg" = "X-lc" && continue
1220
1290
*-*-rhapsody* | *-*-darwin1.[012])
1221
# Rhapsody math library is in the System framework
1222
deplibs="$deplibs -framework System"
1291
# Rhapsody C and math libraries are in the System framework
1292
deplibs="$deplibs System.ltframework"
1295
elif test "X$arg" = "X-lc_r"; then
1298
# prevent being parsed by the freebsd regexp below
1301
# Do not include libc_r directly, use -pthread flag.
1227
1306
deplibs="$deplibs $arg"
1385
1506
# A libtool-controlled object.
1387
1508
# Check to see that this really is a libtool object.
1388
if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1393
# If there is no directory component, then add one.
1395
*/* | *\\*) . $arg ;;
1399
if test -z "$pic_object" || \
1400
test -z "$non_pic_object" ||
1401
test "$pic_object" = none && \
1402
test "$non_pic_object" = none; then
1403
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1509
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1514
# If there is no directory component, then add one.
1516
*/* | *\\*) . $arg ;;
1520
if test -z "$pic_object" || \
1521
test -z "$non_pic_object" ||
1522
test "$pic_object" = none && \
1523
test "$non_pic_object" = none; then
1524
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
1407
1528
# Extract subdirectory from the argument.
1408
1529
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1409
1530
if test "X$xdir" = "X$arg"; then
1415
if test "$pic_object" != none; then
1416
# Prepend the subdirectory the object is found in.
1536
if test "$pic_object" != none; then
1537
# Prepend the subdirectory the object is found in.
1417
1538
pic_object="$xdir$pic_object"
1419
1540
if test "$prev" = dlfiles; then
1420
1541
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1421
dlfiles="$dlfiles $pic_object"
1542
dlfiles="$dlfiles $pic_object"
1425
# If libtool objects are unsupported, then we need to preload.
1546
# If libtool objects are unsupported, then we need to preload.
1430
1551
# CHECK ME: I think I busted this. -Ossama
1431
if test "$prev" = dlprefiles; then
1552
if test "$prev" = dlprefiles; then
1432
1553
# Preload the old-style object.
1433
1554
dlprefiles="$dlprefiles $pic_object"
1438
1559
libobjs="$libobjs $pic_object"
1439
1560
arg="$pic_object"
1443
if test "$non_pic_object" != none; then
1444
# Prepend the subdirectory the object is found in.
1564
if test "$non_pic_object" != none; then
1565
# Prepend the subdirectory the object is found in.
1445
1566
non_pic_object="$xdir$non_pic_object"
1447
# A standard non-PIC object
1448
non_pic_objects="$non_pic_objects $non_pic_object"
1449
if test -z "$pic_object" || test "$pic_object" = none ; then
1450
arg="$non_pic_object"
1454
# Only an error if not doing a dry-run.
1455
if test -z "$run"; then
1456
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1568
# A standard non-PIC object
1569
non_pic_objects="$non_pic_objects $non_pic_object"
1570
if test -z "$pic_object" || test "$pic_object" = none ; then
1571
arg="$non_pic_object"
1575
# Only an error if not doing a dry-run.
1576
if test -z "$run"; then
1577
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1461
1582
# Extract subdirectory from the argument.
1462
1583
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1530
1652
# command doesn't match the default compiler.
1531
1653
if test -n "$available_tags" && test -z "$tagname"; then
1532
1654
case $base_compile in
1534
1655
# Blanks in the command may have been stripped by the calling shell,
1535
# but not from the CC environment variable when ltconfig was run.
1656
# but not from the CC environment variable when configure was run.
1657
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1658
# Blanks at the start of $base_compile will cause this to fail
1659
# if we don't check for them as well.
1538
for z in $available_tags; do
1539
if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1661
for z in $available_tags; do
1662
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1540
1663
# Evaluate the configuration.
1541
eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1542
case $base_compile in
1544
# The compiler in $compile_command matches
1545
# the one in the tagged configuration.
1546
# Assume this is the tagged configuration we want.
1664
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1665
case $base_compile in
1666
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1667
# The compiler in $compile_command matches
1668
# the one in the tagged configuration.
1669
# Assume this is the tagged configuration we want.
1557
# If $tagname still isn't set, then no tagged configuration
1558
# was found and let the user know that the "--tag" command
1559
# line option must be used.
1560
if test -z "$tagname"; then
1561
echo "$modename: unable to infer tagged configuration"
1562
echo "$modename: specify a tag with \`--tag'" 1>&2
1676
# If $tagname still isn't set, then no tagged configuration
1677
# was found and let the user know that the "--tag" command
1678
# line option must be used.
1679
if test -z "$tagname"; then
1680
$echo "$modename: unable to infer tagged configuration"
1681
$echo "$modename: specify a tag with \`--tag'" 1>&2
1565
# echo "$modename: using $tagname tagged configuration"
1684
# $echo "$modename: using $tagname tagged configuration"
1617
1736
*) linkmode=prog ;; # Anything else should be a program.
1740
*cygwin* | *mingw* | *pw32*)
1741
# don't eliminate duplcations in $postdeps and $predeps
1742
duplicate_compiler_generated_deps=yes
1745
duplicate_compiler_generated_deps=$duplicate_deps
1620
1748
specialdeplibs=
1622
1751
# Find all interdependent deplibs by searching for libraries
1623
1752
# that are linked more than once (e.g. -la -lb -la)
1624
1753
for deplib in $deplibs; do
1626
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1754
if test "X$duplicate_deps" = "Xyes" ; then
1756
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1628
1759
libs="$libs $deplib"
1631
if test $linkmode = lib; then
1762
if test "$linkmode" = lib; then
1632
1763
libs="$predeps $libs $compiler_lib_search_path $postdeps"
1765
# Compute libraries that are listed more than once in $predeps
1766
# $postdeps and mark them as special (i.e., whose duplicates are
1767
# not to be eliminated).
1769
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1770
for pre_post_dep in $predeps $postdeps; do
1771
case "$pre_post_deps " in
1772
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1774
pre_post_deps="$pre_post_deps $pre_post_dep"
1636
1781
newdependency_libs=
1637
1782
newlib_search_path=
1638
1783
need_relink=no # whether we're linking any uninstalled libtool libraries
1639
uninst_deplibs= # uninstalled libtool libraries
1640
uninst_path= # paths that contain uninstalled libtool libraries
1784
notinst_deplibs= # not-installed libtool libraries
1785
notinst_path= # paths that contain not-installed libtool libraries
1641
1786
case $linkmode in
1643
1788
passes="conv link"
1686
1831
case $deplib in
1688
if test $linkmode != lib && test $linkmode != prog; then
1833
if test "$linkmode" != lib && test "$linkmode" != prog; then
1689
1834
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1692
if test $pass = conv; then
1837
if test "$pass" = conv && test "$allow_undefined" = yes; then
1693
1838
deplibs="$deplib $deplibs"
1696
1841
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1697
1842
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1698
# Search the libtool library
1699
lib="$searchdir/lib${name}.la"
1700
if test -f "$lib"; then
1843
for search_ext in .la $shrext .so .a; do
1844
# Search the libtool library
1845
lib="$searchdir/lib${name}${search_ext}"
1846
if test -f "$lib"; then
1847
if test "$search_ext" = ".la"; then
1705
1856
if test "$found" != yes; then
1857
# deplib doesn't seem to be a libtool library
1706
1858
if test "$linkmode,$pass" = "prog,link"; then
1707
1859
compile_deplibs="$deplib $compile_deplibs"
1708
1860
finalize_deplibs="$deplib $finalize_deplibs"
1710
1862
deplibs="$deplib $deplibs"
1711
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1863
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1866
else # deplib is a libtool library
1867
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1868
# We need to do some special things here, and not later.
1869
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1870
case " $predeps $postdeps " in
1872
if (${SED} -e '2q' $lib |
1873
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1877
*/* | *\\*) . $lib ;;
1880
for l in $old_library $library_names; do
1883
if test "X$ll" = "X$old_library" ; then # only static version available
1885
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1886
test "X$ladir" = "X$lib" && ladir="."
1887
lib=$ladir/$old_library
1888
if test "$linkmode,$pass" = "prog,link"; then
1889
compile_deplibs="$deplib $compile_deplibs"
1890
finalize_deplibs="$deplib $finalize_deplibs"
1892
deplibs="$deplib $deplibs"
1893
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1905
if test "$linkmode,$pass" = "prog,link"; then
1906
compile_deplibs="$deplib $compile_deplibs"
1907
finalize_deplibs="$deplib $finalize_deplibs"
1909
deplibs="$deplib $deplibs"
1910
if test "$linkmode" = lib ; then
1911
newdependency_libs="$deplib $newdependency_libs"
1717
1917
case $linkmode in
1719
1919
deplibs="$deplib $deplibs"
1720
test $pass = conv && continue
1920
test "$pass" = conv && continue
1721
1921
newdependency_libs="$deplib $newdependency_libs"
1722
1922
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1725
if test $pass = conv; then
1925
if test "$pass" = conv; then
1726
1926
deplibs="$deplib $deplibs"
1729
if test $pass = scan; then
1929
if test "$pass" = scan; then
1730
1930
deplibs="$deplib $deplibs"
1731
1931
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1755
1955
*.la) lib="$deplib" ;;
1757
if test $pass = conv; then
1957
if test "$pass" = conv; then
1758
1958
deplibs="$deplib $deplibs"
1761
1961
case $linkmode in
1763
1963
if test "$deplibs_check_method" != pass_all; then
1765
echo "*** Warning: This library needs some functionality provided by $deplib."
1766
echo "*** I have the capability to make that library automatically link in when"
1767
echo "*** you link to this library. But I can only do this if you have a"
1768
echo "*** shared version of the library, which you do not appear to have."
1965
$echo "*** Warning: Trying to link with static lib archive $deplib."
1966
$echo "*** I have the capability to make that library automatically link in when"
1967
$echo "*** you link to this library. But I can only do this if you have a"
1968
$echo "*** shared version of the library, which you do not appear to have"
1969
$echo "*** because the file extensions .$libext of this argument makes me believe"
1970
$echo "*** that it is just a static archive that I should not used here."
1771
echo "*** Warning: Linking the shared library $output against the"
1772
echo "*** static library $deplib is not portable!"
1973
$echo "*** Warning: Linking the shared library $output against the"
1974
$echo "*** static library $deplib is not portable!"
1773
1975
deplibs="$deplib $deplibs"
1778
if test $pass != link; then
1980
if test "$pass" != link; then
1779
1981
deplibs="$deplib $deplibs"
1781
1983
compile_deplibs="$deplib $compile_deplibs"
2046
# Convert "-framework foo" to "foo.ltframework" in dependency_libs
2047
test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
1841
2051
if test "$linkmode,$pass" = "lib,link" ||
1842
2052
test "$linkmode,$pass" = "prog,scan" ||
1843
{ test $linkmode != prog && test $linkmode != lib; }; then
2053
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
1844
2054
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1845
2055
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1848
if test $pass = conv; then
1849
# only check for convenience libraries
2058
if test "$pass" = conv; then
2059
# Only check for convenience libraries
1850
2060
deplibs="$lib $deplibs"
2062
for deplib in $dependency_libs; do
2063
#echo "Adding $deplib to \$deplibs"
2064
deplibs="$deplib $deplibs"
2065
if test "X$duplicate_deps" = "Xyes" ; then
2066
case "$tmp_libs " in
2067
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2070
tmp_libs="$tmp_libs $deplib"
1851
2072
if test -z "$libdir"; then
1852
2073
if test -z "$old_library"; then
1853
2074
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2243
2509
if test "$deplibs_check_method" != pass_all; then
2244
2510
# We're trying link a shared library against a static one
2245
2511
# but the system doesn't support it.
2246
2513
# Just print a warning and add the library to dependency_libs so
2247
2514
# that the program can be linked against the static library.
2249
echo "*** Warning: This library needs some functionality provided by $lib."
2250
echo "*** I have the capability to make that library automatically link in when"
2251
echo "*** you link to this library. But I can only do this if you have a"
2252
echo "*** shared version of the library, which you do not appear to have."
2516
$echo "*** Warning: This system can not link to static lib archive $lib."
2517
$echo "*** I have the capability to make that library automatically link in when"
2518
$echo "*** you link to this library. But I can only do this if you have a"
2519
$echo "*** shared version of the library, which you do not appear to have."
2520
if test "$module" = yes; then
2521
$echo "*** But as you try to build a module library, libtool will still create "
2522
$echo "*** a static module, that should work as long as the dlopening application"
2523
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2524
if test -z "$global_symbol_pipe"; then
2526
$echo "*** However, this would only work if libtool was able to extract symbol"
2527
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2528
$echo "*** not find such a program. So, this module is probably useless."
2529
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2531
if test "$build_old_libs" = no; then
2532
build_libtool_libs=module
2535
build_libtool_libs=no
2254
2539
convenience="$convenience $dir/$old_library"
2255
2540
old_convenience="$old_convenience $dir/$old_library"
2256
2541
deplibs="$dir/$old_library $deplibs"
2257
2542
link_static=yes
2544
fi # link shared/static library?
2261
if test $linkmode = lib; then
2262
if test -n "$dependency_libs" &&
2263
{ test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2264
test $link_static = yes; }; then
2546
if test "$linkmode" = lib; then
2547
#if test -n "$dependency_libs" &&
2548
# { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2549
# test "$link_static" = yes; }; then
2265
2550
# Extract -R from dependency_libs
2267
2552
for libdir in $dependency_libs; do
2312
2599
if grep "^installed=no" $deplib > /dev/null; then
2313
path="-L$absdir/$objdir"
2600
path="$absdir/$objdir"
2315
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2602
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2316
2603
if test -z "$libdir"; then
2317
2604
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2320
2607
if test "$absdir" != "$libdir"; then
2321
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2608
# Sure, some shells/systems don't implement the -ef.
2609
# Those will have to live with the warning.
2610
test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
2611
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2618
# we do not want to link against static libs, but need to link against shared
2619
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2620
if test -n "$deplibrary_names" ; then
2621
for tmp in $deplibrary_names ; do
2624
if test -f "$path/$depdepl" ; then
2625
depdepl="$path/$depdepl"
2627
# do not add paths which are already there
2628
case " $newlib_search_path " in
2630
*) newlib_search_path="$newlib_search_path $path";;
2644
# Again, we only want to link against shared libraries
2645
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2646
for tmp in $newlib_search_path ; do
2647
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2648
eval depdepl="$tmp/lib$tmp_libs.dylib"
2328
2668
case " $deplibs " in
2670
*) deplibs="$deplibs $depdepl" ;;
2672
case " $deplibs " in
2329
2673
*" $path "*) ;;
2330
*) deplibs="$path $deplibs" ;;
2674
*) deplibs="$deplibs $path" ;;
2677
fi # link_all_deplibs != no
2679
done # for deplib in $libs
2336
2680
dependency_libs="$newdependency_libs"
2337
if test $pass = dlpreopen; then
2681
if test "$pass" = dlpreopen; then
2338
2682
# Link the dlpreopened libraries before other libraries
2339
2683
for deplib in $save_deplibs; do
2340
2684
deplibs="$deplib $deplibs"
2343
if test $pass != dlopen; then
2344
if test $pass != conv; then
2687
if test "$pass" != dlopen; then
2688
if test "$pass" != conv; then
2345
2689
# Make sure lib_search_path contains only unique directories.
2346
2690
lib_search_path=
2347
2691
for dir in $newlib_search_path; do
2359
2703
vars="compile_deplibs finalize_deplibs"
2361
2705
for var in $vars dependency_libs; do
2362
# Make sure that $var contains only unique libraries
2363
# and add them in reverse order
2706
# Add libraries to $var in reverse order
2364
2707
eval tmp_libs=\"\$$var\"
2366
2709
for deplib in $tmp_libs; do
2710
# FIXME: Pedantically, this is the right thing to do, so
2711
# that some nasty dependency loop isn't accidentally
2713
#new_libs="$deplib $new_libs"
2714
# Pragmatically, this seems to cause very few problems in
2368
2717
-L*) new_libs="$deplib $new_libs" ;;
2720
# And here is the reason: when a library appears more
2721
# than once as an explicit dependence of a library, or
2722
# is implicitly linked in more than once by the
2723
# compiler, it is considered special, and multiple
2724
# occurrences thereof are not removed. Compare this
2725
# with having the same library being listed as a
2726
# dependency of multiple other libraries: in this case,
2727
# we know (pedantically, we assume) the library does not
2728
# need to be listed more than once, so we keep only the
2729
# last copy. This is not always right, but it is rare
2730
# enough that we require users that really mean to play
2731
# such unportable linking tricks to link the library
2732
# using -Wl,-lname, so that libtool does not consider it
2733
# for duplicate removal.
2370
2734
case " $specialdeplibs " in
2371
2735
*" $deplib "*) new_libs="$deplib $new_libs" ;;
2793
3236
$LTCC -o conftest conftest.c $deplibs
2794
if test $? -eq 0 ; then
3237
if test "$?" -eq 0 ; then
2795
3238
ldd_output=`ldd conftest`
2796
3239
for i in $deplibs; do
2797
3240
name="`expr $i : '-l\(.*\)'`"
2798
3241
# If $name is empty we are operating on a -L argument.
2799
if test "$name" != "" -a "$name" != "0"; then
2800
libname=`eval \\$echo \"$libname_spec\"`
2801
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2802
set dummy $deplib_matches
2804
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2805
newdeplibs="$newdeplibs $i"
2809
echo "*** Warning: This library needs some functionality provided by $i."
2810
echo "*** I have the capability to make that library automatically link in when"
2811
echo "*** you link to this library. But I can only do this if you have a"
2812
echo "*** shared version of the library, which you do not appear to have."
2815
newdeplibs="$newdeplibs $i"
2819
# Error occured in the first compile. Let's try to salvage the situation:
2820
# Compile a seperate program for each library.
2821
for i in $deplibs; do
2822
name="`expr $i : '-l\(.*\)'`"
2823
# If $name is empty we are operating on a -L argument.
2824
if test "$name" != "" -a "$name" != "0"; then
2826
$LTCC -o conftest conftest.c $i
2828
if test $? -eq 0 ; then
2829
ldd_output=`ldd conftest`
3242
if test "$name" != "" && test "$name" -ne "0"; then
3243
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3244
case " $predeps $postdeps " in
3246
newdeplibs="$newdeplibs $i"
3251
if test -n "$i" ; then
2830
3252
libname=`eval \\$echo \"$libname_spec\"`
2831
3253
deplib_matches=`eval \\$echo \"$library_names_spec\"`
2832
3254
set dummy $deplib_matches
2835
3257
newdeplibs="$newdeplibs $i"
2837
3259
droppeddeps=yes
2839
echo "*** Warning: This library needs some functionality provided by $i."
2840
echo "*** I have the capability to make that library automatically link in when"
2841
echo "*** you link to this library. But I can only do this if you have a"
2842
echo "*** shared version of the library, which you do not appear to have."
3261
$echo "*** Warning: dynamic linker does not accept needed library $i."
3262
$echo "*** I have the capability to make that library automatically link in when"
3263
$echo "*** you link to this library. But I can only do this if you have a"
3264
$echo "*** shared version of the library, which I believe you do not have"
3265
$echo "*** because a test_compile did reveal that the linker did not use it for"
3266
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
3270
newdeplibs="$newdeplibs $i"
3274
# Error occurred in the first compile. Let's try to salvage
3275
# the situation: Compile a separate program for each library.
3276
for i in $deplibs; do
3277
name="`expr $i : '-l\(.*\)'`"
3278
# If $name is empty we are operating on a -L argument.
3279
if test "$name" != "" && test "$name" != "0"; then
3281
$LTCC -o conftest conftest.c $i
3283
if test "$?" -eq 0 ; then
3284
ldd_output=`ldd conftest`
3285
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3286
case " $predeps $postdeps " in
3288
newdeplibs="$newdeplibs $i"
3293
if test -n "$i" ; then
3294
libname=`eval \\$echo \"$libname_spec\"`
3295
deplib_matches=`eval \\$echo \"$library_names_spec\"`
3296
set dummy $deplib_matches
3298
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3299
newdeplibs="$newdeplibs $i"
3303
$echo "*** Warning: dynamic linker does not accept needed library $i."
3304
$echo "*** I have the capability to make that library automatically link in when"
3305
$echo "*** you link to this library. But I can only do this if you have a"
3306
$echo "*** shared version of the library, which you do not appear to have"
3307
$echo "*** because a test_compile did reveal that the linker did not use this one"
3308
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2845
3312
droppeddeps=yes
2847
echo "*** Warning! Library $i is needed by this library but I was not able to"
2848
echo "*** make it link in! You will probably need to install it or some"
2849
echo "*** library that it depends on before this library will be fully"
2850
echo "*** functional. Installing it before continuing would be even better."
3314
$echo "*** Warning! Library $i is needed by this library but I was not able to"
3315
$echo "*** make it link in! You will probably need to install it or some"
3316
$echo "*** library that it depends on before this library will be fully"
3317
$echo "*** functional. Installing it before continuing would be even better."
2853
3320
newdeplibs="$newdeplibs $i"
2861
3328
for a_deplib in $deplibs; do
2862
3329
name="`expr $a_deplib : '-l\(.*\)'`"
2863
3330
# If $name is empty we are operating on a -L argument.
2864
if test "$name" != "" -a "$name" != "0"; then
2865
libname=`eval \\$echo \"$libname_spec\"`
2866
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2867
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2868
for potent_lib in $potential_libs; do
3331
if test "$name" != "" && test "$name" != "0"; then
3332
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3333
case " $predeps $postdeps " in
3335
newdeplibs="$newdeplibs $a_deplib"
3340
if test -n "$a_deplib" ; then
3341
libname=`eval \\$echo \"$libname_spec\"`
3342
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3343
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3344
for potent_lib in $potential_libs; do
2869
3345
# Follow soft links.
2870
3346
if ls -lLd "$potent_lib" 2>/dev/null \
2871
3347
| grep " -> " >/dev/null; then
2879
3355
potlib="$potent_lib"
2880
3356
while test -h "$potlib" 2>/dev/null; do
2881
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
3357
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2882
3358
case $potliblink in
2883
3359
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2884
3360
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2887
3363
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2889
| egrep "$file_magic_regex" > /dev/null; then
3365
| $EGREP "$file_magic_regex" > /dev/null; then
2890
3366
newdeplibs="$newdeplibs $a_deplib"
2896
if test -n "$a_deplib" ; then
2899
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2900
echo "*** I have the capability to make that library automatically link in when"
2901
echo "*** you link to this library. But I can only do this if you have a"
2902
echo "*** shared version of the library, which you do not appear to have."
3373
if test -n "$a_deplib" ; then
3376
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3377
$echo "*** I have the capability to make that library automatically link in when"
3378
$echo "*** you link to this library. But I can only do this if you have a"
3379
$echo "*** shared version of the library, which you do not appear to have"
3380
$echo "*** because I did check the linker path looking for a file starting"
3381
if test -z "$potlib" ; then
3382
$echo "*** with $libname but no candidates were found. (...for file magic test)"
3384
$echo "*** with $libname and none of the candidates passed a file format test"
3385
$echo "*** using a file magic. Last file checked: $potlib"
3389
# Add a -L argument.
3390
newdeplibs="$newdeplibs $a_deplib"
3392
done # Gone through all deplibs.
3395
set dummy $deplibs_check_method
3396
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3397
for a_deplib in $deplibs; do
3398
name="`expr $a_deplib : '-l\(.*\)'`"
3399
# If $name is empty we are operating on a -L argument.
3400
if test -n "$name" && test "$name" != "0"; then
3401
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3402
case " $predeps $postdeps " in
3404
newdeplibs="$newdeplibs $a_deplib"
3409
if test -n "$a_deplib" ; then
3410
libname=`eval \\$echo \"$libname_spec\"`
3411
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3412
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3413
for potent_lib in $potential_libs; do
3414
potlib="$potent_lib" # see symlink-check above in file_magic test
3415
if eval $echo \"$potent_lib\" 2>/dev/null \
3417
| $EGREP "$match_pattern_regex" > /dev/null; then
3418
newdeplibs="$newdeplibs $a_deplib"
3425
if test -n "$a_deplib" ; then
3428
$echo "*** Warning: linker path does not have real file for library $a_deplib."
3429
$echo "*** I have the capability to make that library automatically link in when"
3430
$echo "*** you link to this library. But I can only do this if you have a"
3431
$echo "*** shared version of the library, which you do not appear to have"
3432
$echo "*** because I did check the linker path looking for a file starting"
3433
if test -z "$potlib" ; then
3434
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3436
$echo "*** with $libname and none of the candidates passed a file format test"
3437
$echo "*** using a regex pattern. Last file checked: $potlib"
2905
3441
# Add a -L argument.
2910
3446
none | unknown | *)
2912
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2913
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2914
grep . >/dev/null; then
3448
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3449
-e 's/ -[LR][^ ]*//g'`
3450
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3451
for i in $predeps $postdeps ; do
3452
# can't use Xsed below, because $i might contain '/'
3453
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3456
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3457
| grep . >/dev/null; then
2916
3459
if test "X$deplibs_check_method" = "Xnone"; then
2917
echo "*** Warning: inter-library dependencies are not supported in this platform."
3460
$echo "*** Warning: inter-library dependencies are not supported in this platform."
2919
echo "*** Warning: inter-library dependencies are not known to be supported."
3462
$echo "*** Warning: inter-library dependencies are not known to be supported."
2921
echo "*** All declared inter-library dependencies are being dropped."
3464
$echo "*** All declared inter-library dependencies are being dropped."
2922
3465
droppeddeps=yes
2929
3472
libname=$libname_save
2930
3473
name=$name_save
3476
*-*-rhapsody* | *-*-darwin1.[012])
3477
# On Rhapsody replace the C library is the System framework
3478
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
2932
3482
if test "$droppeddeps" = yes; then
2933
3483
if test "$module" = yes; then
2935
echo "*** Warning: libtool could not satisfy all declared inter-library"
2936
echo "*** dependencies of module $libname. Therefore, libtool will create"
2937
echo "*** a static module, that should work as long as the dlopening"
2938
echo "*** application is linked with the -dlopen flag."
3485
$echo "*** Warning: libtool could not satisfy all declared inter-library"
3486
$echo "*** dependencies of module $libname. Therefore, libtool will create"
3487
$echo "*** a static module, that should work as long as the dlopening"
3488
$echo "*** application is linked with the -dlopen flag."
2939
3489
if test -z "$global_symbol_pipe"; then
2941
echo "*** However, this would only work if libtool was able to extract symbol"
2942
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2943
echo "*** not find such a program. So, this module is probably useless."
2944
echo "*** \`nm' from GNU binutils and a full rebuild may help."
3491
$echo "*** However, this would only work if libtool was able to extract symbol"
3492
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3493
$echo "*** not find such a program. So, this module is probably useless."
3494
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
2946
3496
if test "$build_old_libs" = no; then
2947
3497
oldlibs="$output_objdir/$libname.$libext"
2951
3501
build_libtool_libs=no
2954
echo "*** The inter-library dependencies that have been dropped here will be"
2955
echo "*** automatically added whenever a program is linked with this library"
2956
echo "*** or is declared to -dlopen it."
3504
$echo "*** The inter-library dependencies that have been dropped here will be"
3505
$echo "*** automatically added whenever a program is linked with this library"
3506
$echo "*** or is declared to -dlopen it."
2958
if test $allow_undefined = no; then
2960
echo "*** Since this library must not contain undefined symbols,"
2961
echo "*** because either the platform does not support them or"
2962
echo "*** it was explicitly requested with -no-undefined,"
2963
echo "*** libtool will only create a static version of it."
3508
if test "$allow_undefined" = no; then
3510
$echo "*** Since this library must not contain undefined symbols,"
3511
$echo "*** because either the platform does not support them or"
3512
$echo "*** it was explicitly requested with -no-undefined,"
3513
$echo "*** libtool will only create a static version of it."
2964
3514
if test "$build_old_libs" = no; then
2965
3515
oldlibs="$output_objdir/$libname.$libext"
2966
3516
build_libtool_libs=module
3135
3699
$show "$mkdir $xdir"
3136
3700
$run $mkdir "$xdir"
3138
if test $status -ne 0 && test ! -d "$xdir"; then
3702
if test "$status" -ne 0 && test ! -d "$xdir"; then
3705
# We will extract separately just the conflicting names and we will no
3706
# longer touch any unique names. It is faster to leave these extract
3707
# automatically by $AR in one run.
3141
3708
$show "(cd $xdir && $AR x $xabs)"
3142
3709
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3710
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3713
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3714
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3715
$AR t "$xabs" | sort | uniq -cd | while read -r count name
3718
while test "$i" -le "$count"
3720
# Put our $i before any first dot (extension)
3721
# Never overwrite any file
3723
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3725
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3727
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3728
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3144
3734
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3154
3744
# Make a backup of the uninstalled library when relinking
3155
if test "$mode" = relink && test "$hardcode_into_libs" = all; then
3745
if test "$mode" = relink; then
3156
3746
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3749
# Add all flags from the command line. We here create a library,
3750
# but those flags were only added to compile_command and
3751
# finalize_command, which are only used when creating executables.
3752
# So do it by hand here.
3753
compiler_flags="$compiler_flags $add_flags"
3754
# Only add it to commands which use CC, instead of LD, i.e.
3755
# only to $compiler_flags
3756
#linker_flags="$linker_flags $add_flags"
3159
3758
# Do each of the archive commands.
3759
if test "$module" = yes && test -n "$module_cmds" ; then
3760
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3761
eval cmds=\"$module_expsym_cmds\"
3763
eval cmds=\"$module_cmds\"
3160
3766
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3161
3767
eval cmds=\"$archive_expsym_cmds\"
3163
3769
eval cmds=\"$archive_cmds\"
3165
if len=`expr "X$cmds" : ".*"` &&
3166
test $len -le $max_cmd_len; then
3773
if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3774
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3169
3777
# The command line is too long to link in one step, link piecewise.
3170
$echo "creating reloadable object files..."
3778
$echo "creating reloadable object files..."
3172
3780
# Save the value of $output and $libobjs because we want to
3173
3781
# use them later. If we have whole_archive_flag_spec, we
3180
3788
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3181
3789
save_libobjs=$libobjs
3185
3793
# Clear the reloadable object creation command queue and
3186
3794
# initialize k to one.
3193
output=$output_objdir/$save_output-${k}.$objext
3801
output=$output_objdir/$save_output-${k}.$objext
3194
3802
# Loop over the list of objects to be linked.
3195
for obj in $save_libobjs
3197
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3198
if test "X$objlist" = X ||
3803
for obj in $save_libobjs
3805
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3806
if test "X$objlist" = X ||
3199
3807
{ len=`expr "X$test_cmds" : ".*"` &&
3200
test $len -le $max_cmd_len; }; then
3201
objlist="$objlist $obj"
3808
test "$len" -le "$max_cmd_len"; }; then
3809
objlist="$objlist $obj"
3203
3811
# The command $test_cmds is almost too long, add a
3204
3812
# command to the queue.
3205
if test $k -eq 1 ; then
3206
# The first file doesn't have a previous command to add.
3207
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3209
# All subsequent reloadable object files will link in
3210
# the last one created.
3211
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3213
last_robj=$output_objdir/$save_output-${k}.$objext
3215
output=$output_objdir/$save_output-${k}.$objext
3813
if test "$k" -eq 1 ; then
3814
# The first file doesn't have a previous command to add.
3815
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3817
# All subsequent reloadable object files will link in
3818
# the last one created.
3819
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3821
last_robj=$output_objdir/$save_output-${k}.$objext
3823
output=$output_objdir/$save_output-${k}.$objext
3220
3828
# Handle the remaining objects by creating one last
3221
3829
# reloadable object file. All subsequent reloadable object
3222
3830
# files will link in the last one created.
3223
3831
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3224
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3832
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3834
if ${skipped_export-false}; then
3835
$show "generating symbol list for \`$libname.la'"
3836
export_symbols="$output_objdir/$libname.exp"
3837
$run $rm $export_symbols
3839
# Append the command to create the export file.
3840
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3226
3843
# Set up a command to remove the reloadale object files
3227
3844
# after they are used.
3229
while test $i -lt $k
3232
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3846
while test "$i" -lt "$k"
3849
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3235
$echo "creating a temporary reloadable object file: $output"
3852
$echo "creating a temporary reloadable object file: $output"
3237
3854
# Loop through the commands generated above and execute them.
3238
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3239
for cmd in $concat_cmds; do
3242
$run eval "$cmd" || exit $?
3855
save_ifs="$IFS"; IFS='~'
3856
for cmd in $concat_cmds; do
3859
$run eval "$cmd" || exit $?
3247
3864
# Restore the value of output.
3250
3867
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3251
3868
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3254
3871
# value of $libobjs for piecewise linking.
3256
3873
# Do each of the archive commands.
3257
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3258
eval cmds=\"$archive_expsym_cmds\"
3260
eval cmds=\"$archive_cmds\"
3874
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3875
eval cmds=\"$archive_expsym_cmds\"
3877
eval cmds=\"$archive_cmds\"
3263
3880
# Append the command to remove the reloadable object files
3264
3881
# to the just-reset $cmds.
3265
eval cmds=\"\$cmds~$rm $delfiles\"
3267
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3268
for cmd in $cmds; do
3271
$run eval "$cmd" || exit $?
3882
eval cmds=\"\$cmds~$rm $delfiles\"
3884
save_ifs="$IFS"; IFS='~'
3885
for cmd in $cmds; do
3888
$run eval "$cmd" || exit $?
3275
3892
# Restore the uninstalled library and exit
3276
if test "$mode" = relink && test "$hardcode_into_libs" = all; then
3893
if test "$mode" = relink; then
3277
3894
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3376
3993
$show "$mkdir $xdir"
3377
3994
$run $mkdir "$xdir"
3379
if test $status -ne 0 && test ! -d "$xdir"; then
3996
if test "$status" -ne 0 && test ! -d "$xdir"; then
3999
# We will extract separately just the conflicting names and we will no
4000
# longer touch any unique names. It is faster to leave these extract
4001
# automatically by $AR in one run.
3382
4002
$show "(cd $xdir && $AR x $xabs)"
3383
4003
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4004
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4007
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4008
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4009
$AR t "$xabs" | sort | uniq -cd | while read -r count name
4012
while test "$i" -le "$count"
4014
# Put our $i before any first dot (extension)
4015
# Never overwrite any file
4017
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4019
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4021
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4022
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3385
4028
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3915
4575
# win32 will think the script is a binary if it has
3916
4576
# a .exe suffix, so we strip it off here.
3917
4577
case $output in
3918
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4578
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3920
4580
# test for cygwin because mv fails w/o .exe extensions
3922
*cygwin*) exeext=.exe ;;
4584
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4588
*cygwin* | *mingw* )
4589
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4590
cwrapper=`$echo ${output}.exe`
4591
$rm $cwrappersource $cwrapper
4592
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4594
cat > $cwrappersource <<EOF
4596
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4597
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4599
The $output program cannot be directly executed until all the libtool
4600
libraries that it depends on are installed.
4602
This wrapper executable should never be moved out of the build directory.
4603
If it is, it will not operate correctly.
4605
Currently, it simply execs the wrapper *script* "/bin/sh $output",
4606
but could eventually absorb all of the scripts functionality and
4607
exec $objdir/$outputname directly.
4610
cat >> $cwrappersource<<"EOF"
4618
#if defined(PATH_MAX)
4619
# define LT_PATHMAX PATH_MAX
4620
#elif defined(MAXPATHLEN)
4621
# define LT_PATHMAX MAXPATHLEN
4623
# define LT_PATHMAX 1024
4626
#ifndef DIR_SEPARATOR
4627
#define DIR_SEPARATOR '/'
4630
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4632
#define HAVE_DOS_BASED_FILE_SYSTEM
4633
#ifndef DIR_SEPARATOR_2
4634
#define DIR_SEPARATOR_2 '\\'
4638
#ifndef DIR_SEPARATOR_2
4639
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4640
#else /* DIR_SEPARATOR_2 */
4641
# define IS_DIR_SEPARATOR(ch) \
4642
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4643
#endif /* DIR_SEPARATOR_2 */
4645
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4646
#define XFREE(stale) do { \
4647
if (stale) { free ((void *) stale); stale = 0; } \
4650
const char *program_name = NULL;
4652
void * xmalloc (size_t num);
4653
char * xstrdup (const char *string);
4654
char * basename (const char *name);
4655
char * fnqualify(const char *path);
4656
char * strendzap(char *str, const char *pat);
4657
void lt_fatal (const char *message, ...);
4660
main (int argc, char *argv[])
4665
program_name = (char *) xstrdup ((char *) basename (argv[0]));
4666
newargz = XMALLOC(char *, argc+2);
4669
cat >> $cwrappersource <<EOF
4670
newargz[0] = "$SHELL";
4673
cat >> $cwrappersource <<"EOF"
4674
newargz[1] = fnqualify(argv[0]);
4675
/* we know the script has the same name, without the .exe */
4676
/* so make sure newargz[1] doesn't end in .exe */
4677
strendzap(newargz[1],".exe");
4678
for (i = 1; i < argc; i++)
4679
newargz[i+1] = xstrdup(argv[i]);
4680
newargz[argc+1] = NULL;
4683
cat >> $cwrappersource <<EOF
4684
execv("$SHELL",newargz);
4687
cat >> $cwrappersource <<"EOF"
4691
xmalloc (size_t num)
4693
void * p = (void *) malloc (num);
4695
lt_fatal ("Memory exhausted");
4701
xstrdup (const char *string)
4703
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4708
basename (const char *name)
4712
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4713
/* Skip over the disk name in MSDOS pathnames. */
4714
if (isalpha (name[0]) && name[1] == ':')
4718
for (base = name; *name; name++)
4719
if (IS_DIR_SEPARATOR (*name))
4721
return (char *) base;
4725
fnqualify(const char *path)
4729
char tmp[LT_PATHMAX + 1];
4731
assert(path != NULL);
4733
/* Is it qualified already? */
4734
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4735
if (isalpha (path[0]) && path[1] == ':')
4736
return xstrdup (path);
4738
if (IS_DIR_SEPARATOR (path[0]))
4739
return xstrdup (path);
4741
/* prepend the current directory */
4742
/* doesn't handle '~' */
4743
if (getcwd (tmp, LT_PATHMAX) == NULL)
4744
lt_fatal ("getcwd failed");
4745
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4746
p = XMALLOC(char, size);
4747
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4752
strendzap(char *str, const char *pat)
4756
assert(str != NULL);
4757
assert(pat != NULL);
4760
patlen = strlen(pat);
4764
str += len - patlen;
4765
if (strcmp(str, pat) == 0)
4772
lt_error_core (int exit_status, const char * mode,
4773
const char * message, va_list ap)
4775
fprintf (stderr, "%s: %s: ", program_name, mode);
4776
vfprintf (stderr, message, ap);
4777
fprintf (stderr, ".\n");
4779
if (exit_status >= 0)
4784
lt_fatal (const char *message, ...)
4787
va_start (ap, message);
4788
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4792
# we should really use a build-platform specific compiler
4793
# here, but OTOH, the wrappers (shell script and this C one)
4794
# are only useful if you want to execute the "real" binary.
4795
# Since the "real" binary is built for $host, then this
4796
# wrapper might as well be built for $host, too.
4797
$run $LTCC -s -o $cwrapper $cwrappersource
3926
4801
trap "$rm $output; exit 1" 1 2 15
4157
5023
$show "$mkdir $xdir"
4158
5024
$run $mkdir "$xdir"
4160
if test $status -ne 0 && test ! -d "$xdir"; then
5026
if test "$status" -ne 0 && test ! -d "$xdir"; then
5029
# We will extract separately just the conflicting names and we will no
5030
# longer touch any unique names. It is faster to leave these extract
5031
# automatically by $AR in one run.
4163
5032
$show "(cd $xdir && $AR x $xabs)"
4164
5033
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5034
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5037
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5038
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5039
$AR t "$xabs" | sort | uniq -cd | while read -r count name
5042
while test "$i" -le "$count"
5044
# Put our $i before any first dot (extension)
5045
# Never overwrite any file
5047
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5049
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5051
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5052
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4166
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
5058
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5062
compiler_flags="$compiler_flags $add_flags"
4170
5064
# Do each command in the archive commands.
4171
5065
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4172
5066
eval cmds=\"$old_archive_from_new_cmds\"
4174
# # Ensure that we have .o objects in place in case we decided
4175
# # not to build a shared library, and have fallen back to building
4176
# # static libs even though --disable-static was passed!
4177
# for oldobj in $oldobjs; do
4178
# if test ! -f $oldobj; then
4179
# xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4180
# if test "X$xdir" = "X$oldobj"; then
4185
# baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4186
# obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4187
# $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4188
# $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4192
eval cmds=\"$old_archive_cmds\"
4194
if len=`expr "X$cmds" : ".*"` &&
4195
test $len -le $max_cmd_len; then
4198
# the command line is too long to link in one step, link in parts
4199
$echo "using piecewise archive linking..."
5068
eval cmds=\"$old_archive_cmds\"
5070
if len=`expr "X$cmds" : ".*"` &&
5071
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5074
# the command line is too long to link in one step, link in parts
5075
$echo "using piecewise archive linking..."
4200
5076
save_RANLIB=$RANLIB
4204
save_oldobjs=$oldobjs
4205
for obj in $save_oldobjs
4207
oldobjs="$objlist $obj"
4208
objlist="$objlist $obj"
4209
eval test_cmds=\"$old_archive_cmds\"
4210
if len=`expr "X$test_cmds" : ".*"` &&
4211
test $len -le $max_cmd_len; then
4214
# the above command should be used before it gets too long
5080
save_oldobjs=$oldobjs
5081
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
5082
# encoded into archives. This makes 'ar r' malfunction in
5083
# this piecewise linking case whenever conflicting object
5084
# names appear in distinct ar calls; check, warn and compensate.
5085
if (for obj in $save_oldobjs
5087
$echo "X$obj" | $Xsed -e 's%^.*/%%'
5088
done | sort | sort -uc >/dev/null 2>&1); then
5091
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5092
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5095
# Is there a better way of finding the last object in the list?
5096
for obj in $save_oldobjs
5100
for obj in $save_oldobjs
5102
oldobjs="$objlist $obj"
5103
objlist="$objlist $obj"
5104
eval test_cmds=\"$old_archive_cmds\"
5105
if len=`expr "X$test_cmds" : ".*"` &&
5106
test "$len" -le "$max_cmd_len"; then
5109
# the above command should be used before it gets too long
5111
if test "$obj" = "$last_oldobj" ; then
4216
5114
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4217
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5115
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4221
5119
RANLIB=$save_RANLIB
4223
eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5121
if test "X$oldobjs" = "X" ; then
5122
eval cmds=\"\$concat_cmds\"
5124
eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4226
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5128
save_ifs="$IFS"; IFS='~'
4227
5129
for cmd in $cmds; do
4228
5130
IFS="$save_ifs"
4557
5463
test "X$dir" = "X$file/" && dir=
4558
5464
dir="$dir$objdir"
4560
if test "$hardcode_into_libs" = all && test -n "$relink_command"; then
5466
if test -n "$relink_command"; then
5467
# Determine the prefix the user has applied to our future dir.
5468
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5470
# Don't allow the user to place us outside of our expected
5471
# location b/c this prevents finding dependent libraries that
5472
# are installed to the same prefix.
5473
# At present, this check doesn't affect windows .dll's that
5474
# are installed into $libdir/../bin (currently, that works fine)
5475
# but it's something to keep an eye on.
5476
if test "$inst_prefix_dir" = "$destdir"; then
5477
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5481
if test -n "$inst_prefix_dir"; then
5482
# Stick the inst_prefix_dir data into the link command.
5483
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5485
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4561
5488
$echo "$modename: warning: relinking \`$file'" 1>&2
4562
5489
$show "$relink_command"
4563
5490
if $run eval "$relink_command"; then :
4565
5492
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4671
5598
destfile="$destdir/$destfile"
5601
# If the file is missing, and there is a .exe on the end, strip it
5602
# because it is most likely a libtool script we actually want to
5607
if test ! -f "$file"; then
5608
file=`$echo $file|${SED} 's,.exe$,,'`
4674
5614
# Do a test to see if this is really a libtool program.
4675
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5617
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5623
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4677
5625
relink_command=
5627
# To insure that "foo" is sourced, and not "foo.exe",
5628
# finese the cygwin/MSYS system by explicitly sourcing "foo."
5629
# which disallows the automatic-append-.exe behavior.
5631
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5632
*) wrapperdot=${wrapper} ;;
4679
5634
# If there is no directory component, then add one.
4681
*/* | *\\*) . $file ;;
5636
*/* | *\\*) . ${wrapperdot} ;;
5637
*) . ./${wrapperdot} ;;
4685
5640
# Check the variables that should have been set.
4686
if test -z "$uninst_deplibs"; then
4687
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
5641
if test -z "$notinst_deplibs"; then
5642
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4692
for lib in $uninst_deplibs; do
5647
for lib in $notinst_deplibs; do
4693
5648
# Check to see that each library is installed.
4695
5650
if test -f "$lib"; then
4848
5807
# Exit here if they wanted silent mode.
4851
echo "----------------------------------------------------------------------"
4852
echo "Libraries have been installed in:"
5810
$echo "----------------------------------------------------------------------"
5811
$echo "Libraries have been installed in:"
4853
5812
for libdir in $libdirs; do
4857
echo "If you ever happen to want to link against installed libraries"
4858
echo "in a given directory, LIBDIR, you must either use libtool, and"
4859
echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4860
echo "flag during linking and do at least one of the following:"
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:"
4861
5820
if test -n "$shlibpath_var"; then
4862
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4863
echo " during execution"
5821
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5822
$echo " during execution"
4865
5824
if test -n "$runpath_var"; then
4866
echo " - add LIBDIR to the \`$runpath_var' environment variable"
4867
echo " during linking"
5825
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
5826
$echo " during linking"
4869
5828
if test -n "$hardcode_libdir_flag_spec"; then
4871
5830
eval flag=\"$hardcode_libdir_flag_spec\"
4873
echo " - use the \`$flag' linker flag"
5832
$echo " - use the \`$flag' linker flag"
4875
5834
if test -n "$admincmds"; then
4876
echo " - have your system administrator run these commands:$admincmds"
5835
$echo " - have your system administrator run these commands:$admincmds"
4878
5837
if test -f /etc/ld.so.conf; then
4879
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5838
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4882
echo "See any operating system documentation about shared libraries for"
4883
echo "more information, such as the ld(1) and ld.so(8) manual pages."
4884
echo "----------------------------------------------------------------------"
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 "----------------------------------------------------------------------"
6015
origobjdir="$objdir"
5056
6016
for file in $files; do
5057
6017
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5058
6018
if test "X$dir" = "X$file"; then
6020
objdir="$origobjdir"
5062
objdir="$dir/$objdir"
6022
objdir="$dir/$origobjdir"
5064
6024
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5065
test $mode = uninstall && objdir="$dir"
6025
test "$mode" = uninstall && objdir="$dir"
5067
6027
# Remember objdir for removal later, being careful to avoid duplicates
5068
if test $mode = clean; then
6028
if test "$mode" = clean; then
5070
6030
*" $objdir "*) ;;
5071
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
5075
6047
rmfiles="$file"
5079
6051
# Possibly a libtool archive, so verify it.
5080
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6052
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5083
6055
# Delete the libtool libraries and symlinks.
5120
6098
# Possibly a libtool object, so verify it.
5121
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6099
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5126
6104
# Add PIC object to the list of files to remove.
5127
if test -n "$pic_object" \
5128
&& test "$pic_object" != none; then
6105
if test -n "$pic_object" \
6106
&& test "$pic_object" != none; then
5129
6107
rmfiles="$rmfiles $dir/$pic_object"
5132
6110
# Add non-PIC object to the list of files to remove.
5133
if test -n "$non_pic_object" \
5134
&& test "$non_pic_object" != none; then
6111
if test -n "$non_pic_object" \
6112
&& test "$non_pic_object" != none; then
5135
6113
rmfiles="$rmfiles $dir/$non_pic_object"
5141
# Do a test to see if this is a libtool program.
5142
if test $mode = clean &&
5143
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6119
if test "$mode" = clean ; then
6123
file=`$echo $file|${SED} 's,.exe$,,'`
6124
noexename=`$echo $name|${SED} 's,.exe$,,'`
6125
# $file with .exe has already been added to rmfiles,
6126
# add $file without .exe
6127
rmfiles="$rmfiles $file"
6130
# Do a test to see if this is a libtool program.
6131
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5147
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5148
if test "$fast_install" = yes && test -n "$relink_command"; then
5149
rmfiles="$rmfiles $objdir/lt-$name"
6135
# note $name still contains .exe if it was in $file originally
6136
# as does the version of $file that was added into $rmfiles
6137
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6138
if test "$fast_install" = yes && test -n "$relink_command"; then
6139
rmfiles="$rmfiles $objdir/lt-$name"
6141
if test "X$noexename" != "X$name" ; then
6142
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
5154
6148
$show "$rm $rmfiles"
6149
$run $rm $rmfiles || exit_status=1
6151
objdir="$origobjdir"
5158
6153
# Try to remove the ${objdir}s in the directories where we deleted files
5159
6154
for dir in $rmdirs; do
5160
6155
if test -d "$dir"; then
5162
$run rmdir $dir >/dev/null 2>&1
6157
$run rmdir $dir >/dev/null 2>&1