[svn:PHP-Sandwich] r12064 - PHP-Sandwich/trunk
[email protected] Tue, 11 Nov 2008 13:20:17 -0800 (PST)
| Newsgroups | perl.php.sandwich.dev |
|---|---|
| Message-ID | <[email protected]> |
Author: aff
Date: Tue Nov 11 13:20:16 2008
New Revision: 12064
Modified:
PHP-Sandwich/trunk/Makefile.PL
Log:
Allow PHP_CONFIG to be customized.
Modified: PHP-Sandwich/trunk/Makefile.PL
==============================================================================
--- PHP-Sandwich/trunk/Makefile.PL (original)
+++ PHP-Sandwich/trunk/Makefile.PL Tue Nov 11 13:20:16 2008
@@ -5,6 +5,10 @@
use Config;
use File::Spec::Functions qw(catdir);
+# Allow 'php-config' to be customized
+my $php_config = $ENV{PHP_CONFIG} || q{php-config};
+print "using php_config '$php_config'\n";
+
# Check if File::Find is present
eval { use File::Find; };
my $filefind = (!$@) ? 1 : 0;
@@ -48,15 +52,16 @@
}
# Die unless 'php-config' is found
-qx(php-config) or die "Failed to find the 'php-config' executable. " .
+qx($php_config) or die "Failed to find the 'php-config' executable. " .
"Make sure you have PHP and PHP sources installed, ".
"and that 'php-config' is in PATH.";
+
# Execute 'php-config' for each variable. Dies if executable is not
# in path.
my %conf = map {
- my $a = qx(php-config --$_);
- die "Error: php-config --$_ failed\n" unless $a;
+ my $a = qx($php_config --$_);
+ die "Error: $php_config --$_ failed\n" unless $a;
chomp $a;
$_ => $a;
} qw(includes prefix version ldflags);
@@ -131,7 +136,17 @@
Valid environment variables are
- PHP_PREFIX
+=head2 PHP_PREFIX
+
+The root directory of the PHP install, e.g. '/usr/local/' or
+'C:\\php'.
+
+=head2 PHP_CONFIG
+
+The executable used to set up the PHP environment,
+e.g. '/usr/local/bin/php-config'. Default is to just set it to
+'php-config', which means it must be in your PATH. In case of more
+than one matching file, then the first one will be used.
=head1 DESCRIPTION
@@ -157,8 +172,7 @@
You can resolve this problem by setting I<PHP_PREFIX> to the root
directory of you PHP install. Do also make sure that your install of
-PHP is supported by this version of PHP::Interpreter (see the README
-file).
+PHP is compiled as described in the the README file.
=head1 SEE ALSO