summaryrefslogtreecommitdiff
path: root/mk/compiler
diff options
context:
space:
mode:
authorjschauma <jschauma>2006-12-02 22:32:59 +0000
committerjschauma <jschauma>2006-12-02 22:32:59 +0000
commit6538aefdf7e668723a29797158b522ad24f1c6db (patch)
tree97923b6df098fa627f577ea81af4285038c9d84a /mk/compiler
parent3398d954c0156c67233b4427d1a6ee2839a239ec (diff)
downloadpkgsrc-6538aefdf7e668723a29797158b522ad24f1c6db.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/compiler')
-rw-r--r--mk/compiler/gcc.mk6
-rw-r--r--mk/compiler/mipspro.mk6
2 files changed, 10 insertions, 2 deletions
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