From: David MacKenzie Date: Wed, 13 Nov 1996 05:18:44 +0000 (+0000) Subject: split up sed substitution commands X-Git-Tag: fsf-origin~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfa15ba91d01fa5a0d1f73af5e6ba47ea0efe0a0;p=thirdparty%2Fautoconf.git split up sed substitution commands --- diff --git a/ChangeLog b/ChangeLog index c62ec9db..6242aa37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ Tue Nov 12 00:06:14 1996 David J MacKenzie + * 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 . + + * 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 diff --git a/NEWS b/NEWS index 3a0ee5f5..658b2536 100644 --- a/NEWS +++ b/NEWS @@ -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. diff --git a/TODO b/TODO index df6e99b9..e913ffb6 100644 --- a/TODO +++ b/TODO @@ -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. ------------------------------------------------------------------------------ diff --git a/acgeneral.m4 b/acgeneral.m4 index 22a3dd13..9311aeab 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -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 < $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. diff --git a/acspecific.m4 b/acspecific.m4 index 8ff07aeb..fb95e46d 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -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 diff --git a/configure b/configure index 6ea613a3..b839f748 100755 --- a/configure +++ b/configure @@ -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 < $ac_file +" $ac_given_srcdir/$ac_file_in | eval "$ac_sed_cmds" > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 22a3dd13..9311aeab 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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 < $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. diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 8ff07aeb..fb95e46d 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -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