Module Name:    src
Committed By:   christos
Date:           Fri Apr 29 16:08:09 UTC 2016

Modified Files:
        src: build.sh

Log Message:
Provide the correct system Makefile path to the tools make. This is needed
because although the arch-specific make wrapper sets $MAKEFLAGS to include
the proper system Makefile path, configure clears $MAKEFLAGS before it invokes
$MAKE to figure out which dependency style to use. This made the build fail
during the gcc build.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/build.sh

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.308 src/build.sh:1.309
--- src/build.sh:1.308	Sat Jun 27 02:00:28 2015
+++ src/build.sh	Fri Apr 29 12:08:09 2016
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.308 2015/06/27 06:00:28 matt Exp $
+#	$NetBSD: build.sh,v 1.309 2016/04/29 16:08:09 christos Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1593,21 +1593,28 @@ rebuildmake()
 	fi
 
 	# Build bootstrap ${toolprefix}make if needed.
-	if ${do_rebuildmake}; then
-		statusmsg "Bootstrapping ${toolprefix}make"
-		${runcmd} cd "${tmpdir}"
-		${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" )
-		${runcmd} ${HOST_SH} buildmake.sh ||
-		    bomb "Build of ${toolprefix}make failed"
-		make="${tmpdir}/${toolprefix}make"
-		${runcmd} cd "${TOP}"
-		${runcmd} rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o
-		done_rebuildmake=true
+	if ! ${do_rebuildmake}; then
+		return
 	fi
+
+	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}" \
+\
+	    ${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" )
+	${runcmd} ${HOST_SH} buildmake.sh ||
+	    bomb "Build of ${toolprefix}make failed"
+	make="${tmpdir}/${toolprefix}make"
+	${runcmd} cd "${TOP}"
+	${runcmd} rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o
+	done_rebuildmake=true
 }
 
 # validatemakeparams --
@@ -1869,7 +1876,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.308 2015/06/27 06:00:28 matt Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.309 2016/04/29 16:08:09 christos Exp $
 # with these arguments: ${_args}
 #
 

Reply via email to