How can I determine if a function is available?

Ryan Schmidt ryandesign at
Mon Apr 9 00:46:38 PDT 2007

On Apr 9, 2007, at 00:30, Ryan Schmidt wrote:

> I would like to improve the php5 port so that both an Apache 1 or 2  
> module and the FastCGI binary can be installed at the same time.  
> The php build system does not accommodate targeting multiple SAPIs  
> at once. Therefore it will be necessary to have port build once for  
> the Apache module of choice, and then build again for the FastCGI  
> module.
> I would like to make use of the strategy that was briefly employed  
> by the zlib port to re-run the configure and build phases, but I  
> need some advice, because of the following two commits:
> In r23238, the command "command" was removed, and a new command  
> "command_exec" was introduced, but this change did not make it into  
> MacPorts 1.4.0.
> In r23409, it was shown how this change will affect portfiles: a  
> wrapper which called 'system "[command $cmd]"' was replaced with  
> just "command_exec $cmd".
> So as I understand it, in MacPorts 1.4.0, I must use a wrapper  
> which calls 'system "[command $cmd]"'. But whenever r23238 is  
> merged into a released version of MacPorts (be that 1.4.1 or  
> 1.5.0), this code will break, and it will then be necessary to use  
> "command_exec $cmd".
> Is there a way that I can code my portfile today that will work  
> with both current and future MacPorts versions? Is there a way that  
> I can detect which of "command" or "command_exec" are available in  
> the installed version of MacPorts?

My preliminary patch for php5 is attached to this ticket:

However I still need a fix that will let it work with either MP 1.4.0  
or trunk.

Also would like advice regarding any ways to reduce the size of the  
patch. I'm concerned about the duplication of the apache, apache2 and  
fastcgi options. You'll see what I mean if you look in the patch...

More information about the macports-dev mailing list