This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: 4.6.3 build error: go (gccgo) does not seem to see configure


On Wed, 21 Mar 2012 12:57:14 -0400
Michael Shell <list1@michaelshell.org> wrote:

> I guess the question becomes: What possible circumstances could cause
> 
> g++ -c -H -I ../../gcc-4.6.3/gcc/go -I ../../gcc-4.6.3/gcc/go/gofrontend 
> -I. -Igo -I../../gcc-4.6.3/gcc ......
> 
> running in gcc-build/gcc to fail to pull in gcc-build/gcc/config.h ?


I got it! The file that calls for the include of "config.h" is
gcc-4.6.3/gcc/go/go-system.h
OK, now the rule for -I states:

http://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

 "If a standard system include directory, or a directory specified with
  -isystem, is also specified with -I, the -I option will be ignored."

Here we have a mechanism whereby an -I can be ignored. So, the question
becomes, what determines, or can alter, the definition of the list of
standard system include directories?

Here we see:

http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html#Environment-Variables

 "Some additional environments variables affect the behavior of the
  preprocessor.

  CPATH
  C_INCLUDE_PATH
  CPLUS_INCLUDE_PATH
  OBJC_INCLUDE_PATH

  Each variable's value is a list of directories separated by a special
  character, much like PATH, in which to look for header files. The
  special character, PATH_SEPARATOR, is target-dependent and determined at
  GCC build time. For Microsoft Windows-based targets it is a semicolon,
  and for almost all other targets it is a colon.

  CPATH specifies a list of directories to be searched as if specified with
  -I, but after any paths given with -I options on the command line. This
  environment variable is used regardless of which language is being
  preprocessed.

  The remaining environment variables apply only when preprocessing the
  particular language indicated. Each specifies a list of directories to be
  searched as if specified with -isystem, but after any paths given with
  -isystem options on the command line.

  In all these variables, an empty element instructs the compiler to search
  its current working directory. Empty elements can appear at the beginning
  or end of a path. For instance, if the value of CPATH is :/special/include,
  that has the same effect as `-I. -I/special/include'.
 "


Un huh, and what, pray tell, was in my CPLUS_INCLUDE_PATH? 

echo $CPLUS_INCLUDE_PATH
/opt/qt/include:


Ouch! That pesky : without a following directory told it to treat -I. as
a system include directory and thus an -I. on the g++ command line will
be ignored. Clearing CPLUS_INCLUDE_PATH resulted in expected behavior.
Oh, what a tangled web we weave.


  Cheers and thank you,

  Mike





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