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

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