develooper Front page | perl.php.sandwich.dev | Postings from November 2008

Re: [svn:PHP-Sandwich] r12056 - PHP-Sandwich/trunk

Thread Previous | Thread Next
From:
David E. Wheeler
Date:
November 9, 2008 15:04
Subject:
Re: [svn:PHP-Sandwich] r12056 - PHP-Sandwich/trunk
Message ID:
05F0ECFF-D884-47FE-9714-8C03EE237027@kineticode.com
On Nov 7, 2008, at 12:22 AM, aff@cvs.perl.org wrote:

> +# Get prefix. Use script argument as prefix, otherwise use value from
> +# 'php-config'
> +my $prefix = shift @ARGV || ($conf{prefix});
> +die "Failed to find php prefix" if (!defined($prefix) or !-d  
> $prefix);
> +print "using prefix $prefix\n";

I don't think that this is the way to do it, because  
ExtUtils::MakeMaker supports other options to be passed on the command- 
line, like LDFLAGS and LIB. This gets in the way of that by  
potentially shifting off such commands. For example, when I go to  
build on Mac OS X, I have to tell EU::MM where to find libphp5.so:

   % perl Makefile.PL LIBS=-L/usr/libexec/apache2
   using php version 5.2.6
   Failed to find php prefix at Makefile.PL line 72.

I should not get that error, but I do, because $prefix is populated  
with "LIBS=-L/usr/libexec/apache2", and it should not be. I think that  
a better approach would be to use environment variables, such as  
DBD::Pg does.

   http://search.cpan.org/src/TURNSTEP/DBD-Pg-2.11.3/Makefile.PL

That way you stay out of the way of EU::MM processing. So then users  
would be able to do something like this:

   % PHPHOME=/path/to/php perl Makefile.PL LIBS=-L/usr/libexec/apache2

Thanks,

David


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About