[svn:PHP-Sandwich] r1442 - PHP-Sandwich/trunk
[email protected] 31 Jul 2005 16:15:45 -0000
| Newsgroups | perl.php.sandwich.dev |
|---|---|
| Message-ID | <[email protected]> |
Author: theory
Date: Sun Jul 31 09:15:45 2005
New Revision: 1442
Modified:
PHP-Sandwich/trunk/Makefile.PL
Log:
Cleaned up and made more portable.
Modified: PHP-Sandwich/trunk/Makefile.PL
==============================================================================
--- PHP-Sandwich/trunk/Makefile.PL (original)
+++ PHP-Sandwich/trunk/Makefile.PL Sun Jul 31 09:15:45 2005
@@ -1,33 +1,34 @@
use ExtUtils::MakeMaker;
-use Config ;
-use POSIX;
+use Config;
+use File::Spec::Functions qw(catfile catdir);
-my $phpdir = shift @ARGV || '/usr/local';
+my $phpdir = shift @ARGV || $^O eq 'MSWin32' ? 'C:\\php' : '/usr/local';
print "using phpdir $phpdir\n";
-push @libs, '-lphp5';
+my @libs = ('-lphp5');
-@lddlflags = ($Config{lddlflags});
-my $php_lddlflags = `$phpdir/bin/php-config --ldflags`;
+my $phpconfig = catfile $phpdir, 'bin', 'php-config';
+
+my @lddlflags = ($Config{lddlflags});
+my $php_lddlflags = `$phpconfig --ldflags`;
chomp $php_lddlflags;
push @lddlflags, $php_lddlflags;
-push @lddlflags , "-L$phpdir/lib/";
+push @lddlflags , "-L" . catdir $phpdir, "lib";
+
+my $inc = "-I" . catdir ($phpdir, 'include') . " ".`$phpconfig --includes`;
-@ofiles = ('PHP.o', 'phpinterp.o', 'phpfuncs.o');
+my @ofiles = ('PHP.o', 'phpinterp.o', 'phpfuncs.o');
WriteMakefile(
- CC => $ENV{CC},
- CCFLAGS => '-g',
- OBJECT => join(' ',@ofiles),
- NAME => 'PHP::Interpreter',
- VERSION_FROM => 'lib/PHP/Interpreter.pm',
- PMLIBDIRS => ['lib'],
- LIBS => join(' ',@libs),
- LDDLFLAGS => join(' ',@lddlflags),
- INC => "-I$phpdir/include ".`$phpdir/bin/php-config --includes`
- PREREQ_PM => {
- # Just required for testing.
- Test::More => 0,
- IO::File => 0
- }
- );
+ CCFLAGS => '-g',
+ OBJECT => join(' ', @ofiles),
+ NAME => 'PHP::Interpreter',
+ LIBS => join(' ', @libs),
+ LDDLFLAGS => join(' ', @lddlflags),
+ INC => $inc,
+ PREREQ_PM => {
+ # Just required for testing.
+ Test::More => 0,
+ IO::File => 0
+ },
+);