summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjschauma <jschauma>2006-12-02 22:32:59 +0000
committerjschauma <jschauma>2006-12-02 22:32:59 +0000
commitc224f2013c6dd86f664309dac9b78b97cf953a2b (patch)
tree97923b6df098fa627f577ea81af4285038c9d84a /mk
parent466b82ff731e2238dc1f95e4cda2b4689c2373a8 (diff)
downloadpkgsrc-c224f2013c6dd86f664309dac9b78b97cf953a2b.tar.gz
Instead of setting compiler flags in each package if it uses C99,
allow USE_LANGUAGES+=c99 and let gcc and mipspro do the right thing. May need to be reviewed/added for other compilers. ok rillig@
Diffstat (limited to 'mk')
-rw-r--r--mk/compiler.mk6
-rw-r--r--mk/compiler/gcc.mk6
-rw-r--r--mk/compiler/mipspro.mk6
3 files changed, 13 insertions, 5 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index 158dc65ed13..9e08c8d6c7b 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.56 2006/11/16 02:42:13 markd Exp $
+# $NetBSD: compiler.mk,v 1.57 2006/12/02 22:32:59 jschauma Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -49,8 +49,8 @@
# USE_LANGUAGES
# Lists the languages used in the source code of the package,
# and is used to determine the correct compilers to install.
-# Valid values are: c, c++, fortran, java, objc. The default
-# is "c".
+# Valid values are: c, c99, c++, fortran, java, objc. The
+# default is "c".
#
# The following variables are defined, and available for testing in
# package Makefiles:
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk
index 1c7845163ba..465d181c455 100644
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.85 2006/10/22 00:14:17 rillig Exp $
+# $NetBSD: gcc.mk,v 1.86 2006/12/02 22:32:59 jschauma Exp $
#
# This is the compiler definition for the GNU Compiler Collection.
#
@@ -137,6 +137,10 @@ _LANGUAGES.gcc= # empty
_LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}}
.endfor
+.if !empty(USE_LANGUAGES:Mc99)
+_WRAP_EXTRA_ARGS.CC+= -std=c99
+.endif
+
# GCC has this annoying behaviour where it advocates in a multi-line
# banner the use of "#include" over "#import" when including headers.
# This generates a huge number of warnings when building practically all
diff --git a/mk/compiler/mipspro.mk b/mk/compiler/mipspro.mk
index ef44bfc6ddc..be8ba1ef75f 100644
--- a/mk/compiler/mipspro.mk
+++ b/mk/compiler/mipspro.mk
@@ -1,4 +1,4 @@
-# $NetBSD: mipspro.mk,v 1.35 2006/10/22 00:14:17 rillig Exp $
+# $NetBSD: mipspro.mk,v 1.36 2006/12/02 22:32:59 jschauma Exp $
#
# This is the compiler definition for the MIPSpro C compiler.
#
@@ -71,6 +71,10 @@ _LANGUAGES.mipspro= # empty
_LANGUAGES.mipspro+= ${LANGUAGES.mipspro:M${_lang_}}
.endfor
+.if !empty(USE_LANGUAGES:Mc99)
+_WRAP_EXTRA_ARGS.CC+= -c99
+.endif
+
# Prepend the path to the compiler to the PATH.
.if !empty(_LANGUAGES.mipspro)
PREPEND_PATH+= ${_MIPSPRO_DIR}/bin