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.
This commit is contained in:
uwe 2018-01-16 08:53:51 +00:00
parent 1151dedd75
commit 4f2e9ed826

View File

@ -1,25 +1,28 @@
#! /bin/sh
# $NetBSD: buildmake.sh.in,v 1.11 2018/01/15 20:14:49 uwe Exp $
# $NetBSD: buildmake.sh.in,v 1.12 2018/01/16 08:53:51 uwe Exp $
#
# buildmake.sh.in - Autoconf-processed shell script for building make(1).
#
: ${NETBSDSRCDIR:=@srcdir@/../..}
MKSRCDIR=${NETBSDSRCDIR}/usr.bin/make
: ${HOST_CC="@CC@"}
: ${HOST_CFLAGS="@CPPFLAGS@ @CFLAGS@"}
: ${HOST_LDFLAGS="@LDFLAGS@ @LIBS@"}
_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=${NETBSDSRCDIR}/usr.bin/make
HOST_CFLAGS="${HOST_CFLAGS} -D_PATH_DEFSYSPATH=\"${NETBSDSRCDIR}/share/mk\""
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} -o ${_TOOL_PREFIX:-nb}make *.o ${HOST_LDFLAGS}"
docmd "${_CC} -o ${_TOOL_PREFIX:-nb}make *.o ${_LDFLAGS}"