cflags problem

ac nyvsld at gmail.com
Wed Oct 19 05:05:07 PDT 2005


when a package is installed at `/usr/local', which is the default
install location for packages using GNU autotool to configure
themselves,
later `pkg-config --cflags pkgname' will output something like
`-I/usr/local/include',
but since `/usr/local/include' is searched by gcc as one standard
system header directory, `-I/usr/local/include' actually do nothing, 
and is ignored by gcc,

this behavior may cause problem , especially used with
`-I/usr/X11R6/include' , which is not searched by default by gcc.

if gcc is passed options like `-I/usr/local/include -I/usr/X11R6/include',
one would expect that gcc will search `/usr/local/include first',
but that wont happen, coz ```-I/usr/local/include' does nothing'' ,
said Pinskia( gcc developer ) and gcc manual.

an alternative way is to have pkg-config return cflags using `-isystem
dir' instead of `-I dir'.

an instance is here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24431


More information about the pkg-config mailing list