]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
split up sed substitution commands
authorDavid MacKenzie <djm@djmnet.org>
Wed, 13 Nov 1996 05:18:44 +0000 (05:18 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Wed, 13 Nov 1996 05:18:44 +0000 (05:18 +0000)
ChangeLog
NEWS
TODO
acgeneral.m4
acspecific.m4
configure
lib/autoconf/general.m4
lib/autoconf/specific.m4

index c62ec9dbc793d24da3c4c9c6d741f112372ae5a7..6242aa373012d13073b09928926f9e22ee2c355b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/NEWS b/NEWS
index 3a0ee5f5037e916ac9b173febdaabdc7225b6f9c..658b2536cf6e8c5906384be8d78502770aba21dd 100644 (file)
--- 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 df6e99b9028fb44dd7ca63d73d24ba104bb832ce..e913ffb656211cd239489e8154ecfb611012fd6d 100644 (file)
--- 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.
 
 ------------------------------------------------------------------------------
 
index 22a3dd13b6b07c59174a24b71b0458cfbb8c694f..9311aeab6474cbfed5f51ace16b11c8f63b427ee 100644 (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.
index 8ff07aebbb0a717fa916a1304047a22ea68203ff..fb95e46db3daa8f50c34f459786dbe4ddf79c611 100644 (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
index 6ea613a3688d60a257159762e52657844d48a930..b839f748fa84b6e1d067dedd2411e39e0716417e 100755 (executable)
--- 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 <<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*
 
 
 
index 22a3dd13b6b07c59174a24b71b0458cfbb8c694f..9311aeab6474cbfed5f51ace16b11c8f63b427ee 100644 (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.
index 8ff07aebbb0a717fa916a1304047a22ea68203ff..fb95e46db3daa8f50c34f459786dbe4ddf79c611 100644 (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