Merge branch 'master' into pb/gitpm
[gitweb.git] / perl / Makefile.PL
index 25ae54a5151143ceb8ed1710b034b8d072d8e91f..ef9d82d7b63f0c2bee5777025450af4c5eb3abb2 100644 (file)
@@ -5,6 +5,11 @@ sub MY::postamble {
 instlibdir:
        @echo '$(INSTALLSITEARCH)'
 
+check:
+       perl -MDevel::PPPort -le 'Devel::PPPort::WriteFile(".ppport.h")' && \
+       perl .ppport.h --compat-version=5.6.0 Git.xs && \
+       rm .ppport.h
+
 MAKE_FRAG
 }
 
@@ -17,15 +22,14 @@ if ($@) {
        $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
 }
 
+my %extra;
+$extra{DESTDIR} = $ENV{DESTDIR} if $ENV{DESTDIR};
+
 WriteMakefile(
        NAME            => 'Git',
        VERSION_FROM    => 'Git.pm',
        PM              => \%pm,
        MYEXTLIB        => '../libgit.a',
        INC             => '-I. -I..',
+       %extra
 );
-
-
-use Devel::PPPort;
-
--s 'ppport.h' or Devel::PPPort::WriteFile();