[PATCH] Remove -nostdinc in aicasm
Robert Millan
rmh at debian.org
Sun Jul 3 14:15:10 UTC 2011
2011/7/2 Robert Millan <rmh at debian.org>:
> 2011/7/2 Benjamin Kaduk <kaduk at mit.edu>:
>> There is a functional difference between '-nostdinc -I/usr/include -I.' even
>> when the standard include search path is just /usr/include -- the standard
>> include paths are always searched last (unless -nostdinc is given), even if
>> they are explicitly listed on the command line. If there are conflicting
>> definitions in /usr/local/foo.h and ./foo.h, this gimmick can be necessary
>> to pull in the correct version. (I've needed to do this when packaging
>> software for the freebsd ports collection, though with /usr/local/include
>> replacing '.'.)
>
> In this case I'd rather be safe than sorry and use -iwithprefix or
> -isystem `gcc --print-file-name=` on GCC only.
I hope this patch is better. Please have a look.
--
Robert Millan
-------------- next part --------------
Index: sys/dev/aic7xxx/aicasm/Makefile
===================================================================
--- sys/dev/aic7xxx/aicasm/Makefile (revision 223721)
+++ sys/dev/aic7xxx/aicasm/Makefile (working copy)
@@ -26,6 +26,13 @@
NOSTDINC= -nostdinc
CFLAGS+= ${NOSTDINC} -I/usr/include -I.
+# This is needed when using upstream GCC (whose <stddef.h>, etc, are
+# not re-enabled by -I/usr/inclde).
+.if ${CC:T:Mclang} != "clang"
+GCCINCDIR!= gcc --print-file-name=
+CFLAGS+= -I${GCCINCDIR}/include -I${GCCINCDIR}/include-fixed
+.endif
+
.ifdef MAKESRCPATH
CFLAGS+= -I${MAKESRCPATH}
.endif
More information about the freebsd-hackers
mailing list