Better compatibility with Windows in Build.PL

This commit is contained in:
Alessandro Ranellucci 2013-08-24 11:59:51 +02:00
parent 097912755b
commit af687a98e2

View File

@ -89,6 +89,11 @@ EOF
# make sure our cpanm is updated (old ones don't support the ~ syntax) # make sure our cpanm is updated (old ones don't support the ~ syntax)
system $cpanm, 'App::cpanminus'; system $cpanm, 'App::cpanminus';
# install the Windows-compatible Math::Libm
if ($^O eq 'MSWin32') {
system $cpanm, 'https://github.com/alexrj/Math-Libm/tarball/master';
}
my %modules = (%prereqs, %recommends); my %modules = (%prereqs, %recommends);
foreach my $module (sort keys %modules) { foreach my $module (sort keys %modules) {
my $version = $modules{$module}; my $version = $modules{$module};
@ -99,7 +104,18 @@ EOF
# temporarily require this dev version until this upstream bug # temporarily require this dev version until this upstream bug
# is resolved: https://rt.cpan.org/Ticket/Display.html?id=86367 # is resolved: https://rt.cpan.org/Ticket/Display.html?id=86367
system $cpanm, 'SMUELLER/ExtUtils-ParseXS-3.18_04.tar.gz'; system $cpanm, 'SMUELLER/ExtUtils-ParseXS-3.18_04.tar.gz';
system './xs/Build', 'distclean' if -e './xs/Build';
# clean xs directory before reinstalling, to make sure Build is called
# with current perl binary
if (-e './xs/Build') {
if ($^O eq 'MSWin32') {
system 'pushd', 'xs';
system 'Build', 'distclean';
system 'popd';
} else {
system './xs/Build', 'distclean';
}
}
system $cpanm, '--reinstall', './xs'; system $cpanm, '--reinstall', './xs';
} }