perl / Makefile.PLon commit Merge branch 'ml/color-grep' (f1aa782)
   1use ExtUtils::MakeMaker;
   2
   3sub MY::postamble {
   4        return <<'MAKE_FRAG';
   5instlibdir:
   6        @echo '$(INSTALLSITELIB)'
   7
   8ifneq (,$(DESTDIR))
   9ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
  10$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
  11        is likely incompatible with the DESTDIR mechanism.  Try setting \
  12        NO_PERL_MAKEMAKER=1 instead)
  13endif
  14endif
  15
  16MAKE_FRAG
  17}
  18
  19my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');
  20
  21# We come with our own bundled Error.pm. It's not in the set of default
  22# Perl modules so install it if it's not available on the system yet.
  23eval { require Error };
  24if ($@ || $Error::VERSION < 0.15009) {
  25        $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
  26}
  27
  28# redirect stdout, otherwise the message "Writing perl.mak for Git"
  29# disrupts the output for the target 'instlibdir'
  30open STDOUT, ">&STDERR";
  31
  32WriteMakefile(
  33        NAME            => 'Git',
  34        VERSION_FROM    => 'Git.pm',
  35        PM              => \%pm,
  36        MAKEFILE        => 'perl.mak',
  37        INSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3'
  38);