Subject: code: which option from an options group was selected?
To: None <tech-pkg@netbsd.org>
From: Geert Hendrickx <geert.hendrickx@ua.ac.be>
List: tech-pkg
Date: 09/19/2005 16:00:47
Hi guys, 

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"
> 
> .if !empty(PKG_OPTIONS:Mmozilla-gtk2)
> MOZILLA=	mozilla-gtk2
> .endif
> 
> .if !empty(PKG_OPTIONS:Mmozilla)
> MOZILLA=	mozilla
> .endif
> 
> .if !empty(PKG_OPTIONS:Mfirefox)
> MOZILLA=	firefox
> .endif
> 
> .if !empty(PKG_OPTIONS:Mfirefox-gtk1)
> MOZILLA=	firefox-gtk1
> .endif
> 
> .include "../../www/${MOZILLA}/buildlink3.mk"
> BUILDLINK_DEPMETHOD.${MOZILLA}=	build
> 
> ALT_MOZILLA_HEADERS_PATH=${PREFIX}/include/${MOZILLA}

I want to do something like: 

> MOZILLA=	${PKG_OPTIONS:whichever option from the mozilla group was selected}

Is that possible with pkgsrc?  

Thanks, 

	Geert