Module Name:    src
Committed By:   joerg
Date:           Sat Dec 25 18:56:45 UTC 2010

Modified Files:
        src/share/mk: bsd.hostprog.mk bsd.sys.mk
        src/tools: Makefile.host

Log Message:
If MKREPRO, transform ${NETBSDSRCDIR} to /usr/src and ${DESTDIR} to /
for the purpose of the C preprocessor.  This avoids leaking the source
path into the final binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/share/mk/bsd.hostprog.mk
cvs rdiff -u -r1.192 -r1.193 src/share/mk/bsd.sys.mk
cvs rdiff -u -r1.26 -r1.27 src/tools/Makefile.host

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.hostprog.mk
diff -u src/share/mk/bsd.hostprog.mk:1.59 src/share/mk/bsd.hostprog.mk:1.60
--- src/share/mk/bsd.hostprog.mk:1.59	Mon Nov 22 11:29:07 2010
+++ src/share/mk/bsd.hostprog.mk	Sat Dec 25 18:56:45 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.hostprog.mk,v 1.59 2010/11/22 11:29:07 pooka Exp $
+#	$NetBSD: bsd.hostprog.mk,v 1.60 2010/12/25 18:56:45 joerg Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .include <bsd.init.mk>
@@ -125,7 +125,7 @@
 
 beforedepend:
 CFLAGS:=	${HOST_CFLAGS}
-CPPFLAGS:=	${HOST_CPPFLAGS}
+CPPFLAGS:=	${HOST_CPPFLAGS:N-Wp,-iremap,*}
 
 lint: ${LOBJS}
 .if defined(LOBJS) && !empty(LOBJS)

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.192 src/share/mk/bsd.sys.mk:1.193
--- src/share/mk/bsd.sys.mk:1.192	Wed Apr 21 16:09:11 2010
+++ src/share/mk/bsd.sys.mk	Sat Dec 25 18:56:45 2010
@@ -1,10 +1,15 @@
-#	$NetBSD: bsd.sys.mk,v 1.192 2010/04/21 16:09:11 pooka Exp $
+#	$NetBSD: bsd.sys.mk,v 1.193 2010/12/25 18:56:45 joerg Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
 .if !defined(_BSD_SYS_MK_)
 _BSD_SYS_MK_=1
 
+.if ${MKREPRO:Uno} == "yes"
+CPPFLAGS+=	-Wp,-iremap,${NETBSDSRCDIR}:/usr/src
+CPPFLAGS+=	-Wp,-iremap,${DESTDIR}/:/
+.endif
+
 .if defined(WARNS)
 .if ${WARNS} > 0
 CFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith

Index: src/tools/Makefile.host
diff -u src/tools/Makefile.host:1.26 src/tools/Makefile.host:1.27
--- src/tools/Makefile.host:1.26	Tue Dec  1 17:06:34 2009
+++ src/tools/Makefile.host	Sat Dec 25 18:56:44 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.host,v 1.26 2009/12/01 17:06:34 uebayasi Exp $
+#	$NetBSD: Makefile.host,v 1.27 2010/12/25 18:56:44 joerg Exp $
 
 NOINFO=		# defined
 NOLINT=		# defined
@@ -42,6 +42,7 @@
 HOSTPROGNAME?=	${HOSTPROG}
 HOST_BINDIR?=	${TOOLDIR}/bin
 HOST_CPPFLAGS:=	${HOST_CPPFLAGS} ${CPPFLAGS}
+HOST_CPPFLAGS:=	${HOST_CPPFLAGS:N-Wp,-iremap,*}
 .undef LINKS
 
 SRCS?=		${HOSTPROG}.c

Reply via email to