Tried those variations just now, and they don't change anything either. What is more troublesome, is that CPPFLAGS doesn't really seem to change the compiler command. It seems newlib is isolating its build process pretty well from stray flags declarations.
As to the kernel headers, it definitely isn't picking them up where I supply them. Because I don't use the same name for these as my host os (linux in this case), I can't tell whether it is picking up the host kernel headers, but judging from the compile line the make file is printing I would doubt it can pick up stuff from there. I've included said line below:
Code:
i686-fullmoon-gcc -B/home/david/fullmoon/sysroot/src/newlib-build/i686-fullmoon/newlib/ -isystem /home/david/fullmoon/sysroot/src/newlib-build/i686-fullmoon/newlib/targ-include -isystem /home/david/fullmoon/sysroot/src/newlib-2.5.0/newlib/libc/include -B/home/david/fullmoon/sysroot/src/newlib-build/i686-fullmoon/libgloss/i386 -L/home/david/fullmoon/sysroot/src/newlib-build/i686-fullmoon/libgloss/libnosys -L/home/david/fullmoon/sysroot/src/newlib-2.5.0/libgloss/i386 -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.5.0\" -DPACKAGE_STRING=\"newlib\ 2.5.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../newlib-2.5.0/newlib/libc/argz -DMISSING_SYSCALL_NAMES -fno-builtin -g -O2 -c -o lib_a-argz_add.o `test -f 'argz_add.c' || echo '../../../../../newlib-2.5.0/newlib/libc/argz/'`argz_add.c
From what I see here, I'm guessing that, for some reason, the newlib build system doesn't introduce --sysroot or -isysroot flags to the compiler, even though I'm telling it that it should compile in a sysroot-aware fashion. I wonder why it is ignoring that.