1998-12-23 Alexandre Oliva <oliva@dcc.unicamp.br>
+ * ltmain.in (SP2NL, NL2SP): use `tr' magic to avoid passing very
+ long lines to sed
+ * doc/libtool.texi (sed): very long lines are no longer a problem
+
* libltdl/Makefile.am: install libltdl conditionally...
* libltdl/configure.in: ... if --enable-ltdl-install is issued
* libltdl/ltdl.c: removed #ifdef DEBUG
Note: The vendor-distributed HP-UX @code{sed}(1) programs are horribly
broken, and cannot handle libtool's requirements, so users may report
-unusual problems. The Solaris @code{sed} program is not suitable either,
-if more than 255 object files are to be linked together. There is no
-workaround except to install a working sed (such as GNU sed) on these
-systems.
+unusual problems. There is no workaround except to install a working
+@code{sed} (such as GNU @code{sed}) on these systems.
@node Platform quirks
@section Platform quirks
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
+Xsed='sed -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+SP2NL='tr \040 \012'
+NL2SP='tr \012 \040'
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
show_help=
execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
-los2o="s/\\.lo /.${objext} /g"
# Parse our command line options once, thoroughly.
while test $# -gt 0
oldlibs="$oldlibs $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
- oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e "$los2o" -e 's/ $//g'`
+ oldobjs="$objs"`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" -e '/^$/d' | $NL2SP`
fi
if test "$build_libtool_libs" = yes; then
done
# Use standard objects if they are PIC.
- test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e "$los2o" -e 's/ $//g'`
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" -e '/^$/d' | $NL2SP`
if test -n "$whole_archive_flag_spec"; then
if test -n "$convenience"; then
$run $rm $obj $libobj
# Create the old-style object.
- reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e 's/[^ ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
+ reload_objs="$objs"`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" -e '/^$/d' | $NL2SP`
output="$obj"
eval cmds=\"$reload_cmds\"
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
- compile_command=`$echo "X$compile_command " | $Xsed -e "$los2o" -e 's/ $//'`
- finalize_command=`$echo "X$finalize_command " | $Xsed -e "$los2o" -e 's/ $//'`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" -e '/^$/d' | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" -e '/^$/d' | $NL2SP`
fi
if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
*.c)
if test -z "$export_symbols"; then
# Add our own program objects to the preloaded list.
- dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e "$los2o" -e 's/ $//'`
+ dlprefiles=`$echo "X$objs$dlprefiles" | $SP2NL | $Xsed -e "$lo2o" -e '/^$/d' | $NL2SP`
fi
# Discover the nlist of each of the dlfiles.
addlibs="$convenience"
build_libtool_libs=no
else
- oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e 's/[^ ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" -e '/^$/d' | $NL2SP`
addlibs="$old_convenience"
fi