Platform specific flags and universal variants

Ryan Schmidt ryandesign at
Mon Feb 23 17:33:29 PST 2009

On Feb 23, 2009, at 18:58, Adam Mercer wrote:

> I recently modified the fftw-3 and fftw-3-single ports to use the
> muniversal PortGroup, which greatly simplfies building a universal
> port but am running into a annoying issue. FFTW needs to be compiled
> so that it runs as fast as possible, I therefore need to pass specific
> options to configure depending on the platform. Using the muniversal
> PortGroup I achieve this with the following:
> array set merger_configure_args {
>     ppc    "--enable-fma"
>     ppc64  "--enable-fma"
>     i386   "--enable-sse2"
>     x86_64 "--enable-sse2"
> }
> for the fftw-3 port. However I also need to ensure these flags are
> applied for the appropriate platform when the port is not built
> universally. As the above only effects when the port is being built
> universally. I need another way to apply these flags when built for a
> single platform. Is there a way I can specify platform variants that
> are ignored when the port is built universally?

You could do (untested):

platform i386 {
	if {![variant_isset universal]} {
		configure.args-append --enable-sse2

platform powerpc {
	if {![variant_isset universal]} {
		configure.args-append --enable-fma

More information about the macports-users mailing list