* ltmain.sh: updated from debian 'sid' version of libtool, should fix the

    Mac OS X compilation.
parent b3f15d61
...@@ -49,14 +49,14 @@ EOF ...@@ -49,14 +49,14 @@ EOF
fi fi
# The name of this program. # The name of this program.
progname=`$echo "$0" | sed 's%^.*/%%'` progname=`$echo "$0" | ${SED} 's%^.*/%%'`
modename="$progname" modename="$progname"
# Constants. # Constants.
PROGRAM=ltmain.sh PROGRAM=ltmain.sh
PACKAGE=libtool PACKAGE=libtool
VERSION=1.4.2a VERSION=1.4.2a
TIMESTAMP=" (1.922.2.79 2001/11/28 21:50:31)" TIMESTAMP=" (1.922.2.93 2002/05/06 15:02:58)"
default_mode= default_mode=
help="Try \`$progname --help' for more information." help="Try \`$progname --help' for more information."
...@@ -67,10 +67,19 @@ rm="rm -f" ...@@ -67,10 +67,19 @@ rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies # Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings. # metacharacters that are still active within double-quoted strings.
Xsed='sed -e 1s/^X//' Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
SP2NL='tr \040 \012' # test EBCDIC or ASCII
NL2SP='tr \015\012 \040\040' case `echo A|od -x` in
*[Cc]1*) # EBCDIC based system
SP2NL="tr '\100' '\n'"
NL2SP="tr '\r\n' '\100\100'"
;;
*) # Assume ASCII based system
SP2NL="tr '\040' '\012'"
NL2SP="tr '\015\012' '\040\040'"
;;
esac
# NLS nuisances. # NLS nuisances.
# Only set LANG and LC_ALL to C if already set. # Only set LANG and LC_ALL to C if already set.
...@@ -144,7 +153,7 @@ do ...@@ -144,7 +153,7 @@ do
;; ;;
--config) --config)
sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
exit 0 exit 0
;; ;;
...@@ -469,7 +478,7 @@ if test -z "$show_help"; then ...@@ -469,7 +478,7 @@ if test -z "$show_help"; then
pic_mode=default pic_mode=default
;; ;;
esac esac
if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
# non-PIC code in shared libraries is not supported # non-PIC code in shared libraries is not supported
pic_mode=default pic_mode=default
fi fi
...@@ -1514,7 +1523,7 @@ compiler." ...@@ -1514,7 +1523,7 @@ compiler."
fi fi
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit 1
...@@ -1776,8 +1785,8 @@ compiler." ...@@ -1776,8 +1785,8 @@ compiler."
# Make a new name for the extract_expsyms_cmds to use # Make a new name for the extract_expsyms_cmds to use
soroot="$soname" soroot="$soname"
soname=`echo $soroot | sed -e 's/^.*\///'` soname=`echo $soroot | ${SED} -e 's/^.*\///'`
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now # If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then : if test -f "$output_objdir/$soname-def"; then :
...@@ -2022,7 +2031,7 @@ compiler." ...@@ -2022,7 +2031,7 @@ compiler."
if grep "^installed=no" $deplib > /dev/null; then if grep "^installed=no" $deplib > /dev/null; then
path="-L$absdir/$objdir" path="-L$absdir/$objdir"
else else
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1 exit 1
...@@ -2287,14 +2296,14 @@ compiler." ...@@ -2287,14 +2296,14 @@ compiler."
;; ;;
irix | nonstopux) irix | nonstopux)
major=`expr $current - $age + 1`
case $version_type in case $version_type in
nonstopux) verstring_prefix=nonstopux ;; nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;; *) verstring_prefix=sgi ;;
esac esac
verstring="$verstring_prefix$major.$revision" verstring="$verstring_prefix$major.$revision"
major=`expr $current - $age + 1`
# Add in all the interfaces that we are compatible with. # Add in all the interfaces that we are compatible with.
loop=$revision loop=$revision
while test $loop != 0; do while test $loop != 0; do
...@@ -2406,9 +2415,9 @@ compiler." ...@@ -2406,9 +2415,9 @@ compiler."
# Eliminate all temporary directories. # Eliminate all temporary directories.
for path in $notinst_path; do for path in $notinst_path; do
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
done done
if test -n "$xrpath"; then if test -n "$xrpath"; then
...@@ -2596,14 +2605,14 @@ EOF ...@@ -2596,14 +2605,14 @@ EOF
# but so what? # but so what?
potlib="$potent_lib" potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | sed 's/.* -> //'` potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac esac
done done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
| sed 10q \ | ${SED} 10q \
| egrep "$file_magic_regex" > /dev/null; then | egrep "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib" newdeplibs="$newdeplibs $a_deplib"
a_deplib="" a_deplib=""
...@@ -2645,7 +2654,7 @@ EOF ...@@ -2645,7 +2654,7 @@ EOF
for potent_lib in $potential_libs; do for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check below in file_magic test potlib="$potent_lib" # see symlink-check below in file_magic test
if eval echo \"$potent_lib\" 2>/dev/null \ if eval echo \"$potent_lib\" 2>/dev/null \
| sed 10q \ | ${SED} 10q \
| egrep "$match_pattern_regex" > /dev/null; then | egrep "$match_pattern_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib" newdeplibs="$newdeplibs $a_deplib"
a_deplib="" a_deplib=""
...@@ -2931,7 +2940,18 @@ EOF ...@@ -2931,7 +2940,18 @@ EOF
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\" eval cmds=\"$archive_expsym_cmds\"
else else
save_deplibs="$deplibs"
for conv in $convenience; do
tmp_deplibs=
for test_deplib in $deplibs; do
if test "$test_deplib" != "$conv"; then
tmp_deplibs="$tmp_deplibs $test_deplib"
fi
done
deplibs="$tmp_deplibs"
done
eval cmds=\"$archive_cmds\" eval cmds=\"$archive_cmds\"
deplibs="$save_deplibs"
fi fi
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
...@@ -3130,7 +3150,7 @@ EOF ...@@ -3130,7 +3150,7 @@ EOF
prog) prog)
case $host in case $host in
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac esac
if test -n "$vinfo"; then if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
...@@ -3318,9 +3338,9 @@ extern \"C\" { ...@@ -3318,9 +3338,9 @@ extern \"C\" {
if test -z "$export_symbols"; then if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp" export_symbols="$output_objdir/$output.exp"
$run $rm $export_symbols $run $rm $export_symbols
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else else
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"' $run eval 'mv "$nlist"T "$nlist"'
fi fi
...@@ -3328,7 +3348,7 @@ extern \"C\" { ...@@ -3328,7 +3348,7 @@ extern \"C\" {
for arg in $dlprefiles; do for arg in $dlprefiles; do
$show "extracting global C symbols from \`$arg'" $show "extracting global C symbols from \`$arg'"
name=`echo "$arg" | sed -e 's%^.*/%%'` name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
$run eval 'echo ": $name " >> "$nlist"' $run eval 'echo ": $name " >> "$nlist"'
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done done
...@@ -3343,7 +3363,13 @@ extern \"C\" { ...@@ -3343,7 +3363,13 @@ extern \"C\" {
fi fi
# Try sorting and uniquifying the output. # Try sorting and uniquifying the output.
if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then if grep -v "^: " < "$nlist" |
if sort -k 3 </dev/null >/dev/null 2>&1; then
sort -k 3
else
sort +2
fi |
uniq > "$nlist"S; then
: :
else else
grep -v "^: " < "$nlist" > "$nlist"S grep -v "^: " < "$nlist" > "$nlist"S
...@@ -3585,7 +3611,7 @@ static const void *lt_preloaded_setup() { ...@@ -3585,7 +3611,7 @@ static const void *lt_preloaded_setup() {
# win32 will think the script is a binary if it has # win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here. # a .exe suffix, so we strip it off here.
case $output in case $output in
*.exe) output=`echo $output|sed 's,.exe$,,'` ;; *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
esac esac
# test for cygwin because mv fails w/o .exe extensions # test for cygwin because mv fails w/o .exe extensions
case $host in case $host in
...@@ -3609,7 +3635,7 @@ static const void *lt_preloaded_setup() { ...@@ -3609,7 +3635,7 @@ static const void *lt_preloaded_setup() {
# Sed substitution that helps us do robust quoting. It backslashifies # Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings. # metacharacters that are still active within double-quoted strings.
Xsed='sed -e 1s/^X//' Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='$sed_quote_subst' sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
...@@ -3647,7 +3673,7 @@ else ...@@ -3647,7 +3673,7 @@ else
test \"x\$thisdir\" = \"x\$file\" && thisdir=. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir. # Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do while test -n \"\$file\"; do
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
...@@ -3660,7 +3686,7 @@ else ...@@ -3660,7 +3686,7 @@ else
fi fi
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
done done
# Try to get the absolute directory name. # Try to get the absolute directory name.
...@@ -3674,7 +3700,7 @@ else ...@@ -3674,7 +3700,7 @@ else
progdir=\"\$thisdir/$objdir\" progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\ if test ! -f \"\$progdir/\$program\" || \\
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\" file=\"\$\$-\$program\"
...@@ -3720,7 +3746,7 @@ else ...@@ -3720,7 +3746,7 @@ else
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\" $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var # Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 sed # The second colon is a workaround for a bug in BeOS R4 ${SED}
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
export $shlibpath_var export $shlibpath_var
...@@ -3912,7 +3938,7 @@ fi\ ...@@ -3912,7 +3938,7 @@ fi\
case $deplib in case $deplib in
*.la) *.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1 exit 1
...@@ -3926,7 +3952,7 @@ fi\ ...@@ -3926,7 +3952,7 @@ fi\
newdlfiles= newdlfiles=
for lib in $dlfiles; do for lib in $dlfiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit 1
...@@ -3937,7 +3963,7 @@ fi\ ...@@ -3937,7 +3963,7 @@ fi\
newdlprefiles= newdlprefiles=
for lib in $dlprefiles; do for lib in $dlprefiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit 1
...@@ -4161,7 +4187,7 @@ relink_command=\"$relink_command\"" ...@@ -4161,7 +4187,7 @@ relink_command=\"$relink_command\""
*.la) *.la)
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
...@@ -4312,13 +4338,13 @@ relink_command=\"$relink_command\"" ...@@ -4312,13 +4338,13 @@ relink_command=\"$relink_command\""
# Do a test to see if this is really a libtool program. # Do a test to see if this is really a libtool program.
case $host in case $host in
*cygwin*|*mingw*) *cygwin*|*mingw*)
wrapper=`echo $file | sed -e 's,.exe$,,'` wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
;; ;;
*) *)
wrapper=$file wrapper=$file
;; ;;
esac esac
if (sed -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
notinst_deplibs= notinst_deplibs=
relink_command= relink_command=
...@@ -4404,7 +4430,7 @@ relink_command=\"$relink_command\"" ...@@ -4404,7 +4430,7 @@ relink_command=\"$relink_command\""
destfile=$destfile.exe destfile=$destfile.exe
;; ;;
*:*.exe) *:*.exe)
destfile=`echo $destfile | sed -e 's,.exe$,,'` destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
;; ;;
esac esac
;; ;;
...@@ -4552,7 +4578,7 @@ relink_command=\"$relink_command\"" ...@@ -4552,7 +4578,7 @@ relink_command=\"$relink_command\""
case $file in case $file in
*.la) *.la)
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
...@@ -4623,7 +4649,7 @@ relink_command=\"$relink_command\"" ...@@ -4623,7 +4649,7 @@ relink_command=\"$relink_command\""
-*) ;; -*) ;;
*) *)
# Do a test to see if this is really a libtool program. # Do a test to see if this is really a libtool program.
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# If there is no directory component, then add one. # If there is no directory component, then add one.
case $file in case $file in
*/* | *\\*) . $file ;; */* | *\\*) . $file ;;
...@@ -4732,7 +4758,7 @@ relink_command=\"$relink_command\"" ...@@ -4732,7 +4758,7 @@ relink_command=\"$relink_command\""
case $name in case $name in
*.la) *.la)
# Possibly a libtool archive, so verify it. # Possibly a libtool archive, so verify it.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
. $dir/$name . $dir/$name
# Delete the libtool libraries and symlinks. # Delete the libtool libraries and symlinks.
...@@ -4787,7 +4813,7 @@ relink_command=\"$relink_command\"" ...@@ -4787,7 +4813,7 @@ relink_command=\"$relink_command\""
*) *)
# Do a test to see if this is a libtool program. # Do a test to see if this is a libtool program.
if test $mode = clean && if test $mode = clean &&
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
relink_command= relink_command=
. $dir/$file . $dir/$file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment