Article View: gnu.gcc.bug
Article #6035addition to standard include search path for gcc-2.7.2.1
From: Alex Garthwaite
Date: Tue, 07 Jan 1997 00:00
Date: Tue, 07 Jan 1997 00:00
118 lines
5477 bytes
5477 bytes
We install and maintain multiple versions of gcc at a given time.
To keep them separate, we make use of the --prefix option to
configure to define separate installation trees for each version.
Under each tree, we group not only a given version of gcc but also
the other compiler support tools (flex, bison, make, gdb) that
were released at the same time as that version of gcc. With one
minor glitch, this arrangement works very well.
The glitch lies in the list of standard places gcc looks for
include files. Currently, this list is
/usr/local/include
$prefix/$arch/include
$libsubdir/include
/usr/include
What is missing here is $prefix/include (where the other
compiler support tools still header files). Our fix was to
extend this list to search $prefix/include first and then
the other standard places. This way, the different installations
of gcc and related tools work correctly.
Below are the patches I made to cccp.c, cpplib.c, protoize.c,
and Makefile.in for these changes.
-- Alex
--
Alex Garthwaite Internet: alex@cis.upenn.edu
Systems Programmer Computer and Information Science
University of Pennsylvania (215) 898-5617
---------------- Attached patches for PREFIX_INCLUDE -----------------
*** cccp.c.orig Thu Oct 26 18:07:26 1995
--- cccp.c Mon Jan 6 12:51:30 1997
***************
*** 601,606 ****
--- 601,609 ----
/* This is another place that the target system's headers might be. */
{ TOOL_INCLUDE_DIR, 0, 0 },
#else /* not CROSS_COMPILE */
+ /* This should be $prefix/include and should come before
+ the local include header files. */
+ { PREFIX_INCLUDE_DIR, 0, 1 },
/* This should be /usr/local/include and should come before
the fixincludes-fixed header files. */
{ LOCAL_INCLUDE_DIR, 0, 1 },
*** cpplib.c.orig Sat Nov 4 10:43:48 1995
--- cpplib.c Mon Jan 6 13:34:51 1997
***************
*** 376,381 ****
--- 376,384 ----
/* This is another place that the target system's headers might be. */
{ TOOL_INCLUDE_DIR, 0, 1 },
#else /* not CROSS_COMPILE */
+ /* This should be $prefix/include and should come before
+ the local include header files. */
+ { PREFIX_INCLUDE_DIR, 0, 1 },
/* This should be /usr/local/include and should come before
the fixincludes-fixed header files. */
{ LOCAL_INCLUDE_DIR, 0, 1 },
*** protoize.c.orig Mon Oct 9 12:37:32 1995
--- protoize.c Mon Jan 6 13:34:42 1997
***************
*** 312,317 ****
--- 312,320 ----
/* This is another place that the target system's headers might be. */
{ TOOL_INCLUDE_DIR, 0, 0 },
#else /* not CROSS_COMPILE */
+ /* This should be $prefix/include and should come before
+ the local include header files. */
+ { PREFIX_INCLUDE_DIR, 0, 1 },
/* This should be /use/local/include and should come before
the fixincludes-fixed header files. */
{ LOCAL_INCLUDE_DIR, 0, 1 },
*** Makefile.in.orig Sun Nov 26 14:44:25 1995
--- Makefile.in Mon Jan 6 13:36:17 1997
***************
*** 1622,1627 ****
--- 1622,1628 ----
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
+ -DPREFIX_INCLUDE_DIR=\"$(prefix)/include\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
***************
*** 1636,1641 ****
--- 1637,1643 ----
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
+ -DPREFIX_INCLUDE_DIR=\"$(prefix)/include\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
***************
*** 1670,1675 ****
--- 1672,1678 ----
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
-DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
+ -DPREFIX_INCLUDE_DIR=\"$(prefix)/include\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DSTD_PROTO_DIR=\"$(libsubdir)\" \
-DUNPROTOIZE $(srcdir)/protoize.c
***************
*** 1679,1684 ****
--- 1682,1688 ----
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
-DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
+ -DPREFIX_INCLUDE_DIR=\"$(prefix)/include\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DSTD_PROTO_DIR=\"$(libsubdir)\" \
$(srcdir)/protoize.c
Technical Details
Message-ID:
<199701071547.KAA16123@samwise.cis.upenn.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,503ceae59b548bcf,start X-Google-Attributes: gid113d02,public From: alex@samwise.cis.upenn.edu (Alex Garthwaite) Subject: addition to standard include search path for gcc-2.7.2.1 Date: 1997/01/07 Message-ID: <199701071547.KAA16123@samwise.cis.upenn.edu> X-Deja-AN: 208291911 sender: bug-gcc-request@prep.ai.mit.edu content-type: text/plain; charset=US-ASCII x-gateway: relay2.UU.NET from bug-gcc to gnu.gcc.bug; Tue, 7 Jan 1997 10:47:44 EST mime-version: 1.0 newsgroups: gnu.gcc.bug x-mailer: ELM [version 2.4 PL23-upenn2.9]