public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: A patch for configure.in
@ 1997-08-19  1:10 H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 1997-08-19  1:10 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
> 

I prefer date since it is easy to track. But I don't really mind
either way.

-- 
H.J. Lu (hjl@gnu.ai.mit.edu)

^ permalink raw reply	[flat|nested] 3+ messages in thread
* An autoconf patch
@ 1997-08-17 21:48 H.J. Lu
  1997-08-17 21:48 ` A patch for configure.in Jeffrey A Law
  0 siblings, 1 reply; 3+ 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] 3+ messages in thread
* A patch for configure.in
@ 1997-08-17 16:44 H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 1997-08-17 16:44 UTC (permalink / raw)
  To: egcs

Can we use this patch? I'd like to keep the binaries for all versions
if my disk space allows.

Thanks.


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)
--
Sun Aug 17 09:17:32 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* configure.in (version): set version to MM.mm.pp-yymmdd.

Index: configure.in
===================================================================
RCS file: /home/work/cvs/gnu/egcs/configure.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 configure.in
--- configure.in	1997/08/16 03:48:37	1.1.1.1
+++ configure.in	1997/08/17 16:16:19
@@ -2746,7 +2746,10 @@
 fi
 
 # Get the version number from the toplevel
-version=`sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/' < ${srcdir}/version.c`
+dnl We need to use [ and ] for other purposes for a while now.
+changequote(,)dnl
+version=`sed -e 's/\([0-9][^ ]*\)[ 	]*[a-zA-Z]*[ 	]*/\1-/' -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${srcdir}/version.c`
+changequote([,])dnl
 
 # Are we using gcc as the native compiler?
 case $host in

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

end of thread, other threads:[~1997-08-19  1:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-19  1:10 A patch for configure.in H.J. Lu
  -- strict thread matches above, loose matches on Subject: below --
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 16:44 H.J. Lu

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).