root / ImageMagick / trunk / PerlMagick / Makefile.PL

Revision 12026, 4.1 kB (checked in by cristy, 7 days ago)
Line 
1#  Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization
2#  dedicated to making software imaging solutions freely available.
3#
4#  You may not use this file except in compliance with the License.  You may
5#  obtain a copy of the License at
6#
7#    http://www.imagemagick.org/script/license.php
8#
9#  Unless required by applicable law or agreed to in writing, software
10#  distributed under the License is distributed on an "AS IS" BASIS,
11#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12#  See the License for the specific language governing permissions and
13#  limitations under the License.
14#
15#  Exercise all regression tests:
16
17#    make test
18#
19#  Exersise one regression test:
20#
21#    make TEST_VERBOSE=1 TEST_FILES=t/filter.t test
22#
23
24use ExtUtils::MakeMaker;
25use Config;
26
27# Compute test specification
28my $delegate_tests='t/*.t';
29my $delegate;
30foreach $delegate (qw/autotrace bzlib fontconfig freetype gvc jpeg jp2 lcms openexr png rsvg tiff x11 xml wmf zlib/) {
31  if ( -d "t/$delegate" ) {
32    if ($delegate =~ /x11/) {
33      if ( defined $ENV{'DISPLAY'} ) {
34        $delegate_tests .= " t/$delegate/*.t";
35      }
36      next;
37    }
38    $delegate_tests .= " t/$delegate/*.t";
39  }
40}
41
42# See lib/ExtUtils/MakeMaker.pm for details of how to influence
43# the contents of the Makefile that is written.
44WriteMakefile
45  (
46   # Module description
47   'ABSTRACT'   => 'ImageMagick PERL Extension',
48
49   # Perl module name is Image::Magick
50   'NAME'       => 'Image::Magick',
51
52   # Module author
53   'AUTHOR'    => 'ImageMagick Studio LLC',
54
55   # Module version
56   'VERSION'   => '6.4.3',
57
58   # Preprocessor defines
59   'DEFINE'     => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H',     # e.g., '-DHAVE_SOMETHING'
60
61   # Header search specfication and preprocessor flags
62   'INC'        => '-I../ -I.. -I/usr/include/freetype2 -I/usr/include/libxml2',
63
64   # C pre-processor flags (e.g. -I & -D options)
65   # 'CPPFLAGS'    => "$Config{'cppflags'} -I/usr/include/freetype2 -I/usr/include/libxml2",
66
67   # C compiler flags (e.g. -O -g)
68   'CCFLAGS'     => "$Config{'ccflags'} -fopenmp -g -O2 -Wall -W -pthread",
69
70   # Linker flags for building an executable
71   'LDFLAGS'    =>  "-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand $Config{'ldflags'} -lfreetype",
72
73   # Linker flags for building a dynamically loadable module
74   'LDDLFLAGS'  => "-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand $Config{'lddlflags'} -lfreetype",
75
76   # Install PerlMagick binary into ImageMagick bin directory
77   'INSTALLBIN' => '/usr/local/bin',
78
79   # Library specification
80   'LIBS'       => [ '-L/usr/local/lib -L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand' ],
81
82   # Perl binary name (if a Perl binary is built)
83   'MAP_TARGET' => 'PerlMagick',
84
85   # Let CFLAGS drive optimization flags by setting OPTIMIZE to empty
86   # 'OPTIMIZE' => '',
87
88   # Use same compiler as ImageMagick
89   'PERLMAINCC' => ' -fopenmp',
90
91   # Set Perl installation prefix to ImageMagick installation prefix
92#   'PREFIX'    => '/usr/local',
93
94   # Include delegate directories in tests
95   test         => { TESTS      =>      $delegate_tests},
96
97   ($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
98);
99
100
101#
102# Substitutions for "makeaperl" section.
103#
104sub MY::makeaperl {
105     package MY; # so that "SUPER" works right
106     my $inherited = shift->SUPER::makeaperl(@_);
107
108     # Stinky ExtUtils::MM_Unix likes to append its own library path to $(CC),
109     # prior to any user-specified library path so that an installed library is
110     # used rather than the library just built.  This substitution function
111     # tries to insert our library path first. Also, use the same compiler used
112     # to build perlmain.c to link so that a C++ compiler may be used if
113     # necessary.
114     $inherited =~ s:MAP_LINKCMD\s.*\s*\$\(CC\):MAP_LINKCMD   = \$(PERLMAINCC) -L/usr/local/lib: ;
115     $inherited;
116 }
117
118#
119# Substitutions for "test" section.
120#
121sub MY::test {
122     package MY; # so that "SUPER" works right
123     my $inherited = shift->SUPER::test(@_);
124
125     # Run tests in our environment
126     $inherited =~ s:PERL_DL_NONLAZY=1:/bin/sh ../magick.sh PERL_DL_NONLAZY=1:g ;
127     $inherited;
128 }
Note: See TracBrowser for help on using the browser.