Module Name:    src
Committed By:   christos
Date:           Sat Apr 29 20:31:59 UTC 2023

Modified Files:
        src/share/mk: bsd.sys.mk

Log Message:
Like everywhere else make sure DESTDIR is not empty before using it.
Otherwise if it is empty before we were adding an optargless -d, which
ended up using the next argument (a -Isomething) after the recent change
to xlint.c related to sysroot. This broke using the native tools make
with the cross toolchain (for example typing make in /usr/src/bin/ls)
to build and install a single program.


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/share/mk/bsd.sys.mk

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.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.312 src/share/mk/bsd.sys.mk:1.313
--- src/share/mk/bsd.sys.mk:1.312	Sun Jan 22 10:20:01 2023
+++ src/share/mk/bsd.sys.mk	Sat Apr 29 16:31:59 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.312 2023/01/22 15:20:01 rillig Exp $
+#	$NetBSD: bsd.sys.mk,v 1.313 2023/04/29 20:31:59 christos Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -163,7 +163,9 @@ CWARNFLAGS+=	${CWARNFLAGS.${ACTIVE_CC}}
 CPPFLAGS+=	${AUDIT:D-D__AUDIT__}
 _NOWERROR=	${defined(NOGCCERROR) || (${ACTIVE_CC} == "clang" && defined(NOCLANGERROR)):?yes:no}
 CFLAGS+=	${${_NOWERROR} == "no" :?-Werror:} ${CWARNFLAGS}
-LINTFLAGS+=	${DESTDIR:D-d ${DESTDIR}}
+.if !empty(DESTDIR)
+LINTFLAGS+=	-d ${DESTDIR}
+.endif
 
 .if !defined(NOSSP) && (${USE_SSP:Uno} != "no") && (${BINDIR:Ux} != "/usr/mdec")
 .   if !defined(KERNSRCDIR) && !defined(KERN) # not for kernels / kern modules

Reply via email to