From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Loren J. Rittle" To: egcs@cygnus.com Subject: Implications of tighter integration of libg++ Date: Mon, 24 Nov 1997 23:19:00 -0000 Message-id: <199711250040.SAA09460@supra.rsch.comm.mot.com> X-SW-Source: 1997-11/msg00808.html Under EGCS, there is now tighter integration between g++ and the required standard C++ libraries, in that they are now distributed and configured together. Should we assume that this tighter integration will continue? Or is this just a short-term situation to aid current development? The reason I ask is that ./configure --with-gxx-include-dir\=\'\$\{libsubdir\}/include/g++\' invoked at the top-level doesn't work as expected. Granted, the top-level and library configuration programs don't currently understand ${libsubdir} so I shouldn't have expected this to work. It is desirable to place libraries compiled against and dependent upon a given version of g++, and their related header files, into the compiler's lib and include directory. Thus, I actually believe that something akin to the above should be the default. Someone else believed this at one time given the comments in gcc/Makefile.in: > # The reason we use $(libdir)/g++-include rather than using libsubdir > # is for compatibility with the current version of libg++. Given the current state of integration, now might be a golden time to break this ``compatibility''. It is always annoying to have accidentally wiped out an old working g++/libg++ configuration when a new version of the compiler is installed. The included patches are not perfect (i.e. they only work for g++ and only when the default g++ header location has not been overridden with --with-gxx-include-dir). However, they are no worse than the current state of affairs since --with-gxx-include-dir doesn't currently interplay with the libraries' build process. If this patch (or some improvement upon it) is deemed acceptable, then perhaps --with-gxx-include-dir should be revoked as well. A better patch would enhance gcc/g++ to add new --print-* switches to allow tools that build system libraries to find the exact locations where gcc/g++ wants library and headers to be installed (these locations might be different --- and it might be better for g++ to supply the entire destination to the headers instead of the current model used --- see the patch). This patch also gets rid of $(old_gxx_include_dir) from gcc/Makefile.in and OLD_GPLUSPLUS_INCLUDE_DIR from gcc/cccp.c and gcc/cpplib.c since it can't be right to ever want these old versions of libraries under the tightly integrated model. Example of paths (with default ./configure): $ gcc --print-file-name\=include/g++ /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.18/include/g++ $ gcc --print-file-name\=libstdc++.a /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.18/libstdc++.a As new versions of tools are installed, old installations will continue to operate as before since there support libraries are not overwritten. [Since this patch only changes 8 lines of code/shell script and removes another 8 lines of code/shell script, I believe it too minor to file copyright paperwork. I and Motorola hereby disclaim all rights to this patch. It is released into the public domain.] Regards, Loren -- Loren J. Rittle (rittle@comm.mot.com) PGP KeyIDs: 1024/B98B3249 2048/ADCE34A5 Systems Technology Research (IL02/2240) FP1024:6810D8AB3029874DD7065BC52067EAFD Motorola, Inc. FP2048:FDC0292446937F2A240BC07D42763672 (847) 576-7794 Call for verification of fingerprints. diff -Nrc3p -x *.info* /tmp/egcs-971122/gcc/Makefile.in egcs-971122/gcc/Makefile.in *** /tmp/egcs-971122/gcc/Makefile.in Mon Nov 24 17:43:59 1997 --- egcs-971122/gcc/Makefile.in Mon Nov 24 17:32:20 1997 *************** libdir = @libdir@ *** 218,225 **** libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version) # Directory in which the compiler finds g++ includes. gxx_include_dir= @gxx_include_dir@ - # Directory in which the old g++ header files may be found. - old_gxx_include_dir= $(libdir)/g++-include # Directory to search for site-specific includes. includedir = $(local_prefix)/include # assertdir is overridden in cross-make. --- 218,223 ---- *************** $(srcdir)/cexp.c: $(srcdir)/cexp.y *** 1731,1742 **** cd $(srcdir); $(BISON) -o cexp.c cexp.y cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status - # The reason we use $(libdir)/g++-include rather than using libsubdir - # is for compatibility with the current version of libg++. $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \ - -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \ -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \ -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ --- 1729,1737 ---- *************** cpplib.o: cpplib.c $(CONFIG_H) cpplib.h *** 1753,1759 **** $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \ - -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \ -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \ -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ --- 1748,1753 ---- diff -Nrc3p -x *.info* /tmp/egcs-971122/gcc/cccp.c egcs-971122/gcc/cccp.c *** /tmp/egcs-971122/gcc/cccp.c Wed Oct 1 01:22:46 1997 --- egcs-971122/gcc/cccp.c Fri Nov 21 04:58:15 1997 *************** static struct default_include { *** 590,596 **** = { /* Pick up GNU C++ specific include files. */ { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, - { OLD_GPLUSPLUS_INCLUDE_DIR, 1, 1 }, #ifdef CROSS_COMPILE /* This is the dir for fixincludes. Put it just before the files that we fix. */ --- 590,595 ---- diff -Nrc3p -x *.info* /tmp/egcs-971122/gcc/configure egcs-971122/gcc/configure *** /tmp/egcs-971122/gcc/configure Mon Nov 24 17:44:00 1997 --- egcs-971122/gcc/configure Mon Nov 24 17:36:12 1997 *************** if test "${with_gxx_include_dir+set}" = *** 610,622 **** withval="$with_gxx_include_dir" gxx_include_dir=$with_gxx_include_dir else ! gxx_include_dir='${prefix}/include/g++' fi # Default g++ header file directory if it is empty if [ x$gxx_include_dir = x ]; then ! gxx_include_dir='${prefix}/include/g++' fi # Enable use of cpplib for C. --- 610,622 ---- withval="$with_gxx_include_dir" gxx_include_dir=$with_gxx_include_dir else ! gxx_include_dir='${libsubdir}/include/g++' fi # Default g++ header file directory if it is empty if [ x$gxx_include_dir = x ]; then ! gxx_include_dir='${libsubdir}/include/g++' fi # Enable use of cpplib for C. diff -Nrc3p -x *.info* /tmp/egcs-971122/gcc/configure.in egcs-971122/gcc/configure.in *** /tmp/egcs-971122/gcc/configure.in Mon Nov 24 17:44:00 1997 --- egcs-971122/gcc/configure.in Mon Nov 24 17:35:26 1997 *************** AC_ARG_WITH(gxx-include-dir, *** 71,81 **** [ --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 # Enable use of cpplib for C. --- 71,81 ---- [ --with-gxx-include-dir=DIR specifies directory to put g++ header files.], gxx_include_dir=$with_gxx_include_dir, ! gxx_include_dir='${libsubdir}/include/g++') # Default g++ header file directory if it is empty if [[ x$gxx_include_dir = x ]]; then ! gxx_include_dir='${libsubdir}/include/g++' fi # Enable use of cpplib for C. diff -Nrc3p -x *.info* /tmp/egcs-971122/gcc/cpplib.c egcs-971122/gcc/cpplib.c *** /tmp/egcs-971122/gcc/cpplib.c Thu Sep 11 17:51:33 1997 --- egcs-971122/gcc/cpplib.c Fri Nov 21 05:00:13 1997 *************** static struct default_include { *** 363,369 **** = { /* Pick up GNU C++ specific include files. */ { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, - { OLD_GPLUSPLUS_INCLUDE_DIR, 1, 1 }, #ifdef CROSS_COMPILE /* This is the dir for fixincludes. Put it just before the files that we fix. */ --- 363,368 ---- diff -Nrc3p -x *.info* /tmp/egcs-971122/libiberty/Makefile.in egcs-971122/libiberty/Makefile.in *** /tmp/egcs-971122/libiberty/Makefile.in Wed Oct 29 00:39:04 1997 --- egcs-971122/libiberty/Makefile.in Mon Nov 24 16:07:27 1997 *************** prefix = /usr/local *** 32,38 **** exec_prefix = $(prefix) bindir = $(exec_prefix)/bin ! libdir = $(exec_prefix)/lib datadir = $(prefix)/share --- 32,38 ---- exec_prefix = $(prefix) bindir = $(exec_prefix)/bin ! libdir = `$(CXX) --print-file-name\=` datadir = $(prefix)/share *************** man7dir = $(mandir)/man7 *** 47,53 **** man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 infodir = $(prefix)/info ! includedir = $(prefix)/include SHELL = /bin/sh --- 47,53 ---- man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 infodir = $(prefix)/info ! includedir = `$(CXX) --print-file-name\=`include SHELL = /bin/sh diff -Nrc3p -x *.info* /tmp/egcs-971122/libio/config.shared egcs-971122/libio/config.shared *** /tmp/egcs-971122/libio/config.shared Fri Sep 26 23:06:54 1997 --- egcs-971122/libio/config.shared Mon Nov 24 16:05:12 1997 *************** echo "prefix = ${prefix-/usr/local}" *** 72,78 **** echo "exec_prefix = ${exec_prefix-'${prefix}'}" echo 'bindir = $(exec_prefix)/bin' ! echo 'libdir = $(exec_prefix)/lib' echo 'datadir = $(prefix)/lib' echo 'mandir = $(prefix)/man' --- 72,78 ---- echo "exec_prefix = ${exec_prefix-'${prefix}'}" echo 'bindir = $(exec_prefix)/bin' ! echo 'libdir = `$(CXX) --print-file-name\=`' echo 'datadir = $(prefix)/lib' echo 'mandir = $(prefix)/man' *************** echo 'man8dir = $(mandir)/man8' *** 87,93 **** echo 'man9dir = $(mandir)/man9' echo 'infodir = $(prefix)/info' ! echo 'includedir = $(prefix)/include' echo 'gxx_includedir = $(includedir)/g++' echo 'docdir = $(datadir)/doc' echo '' --- 87,93 ---- echo 'man9dir = $(mandir)/man9' echo 'infodir = $(prefix)/info' ! echo 'includedir = `$(CXX) --print-file-name\=`include' echo 'gxx_includedir = $(includedir)/g++' echo 'docdir = $(datadir)/doc' echo ''