Changeset View
Changeset View
Standalone View
Standalone View
share/mk/sys.mk
Show First 20 Lines • Show All 326 Lines • ▼ Show 20 Lines | |||||
__MAKE_SHELL?=/bin/sh | __MAKE_SHELL?=/bin/sh | ||||
.SHELL: name=sh \ | .SHELL: name=sh \ | ||||
quiet="set -" echo="set -v" filter="set -" \ | quiet="set -" echo="set -v" filter="set -" \ | ||||
hasErrCtl=yes check="set -e" ignore="set +e" \ | hasErrCtl=yes check="set -e" ignore="set +e" \ | ||||
echoFlag=v errFlag=e \ | echoFlag=v errFlag=e \ | ||||
path=${__MAKE_SHELL} | path=${__MAKE_SHELL} | ||||
.endif | .endif | ||||
.if ${.MAKE.OS} != "FreeBSD" | |||||
# Use bash with -o pipefail to make sure that all commands exist | |||||
# somehow bmake won't use the check string so lets use a wrapper script | |||||
# instead | |||||
.if !exists(/tmp/bash-with-pipefail) | |||||
_FOOOOO!= echo '\#!/bin/sh' > /tmp/bash-with-pipefail | |||||
_FOOOOO!= echo 'exec /bin/bash -o pipefail "$$@"' >> /tmp/bash-with-pipefail | |||||
_FOOOOO!= chmod +x /tmp/bash-with-pipefail | |||||
.endif | |||||
.SHELL: name=bash path=/tmp/bash-with-pipefail hasErrCtl=true \ | |||||
check="set -uo pipefail" ignore="set +euo pipefail" \ | |||||
echo="set -xv" quiet="set +x" filter="set +x" \ | |||||
echoFlag=xv errFlag="e" newline="'\n'" | |||||
.endif | |||||
# Hack for ports compatibility. Historically, ports makefiles have | # Hack for ports compatibility. Historically, ports makefiles have | ||||
# assumed they can examine MACHINE_CPU without including anything | # assumed they can examine MACHINE_CPU without including anything | ||||
# because this was automatically included in sys.mk. For /usr/src, | # because this was automatically included in sys.mk. For /usr/src, | ||||
# this file has moved to being included from bsd.opts.mk. Until all | # this file has moved to being included from bsd.opts.mk. Until all | ||||
# the ports files are modernized, and a reasonable transition | # the ports files are modernized, and a reasonable transition | ||||
# period has passed, include it while we're in a ports tree here | # period has passed, include it while we're in a ports tree here | ||||
# to preserve historic behavior. | # to preserve historic behavior. | ||||
.if exists(${.CURDIR}/../../Mk/bsd.port.mk) | .if exists(${.CURDIR}/../../Mk/bsd.port.mk) | ||||
.include <bsd.cpu.mk> | .include <bsd.cpu.mk> | ||||
.endif | .endif | ||||
.endif # ! Posix | .endif # ! Posix |