pass DESTDIR to the generated perl/Makefile
[git.git] / perl / Makefile.PL
blobef9d82d7b63f0c2bee5777025450af4c5eb3abb2
1 use ExtUtils::MakeMaker;
3 sub MY::postamble {
4         return <<'MAKE_FRAG';
5 instlibdir:
6         @echo '$(INSTALLSITEARCH)'
8 check:
9         perl -MDevel::PPPort -le 'Devel::PPPort::WriteFile(".ppport.h")' && \
10         perl .ppport.h --compat-version=5.6.0 Git.xs && \
11         rm .ppport.h
13 MAKE_FRAG
16 my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');
18 # We come with our own bundled Error.pm. It's not in the set of default
19 # Perl modules so install it if it's not available on the system yet.
20 eval { require Error };
21 if ($@) {
22         $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
25 my %extra;
26 $extra{DESTDIR} = $ENV{DESTDIR} if $ENV{DESTDIR};
28 WriteMakefile(
29         NAME            => 'Git',
30         VERSION_FROM    => 'Git.pm',
31         PM              => \%pm,
32         MYEXTLIB        => '../libgit.a',
33         INC             => '-I. -I..',
34         %extra