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]

New PATCH to provide $(libsubdir) to sub-makes


On Wed, 17 June 1998, 22:51:24, law@cygnus.com wrote:

 > This looks good to me.  Please install it.
 > 
 > Thanks!
 > jeff

OK, I have to admit, I didn't actually check my patch when I send it
in :-( In the meantime I did and found a problem with it:

  If you're not calling 'make bootstrap' from the toplevel directory,
  but use separate 'make CC=... ' calls in the gcc directory to
  bootstrap the compiler instead, $(gxx_include_dir) and $(version)
  fail to be defined, because there is simply no toplevel make which
  would be passing down the proper values.

I need to do it this way, because I don't want to go through the whole 
bootstrap chain again and again whenever I've made a small change to
whatever file. Currently a complete build on my m68k-motorola-sysv
system takes nearly ONE WEEK, you understand my intention?!? So, I'd
prefer to be able to build up to stage4 or 5.

My new patch (replacing the previous one completely) fixes this.
PLUS, now that libf2c will be installed in ${libsubdir}, I've added
the same behaviour for libio/libstdc++:

  - libstdc++.{a,so*} will be installed in ${libsubdir}
  - gxx_include_dir now defaults to ${libsubdir}/include/g++
  - _G_config.h will be installed in ${gxx_include_dir}

I believe these changes help a lot to use several different egcs
versions in parallel. What do you think?

Is it still OK to install the stuff?

manfred


egcs-19980617/ChangeLog

1998-06-18  Manfred Hollstein  <manfred@s-direktnet.de>

	* configure (gcc_version): Add new variable describing the
	particular gcc version we're building.
	(gxx_include_dir): Default to '${libsubdir}/include/g++' now.
	* Makefile.in (libsubdir): Add new macro for the directory
	in which the compiler finds executables, libraries, etc.
	(BASE_FLAGS_TO_PASS): Pass down gcc_version, target_alias
	and libsubdir.

egcs-19980617/gcc/ChangeLog

1998-06-18  Manfred Hollstein  <manfred@s-direktnet.de>

	* Makefile.in (installdirs): Loop over directories in $(libsubdir)
	creating probably missing ones, instead of single if statements.
	* configure.in (gxx_include_dir): Use same default as the toplevel
	configure script would use; add comment for this.
	* configure: Regenerate.

egcs-19980617/libio/ChangeLog

1998-07-18  Manfred Hollstein  <manfred@s-direktnet.de>

	* Makefile.in (install): Install _G_config.h in $(gxx_include_dir).
	* config.shared (FLAGS_TO_PASS): Add libsubdir.
	* config/linux.mt (gxx_include_dir): Remove definition here as we use
	gcc's default anyway.

egcs-19980617/libstdc++/ChangeLog

1998-06-18  Manfred Hollstein  <manfred@s-direktnet.de>

	* Makefile.in (INSTALLDIR): Default to $(libsubdir).

diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/Makefile.in egcs-19980617/Makefile.in
--- egcs-19980617.orig/Makefile.in	Mon May 25 11:29:19 1998
+++ egcs-19980617/Makefile.in	Wed Jun 17 16:29:45 1998
@@ -41,6 +41,8 @@ man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
 infodir = $(prefix)/info
 includedir = $(prefix)/include
+# Directory in which the compiler finds executables, libraries, etc.
+libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
 GDB_NLM_DEPS = 
 
 SHELL = /bin/sh
@@ -355,7 +357,10 @@ BASE_FLAGS_TO_PASS = \
 	"exec_prefix=$(exec_prefix)" \
 	"prefix=$(prefix)" \
 	"tooldir=$(tooldir)" \
-	"gxx_include_dir=$(gxx_include_dir)"
+	"gxx_include_dir=$(gxx_include_dir)" \
+	"gcc_version=$(gcc_version)" \
+	"target_alias=$(target_alias)" \
+	"libsubdir=$(libsubdir)"
 
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/configure egcs-19980617/configure
--- egcs-19980617.orig/configure	Fri Apr 24 07:59:08 1998
+++ egcs-19980617/configure	Wed Jun 17 16:50:23 1998
@@ -56,6 +56,7 @@ exec_prefixoption=
 fatal=
 floating_point=default
 gas=default
+gcc_version=UNKNOWN
 host_alias=NOHOST
 host_makefile_frag=
 moveifchange=
@@ -700,6 +701,12 @@ if [ "${program_prefix}" != "" ] ; then
     program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"
 fi
 
+# If gcc's sources are available, extract its version number which is used by
+# $libsubdir.
+if [ -f $srcdir/gcc/version.c ]; then
+    gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${srcdir}/gcc/version.c`
+fi
+
 # If CC and CXX are not set in the environment, and the Makefile
 # exists, try to extract them from it.  This is to handle running
 # ./config.status by hand.
@@ -1216,7 +1223,7 @@ EOF
 	    # Note, if you change the default, make sure to fix both here
 	    # and in the gcc subdirectory.
 	    if test -z "${with_gxx_include_dir}"; then
-		echo gxx_include_dir = '${prefix}/include/g++' >> ${Makefile}
+		echo gxx_include_dir = '$(libsubdir)/include/g++' >> ${Makefile}
 	    else
 		echo gxx_include_dir = ${with_gxx_include_dir} >> ${Makefile}
 	    fi
@@ -1227,6 +1234,12 @@ EOF
 	    else
 	        echo enable_shared = ${enable_shared} >> ${Makefile}
 	    fi
+
+	    # Emit a macro which is used to build the libsubdir macro where
+	    # compiler specific stuff can be found/installed.
+	    # FIXME: This works only if gcc's sources are available in a gcc
+	    # subdirectory!
+	    echo gcc_version = ${gcc_version} >> ${Makefile}
 
             # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
             # remove any form feeds.
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/gcc/Makefile.in egcs-19980617/gcc/Makefile.in
--- egcs-19980617.orig/gcc/Makefile.in	Fri Jun 12 21:32:21 1998
+++ egcs-19980617/gcc/Makefile.in	Thu Jun 18 07:55:35 1998
@@ -2270,9 +2270,10 @@ installdirs:
 	-if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
 # This dir isn't currently searched by cpp.
 #	-if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
-	-if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias) ; fi
-	-if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi
-	-if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; fi
+	-fdir= ; for dir in `echo $(libsubdir) | tr '/' ' '`; do \
+	  fdir=$${fdir}/$${dir}; \
+	  if [ -d $${fdir} ] ; then true ; else mkdir $${fdir}; chmod a+rx $${fdir}; fi ; \
+	done
 	-if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
 	-if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
 	-if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/gcc/configure.in egcs-19980617/gcc/configure.in
--- egcs-19980617.orig/gcc/configure.in	Thu Jun 11 18:37:06 1998
+++ egcs-19980617/gcc/configure.in	Thu Jun 18 07:57:57 1998
@@ -71,11 +71,12 @@ AC_ARG_WITH(gxx-include-dir,
 [  --with-gxx-include-dir=DIR
                           specifies directory to put g++ header files.],
 gxx_include_dir=$with_gxx_include_dir,
-gxx_include_dir='${prefix}/include/g++')
+gxx_include_dir='${libsubdir}/include/g++')
 
 # Default g++ header file directory if it is empty
+# Note, we need to match the default from the toplevel configure script.
 if [[ x$gxx_include_dir = x ]]; then
-	gxx_include_dir='${prefix}/include/g++'
+	gxx_include_dir='${libsubdir}/include/g++'
 fi
 
 # Enable expensive internal checks
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/libio/Makefile.in egcs-19980617/libio/Makefile.in
--- egcs-19980617.orig/libio/Makefile.in	Mon Feb 23 18:05:53 1998
+++ egcs-19980617/libio/Makefile.in	Wed Jun 17 16:35:50 1998
@@ -107,8 +107,8 @@ install:
 	rootme=`pwd`/ ; export rootme ; \
 	if [ -z "$(MULTISUBDIR)" ]; then \
 	  if [ "$(_G_CONFIG_H)" != "" ]; then \
-	    rm -f $(tooldir)/include/_G_config.h ; \
-	    $(INSTALL_DATA) _G_config.h $(tooldir)/include/_G_config.h || exit 1; \
+	    rm -f $(gxx_include_dir)/_G_config.h ; \
+	    $(INSTALL_DATA) _G_config.h $(gxx_include_dir)/_G_config.h || exit 1; \
 	  else true; \
 	  fi ; \
 	  cd $(srcdir); \
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/libio/config/linux.mt egcs-19980617/libio/config/linux.mt
--- egcs-19980617.orig/libio/config/linux.mt	Wed Feb 18 07:45:46 1998
+++ egcs-19980617/libio/config/linux.mt	Thu Jun 18 08:09:24 1998
@@ -1,8 +1,5 @@
 # Use the libio which comes with the local libc.
 
-# That is where we keep the g++ header files.
-gxx_include_dir =$(prefix)/include/g++
-
 # Comment this out to avoid including the stdio functions in libiostream.a:
 # LIBIOSTREAM_OBJECTS = $(IO_OBJECTS) $(IOSTREAM_OBJECTS) $(STDIO_WRAP_OBJECTS) $(OSPRIM_OBJECTS)
 # LIBIOSTREAM_DEP = $(LIBIOSTREAM_OBJECTS) stdio.list
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/libio/config.shared egcs-19980617/libio/config.shared
--- egcs-19980617.orig/libio/config.shared	Mon Feb 23 18:05:54 1998
+++ egcs-19980617/libio/config.shared	Thu Jun 18 08:03:11 1998
@@ -219,6 +219,7 @@ if [ "${SUBDIRS}" != "" ] ; then
   echo >&2 '	"exec_prefix=$(exec_prefix)" \'
   echo >&2 '	"tooldir=$(tooldir)" \'
   echo >&2 '	"gxx_include_dir=$(gxx_include_dir)" \'
+  echo >&2 '	"libsubdir=$(libsubdir)" \'
   echo >&2 '	"AR=$(AR)" \'
   echo >&2 '	"AR_FLAGS=$(AR_FLAGS)" \'
   echo >&2 '	"CC=$(CC)" \'
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980617.orig/libstdc++/Makefile.in egcs-19980617/libstdc++/Makefile.in
--- egcs-19980617.orig/libstdc++/Makefile.in	Mon May 18 14:06:21 1998
+++ egcs-19980617/libstdc++/Makefile.in	Wed Jun 17 16:36:46 1998
@@ -48,7 +48,7 @@ LIBIBERTY_DIR = ../libiberty
 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
 
 tooldir = $(exec_prefix)/$(target)
-INSTALLDIR = $(libdir)
+INSTALLDIR = $(libsubdir)
 
 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
 CLEAN_JUNK = $(LIBS)


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