perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tors...@apache.org
Subject svn commit: r1074122 - in /perl/modperl/trunk: Changes lib/Apache2/Build.pm
Date Thu, 24 Feb 2011 12:08:05 GMT
Author: torsten
Date: Thu Feb 24 12:08:05 2011
New Revision: 1074122

URL: http://svn.apache.org/viewvc?rev=1074122&view=rev
Log:
Check the ExtUtils::Embed version in Apache2::Build,
see http://www.gossamer-threads.com/lists/modperl/modperl/102740#102740

Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/lib/Apache2/Build.pm

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?rev=1074122&r1=1074121&r2=1074122&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Thu Feb 24 12:08:05 2011
@@ -12,6 +12,8 @@ Also refer to the Apache::Test changes l
 
 =item 2.0.6-dev
 
+Check for the right ExtUtils::Embed version during build [Torsten Foertsch]
+
 Take a lesson from rt.cpan.org #66085 and pass LD_LIBRARY_PATH if mod_env
 is present.  Should prevent test failures on some platforms.
 [Fred Moyer]

Modified: perl/modperl/trunk/lib/Apache2/Build.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/Apache2/Build.pm?rev=1074122&r1=1074121&r2=1074122&view=diff
==============================================================================
--- perl/modperl/trunk/lib/Apache2/Build.pm (original)
+++ perl/modperl/trunk/lib/Apache2/Build.pm Thu Feb 24 12:08:05 2011
@@ -27,6 +27,42 @@ use File::Basename;
 use ExtUtils::Embed ();
 use File::Copy ();
 
+BEGIN {				# check for a sane ExtUtils::Embed
+    unless ($ENV{MP_USE_MY_EXTUTILS_EMBED}) {
+	my ($version, $path)=(ExtUtils::Embed->VERSION,
+			      $INC{q{ExtUtils/Embed.pm}});
+	my $msg=<<"EOF";
+I have found ExtUtils::Embed $version at
+
+  $path
+
+This is probably not the right one for this perl version. Please make sure
+there is only one version of this module installed and that it is the one
+that comes with this perl version.
+
+If you insist on using the ExtUtils::Embed as is set the environment
+variable MP_USE_MY_EXTUTILS_EMBED=1 and try again.
+
+EOF
+	if (eval {require Module::CoreList}) {
+	    my $req=$Module::CoreList::version{$]}->{q/ExtUtils::Embed/};
+	    die "Please repair your Module::CoreList" unless $req;
+	    unless ($version eq $req) {
+		$msg.=("Details: expecting ExtUtils::Embed $req ".
+		       "(according to Module::CoreList)\n\n");
+		die $msg;
+	    }
+	}
+	else {
+	    my $req=$Config{privlib}.'/ExtUtils/Embed.pm';
+	    unless ($path eq $req) {
+		$msg.="Details: expecting ExtUtils::Embed at $req\n\n";
+		die $msg;
+	    }
+	}
+    }
+}
+
 use constant IS_MOD_PERL_BUILD => grep 
     { -e "$_/Makefile.PL" && -e "$_/lib/mod_perl2.pm" } qw(. ..);
 



Mime
View raw message