Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk Fix --sysroot usage.



details:   https://anonhg.NetBSD.org/src/rev/4daa87c1b931
branches:  trunk
changeset: 764376:4daa87c1b931
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Apr 18 02:16:55 2011 +0000

description:
Fix --sysroot usage.

diffstat:

 share/mk/bsd.own.mk |  25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diffs (50 lines):

diff -r f68559eac22f -r 4daa87c1b931 share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk       Mon Apr 18 01:47:28 2011 +0000
+++ b/share/mk/bsd.own.mk       Mon Apr 18 02:16:55 2011 +0000
@@ -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



Home | Main Index | Thread Index | Old Index