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

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