3 use ExtUtils::MakeMaker;
7 my $verbose = $ENV{IM_VERBOSE};
11 GetOptions("incpath=s", \@incpaths,
12 "libpath=s" => \@libpaths,
13 "verbose|v" => \$verbose);
20 NAME => 'Imager::Font::W32',
21 VERSION_FROM => 'W32.pm',
22 OBJECT => 'W32.o win32.o',
23 clean => { FILES => 'testout' },
26 if (eval { ExtUtils::MakeMaker->VERSION('6.46'); 1 }) {
27 $opts{LICENSE} = "perl_5";
28 $opts{AUTHOR} = 'Tony Cook <tonyc@cpan.org>';
29 $opts{ABSTRACT} = 'Win32 font driver for Imager';
35 url => "https://metacpan.org/pod/CPAN::Meta::Spec",
39 homepage => "http://imager.perl.org/",
43 url => "git://git.imager.perl.org/imager.git",
44 web => "http://git.imager.perl.org/imager.git",
48 web => "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Imager",
49 mailto => 'bug-Imager@rt.cpan.org',
56 if ($BUILDING_IMAGER) {
58 unshift @INC, "../lib";
62 print "Win32: building independently\n";
63 require Imager::ExtUtils;
64 push @inc, Imager::ExtUtils->includes;
65 $opts{TYPEMAPS} = [ Imager::ExtUtils->typemap ];
67 # Imager required configure through use
68 my @Imager_req = ( Imager => "0.95" );
69 if (eval { ExtUtils::MakeMaker->VERSION('6.46'); 1 }) {
70 $opts{META_MERGE}{prereqs} =
84 "Test::More" => "0.47",
98 "Test::More" => "0.47",
110 require Imager::Probe;
115 inccheck => sub { -e File::Spec->catfile($_[0], "windows.h") },
117 testcode => _win32_test_code(),
118 testcodeheaders => [ "stdio.h", "string.h", "windows.h" ],
119 incpath => \@incpaths,
120 libpath => \@libpaths,
124 my $probe_res = Imager::Probe->probe(\%probe);
126 $IMAGER_LIBS{Win32} = 1;
128 push @inc, $probe_res->{INC};
129 $opts{LIBS} = $probe_res->{LIBS};
130 $opts{DEFINE} = $probe_res->{DEFINE};
133 WriteMakefile(%opts);
136 $IMAGER_LIBS{Win32} = 0;
138 if ($BUILDING_IMAGER) {
139 ExtUtils::MakeMaker::WriteEmptyMakefile(%opts);
143 die "OS unsupported: Win32 libraries or headers not found\n";
147 sub _win32_test_code {
149 HDC dc = GetDC(NULL);
150 HDC bmpDc = CreateCompatibleDC(dc);