This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
should we search $prefix/include ?
- To: gcc at gcc dot gnu dot org
- Subject: should we search $prefix/include ?
- From: Per Bothner <per at bothner dot com>
- Date: 09 Jun 2001 14:53:31 -0700
We have a problem which I believe needs to be resolved for gcc-3.0.
(Perhaps people are already working on it; if so I apologize.)
I believe g++ used to search $prefix/include. It now seaches
$prefix/include/g++-v3, as well as /usr/include. However,
libgcj installes the CNI (C++ for Java) header files into
$includedir or $prefix/include. So unless gcj is installed
into /usr or /usr/local, you cannot use CNI without an explicit -I.
The easiest fix is to change the libgcj Makefile so it installs into
$includedir/g++-v3. That may be the right thing for 3.0. However, it
seems counter-intuitive to me that gcc should not search $includedir.
One might argue it violates the GNU coding standards, or rather it
forces people to violate them.
This is not just a C++ problem. Compiling foo.c I get:
Reading specs from /home/bothner/GNU/install-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: /home/bothner/GNU/gcc/configure --enable-threads --prefix=/home/bothner/GNU/install-gcc --enable-languages=C++,java
Thread model: posix
gcc version 3.1 20010608 (experimental)
/home/bothner/GNU/install-gcc/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/cctTxHH8.s
GNU CPP version 3.1 20010608 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 3.1 20010608 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 3.1 20010608 (experimental).
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/home/bothner/GNU/install-gcc/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/home/bothner/GNU/install-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
/usr/include
End of search list.
I.e. /home/bothner/GNU/install-gcc/include is missing.
I do think we need to change this.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/