Subject: Re: code: which option from an options group was selected?
To: None <tech-pkg@netbsd.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-pkg
Date: 09/19/2005 19:43:27
On Mon, 19 Sep 2005, Geert Hendrickx wrote:
> is it possible to make the following code shorter: 
> 
> > PKG_OPTIONS_REQUIRED_GROUPS+=   mozilla
> > PKG_OPTIONS_GROUP.mozilla=      firefox firefox-gtk1 mozilla mozilla-gtk2
> > PKG_SUGGESTED_OPTIONS+=         firefox
> > 
> > .include "../../mk/bsd.options.mk"

[snip]

> I want to do something like: 
> 
> > MOZILLA=	${PKG_OPTIONS:whichever option from the mozilla group was selected}

Try something like this (untested):

.for _opt_ in ${PKG_OPTIONS_GROUP.mozilla}
.if !empty(PKG_OPTIONS:M${_opt_})
MOZILLA= ${_opt_}
.endif
.endfor

--apb (Alan Barrett)