Blame SOURCES/autoconf-2.13-make-defs-62361.patch

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