public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* An autoconf patch
@ 1997-08-17 21:48 H.J. Lu
  1997-08-17 21:48 ` A patch for configure.in Jeffrey A Law
  1997-08-17 21:48 ` GCC Projects? Joel Sherrill
  0 siblings, 2 replies; 4+ messages in thread
From: H.J. Lu @ 1997-08-17 21:48 UTC (permalink / raw)
  To: egcs

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 <stdlib.h> 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"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC Projects?
  1997-08-17 21:48 An autoconf patch H.J. Lu
  1997-08-17 21:48 ` A patch for configure.in Jeffrey A Law
@ 1997-08-17 21:48 ` Joel Sherrill
  1 sibling, 0 replies; 4+ messages in thread
From: Joel Sherrill @ 1997-08-17 21:48 UTC (permalink / raw)
  To: egcs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A patch for configure.in
  1997-08-17 21:48 An autoconf patch H.J. Lu
@ 1997-08-17 21:48 ` Jeffrey A Law
  1997-08-17 21:48 ` GCC Projects? Joel Sherrill
  1 sibling, 0 replies; 4+ messages in thread
From: Jeffrey A Law @ 1997-08-17 21:48 UTC (permalink / raw)
  To: egcs

  In message <m0x08nj-0004ecC@ocean.lucon.org>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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: An autoconf patch
@ 1997-08-18  5:12 Doug Evans
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Evans @ 1997-08-18  5:12 UTC (permalink / raw)
  To: egcs

   From: hjl@lucon.org (H.J. Lu)
   Date: Sun, 17 Aug 1997 13:47:21 -0700 (PDT)

   This patch should fix the config.h problem when host != build.

Can I see a session log that recreates the bug this is supposed to fix?
Thanks.

   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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-08-18  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-17 21:48 An autoconf patch H.J. Lu
1997-08-17 21:48 ` A patch for configure.in Jeffrey A Law
1997-08-17 21:48 ` GCC Projects? Joel Sherrill
1997-08-18  5:12 An autoconf patch Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).