Metaport

Ryan Schmidt ryandesign at macports.org
Mon Oct 19 10:16:29 PDT 2009


On Oct 19, 2009, at 05:31, vincent habchi wrote:

> Le 15 oct. 2009 à 18:08, Ryan Schmidt a écrit :
>
>> This is possible without needing to do anything complicated. You  
>> can just set the merger_configure_args list with the desired  
>> values. There are some existing ports that use this, which you can  
>> look at for examples: nspr uses it to add "--enable-64bit" on 64- 
>> bit architectures. fontconfig uses it to specify the architecture  
>> in a "--with-arch" flag. tiff uses it to ensure "--with-apple- 
>> opengl-framework" is not used on 64-bit architectures on Tiger.  
>> gtk2 adds "--disable-cups" on 64-bit architectures on Tiger. fftw-3  
>> adds "--enable-fma" on PowerPC systems and "--enable-sse2" on Intel  
>> systems.
>
> Ok, I tried this but it does not work. Well, it works, but this is  
> not what I need. I need to be able to access a variable in the pre- 
> configure phase that is either 32 or 64 depending on what arch the  
> code is being compiled for. And that variable is to be used in a  
> replace statement, so I really must be able to access it, not to  
> include it implicitly via merger_configure_args(XXX).

I don't believe that will be possible with the way the muniversal  
portgroup is written today. Looking in muniversal-1.0.tcl, I see its  
configure phase runs a loop over all requested architectures, and in  
that loop, it copies the worksrcpath to a new worksrcpath with a name  
based on the arch, sets up variables and flags, and then calls  
configure_main from MacPorts base. The muniversal portgroup doesn't do  
anything to change how pre-configure or post-configure are handled, so  
MacPorts base continues to handle this, which means pre-configure and  
post-configure only run once, not once per architecture. Also, since  
the actual worksrcdirs that will be used by configure are not created  
until the configure phase, they don't exist yet in pre-configure, so  
you can't do anything to them there.

Are these C source files you're patching? If so, is there maybe a way  
to achieve what you want by using a patch which uses the __LP64__  
#define?

#ifdef __LP64__
do something 64-bit
#else
do something 32-bit
#endif





More information about the macports-dev mailing list