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

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