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]

PATCH to provide $(libsubdir) to sub-makes (was: Re: How to get top-level library installed in lib/gcc-lib/...?)


On Sat, 13 June 1998, 03:34:48, burley@gnu.org wrote:

 > Hopefully someone will improve the top-level Makefile to pass down
 > the appropriate version and target_alias information soon.  I would
 > think the top-level directory should really have its own version.c
 > file that is "superior" to the one in the gcc/ directory, and
 > related infrastructure modified accordingly, but don't know enough
 > to be sure, or suggest much about how it should be done, certainly
 > not enough to submit any patches....
 > 
 >         tq vm, (burley)

OK, here it is. The toplevel Makefile will contain the following new
macros:

  gcc_version and
  libsubdir

BASE_FLAGS_TO_PASS will pass them down to sub-makes along with
target_alias. My patch will not change, where e.g. libstdc++.{a,so}
will be installed, but as I've indicated long time ago, I'd actually
prefer them to be installed in ${libsubdir}, too. Tomorrow I'll send a 
separate patch for that.

As a side-effect I've changed the various mkdir statements to create
the various subdirectories down to $(libsubdir) to use a for loop
instead.

top-level ChangeLog:

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

	* configure (gcc_version): Add new variable describing the
	particular gcc version we're building.
	* 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.

gcc ChangeLog:

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

	* Makefile.in (version): Initialize using passed down value of new
	macro "gcc_version".
	(installdirs): Loop over directories in $(libsubdir) creating probably
	missing ones, instead of single if statements.
	* configure.in (version): Remove definition; do not AC_SUBST(version);
	do not emit definition into config.status.
	* configure: Regenerate.
	* configure.lang (version): Remove sed pattern.

OK to install?

manfred


diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980615.orig/Makefile.in egcs-19980615/Makefile.in
--- egcs-19980615.orig/Makefile.in	Mon May 25 11:29:19 1998
+++ egcs-19980615/Makefile.in	Mon Jun 15 17:13:21 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-19980615.orig/configure egcs-19980615/configure
--- egcs-19980615.orig/configure	Fri Apr 24 07:59:08 1998
+++ egcs-19980615/configure	Mon Jun 15 17:40:00 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.
@@ -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-19980615.orig/gcc/Makefile.in egcs-19980615/gcc/Makefile.in
--- egcs-19980615.orig/gcc/Makefile.in	Fri Jun 12 21:32:21 1998
+++ egcs-19980615/gcc/Makefile.in	Mon Jun 15 17:31:03 1998
@@ -245,7 +245,8 @@ lang_specs_files=@lang_specs_files@
 lang_options_files=@lang_options_files@
 GCC_THREAD_FILE=@thread_file@
 GTHREAD_FLAGS=@gthread_flags@
-version=@version@
+# This is now passed down from the toplevel Makefile.
+version=$(gcc_version)
 mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
 
 # Common prefix for installation directories.
@@ -2270,9 +2271,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-19980615.orig/gcc/configure.in egcs-19980615/gcc/configure.in
--- egcs-19980615.orig/gcc/configure.in	Thu Jun 11 18:37:06 1998
+++ egcs-19980615/gcc/configure.in	Mon Jun 15 17:31:56 1998
@@ -3122,9 +3122,6 @@ if [[ x$host_truncate_target != x ]]; th
 	target=`echo $target | sed -e 's/\(..............\).*/\1/'`
 fi
 
-# Get the version number from the toplevel
-version=`sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/' < ${srcdir}/version.c`
-
 # Get an absolute path to the GCC top-level source directory
 holddir=`pwd`
 cd $srcdir
@@ -3543,7 +3540,6 @@ AC_SUBST(host_xm_file_list)
 AC_SUBST(lang_specs_files)
 AC_SUBST(lang_options_files)
 AC_SUBST(thread_file)
-AC_SUBST(version)
 AC_SUBST(local_prefix)
 AC_SUBST(gxx_include_dir)
 AC_SUBST(fixincludes)
@@ -3646,7 +3642,6 @@ host_xmake_file='${host_xmake_file}'
 dep_tmake_file='${dep_tmake_file}'
 tmake_file='${tmake_file}'
 thread_file='${thread_file}'
-version='${version}'
 local_prefix='${local_prefix}'
 build_install_headers_dir='${build_install_headers_dir}'
 build_exeext='${build_exeext}'
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980615.orig/gcc/configure egcs-19980615/gcc/configure
--- egcs-19980615.orig/gcc/configure	Thu Jun 11 18:39:30 1998
+++ egcs-19980615/gcc/configure	Mon Jun 15 17:32:45 1998
@@ -4966,9 +4966,6 @@ if [ x$host_truncate_target != x ]; then
 	target=`echo $target | sed -e 's/\(..............\).*/\1/'`
 fi
 
-# Get the version number from the toplevel
-version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${srcdir}/version.c`
-
 # Get an absolute path to the GCC top-level source directory
 holddir=`pwd`
 cd $srcdir
@@ -5126,7 +5123,7 @@ fi
 
 # Figure out what assembler alignment features are present.
 echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:5130: checking assembler alignment features" >&5
+echo "configure:5127: checking assembler alignment features" >&5
 gcc_cv_as=
 gcc_cv_as_alignment_features=
 if [ -x as$host_exeext ]; then
@@ -5416,7 +5413,6 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configur
 
 
 
-
 # Echo that links are built
 if [ x$host = x$target ]
 then
@@ -5654,7 +5650,6 @@ s%@host_xm_file_list@%$host_xm_file_list
 s%@lang_specs_files@%$lang_specs_files%g
 s%@lang_options_files@%$lang_options_files%g
 s%@thread_file@%$thread_file%g
-s%@version@%$version%g
 s%@local_prefix@%$local_prefix%g
 s%@gxx_include_dir@%$gxx_include_dir%g
 s%@fixincludes@%$fixincludes%g
@@ -5901,7 +5896,6 @@ host_xmake_file='${host_xmake_file}'
 dep_tmake_file='${dep_tmake_file}'
 tmake_file='${tmake_file}'
 thread_file='${thread_file}'
-version='${version}'
 local_prefix='${local_prefix}'
 build_install_headers_dir='${build_install_headers_dir}'
 build_exeext='${build_exeext}'
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980615.orig/gcc/configure.lang egcs-19980615/gcc/configure.lang
--- egcs-19980615.orig/gcc/configure.lang	Fri May 29 14:43:08 1998
+++ egcs-19980615/gcc/configure.lang	Mon Jun 15 17:32:28 1998
@@ -183,7 +183,6 @@ $program_transform_name/" \
 	echo "s|^target_alias=.*$|target_alias=${target_alias}|" >> Makefile.sed
 	echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed
 	echo "s|^tmake_file=.*$|tmake_file=${dep_tmake_file}|" >> Makefile.sed
-	echo "s|^version=.*$|version=${version}|" >> Makefile.sed
 	echo "s|^GCC_THREAD_FILE=.*$|GCC_THREAD_FILE=${thread_file}|" >> Makefile.sed
 	echo "s|^prefix[ 	]*=.*|prefix = $prefix|" >> Makefile.sed
 	echo "s|^local_prefix[ 	]*=.*|local_prefix = $local_prefix|" >> Makefile.sed


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