Index: Mk/Uses/php.mk =================================================================== --- Mk/Uses/php.mk +++ Mk/Uses/php.mk @@ -420,3 +420,40 @@ . endfor . endif .endif + +# Basic Idea: +# - If PHP_FLAVORS are defined +# -- check if used FLAVOR is allowed +# -- set FLAVORS to PHP_FLAVORS +# - Set PHP_VER to FLAVOR +# - Set PKGNAMEPREFIX to php$FLAVOR- +# - Set IGNORE_WITH_PHP to everyting else not matching FLAVOR + +ALLOWED_PHP_FLAVORS=56 70 71 72 + +.if empty(FLAVORS) && defined(PHP_FLAVORS) + + # check if set FLAVOR is allowed + rc=0 +. for allowed_flavor in ${ALLOWED_PHP_FLAVORS} +. if ${FLAVOR} == ${allowed_flavor} + rc=1 +. endif +. endfor + +. if ${rc} == 0 +. error "Flavor $FLAVOR is not in list of allowed flavors $ALLOWED_PHP_FLAVORS" +. endif + + FLAVORS=${PHP_FLAVORS} + PKGNAMEPREFIX= "php${FLAVOR}-" + PHP_VER= ${FLAVOR} + +. for allowed_flavor in ${ALLOWED_PHP_FLAVORS} +. if ${FLAVOR} != ${allowed_flavor} + IGNORE_WITH_PHP+=${allowed_flavor} +. endif +. endfor + +.endif +