aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2009-06-03 21:50:50 +0000
committerPav Lucistnik <pav@FreeBSD.org>2009-06-03 21:50:50 +0000
commitab5c91839fead28a46d188b7e895a5a96baad9db (patch)
tree842aa40ed72b863e2a633b1963c3f977bf419cc7 /Mk/bsd.port.mk
parente7370bdd9867f9d099281bdf17432d066b1eceab (diff)
downloadports-ab5c91839fead28a46d188b7e895a5a96baad9db.tar.gz
ports-ab5c91839fead28a46d188b7e895a5a96baad9db.zip
- Add USE_CSTD flag that adds --std=value to CFLAGS
PR: ports/135083 Submitted by: ed - Separate MAKE_JOBS_NUMBER from _MAKE_JOBS, so it can be used in individual ports PR: ports/134977 Submitted by: David Naylor <naylor.b.david@gmail.com>
Notes
Notes: svn path=/head/; revision=235136
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk10
1 files changed, 6 insertions, 4 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 969efcb38053..0a06cb21ba81 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -308,6 +308,7 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# the regular expression.
# USE_GCC - If set, this port requires this version of gcc, either in
# the system or installed from a port.
+# USE_CSTD - Override the default C language standard (gnu89, gnu99)
# USE_GMAKE - If set, this port uses gmake.
# GMAKE - Set to path of GNU make if not in $PATH.
# Default: gmake
@@ -2180,16 +2181,17 @@ CFLAGS+= -fno-strict-aliasing
.endif
.endif
+.if defined(USE_CSTD)
+CFLAGS:= ${CFLAGS:N-std=*} -std=${USE_CSTD}
+.endif
+
# Multiple make jobs support
.if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
_MAKE_JOBS= #
.else
.if defined(MAKE_JOBS_SAFE) || defined(FORCE_MAKE_JOBS)
-.if defined(MAKE_JOBS_NUMBER)
+MAKE_JOBS_NUMBER?= `${SYSCTL} -n kern.smp.cpus`
_MAKE_JOBS= -j${MAKE_JOBS_NUMBER}
-.else
-_MAKE_JOBS= -j`${SYSCTL} -n kern.smp.cpus`
-.endif
.if defined(FORCE_MAKE_JOBS)
BUILD_FAIL_MESSAGE+= "You have chosen to use multiple make jobs (parallelization) for all ports. This port was not tested for this setting. Please remove FORCE_MAKE_JOBS and retry the build before reporting the failure to the maintainer."
.endif