3 use ExtUtils::MakeMaker;
7 my $verbose = $ENV{IM_VERBOSE};
11 GetOptions("incpath=s", \@incpaths,
12 "libpath=s" => \@libpaths,
13 "verbose|v" => \$verbose);
18 my $MM_ver = eval $ExtUtils::MakeMaker::VERSION;
22 NAME => 'Imager::Font::W32',
23 VERSION_FROM => 'W32.pm',
24 OBJECT => 'W32.o win32.o',
25 clean => { FILES => 'testout' },
29 if ($BUILDING_IMAGER) {
31 unshift @INC, "../lib";
35 print "Win32: building independently\n";
36 require Imager::ExtUtils;
37 push @inc, Imager::ExtUtils->includes;
38 $opts{TYPEMAPS} = [ Imager::ExtUtils->typemap ];
40 # Imager required configure through use
41 my @Imager_req = ( Imager => "0.78" );
42 if ($MM_ver >= 6.46) {
52 "Test::More" => "0.47",
56 homepage => "http://imager.perl.org/",
57 repository => "git://git.imager.perl.org/imager.git",
58 bugtracker => "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Imager",
68 require Imager::Probe;
73 inccheck => sub { -e File::Spec->catfile($_[0], "windows.h") },
75 testcode => _win32_test_code(),
76 testcodeheaders => [ "stdio.h", "string.h", "windows.h" ],
77 incpath => \@incpaths,
78 libpath => \@libpaths,
81 my $probe_res = Imager::Probe->probe(\%probe);
83 $IMAGER_LIBS{Win32} = 1;
85 push @inc, $probe_res->{INC};
86 $opts{LIBS} = $probe_res->{LIBS};
87 $opts{DEFINE} = $probe_res->{DEFINE};
91 $opts{AUTHOR} = 'Tony Cook <tonyc@cpan.org>';
92 $opts{ABSTRACT} = 'Win32 font file support for Imager';
98 $IMAGER_LIBS{Win32} = 0;
100 if ($BUILDING_IMAGER) {
101 ExtUtils::MakeMaker::WriteEmptyMakefile(%opts);
105 die "OS unsupported: Win32 libraries or headers not found\n";
109 sub _win32_test_code {
111 HDC dc = GetDC(NULL);
112 HDC bmpDc = CreateCompatibleDC(dc);