51
51
# The name of this program.
52
progname=`$echo "$0" | sed 's%^.*/%%'`
52
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
53
53
modename="$progname"
59
TIMESTAMP=" (1.920 2001/04/24 23:26:18)"
59
TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)"
62
62
help="Try \`$progname --help' for more information."
68
68
# Sed substitution that helps us do robust quoting. It backslashifies
69
69
# metacharacters that are still active within double-quoted strings.
70
Xsed="${SED}"' -e 1s/^X//'
71
71
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
73
NL2SP='tr \015\012 \040\040'
72
# test EBCDIC or ASCII
73
case `echo A|od -x` in
74
*[Cc]1*) # EBCDIC based system
75
SP2NL="tr '\100' '\n'"
76
NL2SP="tr '\r\n' '\100\100'"
78
*) # Assume ASCII based system
79
SP2NL="tr '\040' '\012'"
80
NL2SP="tr '\015\012' '\040\040'"
76
85
# Only set LANG and LC_ALL to C if already set.
84
93
save_LANG="$LANG"; LANG=C; export LANG
96
# Make sure IFS has a sensible default
87
99
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
88
100
echo "$modename: not configured to build any kind of library" 1>&2
89
101
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
219
# If this variable is set in any of the actions, the command in it
220
# will be execed at the end. This prevents here-documents from being
221
# left over by shells.
205
224
if test -z "$show_help"; then
207
226
# Infer the operation mode.
208
227
if test -z "$mode"; then
210
*cc | *++ | gcc* | *-gcc*)
229
*cc | *++ | gcc* | *-gcc* | xlc*)
615
634
# Now arrange that obj and lo_libobj become the same file
616
635
$show "(cd $xdir && $LN_S $baseobj $libobj)"
617
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
980
1003
# so, if we see these flags be careful not to treat them like -L
981
1004
-L[A-Z][A-Z]*:*)
982
1005
case $with_gcc/$host in
1006
no/*-*-irix* | no/*-*-nonstopux*)
984
1007
compile_command="$compile_command $arg"
985
1008
finalize_command="$finalize_command $arg"
1031
1054
# These systems don't actually have a C library (as such)
1032
1055
test "X$arg" = "X-lc" && continue
1057
*-*-openbsd* | *-*-freebsd*)
1058
# Do not include libc due to us having libc/libc_r.
1059
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.
1036
1070
deplibs="$deplibs $arg"
1307
1341
# Find all interdependent deplibs by searching for libraries
1308
1342
# that are linked more than once (e.g. -la -lb -la)
1309
1343
for deplib in $deplibs; do
1311
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1344
if test "X$duplicate_deps" = "Xyes" ; then
1346
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1313
1349
libs="$libs $deplib"
1439
1475
if test "$deplibs_check_method" != pass_all; then
1441
echo "*** Warning: This library needs some functionality provided by $deplib."
1477
echo "*** Warning: Trying to link with static lib archive $deplib."
1442
1478
echo "*** I have the capability to make that library automatically link in when"
1443
1479
echo "*** you link to this library. But I can only do this if you have a"
1444
echo "*** shared version of the library, which you do not appear to have."
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."
1447
1485
echo "*** Warning: Linking the shared library $output against the"
1487
1525
# Check to see that this really is a libtool archive.
1488
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1526
if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1490
1528
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1533
1571
for deplib in $dependency_libs; do
1534
1572
deplibs="$deplib $deplibs"
1535
case "$tmp_libs " in
1536
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1573
if test "X$duplicate_deps" = "Xyes" ; then
1574
case "$tmp_libs " in
1575
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1538
1578
tmp_libs="$tmp_libs $deplib"
1540
1580
elif test $linkmode != prog && test $linkmode != lib; then
1657
1697
# or/and link against static libraries
1658
1698
newdependency_libs="$deplib $newdependency_libs"
1660
case "$tmp_libs " in
1661
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1700
if test "X$duplicate_deps" = "Xyes" ; then
1701
case "$tmp_libs " in
1702
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1663
1705
tmp_libs="$tmp_libs $deplib"
1664
1706
done # for deplib
1744
1786
# Make a new name for the extract_expsyms_cmds to use
1745
1787
soroot="$soname"
1746
soname=`echo $soroot | sed -e 's/^.*\///'`
1747
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1788
soname=`echo $soroot | ${SED} -e 's/^.*\///'`
1789
newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
1749
1791
# If the library has no export list, then create one now
1750
1792
if test -f "$output_objdir/$soname-def"; then :
1752
1794
$show "extracting exported symbol list from \`$soname'"
1753
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1795
save_ifs="$IFS"; IFS='~'
1754
1796
eval cmds=\"$extract_expsyms_cmds\"
1755
1797
for cmd in $cmds; do
1756
1798
IFS="$save_ifs"
1903
1945
# Just print a warning and add the library to dependency_libs so
1904
1946
# that the program can be linked against the static library.
1906
echo "*** Warning: This library needs some functionality provided by $lib."
1948
echo "*** Warning: This system can not link to static lib archive $lib."
1907
1949
echo "*** I have the capability to make that library automatically link in when"
1908
1950
echo "*** you link to this library. But I can only do this if you have a"
1909
1951
echo "*** shared version of the library, which you do not appear to have."
1910
1952
if test "$module" = yes; then
1911
echo "*** Therefore, libtool will create a static module, that should work "
1912
echo "*** as long as the dlopening application is linked with the -dlopen flag."
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."
1913
1956
if test -z "$global_symbol_pipe"; then
1915
echo "*** However, this would only work if libtool was able to extract symbol"
1916
echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1917
echo "*** not find such a program. So, this module is probably useless."
1918
echo "*** \`nm' from GNU binutils and a full rebuild may help."
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."
1920
1963
if test "$build_old_libs" = no; then
1921
build_libtool_libs=module
1964
build_libtool_libs=module
1924
build_libtool_libs=no
1967
build_libtool_libs=no
1959
2002
for deplib in $dependency_libs; do
1960
2003
newdependency_libs="$deplib $newdependency_libs"
1961
case "$tmp_libs " in
1962
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2004
if test "X$duplicate_deps" = "Xyes" ; then
2005
case "$tmp_libs " in
2006
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1964
2009
tmp_libs="$tmp_libs $deplib"
1986
2031
if grep "^installed=no" $deplib > /dev/null; then
1987
2032
path="-L$absdir/$objdir"
1989
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2034
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
1990
2035
if test -z "$libdir"; then
1991
2036
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2250
2295
versuffix=".$current";
2254
2299
major=`expr $current - $age + 1`
2255
verstring="sgi$major.$revision"
2301
case $version_type in
2302
nonstopux) verstring_prefix=nonstopux ;;
2303
*) verstring_prefix=sgi ;;
2305
verstring="$verstring_prefix$major.$revision"
2257
2307
# Add in all the interfaces that we are compatible with.
2259
2309
while test $loop != 0; do
2260
2310
iface=`expr $revision - $loop`
2261
2311
loop=`expr $loop - 1`
2262
verstring="sgi$major.$iface:$verstring"
2312
verstring="$verstring_prefix$major.$iface:$verstring"
2265
2315
# Before this point, $major must not contain `.'.
2312
2362
if test -z "$vinfo" && test -n "$release"; then
2314
2364
verstring="0.0"
2365
case $version_type in
2367
# we can't check for "0.0" in archive_cmds due to quoting
2368
# problems, so we reset it completely
2315
2375
if test "$need_version" = no; then
2356
2416
# Eliminate all temporary directories.
2357
2417
for path in $notinst_path; do
2358
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2359
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2360
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2418
lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2419
deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2420
dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2363
2423
if test -n "$xrpath"; then
2409
2469
# Don't link with libc until the a.out ld.so is fixed.
2471
*-*-openbsd* | *-*-freebsd*)
2472
# Do not include libc due to us having libc/libc_r.
2412
2475
# Add libc to deplibs on all other systems if necessary.
2413
2476
if test $build_libtool_need_lc = "yes"; then
2467
2530
droppeddeps=yes
2469
echo "*** Warning: This library needs some functionality provided by $i."
2532
echo "*** Warning: dynamic linker does not accept needed library $i."
2470
2533
echo "*** I have the capability to make that library automatically link in when"
2471
2534
echo "*** you link to this library. But I can only do this if you have a"
2472
echo "*** shared version of the library, which you do not appear to have."
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."
2475
2540
newdeplibs="$newdeplibs $i"
2479
# Error occured in the first compile. Let's try to salvage the situation:
2480
# Compile a seperate program for each library.
2544
# Error occured in the first compile. Let's try to salvage
2545
# the situation: Compile a separate program for each library.
2481
2546
for i in $deplibs; do
2482
2547
name="`expr $i : '-l\(.*\)'`"
2483
2548
# If $name is empty we are operating on a -L argument.
2497
2562
droppeddeps=yes
2499
echo "*** Warning: This library needs some functionality provided by $i."
2564
echo "*** Warning: dynamic linker does not accept needed library $i."
2500
2565
echo "*** I have the capability to make that library automatically link in when"
2501
2566
echo "*** you link to this library. But I can only do this if you have a"
2502
echo "*** shared version of the library, which you do not appear to have."
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."
2505
2572
droppeddeps=yes
2539
2606
potlib="$potent_lib"
2540
2607
while test -h "$potlib" 2>/dev/null; do
2541
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2608
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2542
2609
case $potliblink in
2543
2610
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2544
2611
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2547
2614
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2549
2616
| egrep "$file_magic_regex" > /dev/null; then
2550
2617
newdeplibs="$newdeplibs $a_deplib"
2556
2623
if test -n "$a_deplib" ; then
2557
2624
droppeddeps=yes
2559
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2626
echo "*** Warning: linker path does not have real file for library $a_deplib."
2560
2627
echo "*** I have the capability to make that library automatically link in when"
2561
2628
echo "*** you link to this library. But I can only do this if you have a"
2562
echo "*** shared version of the library, which you do not appear to have."
2629
echo "*** shared version of the library, which you do not appear to have"
2630
echo "*** because I did check the linker path looking for a file starting"
2631
if test -z "$potlib" ; then
2632
echo "*** with $libname but no candidates were found. (...for file magic test)"
2634
echo "*** with $libname and none of the candidates passed a file format test"
2635
echo "*** using a file magic. Last file checked: $potlib"
2565
2639
# Add a -L argument.
2578
2652
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2579
2653
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2580
2654
for potent_lib in $potential_libs; do
2655
potlib="$potent_lib" # see symlink-check below in file_magic test
2581
2656
if eval echo \"$potent_lib\" 2>/dev/null \
2583
2658
| egrep "$match_pattern_regex" > /dev/null; then
2584
2659
newdeplibs="$newdeplibs $a_deplib"
2590
2665
if test -n "$a_deplib" ; then
2591
2666
droppeddeps=yes
2593
echo "*** Warning: This library needs some functionality provided by $a_deplib."
2668
echo "*** Warning: linker path does not have real file for library $a_deplib."
2594
2669
echo "*** I have the capability to make that library automatically link in when"
2595
2670
echo "*** you link to this library. But I can only do this if you have a"
2596
echo "*** shared version of the library, which you do not appear to have."
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"
2673
if test -z "$potlib" ; then
2674
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"
2599
2681
# Add a -L argument.
2858
2940
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2859
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"
2951
deplibs="$tmp_deplibs"
2861
2953
eval cmds=\"$archive_cmds\"
2954
deplibs="$save_deplibs"
2863
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2956
save_ifs="$IFS"; IFS='~'
2864
2957
for cmd in $cmds; do
2865
2958
IFS="$save_ifs"
3060
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3153
*cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3062
3155
if test -n "$vinfo"; then
3063
3156
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3079
3172
# On Rhapsody replace the C library is the System framework
3080
3173
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3081
3174
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3177
# Don't allow lazy linking, it breaks C++ global constructors
3178
compile_command="$compile_command ${wl}-bind_at_load"
3179
finalize_command="$finalize_command ${wl}-bind_at_load"
3245
3345
if test -z "$export_symbols"; then
3246
3346
export_symbols="$output_objdir/$output.exp"
3247
3347
$run $rm $export_symbols
3248
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3348
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3250
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3350
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3251
3351
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3252
3352
$run eval 'mv "$nlist"T "$nlist"'
3256
3356
for arg in $dlprefiles; do
3257
3357
$show "extracting global C symbols from \`$arg'"
3258
name=`echo "$arg" | sed -e 's%^.*/%%'`
3358
name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3259
3359
$run eval 'echo ": $name " >> "$nlist"'
3260
3360
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3272
3372
# Try sorting and uniquifying the output.
3273
if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3373
if grep -v "^: " < "$nlist" |
3374
if sort -k 3 </dev/null >/dev/null 2>&1; then
3379
uniq > "$nlist"S; then
3276
3382
grep -v "^: " < "$nlist" > "$nlist"S
3287
3393
#undef lt_preloaded_symbols
3289
3395
#if defined (__STDC__) && __STDC__
3290
# define lt_ptr_t void *
3396
# define lt_ptr void *
3292
# define lt_ptr_t char *
3398
# define lt_ptr char *
3296
3402
/* The mapping between symbol names and symbols. */
3298
3404
const char *name;
3301
3407
lt_preloaded_symbols[] =
3305
sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3306
-e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3307
< "$nlist" >> "$output_objdir/$dlsyms"
3411
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3309
3413
$echo >> "$output_objdir/$dlsyms" "\
3313
3417
/* This works around a problem in FreeBSD linker */
3494
3598
relink_command="$var=\"$var_value\"; export $var; $relink_command"
3497
relink_command="cd `pwd`; $relink_command"
3601
relink_command="(cd `pwd`; $relink_command)"
3498
3602
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3514
3618
# win32 will think the script is a binary if it has
3515
3619
# a .exe suffix, so we strip it off here.
3516
3620
case $output in
3517
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3621
*.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
3519
3623
# test for cygwin because mv fails w/o .exe extensions
3539
3643
# Sed substitution that helps us do robust quoting. It backslashifies
3540
3644
# metacharacters that are still active within double-quoted strings.
3541
Xsed='sed -e 1s/^X//'
3645
Xsed="${SED}"' -e 1s/^X//'
3542
3646
sed_quote_subst='$sed_quote_subst'
3544
3648
# The HP-UX ksh and POSIX shell print the target directory to stdout
3576
3680
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3578
3682
# Follow symbolic links until we get to the real thisdir.
3579
file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3683
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3580
3684
while test -n \"\$file\"; do
3581
3685
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3591
3695
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3592
file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3696
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3595
3699
# Try to get the absolute directory name.
3603
3707
progdir=\"\$thisdir/$objdir\"
3605
3709
if test ! -f \"\$progdir/\$program\" || \\
3606
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3710
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3607
3711
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3609
3713
file=\"\$\$-\$program\"
3619
3723
# relink executable if necessary
3620
3724
if test -n \"\$relink_command\"; then
3621
if (eval \$relink_command); then :
3725
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3727
$echo \"\$relink_command_output\" >&2
3623
3728
$rm \"\$progdir/\$file\"
3648
3753
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3650
3755
# Some systems cannot cope with colon-terminated $shlibpath_var
3651
# The second colon is a workaround for a bug in BeOS R4 sed
3756
# The second colon is a workaround for a bug in BeOS R4 ${SED}
3652
3757
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3654
3759
export $shlibpath_var
3825
3930
# Quote the link command for shipping.
3826
relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3931
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
3827
3932
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3829
3934
# Only create the output if not a dry run.
3840
3945
case $deplib in
3842
3947
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3843
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3948
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3844
3949
if test -z "$libdir"; then
3845
3950
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3855
3960
for lib in $dlfiles; do
3856
3961
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3857
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3962
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3858
3963
if test -z "$libdir"; then
3859
3964
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3866
3971
for lib in $dlprefiles; do
3867
3972
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3868
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3973
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3869
3974
if test -z "$libdir"; then
3870
3975
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4091
4196
# Check to see that this really is a libtool archive.
4092
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4197
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4094
4199
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4095
4200
$echo "$help" 1>&2
4240
4345
# Do a test to see if this is really a libtool program.
4241
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4348
wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4354
if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4242
4355
notinst_deplibs=
4243
4356
relink_command=
4245
4358
# If there is no directory component, then add one.
4247
*/* | *\\*) . $file ;;
4360
*/* | *\\*) . $wrapper ;;
4251
4364
# Check the variables that should have been set.
4252
4365
if test -z "$notinst_deplibs"; then
4253
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4366
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4324
4437
destfile=$destfile.exe
4327
destfile=`echo $destfile | sed -e 's,.exe$,,'`
4440
destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4368
4481
if test -n "$current_libdirs"; then
4369
4482
# Maybe just do a dry run.
4370
4483
test -n "$run" && current_libdirs=" -n$current_libdirs"
4371
exec $SHELL $0 --finish$current_libdirs
4484
exec_cmd='$SHELL $0 --finish$current_libdirs'
4378
4490
# libtool finish mode
4475
4587
# Check to see that this really is a libtool archive.
4476
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4588
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4478
4590
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4479
4591
$echo "$help" 1>&2
4546
4658
# Do a test to see if this is really a libtool program.
4547
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4659
if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4548
4660
# If there is no directory component, then add one.
4550
4662
*/* | *\\*) . $file ;;
4575
4687
LANG="$save_LANG"; export LANG
4578
# Now actually exec the command.
4579
eval "exec \$cmd$args"
4581
$echo "$modename: cannot exec \$cmd$args"
4690
# Now prepare to actually exec the command.
4691
exec_cmd="\$cmd$args"
4584
4693
# Display what would be done.
4585
4694
if test -n "$shlibpath_var"; then
4642
4751
# Don't error if the file doesn't exist and rm -f was used.
4643
4752
if (test -L "$file") >/dev/null 2>&1 \
4644
|| (test -h "$file") >/dev/null 2>&1 \
4753
|| (test -h "$file") >/dev/null 2>&1 \
4645
4754
|| test -f "$file"; then
4647
4756
elif test -d "$file"; then
4650
4759
elif test "$rmforce" = yes; then
4654
4763
rmfiles="$file"
4658
4767
# Possibly a libtool archive, so verify it.
4659
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4768
if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4662
4771
# Delete the libtool libraries and symlinks.
4747
$echo "$modename: invalid operation mode \`$mode'" 1>&2
4748
$echo "$generic_help" 1>&2
4856
if test -z "$exec_cmd"; then
4857
$echo "$modename: invalid operation mode \`$mode'" 1>&2
4858
$echo "$generic_help" 1>&2
4750
4861
fi # test -z "$show_help"
4863
if test -n "$exec_cmd"; then
4752
4868
# We need to display help for each of the modes.