version 1.247, 2011/08/30 12:04:12 |
version 1.248, 2011/09/09 13:29:23 |
|
|
#! /usr/bin/env sh |
#! /usr/bin/env sh |
# $NetBSD$ |
# $NetBSD$ |
# |
# |
# Copyright (c) 2001-2009 The NetBSD Foundation, Inc. |
# Copyright (c) 2001-2011 The NetBSD Foundation, Inc. |
# All rights reserved. |
# All rights reserved. |
# |
# |
# This code is derived from software contributed to The NetBSD Foundation |
# This code is derived from software contributed to The NetBSD Foundation |
|
|
bomb "HOST_SH=\"${HOST_SH}\" is not executable." |
bomb "HOST_SH=\"${HOST_SH}\" is not executable." |
} |
} |
|
|
|
# initdefaults -- |
|
# Set defaults before parsing command line options. |
|
# |
initdefaults() |
initdefaults() |
{ |
{ |
makeenv= |
makeenv= |
|
|
[ -f share/mk/bsd.own.mk ] || |
[ -f share/mk/bsd.own.mk ] || |
bomb "src/share/mk is missing; please re-fetch the source tree" |
bomb "src/share/mk is missing; please re-fetch the source tree" |
|
|
# Set LC_ALL=C before we try to parse the output from any command |
# Set various environment variables to known defaults, |
|
# to minimize (cross-)build problems observed "in the field". |
|
# |
|
# LC_ALL=C must be set before we try to parse the output from |
|
# any command. Other variables are set (or unset) here, before |
|
# we parse command line arguments. |
|
# |
|
# These variables can be overridden via "-V var=value" if |
|
# you know what you are doing. |
|
# |
|
unsetmakeenv INFODIR |
|
unsetmakeenv LESSCHARSET |
|
unsetmakeenv MAKEFLAGS |
setmakeenv LC_ALL C |
setmakeenv LC_ALL C |
|
|
# Find information about the build platform. This should be |
# Find information about the build platform. This should be |
|
|
# |
# |
case "${uname_s}" in |
case "${uname_s}" in |
Darwin | FreeBSD | CYGWIN*) |
Darwin | FreeBSD | CYGWIN*) |
MAKEFLAGS=-X |
MAKEFLAGS="-X ${MAKEFLAGS}" |
;; |
|
*) |
|
MAKEFLAGS= |
|
;; |
;; |
esac |
esac |
|
|
|
|
# |
# |
setmakeenv MKARZERO "yes" |
setmakeenv MKARZERO "yes" |
|
|
# Set various environment variables to known defaults, |
|
# to minimize (cross-)build problems observed "in the field". |
|
# |
|
unsetmakeenv INFODIR |
|
unsetmakeenv LESSCHARSET |
|
} |
} |
|
|
getarch() |
getarch() |
|
|
# |
# |
makeenv="${makeenv} TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS" |
makeenv="${makeenv} TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS" |
[ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID" |
[ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID" |
MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}" |
MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS}" |
|
MAKEFLAGS="${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}" |
export MAKEFLAGS MACHINE MACHINE_ARCH |
export MAKEFLAGS MACHINE MACHINE_ARCH |
} |
} |
|
|
|
# sanitycheck -- |
|
# Sanity check after parsing command line options, before rebuildmake. |
|
# |
sanitycheck() |
sanitycheck() |
{ |
{ |
# If the PATH contains any non-absolute components (including, |
# If the PATH contains any non-absolute components (including, |
|
|
fi |
fi |
} |
} |
|
|
|
# validatemakeparams -- |
|
# Perform some late sanity checks, after rebuildmake, |
|
# but before createmakewrapper or any real work. |
|
# |
|
# Also create the top-level obj directory. |
|
# |
validatemakeparams() |
validatemakeparams() |
{ |
{ |
if [ "${runcmd}" = "echo" ]; then |
if [ "${runcmd}" = "echo" ]; then |