summaryrefslogtreecommitdiff
path: root/mk/compiler.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/compiler.mk')
-rw-r--r--mk/compiler.mk18
1 files changed, 17 insertions, 1 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index 44f1d6ec1d2..dbd9cd32fa0 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.94 2019/07/23 13:57:04 gdt Exp $
+# $NetBSD: compiler.mk,v 1.95 2020/06/02 06:58:13 rillig Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -37,6 +37,10 @@
# If set to yes, use symlinks for the compiler drivers, otherwise
# shell scripts are created. The default is yes.
#
+# CHECK_COMPILER
+# If set to yes, fail early if the compiler.mk variables are not
+# set correctly.
+#
# The following variables may be set by a package:
#
# USE_LANGUAGES
@@ -90,6 +94,9 @@ USE_LANGUAGES+= c++
. endif
.endfor
+#.READONLY: USE_LANGUAGES
+_USE_LANGUAGES_EFFECTIVE:= ${USE_LANGUAGES}
+
COMPILER_USE_SYMLINKS?= yes
_COMPILERS= ccc clang gcc hp icc ido \
@@ -265,3 +272,12 @@ ALL_ENV+= CCVER=${DRAGONFLY_CCVER}
.endif
.endif # BSD_COMPILER_MK
+
+.if ${CHECK_COMPILER:Uno:tl} == yes
+. if ${USE_LANGUAGES:O:u} != ${_USE_LANGUAGES_EFFECTIVE:O:u}
+.warning For ${PKGPATH}, only languages "${_USE_LANGUAGES_EFFECTIVE}" are used, the others in "${USE_LANGUAGES}" were defined too late.
+. endif
+. if ${GCC_REQD:U:O:u} != ${_GCC_REQD_EFFECTIVE:U:O:u}
+.warning For ${PKGPATH}, only GCC_REQD "${_GCC_REQD_EFFECTIVE}" are used, the others in "${GCC_REQD}" were defined too late.
+. endif
+.endif