]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
1999-10-05 Akim Demaille <akim@epita.fr>
authorAkim Demaille <akim@epita.fr>
Tue, 5 Oct 1999 08:48:23 +0000 (08:48 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 5 Oct 1999 08:48:23 +0000 (08:48 +0000)
When you rely on the `t' flag of sed for the immediately
preceding substitution, use a combination of `: foo; t foo'.
Additionally, work around a bug in IRIX sed.
Suggested by Ken Pizzini.

* acgeneral.m4 (AC_OUTPUT_HEADER): Added a label and a test in the
sed code of `$ac_cs_root.hdr'.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4

index ef5f37fd37592ae32378b9fc114519a01102d194..aa69cb5c005a3d23f8c8edb4a1a9d552836232fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+1999-10-05  Akim Demaille  <akim@epita.fr>
+
+       When you rely on the `t' flag of sed for the immediately
+       preceding substitution, use a combination of `: foo; t foo'.
+       Additionally, work around a bug in IRIX sed.
+       Suggested by Ken Pizzini.
+
+       * acgeneral.m4 (AC_OUTPUT_HEADER): Added a label and a test in the
+       sed code of `$ac_cs_root.hdr'.
+
 1999-10-05  Akim Demaille  <akim@epita.fr>
 
        Implement AC_PATH_TOOL.
index 9817860d042587e68d3796c8351153dee6cd88a6..16fcda4cb94c996bfe4aae0afe7b0cbc26fa5dd5 100644 (file)
@@ -3342,15 +3342,32 @@ EOF
 rm -f conftest.vals
 dnl Using a here document instead of a string reduces the quoting nightmare.
 dnl Putting comments in sed scripts is not portable.
+dnl
 dnl One may be tempted to use the same trick to speed up the sed script
 dnl as for CONFIG_FILES (combination of :t and t t).  Here we cannot,
 dnl because of the `#define' templates: we may enter in infinite loops
 dnl replacing `#define foo bar' by itself.
 dnl We ought to get rid of the #define templates.
+dnl
+dnl There are two labels in the following scripts, `cleanup' and `clear'.
+dnl
+dnl `cleanup' is used to avoid that the second main sed command (meant for
+dnl 0-ary CPP macros) applies to n-ary macro definitions.  So we use
+dnl `t cleanup' to jump over the second main sed command when it succeeded.
+dnl
+dnl But because in sed the `t' flag is set when there is a substitution
+dnl that succeeded before, and not *right* before (i.e., included the
+dnl first two small commands), we need to clear the `t' flag.  This is the
+dnl purpose of `t clear; : clear'.
+dnl
+dnl Additionally, this works around a bug of IRIX' sed which does not
+dnl clear the `t' flag between to cycles.
 cat > $ac_cs_root.hdr <<\EOF
 changequote(<<, >>)dnl
 s/[\\&%]/\\&/g
 s%[\\$`]%\\&%g
+t clear
+: clear
 s%^[   ]*<<#>>[        ]*define[       ][      ]*\(\([^        (][^    (]*\)([^)]*)\)[         ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
 t cleanup
 s%^[   ]*<<#>>[        ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
index 9817860d042587e68d3796c8351153dee6cd88a6..16fcda4cb94c996bfe4aae0afe7b0cbc26fa5dd5 100644 (file)
@@ -3342,15 +3342,32 @@ EOF
 rm -f conftest.vals
 dnl Using a here document instead of a string reduces the quoting nightmare.
 dnl Putting comments in sed scripts is not portable.
+dnl
 dnl One may be tempted to use the same trick to speed up the sed script
 dnl as for CONFIG_FILES (combination of :t and t t).  Here we cannot,
 dnl because of the `#define' templates: we may enter in infinite loops
 dnl replacing `#define foo bar' by itself.
 dnl We ought to get rid of the #define templates.
+dnl
+dnl There are two labels in the following scripts, `cleanup' and `clear'.
+dnl
+dnl `cleanup' is used to avoid that the second main sed command (meant for
+dnl 0-ary CPP macros) applies to n-ary macro definitions.  So we use
+dnl `t cleanup' to jump over the second main sed command when it succeeded.
+dnl
+dnl But because in sed the `t' flag is set when there is a substitution
+dnl that succeeded before, and not *right* before (i.e., included the
+dnl first two small commands), we need to clear the `t' flag.  This is the
+dnl purpose of `t clear; : clear'.
+dnl
+dnl Additionally, this works around a bug of IRIX' sed which does not
+dnl clear the `t' flag between to cycles.
 cat > $ac_cs_root.hdr <<\EOF
 changequote(<<, >>)dnl
 s/[\\&%]/\\&/g
 s%[\\$`]%\\&%g
+t clear
+: clear
 s%^[   ]*<<#>>[        ]*define[       ][      ]*\(\([^        (][^    (]*\)([^)]*)\)[         ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
 t cleanup
 s%^[   ]*<<#>>[        ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp