[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sed and limited record length
From: |
Ralf Wildenhues |
Subject: |
sed and limited record length |
Date: |
Mon, 22 May 2006 07:31:56 +0200 |
User-agent: |
Mutt/1.5.11+cvs20060403 |
It's not everyday that you get to fix a 5 year old bug. See this
thread for some more gory details you never wanted to know about:
http://lists.gnu.org/archive/html/bug-autoconf/2006-05/msg00063.html
Short version: Libtool's LT_AC_PROG_SED and Autoconf's AC_PROG_SED
will not reject Solaris' /bin/sed (our macro due to bit rot and
misunderstanding why the original did not work as intended).
OK to apply?
The forward-port to HEAD is still pending, I want to avoid putting
$SP2NL and $NL2SP in func_quote* as that those functions are often
called with short arguments, and that would be a serious performance
killer. Also I intend to write a test with a really long link line.
With that, I intend to find out whether $NL2SP really is sufficient,
or all of those should be
($NL2SP; echo)
instead, to ensure a final newline.
Cheers,
Ralf
branch-1-5:
* ltmain.in: Convert *each* occurrence of `compile_command',
`finalize_command', `relink_command', and `link_command',
that can conceivably be longer than 4000 bytes, to newline-
separated arguments before feeding to sed, to cater for sed
implementations with limited line lengths. Convert back
afterwards.
* tests/link.test: Accommodate for trailing white space
resulting from above change.
This addresses an issue reported by Albert Chin on 2001-05-27:
http://lists.gnu.org/archive/html/libtool/2001-05/msg00159.html
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.129
diff -u -r1.334.2.129 ltmain.in
--- ltmain.in 19 May 2006 02:23:53 -0000 1.334.2.129
+++ ltmain.in 21 May 2006 20:48:49 -0000
@@ -4733,16 +4733,16 @@
case $host in
*cygwin* | *mingw* )
if test -f "$output_objdir/${outputname}.def" ; then
- compile_command=`$echo "X$compile_command" | $Xsed -e
"address@hidden@%$output_objdir/${outputname}.def
$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e
"address@hidden@%$output_objdir/${outputname}.def
$output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e
"address@hidden@%$output_objdir/${outputname}.def
$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e
"address@hidden@%$output_objdir/${outputname}.def
$output_objdir/${outputname}S.${objext}%" | $NL2SP`
else
- compile_command=`$echo "X$compile_command" | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
fi
;;
* )
- compile_command=`$echo "X$compile_command" | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e
"address@hidden@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
;;
esac
;;
@@ -4757,13 +4757,13 @@
# really was required.
# Nullify the symbol file.
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%
@address@hidden"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%
@address@hidden"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%
@address@hidden" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%
@address@hidden" | $NL2SP`
fi
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
- compile_command=`$echo "X$compile_command" | $Xsed -e
'address@hidden@%'"$output"'%g'`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e
'address@hidden@%'"$output"'%g' | $NL2SP`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
@@ -4850,7 +4850,7 @@
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
- relink_command=`$echo "X$compile_var$compile_command$compile_rpath"
| $Xsed -e 'address@hidden@%\$progdir/\$file%g'`
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath"
| $SP2NL | $Xsed -e 'address@hidden@%\$progdir/\$file%g' | $NL2SP`
else
# fast_install is set to needless
relink_command=
@@ -4887,7 +4887,7 @@
fi
done
relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e
"$sed_quote_subst" | $NL2SP`
fi
# Quote $echo for shipping.
@@ -5636,7 +5636,7 @@
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink
$libtool_args @inst_prefix_dir@)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e
"$sed_quote_subst" | $NL2SP`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
@@ -5981,9 +5981,9 @@
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
- relink_command=`$echo "$relink_command" | $SED
"address@hidden@%-inst-prefix-dir $inst_prefix_dir%"`
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED
"address@hidden@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
else
- relink_command=`$echo "$relink_command" | $SED "address@hidden@%%"`
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED
"address@hidden@%%" | $NL2SP`
fi
$echo "$modename: warning: relinking \`$file'" 1>&2
@@ -6192,7 +6192,7 @@
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
- relink_command=`$echo "X$relink_command" | $Xsed -e
'address@hidden@%'"$outputname"'%g'`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e
'address@hidden@%'"$outputname"'%g' | $NL2SP`
$show "$relink_command"
if $run eval "$relink_command"; then :
Index: tests/link.test
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/link.test,v
retrieving revision 1.2
diff -u -r1.2 link.test
--- tests/link.test 30 Jun 2001 20:31:34 -0000 1.2
+++ tests/link.test 21 May 2006 20:48:49 -0000
@@ -15,8 +15,8 @@
test $? -eq 0 || exit 1
echo "$linkresult"
-case "$linkresult" in
-*../lib/libnlsut.a) ;;
+case $linkresult in
+*../lib/libnlsut.a*) ;;
*)
echo "$progname: ../lib/libnlsut.a was not used as expected in linking"
exit 1
- sed and limited record length,
Ralf Wildenhues <=