Quiet warning if Makefile.PL is run with -w and no --localedir
[alt-git.git] / perl / Makefile.PL
blob87e1f62ff891e4e6e82ccef517c8ee8735012c70
1 use strict;
2 use warnings;
3 use ExtUtils::MakeMaker;
4 use Getopt::Long;
6 # Sanity: die at first unknown option
7 Getopt::Long::Configure qw/ pass_through /;
9 my $localedir = '';
10 GetOptions("localedir=s" => \$localedir);
12 sub MY::postamble {
13         return <<'MAKE_FRAG';
14 instlibdir:
15         @echo '$(INSTALLSITELIB)'
17 ifneq (,$(DESTDIR))
18 ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
19 $(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
20         is likely incompatible with the DESTDIR mechanism.  Try setting \
21         NO_PERL_MAKEMAKER=1 instead)
22 endif
23 endif
25 MAKE_FRAG
28 # XXX. When editing this list:
30 # * Please update perl/Makefile, too.
31 # * Don't forget to test with NO_PERL_MAKEMAKER=YesPlease
32 my %pm = (
33         'Git.pm' => '$(INST_LIBDIR)/Git.pm',
34         'Git/I18N.pm' => '$(INST_LIBDIR)/Git/I18N.pm',
35         'Git/SVN/Memoize/YAML.pm' => '$(INST_LIBDIR)/Git/SVN/Memoize/YAML.pm',
36         'Git/SVN/Fetcher.pm' => '$(INST_LIBDIR)/Git/SVN/Fetcher.pm',
37         'Git/SVN/Editor.pm' => '$(INST_LIBDIR)/Git/SVN/Editor.pm',
38         'Git/SVN/Prompt.pm' => '$(INST_LIBDIR)/Git/SVN/Prompt.pm',
39         'Git/SVN/Ra.pm' => '$(INST_LIBDIR)/Git/SVN/Ra.pm',
42 # We come with our own bundled Error.pm. It's not in the set of default
43 # Perl modules so install it if it's not available on the system yet.
44 eval { require Error };
45 if ($@ || $Error::VERSION < 0.15009) {
46         $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
49 # redirect stdout, otherwise the message "Writing perl.mak for Git"
50 # disrupts the output for the target 'instlibdir'
51 open STDOUT, ">&STDERR";
53 WriteMakefile(
54         NAME            => 'Git',
55         VERSION_FROM    => 'Git.pm',
56         PM              => \%pm,
57         PM_FILTER       => qq[\$(PERL) -pe "s<\\Q++LOCALEDIR++\\E><$localedir>"],
58         MAKEFILE        => 'perl.mak',
59         INSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3'