From mboxrd@z Thu Jan 1 00:00:00 1970 From: H.J. Lu To: egcs@cygnus.com Subject: An autoconf patch Date: Sun, 17 Aug 1997 21:48:08 -0000 Message-id: X-SW-Source: 1997-08/0055.html Hi, This patch should fix the config.h problem when host != build. -- H.J. Lu (hjl@gnu.ai.mit.edu) --- Sun Aug 17 13:41:42 1997 H.J. Lu (hjl@gnu.ai.mit.edu) * Makefile.in ($(srcdir)/config1.in): Changed from $(srcdir)/config.in. (config1.h): Changed from config.h. (cstamp-h.in): Depend on config1.in. (native): Depend on config1.h. (distclean): Remove config1.h instead of config.h. * configure.in (AC_CONFIG_HEADER): Use config1.h:config1.in instead of config.h:config.in. (--with-config1-h): New argument. Create config1.h. (AC_CHECK_HEADERS): Add wait.h sys/wait.h. (AC_CHECK_FUNCS): Check strerror. (bconfig1.h): Create it if the build machine is not the same as the host machine. (hconfig.h): Include bconfig1.h if the build machine is not the same as the host machine. Otherwise include config1.h. (AC_OUTPUT): Use xconfig1.h:config1.in instead of xconfig.h:config.in. * config.h: New. * acconfig.h: Don't include config2.h. Index: acconfig.h =================================================================== RCS file: /home/work/cvs/gnu/gcc/acconfig.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 acconfig.h --- acconfig.h 1997/07/22 01:15:17 1.1.1.1 +++ acconfig.h 1997/08/17 19:59:41 @@ -1,8 +1,3 @@ - -/* Include the old config.h as config2.h to simplify the transition - to autoconf. */ -#include "config2.h" - /* Whether malloc must be declared even if is included. */ #undef NEED_DECLARATION_MALLOC Index: configure.in =================================================================== RCS file: /home/work/cvs/gnu/gcc/configure.in,v retrieving revision 1.13 diff -u -r1.13 configure.in --- configure.in 1997/08/03 20:11:26 1.13 +++ configure.in 1997/08/17 20:15:24 @@ -22,7 +22,7 @@ # Initialization and defaults AC_INIT(tree.c) -AC_CONFIG_HEADER(config.h:config.in) +AC_CONFIG_HEADER(config1.h:config1.in) native_prefix=/usr remove=rm @@ -32,6 +32,12 @@ # Check for additional parameters +# Generate config1.h only. +AC_ARG_WITH(config1-h, +[ --with-config1-h generate config1.h only.], +config1_h_only=yes, +config1_h_only=no) + # With GNU ld AC_ARG_WITH(gnu-ld, [ --with-gnu-ld arrange to work with GNU ld.], @@ -133,7 +139,10 @@ AC_PROG_CC AC_PROG_MAKE_SET -AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h) +AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h \ + wait.h sys/wait.h) + +AC_CHECK_FUNCS(strerror) GCC_NEED_DECLARATION(malloc) GCC_NEED_DECLARATION(realloc) @@ -2766,6 +2775,20 @@ done done +if [[ -f hconfig.h ]] +then + rm -f hconfig.h.tmp + if [[ x$build != x$host ]] + then + echo "#include \"bconfig1.h\"" > hconfig.h.tmp + else + echo "#include \"config1.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/'` @@ -3143,7 +3166,7 @@ [ . $srcdir/configure.lang case x$CONFIG_HEADERS in -xconfig.h:config.in) +xconfig1.h:config1.in) echo > cstamp-h ;; esac ], @@ -3177,3 +3200,22 @@ cross_overrides='${cross_overrides}' build_overrides='${build_overrides}' ]) + +# We need to create config1.h for the build machine if it is not the +# same as host. +if [[ $config1_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-config1-h \ + --target=$target --host=$host --build=$build + mv config1.h ../bconfig1.h + cd .. + rm -rf $tempdir +fi Index: Makefile.in =================================================================== RCS file: /home/work/cvs/gnu/gcc/Makefile.in,v retrieving revision 1.47 diff -u -r1.47 Makefile.in --- Makefile.in 1997/08/03 20:11:23 1.47 +++ Makefile.in 1997/08/17 19:28:20 @@ -665,7 +665,7 @@ $(srcdir)/configure: $(srcdir)/configure.in cd $(srcdir); autoconf -# cstamp-h.in controls rebuilding of config.in. +# cstamp-h.in controls rebuilding of config1.in. # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't # delete it. A stamp file is needed as autoheader won't update the file if # nothing has changed. @@ -674,13 +674,13 @@ # "echo timestamp" is used instead of touch to be consistent with other # packages that use autoconf (??? perhaps also to avoid problems with patch?). # ??? Newer versions have a maintainer mode that may be useful here. -$(srcdir)/config.in: $(srcdir)/cstamp-h.in +$(srcdir)/config1.in: $(srcdir)/cstamp-h.in $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h cd $(srcdir) && autoheader echo timestamp > $(srcdir)/cstamp-h.in -config.h: cstamp-h ; @true -cstamp-h: config.in config.status - CONFIG_HEADERS=config.h:config.in $(SHELL) config.status +config1.h: cstamp-h ; @true +cstamp-h: config1.in config.status + CONFIG_HEADERS=config1.h:config1.in $(SHELL) config.status # Really, really stupid make features, such as SUN's KEEP_STATE, may force # a target to build even if it is up-to-date. So we must verify that @@ -707,7 +707,7 @@ rest.encap: stmp-headers $(LIBGCC) $(STMP_FIXPROTO) $(EXTRA_PARTS) lang.rest.encap # This is what is made with the host's compiler # whether making a cross compiler or not. -native: config.status config.h cpp $(LANGUAGES) \ +native: config.status config1.h cpp $(LANGUAGES) \ $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) # Define the names for selecting languages in LANGUAGES. @@ -2052,7 +2052,7 @@ # Delete all files that users would normally create # while building and installing GCC. distclean: clean bytecode.distclean lang.distclean - -rm -f tm.h config.h config2.h tconfig.h hconfig.h md cstamp-h + -rm -f tm.h config1.h config2.h tconfig.h hconfig.h md cstamp-h -rm -f config.status config.run config.cache config.bak -rm -f Make-lang Make-hooks Make-host Make-target -rm -f Makefile specs.h options.h *.oaux --- /dev/null Wed Dec 31 16:00:00 1969 +++ config.h Wed Aug 6 15:07:47 1997 @@ -0,0 +1,2 @@ +#include "config1.h" +#include "config2.h" From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Sherrill To: egcs@cygnus.com Subject: Re: GCC Projects? Date: Sun, 17 Aug 1997 21:48:08 -0000 Message-ID: In-reply-to: 5225.871844963@hurl.cygnus.com X-SW-Source: 1997-08/0056.html Message-ID: <19970817214808.L7YyRnnqziaSz1sGZrLB61xfWw0cJMp6S8oEb7fYuf4@z> On Sun, 17 Aug 1997, Jeffrey A Law wrote: > > I see that there are two main unfinished projects in the egcs > > source tree: pre-compiled include files and bytecode generation. > > Is anyone working on one of these? > Nobody is working on these as far as I know. Lots of other stuff > is probably more important -- cpplib, lots of optimization work, > fold in ada & pascal front ends, packaging & release issues, docs, > etc etc. I would like to put a plug in for architectural simulators here. There are a number of targets --especially embedded ones -- which are difficult and/or time-consuming to test. Of the RTEMS configurations (about 8 different ones), I can only do automated tests on 2 of them (powerpc and sparc). The others I can only verify that they can successfully build a full toolchain and support libraries. Periodically, I run code on actual target boards. Long term, if the testing of egcs (and other support libraries) is to be full and complete, we really need to find/develop good simulators for a handful of cpus. --joel Joel Sherrill Sr. Computer Scientist joel@OARcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (205) 722-9985 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: egcs@cygnus.com Subject: Re: A patch for configure.in Date: Sun, 17 Aug 1997 21:48:08 -0000 Message-ID: In-reply-to: A patch for configure.in X-SW-Source: 1997-08/0057.html Message-ID: <19970817214808.ZQ_xOR-4p5lMymlLbY67sAsXZR_f-XdbtpHe_kO4NYY@z> In message you write: > Can we use this patch? I'd like to keep the binaries for all versions > if my disk space allows. How about we just bump the last # in the version for each snapshot? Jeff