]> 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 09:03:05 +0000 (09:03 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 5 Oct 1999 09:03:05 +0000 (09:03 +0000)
The sed quoting script depends on the shape of the commands used
by AC_SUBST.  The latter was changed, but not the former.
Bug triggered with FOO='%\c' AC_SUBST(FOO).

* acgeneral.m4 (AC_OUTPUT_FILES): Fix the sed quoting script.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4

index aa69cb5c005a3d23f8c8edb4a1a9d552836232fa..0f5ff15d9f8205ff7fbf14f6bc640642a0f86fdd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,16 @@
+1999-10-05  Akim Demaille  <akim@epita.fr>
+
+       The sed quoting script depends on the shape of the commands used
+       by AC_SUBST.  The latter was changed, but not the former.
+       Bug triggered with FOO='%\c' AC_SUBST(FOO).
+
+       * acgeneral.m4 (AC_OUTPUT_FILES): Fix the sed quoting script.
+
 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'.
+       Bug triggered if you AC_DEFINE(FOO, "%").
        Additionally, work around a bug in IRIX sed.
        Suggested by Ken Pizzini.
 
index 16fcda4cb94c996bfe4aae0afe7b0cbc26fa5dd5..eb178f7dcd336b57060abbc47fe55e7f834d1b11 100644 (file)
@@ -1826,9 +1826,12 @@ EOF
 dnl ### Setting output variables
 
 
+dnl AC_SUBST(VARIABLE)
+dnl ------------------
 dnl This macro protects VARIABLE from being diverted twice
 dnl if this macro is called twice for it.
-dnl AC_SUBST(VARIABLE)
+dnl Beware that if you change this macro, you also have to change the
+dnl sed script at the top of AC_OUTPUT_FILES.
 define(AC_SUBST,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
@@ -1838,6 +1841,8 @@ AC_DIVERT_POP()dnl
 ])])
 
 dnl AC_SUBST_FILE(VARIABLE)
+dnl -----------------------
+dnl Read the comments of the preceding macro.
 define(AC_SUBST_FILE,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
@@ -3137,9 +3142,12 @@ dnl Upon exit, no here document shall be opened.
 define(AC_OUTPUT_FILES,
 [cat >>$CONFIG_STATUS <<EOF
 # Protect against being on the right side of a sed subst in config.status.
+dnl Please, pay attention that this sed code depends a lot on the shape
+dnl of the sed commands issued by AC_SUBST.  So if you change one, change
+dnl the other too.
 changequote(, )dnl
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > \$ac_cs_root.subs <<\\CEOF
+sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' > \$ac_cs_root.subs <<\\CEOF
 changequote([, ])dnl
 dnl These here document variables are unquoted when configure runs
 dnl but quoted when config.status runs, so variables are expanded once.
index 16fcda4cb94c996bfe4aae0afe7b0cbc26fa5dd5..eb178f7dcd336b57060abbc47fe55e7f834d1b11 100644 (file)
@@ -1826,9 +1826,12 @@ EOF
 dnl ### Setting output variables
 
 
+dnl AC_SUBST(VARIABLE)
+dnl ------------------
 dnl This macro protects VARIABLE from being diverted twice
 dnl if this macro is called twice for it.
-dnl AC_SUBST(VARIABLE)
+dnl Beware that if you change this macro, you also have to change the
+dnl sed script at the top of AC_OUTPUT_FILES.
 define(AC_SUBST,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
@@ -1838,6 +1841,8 @@ AC_DIVERT_POP()dnl
 ])])
 
 dnl AC_SUBST_FILE(VARIABLE)
+dnl -----------------------
+dnl Read the comments of the preceding macro.
 define(AC_SUBST_FILE,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
@@ -3137,9 +3142,12 @@ dnl Upon exit, no here document shall be opened.
 define(AC_OUTPUT_FILES,
 [cat >>$CONFIG_STATUS <<EOF
 # Protect against being on the right side of a sed subst in config.status.
+dnl Please, pay attention that this sed code depends a lot on the shape
+dnl of the sed commands issued by AC_SUBST.  So if you change one, change
+dnl the other too.
 changequote(, )dnl
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > \$ac_cs_root.subs <<\\CEOF
+sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' > \$ac_cs_root.subs <<\\CEOF
 changequote([, ])dnl
 dnl These here document variables are unquoted when configure runs
 dnl but quoted when config.status runs, so variables are expanded once.