Am Sonntag, den 15.11.2009, 12:35 +0100 schrieb Robert Millan: > On Sun, Nov 15, 2009 at 12:17:50PM +0100, Felix Zielcke wrote: > > > > The advantage is that this does exatly what we want for the target. > > Remove /usr/include from the include search directories but still keep > > the gcc internal one for e.g. stdarg.h > > As far as I understand the gcc manual, isystem adds this directory to > > the search path and treats all headers there in as system headers. > > And with the = between -isystem and $(srcdir) it actually uses > > ${sysroot}{$srcdir} but we don't use any --sysroot or -isysroot. > > The arguments we currently have there just look wrong with my understand > > of the gcc manual > > Ah, I see.. > > > $ cat test.c > > #include <stdarg.h> > > #include <stdint.h> > > > > int main (void) > > { > > return 0; > > } > > > > $ srcdir=$PWD builddir=$PWD gcc -isystem=$srcdir/include -I$srcdir/include > > -I$builddir -I$builddir/include test.c -o test && ls test > > test > > $ srcdir=$PWD builddir=$PWD gcc -nostdinc -isystem $(gcc > > -print-file-name=include) -I$srcdir/include -I$builddir -I$builddir/include > > test.c > > test.c:2:20: error: stdint.h: No such file or directory > > We used -isystem as a way of excluding system headers but not gcc headers. > With the -print-file-name trick this seems to be no longer necessary, right? > > So why not "-nostdinc -I$(gcc -print-file-name=include)" instead?
I think we should use -isystem for the gcc internal header files not -I, but I just tested experimental branch with -I instead of -isystem and also compiles cleanly (except the usual grub.texi warnings) As said on IRC already: http://gcc.gnu.org/onlinedocs/cpp/System-Headers.html -- Felix Zielcke Proud Debian Maintainer and GNU GRUB developer _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel