summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim@epita.fr>1999-10-05 08:48:23 +0000
committerAkim Demaille <akim@epita.fr>1999-10-05 08:48:23 +0000
commit6768ab7157575d8ab1a3c7d4239ca363532e9094 (patch)
tree7a22628ab2f2963d0a905ae4a21487ac13edada9
parentae4ed6653031311d9dab7ab5c09b0d714fb4200b (diff)
downloadautoconf-6768ab7157575d8ab1a3c7d4239ca363532e9094.tar.gz
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'.
-rw-r--r--ChangeLog10
-rw-r--r--acgeneral.m417
-rw-r--r--lib/autoconf/general.m417
3 files changed, 44 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ef5f37fd..aa69cb5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
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.
Submited by Gary V. Vaughan.
diff --git a/acgeneral.m4 b/acgeneral.m4
index 9817860d..16fcda4c 100644
--- a/acgeneral.m4
+++ b/acgeneral.m4
@@ -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
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 9817860d..16fcda4c 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -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