Module Name:    src
Committed By:   joerg
Date:           Mon Apr 18 02:16:55 UTC 2011

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

Log Message:
Fix --sysroot usage.


To generate a diff of this commit:
cvs rdiff -u -r1.661 -r1.662 src/share/mk/bsd.own.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.own.mk
diff -u src/share/mk/bsd.own.mk:1.661 src/share/mk/bsd.own.mk:1.662
--- src/share/mk/bsd.own.mk:1.661	Sun Apr 17 15:03:37 2011
+++ src/share/mk/bsd.own.mk	Mon Apr 18 02:16:55 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.661 2011/04/17 15:03:37 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.662 2011/04/18 02:16:55 joerg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -207,12 +207,21 @@
 OBJC=		false
 .endif
 
-.if !defined(HOSTPROG) && !defined(HOSTLIB) && defined(DESTDIR)
+#
+# Make sure DESTDIR is set, so that builds with these tools always
+# get appropriate -nostdinc, -nostdlib, etc. handling.  The default is
+# <empty string>, meaning start from /, the root directory.
+#
+DESTDIR?=
+
+.if !defined(HOSTPROG) && !defined(HOSTLIB)
+.  if ${DESTDIR} != ""
 CPPFLAGS+=	--sysroot=${DESTDIR}
 LDFLAGS+=	--sysroot=${DESTDIR}
-.else
+.  else
 CPPFLAGS+=	--sysroot=/
 LDFLAGS+=	--sysroot=/
+.  endif
 .endif
 .endif	# EXTERNAL_TOOLCHAIN						# }
 
@@ -411,16 +420,6 @@
 .endif
 .endif
 
-
-.if ${USETOOLS} == "yes"						# {
-#
-# Make sure DESTDIR is set, so that builds with these tools always
-# get appropriate -nostdinc, -nostdlib, etc. handling.  The default is
-# <empty string>, meaning start from /, the root directory.
-#
-DESTDIR?=
-.endif									# }
-
 #
 # Build a dynamically linked /bin and /sbin, with the necessary shared
 # libraries moved from /usr/lib to /lib and the shared linker moved

Reply via email to