Module Name:    src
Committed By:   snj
Date:           Mon Feb 19 18:26:44 UTC 2018

Modified Files:
        src [netbsd-8]: build.sh
        src/tools/make [netbsd-8]: buildmake.sh.in

Log Message:
Pull up following revision(s) (requested by uwe in ticket #555):
        build.sh: 1.322-1.323
        tools/make/buildmake.sh.in: 1.9-1.12
Make sure nbmake is always built with the right _PATH_DEFSYSPATH.
--
Restore formatting/indentation of the configure call in rebuildmake()
to what it used to be.
--
G/c unused runcmd.
--
Do not use HOST_CFLAGS to link the make binary.
--
Do not use HOST_CFLAGS and others.  build.sh calls configure with
CFLAGS set to HOST_CFLAGS, etc - so HOST_* environment variables are
already taken into account if set.
OTOH, if configure were to add anything to CFLAGS etc, the old code
would happily ignore those changes, picking up original environment
variables instead.


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.316.4.1 src/build.sh
cvs rdiff -u -r1.8 -r1.8.74.1 src/tools/make/buildmake.sh.in

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.316 src/build.sh:1.316.4.1
--- src/build.sh:1.316	Sat Apr  8 18:22:35 2017
+++ src/build.sh	Mon Feb 19 18:26:44 2018
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.316 2017/04/08 18:22:35 christos Exp $
+#	$NetBSD: build.sh,v 1.316.4.1 2018/02/19 18:26:44 snj Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1616,13 +1616,8 @@ rebuildmake()
 
 	statusmsg "Bootstrapping ${toolprefix}make"
 	${runcmd} cd "${tmpdir}"
-	${runcmd} env \
-\
-CC="${HOST_CC-cc}" \
-CPPFLAGS="${HOST_CPPFLAGS} -D_PATH_DEFSYSPATH="'\"'${NETBSDSRCDIR}/share/mk'\"' \
-CFLAGS="${HOST_CFLAGS--O}" \
-LDFLAGS="${HOST_LDFLAGS}" \
-\
+	${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \
+		CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \
 	    ${HOST_SH} "${TOP}/tools/make/configure" ||
 	( cp ${tmpdir}/config.log ${tmpdir}-config.log
 	      bomb "Configure of ${toolprefix}make failed, see ${tmpdir}-config.log for details" )
@@ -1893,7 +1888,7 @@ createmakewrapper()
 	eval cat <<EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.316 2017/04/08 18:22:35 christos Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.316.4.1 2018/02/19 18:26:44 snj Exp $
 # with these arguments: ${_args}
 #
 

Index: src/tools/make/buildmake.sh.in
diff -u src/tools/make/buildmake.sh.in:1.8 src/tools/make/buildmake.sh.in:1.8.74.1
--- src/tools/make/buildmake.sh.in:1.8	Sat Aug 26 22:17:48 2006
+++ src/tools/make/buildmake.sh.in	Mon Feb 19 18:26:44 2018
@@ -1,23 +1,28 @@
 #! /bin/sh
-#	$NetBSD: buildmake.sh.in,v 1.8 2006/08/26 22:17:48 christos Exp $
+#	$NetBSD: buildmake.sh.in,v 1.8.74.1 2018/02/19 18:26:44 snj Exp $
 #
 # buildmake.sh.in - Autoconf-processed shell script for building make(1).
 #
 
-: ${HOST_CC="@CC@"}
-: ${HOST_CFLAGS="@CPPFLAGS@ @CFLAGS@"}
-: ${HOST_LDFLAGS="@LDFLAGS@ @LIBS@"}
-: ${runcmd=""}
+: ${NETBSDSRCDIR:=@srcdir@/../..}
+MKSRCDIR=${NETBSDSRCDIR}/usr.bin/make
+
+_CC="@CC@"
+
+_CFLAGS="@CPPFLAGS@"
+_CFLAGS="${_CFLAGS} -D_PATH_DEFSYSPATH=\"${NETBSDSRCDIR}/share/mk\""
+_CFLAGS="${_CFLAGS} @DEFS@"
+_CFLAGS="${_CFLAGS} @CFLAGS@"
+
+_LDFLAGS="@LDFLAGS@ @LIBS@"
 
 docmd () {
 	echo "$1"
 	$1 || exit 1
 }
 
-MKSRCDIR=@srcdir@/../../usr.bin/make
-
 for f in $MKSRCDIR/*.c $MKSRCDIR/lst.lib/*.c; do
-	docmd "${HOST_CC} ${HOST_CFLAGS} @DEFS@ -c $f"
+	docmd "${_CC} ${_CFLAGS} -c $f"
 done
 
-docmd "${HOST_CC} ${HOST_CFLAGS} -o ${_TOOL_PREFIX:-nb}make *.o ${HOST_LDFLAGS}"
+docmd "${_CC} -o ${_TOOL_PREFIX:-nb}make *.o ${_LDFLAGS}"

Reply via email to