aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2017-11-02 23:16:31 +0800
committermat <mat@FreeBSD.org>2017-11-02 23:16:31 +0800
commit9ce26475cf346b641d29ba2ad72e1f60e7007c75 (patch)
tree56663eaa64116ecb3fd72edaa0ac02a845fc8d63 /Mk
parent428b5a97126722ce8f0bac63e6da80cf4eed7b3c (diff)
downloadfreebsd-ports-gnome-9ce26475cf346b641d29ba2ad72e1f60e7007c75.tar.gz
freebsd-ports-gnome-9ce26475cf346b641d29ba2ad72e1f60e7007c75.tar.zst
freebsd-ports-gnome-9ce26475cf346b641d29ba2ad72e1f60e7007c75.zip
Add a check for options names.
They must be all uppercase, so that they do not conflict with flavors that are lowercase. Reviewed by: bapt Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D12810
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index b02960c31d76..21b5dd601410 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -4659,6 +4659,24 @@ ${_t}:
.if !target(pre-check-config)
pre-check-config:
+_CHECK_OPTIONS_NAMES= OPTIONS_DEFINE
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_GROUP:S/^/OPTIONS_GROUP_/}
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_MULTI:S/^/OPTIONS_MULTI_/}
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_RADIO:S/^/OPTIONS_RADIO_/}
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_SINGLE:S/^/OPTIONS_SINGLE_/}
+.for var in ${_CHECK_OPTIONS_NAMES}
+. if defined(${var})
+. for o in ${${var}}
+. if ${o:C/[-_[:upper:][:digit:]]//g}
+OPTIONS_BAD_NAMES+= ${o}
+. endif
+. endfor
+. endif
+.endfor
+.if defined(OPTIONS_BAD_NAMES) && !empty(OPTIONS_BAD_NAMES)
+DEV_WARNING+= "These options name have characters outside of [-_A-Z0-9]:"
+DEV_WARNING+= "${OPTIONS_BAD_NAMES:O:u}"
+.endif
.for single in ${OPTIONS_SINGLE}
. for opt in ${OPTIONS_SINGLE_${single}}
. if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})