Fix compilation under blead, and require at least 5.006
[p5sagit/Devel-Size.git] / inc / Module / Install / Win32.pm
CommitLineData
0430b7f7 1#line 1
2package Module::Install::Win32;
3
4use strict;
5use Module::Install::Base;
6
6ea94d90 7use vars qw{$VERSION @ISA $ISCORE};
0430b7f7 8BEGIN {
6ea94d90 9 $VERSION = '0.71';
0430b7f7 10 @ISA = qw{Module::Install::Base};
6ea94d90 11 $ISCORE = 1;
0430b7f7 12}
13
14# determine if the user needs nmake, and download it if needed
15sub check_nmake {
16 my $self = shift;
17 $self->load('can_run');
18 $self->load('get_file');
6ea94d90 19
0430b7f7 20 require Config;
21 return unless (
22 $^O eq 'MSWin32' and
23 $Config::Config{make} and
24 $Config::Config{make} =~ /^nmake\b/i and
25 ! $self->can_run('nmake')
26 );
27
28 print "The required 'nmake' executable not found, fetching it...\n";
29
30 require File::Basename;
31 my $rv = $self->get_file(
32 url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
33 ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
34 local_dir => File::Basename::dirname($^X),
35 size => 51928,
36 run => 'Nmake15.exe /o > nul',
37 check_for => 'Nmake.exe',
38 remove => 1,
39 );
40
6ea94d90 41 die <<'END_MESSAGE' unless $rv;
0430b7f7 42
43-------------------------------------------------------------------------------
44
45Since you are using Microsoft Windows, you will need the 'nmake' utility
46before installation. It's available at:
47
48 http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
49 or
50 ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
51
52Please download the file manually, save it to a directory in %PATH% (e.g.
53C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
54that directory, and run "Nmake15.exe" from there; that will create the
55'nmake.exe' file needed by this module.
56
57You may then resume the installation process described in README.
58
59-------------------------------------------------------------------------------
60END_MESSAGE
6ea94d90 61
0430b7f7 62}
63
641;