From: Brandon Casey Date: Thu, 24 Sep 2009 18:02:55 GMT Subject: [PATCH] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR Message-ID: <7wQSYSBJPoVtvyGI0lqsDW37w4byCpgpMaHiDKALwW_oJ9nHXddX9OBMnqXGZBVAo2U7Tc1BMxg@cipher.nrlssc.navy.mil> In-Reply-To: <7vk4zrt035.fsf@alter.siamese.dyndns.org> From: Brandon Casey It appears that ExtUtils::MakeMaker versions older than 6.11 do not implement the DESTDIR mechanism. So add a test to the generated perl.mak to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and abort with a message suggesting the use of NO_PERL_MAKEMAKER. Signed-off-by: Brandon Casey --- Junio C Hamano wrote: > Brandon Casey writes: > >> Possibly it is related to the version of MakeMaker? I am using version >> 6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86. The >> MakeMaker version should be in the header at the top of the perl.mak >> file. > > I think that is it. DESTDIR support in MakeMaker seems to be lacking in > medieval versions of Perl. It appears that it started being usable at > around its 6.11 (and 6.17 you have is fine). > > http://kobesearch.cpan.org/htdocs/ExtUtils-MakeMaker/Changes.html > https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6131#c7 How about something like this? Seems to work correctly for me on IRIX 6.5 and Solaris 7 with ExtUtils::MakeMaker 6.03. -brandon perl/Makefile.PL | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/perl/Makefile.PL b/perl/Makefile.PL index 320253e..8974015 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -5,6 +5,14 @@ sub MY::postamble { instlibdir: @echo '$(INSTALLSITELIB)' +ifneq (,$(DESTDIR)) +ifeq (1,$(shell expr '$(MM_VERSION)' '<' 6.11)) +$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \ + is likely incompatible with the DESTDIR mechanism. Try setting \ + NO_PERL_MAKEMAKER=1 instead) +endif +endif + MAKE_FRAG } -- 1.6.4.3