This is the mail archive of the
mailing list for the GCC project.
Re: gcc 3.2's cpp breaks configure scripts
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: dave at hiauly1 dot hia dot nrc dot ca (John David Anglin)
- Cc: gcc at gcc dot gnu dot org, tilps at hotmail dot com
- Date: Thu, 1 Aug 2002 15:02:05 -0400 (EDT)
- Subject: Re: gcc 3.2's cpp breaks configure scripts
> > Turning the warning off is not the correct solution, although there
> > may be some circumstances in which it is emitted when it shouldn't
> > be.
> I think so... but I am probably wrong hehe...
You can display the include search order with "gcc -v -E". The situation
where gcc emits the message when it shouldn't is when a user include directory
is specified and it is the same as the first directory searched by gcc.
gcc -v -E main.c -I/opt/gnu/include
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/opt/gnu/hppa2.0w-hp-hpux11.00/include"
cpp0: warning: changing search order for system directory "/opt/gnu/include"
cpp0: warning: as it has already been specified as a non-system directory
ignoring duplicate directory "/opt/gnu/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
As can be seen, the search order hasn't really changed. If "-I/usr/include"
were added to the command, the search order would really have changed.
These are rules under which the macro lib-prefix.m4 used by configure
in textutils-2.1 adds include directories to CPPFLAGS:
dnl Potentially add $additional_includedir to $CPPFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's already present in $CPPFLAGS,
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
"/opt/gnu" is my standard prefix. As can be seen, the above macro
will add "-I/opt/gnu/include" to CPPFLAGS and cause a gcc warning
if something interesting is found there (e.g., libintl.h).
J. David Anglin email@example.com
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)