|
|
d9d0ed |
diff -u autoconf-2.13/acgeneral.m4~ autoconf-2.13/acgeneral.m4
|
|
|
d9d0ed |
--- autoconf-2.13/acgeneral.m4~ Wed May 15 14:47:12 2002
|
|
|
d9d0ed |
+++ autoconf-2.13/acgeneral.m4 Wed May 15 14:47:12 2002
|
|
|
d9d0ed |
@@ -2156,20 +2156,38 @@
|
|
|
d9d0ed |
dnl AC_OUTPUT_MAKE_DEFS()
|
|
|
d9d0ed |
define(AC_OUTPUT_MAKE_DEFS,
|
|
|
d9d0ed |
[# Transform confdefs.h into DEFS.
|
|
|
d9d0ed |
-dnl Using a here document instead of a string reduces the quoting nightmare.
|
|
|
d9d0ed |
# Protect against shell expansion while executing Makefile rules.
|
|
|
d9d0ed |
# Protect against Makefile macro expansion.
|
|
|
d9d0ed |
-cat > conftest.defs <<\EOF
|
|
|
d9d0ed |
-changequote(<<, >>)dnl
|
|
|
d9d0ed |
-s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
|
|
|
d9d0ed |
-s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
|
|
|
d9d0ed |
-s%\[%\\&%g
|
|
|
d9d0ed |
-s%\]%\\&%g
|
|
|
d9d0ed |
-s%\$%$$%g
|
|
|
d9d0ed |
-changequote([, ])dnl
|
|
|
d9d0ed |
-EOF
|
|
|
d9d0ed |
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
|
|
|
d9d0ed |
-rm -f conftest.defs
|
|
|
d9d0ed |
+#
|
|
|
d9d0ed |
+# If the first sed substitution is executed (which looks for macros that
|
|
|
d9d0ed |
+# take arguments), then we branch to the quote section. Otherwise,
|
|
|
d9d0ed |
+# look for a macro that doesn't take arguments.
|
|
|
d9d0ed |
+cat >confdef2opt.sed <<\_ACEOF
|
|
|
d9d0ed |
+changequote(<<, >>)dnl
|
|
|
d9d0ed |
+t clear
|
|
|
d9d0ed |
+: clear
|
|
|
d9d0ed |
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
|
|
|
d9d0ed |
+t quote
|
|
|
d9d0ed |
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
|
|
|
d9d0ed |
+t quote
|
|
|
d9d0ed |
+d
|
|
|
d9d0ed |
+: quote
|
|
|
d9d0ed |
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
|
|
|
d9d0ed |
+s,\[,\\&,g
|
|
|
d9d0ed |
+s,\],\\&,g
|
|
|
d9d0ed |
+s,\$,$$,g
|
|
|
d9d0ed |
+p
|
|
|
d9d0ed |
+changequote([, ])dnl
|
|
|
d9d0ed |
+_ACEOF
|
|
|
d9d0ed |
+# We use echo to avoid assuming a particular line-breaking character.
|
|
|
d9d0ed |
+# The extra dot is to prevent the shell from consuming trailing
|
|
|
d9d0ed |
+# line-breaks from the sub-command output. A line-break within
|
|
|
d9d0ed |
+# single-quotes doesn't work because, if this script is created in a
|
|
|
d9d0ed |
+# platform that uses two characters for line-breaks (e.g., DOS), tr
|
|
|
d9d0ed |
+# would break.
|
|
|
d9d0ed |
+ac_LF_and_DOT=`echo; echo .`
|
|
|
d9d0ed |
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
|
|
|
d9d0ed |
+rm -f confdef2opt.sed
|
|
|
d9d0ed |
])
|
|
|
d9d0ed |
|
|
|
d9d0ed |
dnl Do the variable substitutions to create the Makefiles or whatever.
|