This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add uClinux support for uberbaum build


DJ Delorie wrote:
Thanks.  I've just checked the patch in, but then I noticed
something weird in my regenerared copy of configure.  Even though
I used autoconf-2.13, the following hunk seems to have changed
for no apparent reason.

I'm not sure where this thing came from... Shall I revert it?

Until you can figure out why it happened, yes please. Or at least manually revert that particular chunk. Double check the diff against the old version though.

I found out what is causing it. RedHat's autoconf213-2.13-7.src.rpm contains a patch for AC_OUTPUT_MAKE_DEFS to fix this bug:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=62361

I should have used a pristine autoconf 2.13 instead of RedHat's.
However, the only change introduced in GCC's top-level configure
is the hunk I've quoted earlier.  This change appears to be harmless
and, perhaps, even required for Solaris hosts.

I'll wait a bit before reverting the change in case we actually
want to keep it.  I've attached the autoconf patch for reference.

Another question: didn't we have a script to synchronize top-level
changes with the src repository?  Oddly, my change has not yet shown
there.

--
 // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]