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/",
59 url => "http://imager.perl.org/svn/trunk/Imager/W32",
60 web => "http://imager.perl.org/svnweb/public/browse/trunk/Imager/W32",
72 require Imager::Probe;
77 inccheck => sub { -e File::Spec->catfile($_[0], "windows.h") },
79 testcode => _win32_test_code(),
80 testcodeheaders => [ "stdio.h", "string.h", "windows.h" ],
81 incpath => \@incpaths,
82 libpath => \@libpaths,
85 my $probe_res = Imager::Probe->probe(\%probe);
87 $IMAGER_LIBS{Win32} = 1;
89 push @inc, $probe_res->{INC};
90 $opts{LIBS} = $probe_res->{LIBS};
91 $opts{DEFINE} = $probe_res->{DEFINE};
95 $opts{AUTHOR} = 'Tony Cook <tonyc@cpan.org>';
96 $opts{ABSTRACT} = 'Win32 font file support for Imager';
102 $IMAGER_LIBS{Win32} = 0;
104 if ($BUILDING_IMAGER) {
105 ExtUtils::MakeMaker::WriteEmptyMakefile(%opts);
109 die "OS unsupported: Win32 libraries or headers not found\n";
113 sub _win32_test_code {
115 HDC dc = GetDC(NULL);
116 HDC bmpDc = CreateCompatibleDC(dc);