gengenrtl.h doesn't pick up HAVE_CPP_STRINGIFY.
Lee Iverson
leei@ai.sri.com
Thu Jan 22 02:29:00 GMT 1998
Having mistakenly sent this bugreport to the gcc2 list, H.J. Lu
suggested the following fix.
------- Forwarded Message
Message-Id: <m0xul3m-0004ecC@ocean.lucon.org>
From: hjl@lucon.org (H.J. Lu)
Subject: Re: gengenrtl.h doesn't pick up HAVE_CPP_STRINGIFY.
To: leei@Sunset.AI.SRI.COM (Lee Iverson)
Date: Tue, 20 Jan 1998 13:18:14 -0800 (PST)
Cc: gcc2@cygnus.com
In-Reply-To: <199801202039.MAA14926@Canada.AI.SRI.COM> from "Lee Iverson" at Jan 20, 98 12:39:31 pm
X-Mailer: ELM [version 2.4 PL25 PGP2]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
>
>
> Noticed this on SGI Irix 6.3 bootstrapping with CC='cc -n32'. In this
> case, HAVE_CPP_STRINGIFY is not defined in gengenrtl.c even though it
> is in auto-config.h. It seems gengenrtl.c should include "config.h"
> instead of "hconfig.h", at least as suggested by the contents of
That is not correct.
> config.h, hconfig.h and tconfig.h for host&target == mips-sgi-irix6.
>
> config.h:
> #include "auto-config.h"
> #include "mips/xm-iris6.h"
>
> hconfig.h:
> #include "mips/xm-iris6.h"
>
> tconfig.h:
> #include "mips/xm-iris6.h"
>
> Maybe the *real* fix is to have hconfig.h also #include "auto-config.h",
Bingo! But it is not complete since auto-config.h for host machine
may not the same for build machine.
> but I really don't fully understand all of the subtleties of autoconfig
> when cross-compiling, so this is what I have done.
>
I have been wondering why it takes so long for people to see
this problem :-(. Here is my old patch.
H.J.
- ---
Fri Aug 15 17:47:14 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
* configure.in (--with-auto-config.h): New argument. Create
auto-config.h and exit.
(build-auto-config.h): Create it if the build machine is not
the same as the host machine.
(hconfig.h): Include build-auto-config.h if the build machine
is not the same as the host machine. Otherwise include
auto-config.h.
Index: configure.in
===================================================================
RCS file: /home/work/cvs/gnu/gcc/configure.in,v
retrieving revision 1.1.1.16
diff -u -r1.1.1.16 configure.in
- --- configure.in 1998/01/09 20:45:30 1.1.1.16
+++ configure.in 1998/01/20 21:05:22
@@ -32,6 +32,12 @@
# Check for additional parameters
+# Generate auto-config.h only.
+AC_ARG_WITH(auto-config-h,
+[ --with-auto-config-h generate auto-config.h only.],
+auto_config_h_only=yes,
+auto_config_h_only=no)
+
# With GNU ld
AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld arrange to work with GNU ld.],
@@ -2838,6 +2870,20 @@
done
done
+if [[ -f hconfig.h ]]
+then
+ rm -f hconfig.h.tmp
+ if [[ x$build != x$host ]]
+ then
+ echo "#include \"build-auto-config.h\"" > hconfig.h.tmp
+ else
+ echo "#include \"auto-config.h\"" > hconfig.h.tmp
+ fi
+ cat hconfig.h >> hconfig.h.tmp
+ rm -f hconfig.h
+ mv hconfig.h.tmp hconfig.h
+fi
+
# Truncate the target if necessary
if [[ x$host_truncate_target != x ]]; then
target=`echo $target | sed -e 's/\(..............\).*/\1/'`
@@ -3269,3 +3315,22 @@
cross_overrides='${cross_overrides}'
build_overrides='${build_overrides}'
])
+
+# We need to create auto-config.h for the build machine if it is not the
+# same as host.
+if [[ $auto_config_h_only != yes -a x$build != x$host ]]
+then
+ tempdir=build.$$
+ rm -rf $tempdir
+ mkdir $tempdir
+ cd $tempdir
+ case ${srcdir} in
+ /*) realsrcdir=${srcdir};;
+ *) realsrcdir=../${srcdir};;
+ esac
+ CC=${BUILD_CC-cc} ${realsrcdir}/configure --with-auto-config-h \
+ --target=$target --host=$host --build=$build
+ mv auto-config.h ../build-auto-config.h
+ cd ..
+ rm -rf $tempdir
+fi
------- End of Forwarded Message
More information about the Gcc
mailing list