branch: PATCH to fix include paths

Neil Booth neil@daikokuya.demon.co.uk
Tue Nov 6 14:33:00 GMT 2001


Mark,

OK to apply Per's patch

http://gcc.gnu.org/ml/gcc-patches/2001-09/msg01133.html

to branch as well?  It went into head about 6 weeks ago.  If someone
configures and installs GCC with --prefix, at least one of the new
paths is missing from the include path.

I have pasted it below for your convenience.

Neil.

	* cppdefault.c (cpp_include_defaults):  Also search PREFIX_INCLUDE_DIR.
	* Makefile.in (includedir):  Rename to local_includedir.
	(includedir):  Define as $(prefix)/include.
	* config.in (PREFIX_INCLUDE_DIR):  New variable.
	* configure.in (PREFIX_INCLUDE_DIR):  Test for new variable.

Index: cppdefault.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppdefault.c,v
retrieving revision 1.3
diff -u -r1.3 cppdefault.c
--- cppdefault.c	2001/04/06 06:13:27	1.3
+++ cppdefault.c	2001/09/27 05:55:57
@@ -47,6 +47,9 @@
     /* /usr/local/include comes before the fixincluded header files.  */
     { LOCAL_INCLUDE_DIR, 0, 0, 1 },
 #endif
+#ifdef PREFIX_INCLUDE_DIR
+    { PREFIX_INCLUDE_DIR, 0, 0, 1 },
+#endif
 #ifdef GCC_INCLUDE_DIR
     /* This is the dir for fixincludes and for gcc's private headers.  */
     { GCC_INCLUDE_DIR, "GCC", 0, 0 },
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.739
diff -u -r1.739 Makefile.in
--- Makefile.in	2001/09/25 15:26:49	1.739
+++ Makefile.in	2001/09/27 05:56:00
@@ -306,7 +306,8 @@
 # Directory in which the compiler finds target-independent g++ includes.
 gcc_gxx_include_dir = @gcc_gxx_include_dir@
 # Directory to search for site-specific includes.
-includedir = $(local_prefix)/include
+local_includedir = $(local_prefix)/include
+includedir = $(prefix)/include
 # where the info files go
 infodir = @infodir@
 # Where cpp should go besides $prefix/bin if necessary
@@ -1983,7 +1984,7 @@
   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-  -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
+  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
   -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
 
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.540
diff -u -r1.540 configure.in
--- configure.in	2001/09/12 16:15:55	1.540
+++ configure.in	2001/09/27 05:56:01
@@ -1694,6 +1694,10 @@
 fi
 AC_MSG_RESULT($gcc_cv_as_dwarf2_debug_line)
 
+if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then
+  AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include")
+fi
+
 # Figure out what language subdirectories are present.
 # Look if the user specified --enable-languages="..."; if not, use
 # the environment variable $LANGUAGES if defined. $LANGUAGES might
Index: config.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.in,v
retrieving revision 1.117
diff -u -r1.117 config.in
--- config.in	2001/09/11 16:49:53	1.117
+++ config.in	2001/09/27 05:56:01
@@ -497,6 +497,8 @@
 /* Define 0/1 to force the choice for exception handling model. */
 #undef CONFIG_SJLJ_EXCEPTIONS
 
+/* Define if cpp should also search $prefix/include. */
+#undef PREFIX_INCLUDE_DIR
 
 /* Bison unconditionally undefines `const' if neither `__STDC__' nor
    __cplusplus are defined.  That's a problem since we use `const' in




More information about the Gcc-patches mailing list