[svn:PHP-Sandwich] rev 1018 - PHP-Sandwich/trunk

[email protected] 24 Apr 2005 22:55:09 -0000
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
Author: shughes
Date: Sun Apr 24 15:55:09 2005
New Revision: 1018

Modified:
   PHP-Sandwich/trunk/Makefile.PL
Log:
have Makefile.PL use the directory passed as the first argument 
as the "php install directory," default this value to /usr/local/, 
this allows PHP to be installed in a non-standard location 
(like /home/sterling/private/php5 :)



Modified: PHP-Sandwich/trunk/Makefile.PL
==============================================================================
--- PHP-Sandwich/trunk/Makefile.PL	(original)
+++ PHP-Sandwich/trunk/Makefile.PL	Sun Apr 24 15:55:09 2005
@@ -2,25 +2,28 @@
 use Config ;
 use POSIX;
 
-#push @libs, `/usr/local/bin/php-config --libs`;
+my $phpdir = shift @ARGV || '/usr/local'; 
+
+push @libs, `$phpdir/bin/php-config --libs`;
+push @libs, "-L$phpdir/lib/";
 push @libs, '-lphp5';
 
 use Data::Dumper;
 print Dumper(@libs);
 
 @lddlflags  = ($Config{lddlflags});
-push @lddlflags, `/usr/local/bin/php-config --ldflags`;
+push @lddlflags, `$phpdir/bin/php-config --ldflags`;
 
 @ofiles = ('PHP.o', 'phpinterp.o');
 
 WriteMakefile(
         CC              => $ENV{CC},
-	CCFLAGS		=> '-g',
-	OBJECT		=> join(' ',@ofiles),
+        CCFLAGS		=> '-g',
+        OBJECT		=> join(' ',@ofiles),
         NAME            => 'PHP',
         VERSION_FROM    => 'PHP.pm',
         PMLIBDIRS       => ['PHP'],
         LIBS            =>  join(' ',@libs),
-	LDDLFLAGS	=> join(' ',@lddlflags),
-        INC             => "-I/usr/local/include ".`/usr/local/bin/php-config --includes`
+        LDDLFLAGS	=> join(' ',@lddlflags),
+        INC             => "-I$phpdir/include ".`$phpdir/bin/php-config --includes`
         );