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 for new flag `--enable-libs-in-libsubdir' (was: Re: PATCH for installing runtime libs/headers in $(libsubdir) (was: Re: How to get top-level library installed in lib/gcc-lib/...? ) )


On Fri, 19 June 1998, 20:18:01, law@hurl.cygnus.com wrote:

 > 
 >   In message <13706.45133.352883.28633@saturn.hollstein.net>you write:
 >   > Even if this won't make it into the mainline  source, anyway, here's a
 >   > patch for those who want to be able  to use different egcs versions in
 >   > parallel  without  moving    files   around  after    "make   install"
 >   > (gcc/configure needs to be manually re-built using autoconf!):
 > This makes me wonder if we should have some place to put unofficial
 > patches or something like that.
 > 
 > Anyway, right now I'm tempted to recommend against this patch, though
 > maybe we could have some configure option to enable this behavior? 
 > (or document better how to make existing configure options do the
 > same thing).

OK, this patch adds the new configure option `--enable-libs-in-libsubdir'
(do you know a better name?), which is disabled by default
(== current behaviour). Enabling it has the following effects:

  1. gxx_include_dir will be set to $(libsubdir)/include/g++ if not
     user defined.
  2. _G_config.h will be installed in $(gxx_include_dir), not in
     $(tooldir)/include.
  3. Likewise for libstdc++ header files.
  4. libstdc++.{a,so,sl*} will be installed in $(libsubdir).

Since the current behaviour remains the default, I'd really like this to
be added (cause it'll make my build scripts a lot easier;-).

manfred


egcs-19980620/ChangeLog:

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

	* configure (enable_libs_in_libsubdir): Implement new flag
	--enable-libs-in-libsubdir which installs C++ runtime stuff in
	$(libsubdir); emit definition in each generated Makefile.
	(gxx_include_dir): Initialize depending on $enable_libs_in_libsubdir.

egcs-19980620/gcc/ChangeLog:

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

	* configure.in (gxx_include_dir): Initialize default value depending on
	new flag --enable-libs-in-libsubdir; remove superfluous default initialization
	afterwards.
	* configure: Regenerate.

egcs-19980620/libio/ChangeLog:

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

	* Makefile.in (install): Install _G_config.h depending on new flag
	--enable-libs-in-libsubdir.
	* config/linux.mt (gxx_include_dir): Remove definition here as we use
	gcc's default anyway.

egcs-19980620/libstdc++/ChangeLog:

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

	* Makefile.in (INSTALLDIR): Add comment to document the fact,
	this macro will be properly initialized at make's runtime.
	(install): Add initialization of INSTALLDIR depending on $(libsubdir)
	and ${enable_libs_in_libsubdir}; use $${INSTALLDIR} shell variable
	instead of the $(INSTALLDIR) make macro.

diff -rup -x CVS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980620.orig/configure egcs-19980620/configure
--- egcs-19980620.orig/configure	Fri Jun 19 07:42:14 1998
+++ egcs-19980620/configure	Sat Jun 20 14:54:26 1998
@@ -1223,7 +1223,11 @@ 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}
+	        if test x${enable_libs_in_libsubdir} = xyes; then
+		    echo gxx_include_dir = '${libsubdir}/include/g++' >> ${Makefile}
+		else
+		    echo gxx_include_dir = '${prefix}/include/g++' >> ${Makefile}
+		fi
 	    else
 		echo gxx_include_dir = ${with_gxx_include_dir} >> ${Makefile}
 	    fi
@@ -1233,6 +1237,12 @@ EOF
 	        echo enable_shared = no >> ${Makefile}
 	    else
 	        echo enable_shared = ${enable_shared} >> ${Makefile}
+	    fi
+	    # record if we want to rumtime library stuff installed in libsubdir.
+	    if test -z "${enable_libs_in_libsubdir}"; then
+	        echo enable_libs_in_libsubdir = no >> ${Makefile}
+	    else
+	        echo enable_libs_in_libsubdir = ${enable_libs_in_libsubdir} >> ${Makefile}
 	    fi
 
 	    # Emit a macro which is used to build the libsubdir macro where
diff -rup -x CVS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980620.orig/gcc/configure.in egcs-19980620/gcc/configure.in
--- egcs-19980620.orig/gcc/configure.in	Fri Jun 19 01:36:41 1998
+++ egcs-19980620/gcc/configure.in	Sat Jun 20 15:33:43 1998
@@ -71,12 +71,9 @@ 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++')
-
-# Default g++ header file directory if it is empty
-if [[ x$gxx_include_dir = x ]]; then
-	gxx_include_dir='${prefix}/include/g++'
-fi
+if test x${enable_libs_in_libsubdir} = xyes; then
+gxx_include_dir='${libsubdir}/include/g++'
+else gxx_include_dir='${prefix}/include/g++'; fi)
 
 # Enable expensive internal checks
 AC_ARG_ENABLE(checking,
diff -rup -x CVS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980620.orig/libio/Makefile.in egcs-19980620/libio/Makefile.in
--- egcs-19980620.orig/libio/Makefile.in	Sun Feb 22 17:31:01 1998
+++ egcs-19980620/libio/Makefile.in	Sun Feb 22 17:31:01 1998
@@ -107,8 +107,13 @@ 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; \
+	    if [ x$(enable_libs_in_libsubdir) = xyes ]; then \
+	      rm -f $(gxx_include_dir)/include/_G_config.h ; \
+	      $(INSTALL_DATA) _G_config.h $(gxx_include_dir)/include/_G_config.h || exit 1; \
+	    else \
+	      rm -f $(tooldir)/include/_G_config.h ; \
+	      $(INSTALL_DATA) _G_config.h $(tooldir)/include/_G_config.h || exit 1; \
+	    fi; \
 	  else true; \
 	  fi ; \
 	  cd $(srcdir); \
diff -rup -x CVS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980620.orig/libio/config/linux.mt egcs-19980620/libio/config/linux.mt
--- egcs-19980620.orig/libio/config/linux.mt	Tue Feb 17 21:54:11 1998
+++ egcs-19980620/libio/config/linux.mt	Sat Jun 20 14:55:59 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 *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980620.orig/libstdc++/Makefile.in egcs-19980620/libstdc++/Makefile.in
--- egcs-19980620.orig/libstdc++/Makefile.in	Sun May 17 15:39:11 1998
+++ egcs-19980620/libstdc++/Makefile.in	Sat Jun 20 14:59:44 1998
@@ -48,6 +48,8 @@ LIBIBERTY_DIR = ../libiberty
 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
 
 tooldir = $(exec_prefix)/$(target)
+# This is where the libraries will be installed; note, it will be set
+# at make runtime now. See below at target install.
 INSTALLDIR = $(libdir)
 
 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
@@ -272,24 +274,29 @@ install:
 	else true ; \
 	fi
 	rootme=`pwd`/ ; export rootme ; \
-	rm -f $(INSTALLDIR)$(MULTISUBDIR)/$(SHLINK) ; \
+	if [ x$(libsubdir) = x ] || [ x$(enable_libs_in_libsubdir) != xyes ]; then \
+	  INSTALLDIR=$(libdir); \
+	else \
+	  INSTALLDIR=$(libsubdir); \
+	fi; \
+	rm -f $${INSTALLDIR}$(MULTISUBDIR)/$(SHLINK) ; \
 	for FILE in $(LIBS) ; do \
-	  rm -f $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
+	  rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
 	  if [ $$FILE = $(SHLINK) ] ; then \
-	    ln -f -s $(SHLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
+	    ln -f -s $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
 	  elif [ $$FILE = mshlink ]; then \
 	    for FILE in $(MSHLINK) ; do \
-	      rm -f $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
-	      ln -f -s $(SHLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
+	      rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
+	      ln -f -s $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
 	    done; \
 	  elif [ $$FILE = $(SHLIB) ]; then \
-	    $(INSTALL_PROGRAM) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
+	    $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
 	    : On the HP, shared libraries must be mode 555. ;\
-	    chmod 555 $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
+	    chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
 	  else \
-	    $(INSTALL_DATA) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
-	    $(RANLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
-	    chmod a-x $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
+	    $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
+	    $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
+	    chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
 	  fi ; \
 	done
 	@rootme=`pwd`/ ; export rootme ; \


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