Implications of tighter integration of libg++

Fred Fish fnf@ninemoons.com
Mon Feb 9 15:33:00 GMT 1998


> > So would you prefer the status quo for headers and libs, or would you
> > prefer to see them pushed down into libsubdir?
> 
> libsubdir, I suppose.

The below patch is what we use in Geek Gadgets to get gcc to look under
libsubdir for g++ include files, ahead of the normal include dir:

	* Makefile.in (cccp.o): Define GPLUSPLUS_INCLUDE_DIR_SPECIFIC
	when compiling.
	* cccp.c (include_defaults_array): Add GPLUSPLUS_INCLUDE_DIR_SPECIFIC
	ahead of GPLUSPLUS_INCLUDE_DIR entry.
	* cpplib.c (include_defaults_array): Add GPLUSPLUS_INCLUDE_DIR_SPECIFIC
	ahead of GPLUSPLUS_INCLUDE_DIR entry.

*** Makefile.in	1997/11/24 04:15:29	1.1.1.8
--- Makefile.in	1998/01/21 17:20:42	1.13
***************
*** 1735,1740 ****
--- 1764,1770 ----
  # is for compatibility with the current version of libg++.
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  	  -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
+ 	  -DGPLUSPLUS_INCLUDE_DIR_SPECIFIC=\"$(libsubdir)/include/g++\" \
  	  -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
  	  -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \
  	  -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
***************
*** 1752,1757 ****
--- 1782,1788 ----
  cpplib.o: cpplib.c $(CONFIG_H) cpplib.h cpphash.h config.status
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  	  -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
+ 	  -DGPLUSPLUS_INCLUDE_DIR_SPECIFIC=\"$(libsubdir)/include/g++\" \
  	  -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
  	  -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \
  	  -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
***************
*** 1789,1794 ****
--- 1820,1826 ----
  stamp-proto: protoize.c getopt.h $(CONFIG_H)
  	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
            -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
+ 	  -DGPLUSPLUS_INCLUDE_DIR_SPECIFIC=\"$(libsubdir)/include/g++\" \
  	  -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
            -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
  	  -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
***************
*** 1798,1803 ****
--- 1830,1836 ----
  	mv protoize$(objext) unprotoize$(objext)
  	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
            -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
+ 	  -DGPLUSPLUS_INCLUDE_DIR_SPECIFIC=\"$(libsubdir)/include/g++\" \
  	  -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
            -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
  	  -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
***************
*** 1828,1833 ****
--- 1861,1867 ----
  	./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
  	  $(CFLAGS) $(INCLUDES) \
  	  -DGCC_INCLUDE_DIR=0 \
+ 	  -DGPLUSPLUS_INCLUDE_DIR_SPECIFIC=0 \
  	  -DGPLUSPLUS_INCLUDE_DIR=0 \
  	  -DCROSS_INCLUDE_DIR=0 \
  	  -DTOOL_INCLUDE_DIR=0 \
***************
*** 1838,1843 ****
--- 1872,1878 ----
  	./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
  	  $(CFLAGS) $(INCLUDES) \
  	  -DGCC_INCLUDE_DIR=0 \
+ 	  -DGPLUSPLUS_INCLUDE_DIR_SPECIFIC=0 \
  	  -DGPLUSPLUS_INCLUDE_DIR=0 \
  	  -DCROSS_INCLUDE_DIR=0 \
  	  -DTOOL_INCLUDE_DIR=0 \
*** cccp.c	1997/10/10 21:53:17	1.1.1.2
--- cccp.c	1998/01/21 18:12:27	1.2
***************
*** 588,593 ****
--- 593,600 ----
    = INCLUDE_DEFAULTS;
  #else
    = {
+     /* Pick up GNU C++ specific include files for specific gcc release.  */
+     { GPLUSPLUS_INCLUDE_DIR_SPECIFIC, 1, 1 },
      /* Pick up GNU C++ specific include files.  */
      { GPLUSPLUS_INCLUDE_DIR, 1, 1 },
      { OLD_GPLUSPLUS_INCLUDE_DIR, 1, 1 },
*** cpplib.c	1997/09/18 23:24:03	1.1.1.2
--- cpplib.c	1998/01/21 18:24:39	1.3
***************
*** 361,366 ****
--- 366,373 ----
    = INCLUDE_DEFAULTS;
  #else
    = {
+     /* Pick up GNU C++ specific include files for specific gcc release. */
+     { GPLUSPLUS_INCLUDE_DIR_SPECIFIC, 1, 1},
      /* Pick up GNU C++ specific include files.  */
      { GPLUSPLUS_INCLUDE_DIR, 1, 1 },
      { OLD_GPLUSPLUS_INCLUDE_DIR, 1, 1 },




More information about the Gcc mailing list