1use ExtUtils::MakeMaker;
2
3use strict;
4use Config;
5
6my %extras;
7
8eval { local $SIG{'__WARN__'}; require Test::More };
9if ($@)
10{
11    print "Test::More is not installed: All tests will be skipped\n";
12    # XXX Why can't I reset this to not do any tests?
13    $extras{test} = {TESTS => undef};
14}
15
16# Check that the current GD has TTF support, and that it works.
17eval
18{
19    local $SIG{'__WARN__'};
20    require GD;
21    require File::Spec;
22    require Cwd;
23
24    GD::Image->can('stringTTF')
25	or die "One";
26    GD::Image->stringTTF(0, 'foo', 10, 0, 0, 0, 'foo');
27    $@ =~ /TrueType font support/i
28     	and die "Two";
29    my $test_font = File::Spec->catfile(Cwd::cwd(), "Dustismo_Sans.ttf");
30    GD::Image->stringTTF(0, $test_font, 10, 0, 0, 0, 'foo')
31	or die "Three: $@";
32};
33if ($@ && $@ =~ /^Three/)
34{
35    # We seem to have one of those rare GD installations that claims it
36    # can do TTF, but that fails when we try.
37    warn <<EOW;
38
39Your GD installation claims to support TTF fonts, but it fails to load
40the included test font. The module tests will also fail because of this.
41If you are certain that you have correct TTF support in your GD module,
42please contact the author of this module with as much information you
43can provide about your installation.
44
45Continuing...
46
47EOW
48}
49
50
51WriteMakefile(
52    'DISTNAME'		=> 'GDTextUtil',
53    'NAME'		=> 'GD::Text',
54    'VERSION_FROM' 	=> 'Text.pm',
55    'PREREQ_PM'		=> { 'GD' => 1 },
56	($] >= 5.005 ? (
57	     'ABSTRACT'     => 'text utilities for GD',
58	     'AUTHOR'       => 'Martien Verbruggen (mgjv@comdyn.com.au)',
59	    ):()
60	),
61    clean			=> {FILES => "GDWrap.png"},
62    %extras,
63);
64
65sub MY::postamble
66{
67qq(
68.PHONY: demo
69demo: pure_all GDWrap.png
70GDWrap.png: demo/GDWrap.pl
71	\@$Config{'perlpath'} -Mblib demo/GDWrap.pl demo/GDWrap.png
72)
73}
74
75# $Id: Makefile.PL,v 1.14 2003/06/19 00:57:44 mgjv Exp $
76