From 64af97a33981aacf28f370a9fb85a83b2da6065d Mon Sep 17 00:00:00 2001 From: bde Date: Sun, 1 Feb 1998 17:19:54 +0000 Subject: Restrict the include search path using -nostdinc -I- in $(CFLAGS} as in kernel Makefiles. Nothing in /usr/include is used (provided relative paths for sys/* and can be found), so there is no need for the -I/usr/include kludge as in kernel Makefiles. --- share/mk/bsd.kmod.mk | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk index 9cf946e..d48e9c4 100644 --- a/share/mk/bsd.kmod.mk +++ b/share/mk/bsd.kmod.mk @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.kmod.mk,v 1.41 1997/11/09 15:03:13 wosch Exp $ +# $Id: bsd.kmod.mk,v 1.42 1998/01/26 20:36:38 bde Exp $ # # The include file handles installing Loadable Kernel Modules. # @@ -92,10 +92,19 @@ MODUNLOAD?= /sbin/modunload CFLAGS+= ${COPTS} -DKERNEL -DACTUALLY_LKM_NOT_KERNEL ${CWARNFLAGS} -# Add -I paths for system headers. Individual LKM makefiles don't need any -# -I paths for this. Most of them need .PATH statement(s) for non-headers. +# Don't use any standard or source-relative include directories. +# Since -nostdinc will annull any previous -I paths, we repeat all +# such paths after -nostdinc. It doesn't seem to be possible to +# add to the front of `make' variable. +_ICFLAGS:= ${CFLAGS:M-I*} +CFLAGS+= -nostdinc -I- ${_ICFLAGS} + +# Add -I paths for system headers. Individual LKM makefiles don't +# need any -I paths for this. Similar defaults for .PATH can't be +# set because there are no standard paths for non-headers. CFLAGS+= -I${.OBJDIR} -I${.OBJDIR}/@ +# XXX this is now dubious. .if defined(DESTDIR) CFLAGS+= -I${DESTDIR}/usr/include .endif -- cgit v1.1