This is the mail archive of the gcc@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]

Re: should we search $prefix/include ?


Mark Mitchell <mark@codesourcery.com> writes:

> Please file a high-priority PR so that I don't forget about it.

I tried.  However, gccbug complained about setting the priority high.

> And, I agree with you that searching $prefix/include makes sense.
> Would you mind preparing a patch, and beginning the testing cycle, so
> that we can know whether or not that works?

Well, it is possible the correct patch might be controversial.

The table of standard search directories is in cppdefault.c,
which contains:

#ifdef LOCAL_INCLUDE_DIR
    /* /usr/local/include comes before the fixincluded header files.  */
    { LOCAL_INCLUDE_DIR, 0, 0, 1 },
#endif

The Makefile.in defines:
   -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
and
        # Directory in which to put localized header files. On the systems with
        # gcc as the native cc, `local_prefix' may not be `prefix' which is
        # `/usr'.
        # NOTE: local_prefix *should not* default from prefix.
        local_prefix = @local_prefix@
        ...
        # Directory to search for site-specific includes.
        includedir = $(local_prefix)/include
However, configure defines:
        includedir='${prefix}/include'
but $includedir@ is not used.

I seem to remember lots of arguing about this some time ago.  The thing
is I'm fairly sure $prefix.include *was* being searched fairly recently,
Specifically, I have one slightly older tree installed.  It was
configured with --prefix /home/bothner/GNU/linux on May 21.

Reading specs from /home/bothner/GNU/linux/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: /home/bothner/GNU/gcc/configure --enable-threads --prefix=/home/bothner/GNU/linux --enable-languages=c++,java
Thread model: posix
gcc version 3.1 20010521 (experimental)
 /home/bothner/GNU/linux/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ foo.c -quiet -dumpbase foo.c -version -o /tmp/ccBIimbM.s
GNU CPP version 3.1 20010521 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 3.1 20010521 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.0).
#include "..." search starts here:
#include <...> search starts here:
 /home/bothner/GNU/linux/include
 /home/bothner/GNU/linux/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
 /home/bothner/GNU/linux/i686-pc-linux-gnu/include
 /usr/include
End of search list.

Note this is the trunk - but both the branch and the trunk currently
search /usr/local/include rather than $prefix/include.  The branch
was broken/changed on or before June 6.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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