httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Sabol" <sa...@alderaan.gsfc.nasa.gov>
Subject [ar2] PATCH: Set PERL_PATH correctly in Makefile.PL
Date Thu, 11 Dec 2003 05:28:39 GMT
In a previous e-mail I wrote:
> The PERL_PATH constant in Makefile.PL is defined to be $Config{perlpath}.
> However, if you rename or move the perl executable after you build it, then
> $Config{perlpath} will not point to the perl executable being used to
> invoke Makefile.PL. Frankly, I don't think this is an uncommon occurrence.

Since ExtUtils::MakeMaker obviously gets this correct, I thought I'd
investigate to see how it does what it does and come up with a patch to fix
this problem. I think this patch implements the canonical Perl method of
determining the path to the Perl executable currently being run.

Could someone please test this on WIN32? If this works on WIN32, I would
appreciate it if someone would apply the following patch to the httpd-apreq-2
CVS repository.

Hope this helps,
Ed

Index: Makefile.PL
===================================================================
RCS file: /home/cvspublic/httpd-apreq-2/Makefile.PL,v
retrieving revision 1.8
diff -u -r1.8 Makefile.PL
--- Makefile.PL 7 Nov 2003 20:05:19 -0000       1.8
+++ Makefile.PL 11 Dec 2003 05:17:48 -0000
@@ -4,9 +4,16 @@
 use warnings;
 
 use Getopt::Long qw(GetOptions);
-use Config;
+use ExtUtils::MM;
 
-use constant PERL_PATH => $Config{perlpath}; # XXX
+use vars qw($mm);
+
+BEGIN {
+    local @ARGV = ();
+    $mm = ExtUtils::MM->new({ 'NAME' => 'libapreq2' });
+}
+
+use constant PERL_PATH => $mm->{PERL};
 use constant WIN32 => ($^O =~ /Win32/);
 
 sub test_prereq {

Mime
View raw message