split up sed substitution commands

This commit is contained in:
David MacKenzie 1996-11-13 05:18:44 +00:00
parent 49ce2554a6
commit bfa15ba91d
8 changed files with 136 additions and 21 deletions

View File

@ -1,5 +1,13 @@
Tue Nov 12 00:06:14 1996 David J MacKenzie <djm@catapult.va.pubnix.com>
* acgeneral.m4 (AC_OUTPUT_FILES): Split the list of sed commands in
conftest.subs into multiple files named conftest.s[1-9][0-9]*.
Create a pipeline of sed commands that use these files, then delete
the temporary files. From John W. Eaton <jwe@bevo.che.wisc.edu>.
* acspecific.m4 (AC_AIX, AC_MINIX): Remove warnings about AC_TRY_LINK.
These macros don't change the linkage options.
* Test release 2.10.2.
* acspecific.m4 (AC_PROG_CC, AC_PROG_CXX) [GCC]: Use -O2 instead

10
NEWS
View File

@ -1,18 +1,20 @@
Issues to resolve before release:
1. sed command limitation.
2. autoreconf problem with finding subdirectory acconfig.h.
3. test the new features.
1. autoreconf problem with finding subdirectory acconfig.h.
2. test the new features: AC_PROG_CC_WORKS on Solaris, AC_FUNC_MMAP
on HP-UX, AC_CACHE_SAVE on HP-UX, AC_FUNC_SETPGRP, AC_PATH_XTRA on
Solaris and BSDI 2.1, sed command splitting on HP-UX, AC_FUNC_FNMATCH.
Major changes in release 2.11:
* AC_PROG_CC and AC_PROG_CXX check whether the compiler works.
They default CFLAGS/CXXFLAGS to "-g -O2" for gcc, instead of "-g -O".
* AC_REPLACE_FUNCS defines HAVE_@var{function} if the system has the function.
* AC_REPLACE_FUNCS defines HAVE_foo if the system has the function `foo'.
* The argument to AC_CONFIG_HEADER can contain shell variables.
* New macros: AC_FUNC_FNMATCH, AC_FUNC_SETPGRP.
* The "checking..." messages and the source code for test programs that
fail are saved in config.log.
* Another workaround has been added for seds with small command length limits.
* config.sub and config.guess recognize more system types.
* autoheader.sh adds multiple-inclusion protection for config.h.
* Bug fixes.

2
TODO
View File

@ -52,8 +52,6 @@ these suggestions... their presence here doesn't imply my endorsement.
I'm not sure whether the limit is on lines or bytes; if bytes, it
will be less of a problem than it was with the long lines used for
creating a header file.
There has also been a report that HPUX and OSF/1 seds only allow 100
commands.
------------------------------------------------------------------------------

View File

@ -1843,7 +1843,7 @@ AC_SUBST(subdirs)dnl
])
dnl The big finish.
dnl Produce config.status, config.h, and links, and configure subdirs.
dnl Produce config.status, config.h, and links; and configure subdirs.
dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
define(AC_OUTPUT,
[trap '' 1 2 15
@ -1977,6 +1977,42 @@ dnl Insert the sed substitutions of variables.
undivert(AC_DIVERSION_SED)
CEOF
EOF
cat >> $CONFIG_STATUS <<\EOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_file=1 # Number of current file.
ac_inc=90 # Lines per file.
ac_beg=1 # First line for current file.
ac_end=$ac_inc # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
if ! test -s conftest.s$ac_file; then
ac_more_lines=false
rm -f conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f conftest.s$ac_file"
else
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_inc`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"$1"}
@ -1992,7 +2028,7 @@ dnl but that's not a huge problem.
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust relative srcdir, etc. for subdirectories.
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
@ -2028,6 +2064,7 @@ changequote([, ])dnl
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
])dnl
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
@ -2042,7 +2079,7 @@ s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
])dnl
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
" $ac_given_srcdir/$ac_file_in | eval "$ac_sed_cmds" > $ac_file
dnl This would break Makefile dependencies.
dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
@ -2052,7 +2089,7 @@ dnl rm -f $ac_file
dnl mv conftest.out $ac_file
dnl fi
fi; done
rm -f conftest.subs
rm -f conftest.s*
])
dnl Create the config.h files from the config.h.in files.

View File

@ -2096,7 +2096,6 @@ dnl They aren't cached, to discourage their use.
AC_DEFUN(AC_AIX,
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes,
@ -2108,7 +2107,6 @@ AC_EGREP_CPP(yes,
AC_DEFUN(AC_MINIX,
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
if test "$MINIX" = yes; then

43
configure vendored
View File

@ -868,6 +868,42 @@ s%@standards_dvi@%$standards_dvi%g
CEOF
EOF
cat >> $CONFIG_STATUS <<\EOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_file=1 # Number of current file.
ac_inc=90 # Lines per file.
ac_beg=1 # First line for current file.
ac_end=$ac_inc # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
if ! test -s conftest.s$ac_file; then
ac_more_lines=false
rm -f conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f conftest.s$ac_file"
else
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_inc`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"}
@ -881,7 +917,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust relative srcdir, etc. for subdirectories.
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
@ -909,6 +945,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
[/$]*) INSTALL="$ac_given_INSTALL" ;;
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
@ -922,9 +959,9 @@ s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
" $ac_given_srcdir/$ac_file_in | eval "$ac_sed_cmds" > $ac_file
fi; done
rm -f conftest.subs
rm -f conftest.s*

View File

@ -1843,7 +1843,7 @@ AC_SUBST(subdirs)dnl
])
dnl The big finish.
dnl Produce config.status, config.h, and links, and configure subdirs.
dnl Produce config.status, config.h, and links; and configure subdirs.
dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
define(AC_OUTPUT,
[trap '' 1 2 15
@ -1977,6 +1977,42 @@ dnl Insert the sed substitutions of variables.
undivert(AC_DIVERSION_SED)
CEOF
EOF
cat >> $CONFIG_STATUS <<\EOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_file=1 # Number of current file.
ac_inc=90 # Lines per file.
ac_beg=1 # First line for current file.
ac_end=$ac_inc # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
if ! test -s conftest.s$ac_file; then
ac_more_lines=false
rm -f conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f conftest.s$ac_file"
else
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_inc`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"$1"}
@ -1992,7 +2028,7 @@ dnl but that's not a huge problem.
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust relative srcdir, etc. for subdirectories.
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
@ -2028,6 +2064,7 @@ changequote([, ])dnl
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
])dnl
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
@ -2042,7 +2079,7 @@ s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
])dnl
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
" $ac_given_srcdir/$ac_file_in | eval "$ac_sed_cmds" > $ac_file
dnl This would break Makefile dependencies.
dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
@ -2052,7 +2089,7 @@ dnl rm -f $ac_file
dnl mv conftest.out $ac_file
dnl fi
fi; done
rm -f conftest.subs
rm -f conftest.s*
])
dnl Create the config.h files from the config.h.in files.

View File

@ -2096,7 +2096,6 @@ dnl They aren't cached, to discourage their use.
AC_DEFUN(AC_AIX,
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes,
@ -2108,7 +2107,6 @@ AC_EGREP_CPP(yes,
AC_DEFUN(AC_MINIX,
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
if test "$MINIX" = yes; then