mirror of
https://github.com/git/git.git
synced 2024-11-19 07:24:50 +01:00
5c4082fd68
I have been thinking about how to do the error reporting the best way and after scraping various overcomplicated concepts, I have decided that by far the most elegant way is to throw Error exceptions; the closest sane alternative is to catch the dies in Git.pm by enclosing the calls in eval{}s and that's really _quite_ ugly. The only "small" trouble is that Error.pm turns out sadly not to be part of the standard distribution, and installation from CPAN is a bother, especially if you can't install it system-wide. But since it is very small, I've decided to just bundle it. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
31 lines
619 B
Perl
31 lines
619 B
Perl
use ExtUtils::MakeMaker;
|
|
|
|
sub MY::postamble {
|
|
return <<'MAKE_FRAG';
|
|
instlibdir:
|
|
@echo $(INSTALLSITELIB)
|
|
|
|
MAKE_FRAG
|
|
}
|
|
|
|
my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');
|
|
|
|
# We come with our own bundled Error.pm. It's not in the set of default
|
|
# Perl modules so install it if it's not available on the system yet.
|
|
eval { require 'Error' };
|
|
if ($@) {
|
|
$pm{'Error.pm'} = '$(INST_LIBDIR)/Error.pm';
|
|
}
|
|
|
|
WriteMakefile(
|
|
NAME => 'Git',
|
|
VERSION_FROM => 'Git.pm',
|
|
PM => \%pm,
|
|
MYEXTLIB => '../libgit.a',
|
|
INC => '-I. -I..',
|
|
);
|
|
|
|
|
|
use Devel::PPPort;
|
|
|
|
-s 'ppport.h' or Devel::PPPort::WriteFile();
|