1 # Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization
2 # dedicated to making software imaging solutions freely available.
4 # You may not use this file except in compliance with the License. You may
5 # obtain a copy of the License at
7 # http://www.imagemagick.org/script/license.php
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.
15 # Exercise all regression tests:
19 # Exersise one regression test:
21 # make TEST_VERBOSE=1 TEST_FILES=t/filter.t test
24 use ExtUtils::MakeMaker;
27 # Compute test specification
28 my $delegate_tests='t/*.t';
30 foreach $delegate (qw/bzlib djvu fftw fontconfig freetype jpeg jng jp2 lcms mpeg 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";
38 $delegate_tests .= " t/$delegate/*.t";
42 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
43 # the contents of the Makefile that is written.
47 'ABSTRACT' => 'ImageMagick PERL Extension',
49 # Perl module name is Image::Magick
50 'NAME' => 'Image::Magick',
53 'AUTHOR' => 'ImageMagick Studio LLC',
58 # Preprocessor defines
59 'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING'
61 # Header search specfication and preprocessor flags
62 'INC' => '-I../ -I.. -I/usr/include/freetype2 -I/usr/include/libxml2',
65 #'CC' => 'gcc -std=gnu99',
67 # C pre-processor flags (e.g. -I & -D options)
68 # 'CPPFLAGS' => "$Config{'cppflags'} -I/usr/include/freetype2 -I/usr/include/libxml2",
70 # C compiler flags (e.g. -O -g)
71 'CCFLAGS' => "$Config{'ccflags'} -fopenmp -g -O2 -Wall -W -pthread",
74 #'LD' => $Config{'ld'} == $Config{'cc'} ? 'gcc -std=gnu99' : $Config{'ld'},
76 # Linker flags for building an executable
77 'LDFLAGS' => "-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand $Config{'ldflags'} -lfreetype",
79 # Linker flags for building a dynamically loadable module
80 'LDDLFLAGS' => "-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand $Config{'lddlflags'} -lfreetype",
82 # Install PerlMagick binary into ImageMagick bin directory
83 'INSTALLBIN' => '/usr/local/bin',
85 # Library specification
86 'LIBS' => [ '-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand -lperl -lm' ],
88 # Perl binary name (if a Perl binary is built)
89 'MAP_TARGET' => 'PerlMagick',
91 # Let CFLAGS drive optimization flags by setting OPTIMIZE to empty
94 # Use same compiler as ImageMagick
95 'PERLMAINCC' => ' -fopenmp',
97 # Set Perl installation prefix to ImageMagick installation prefix
98 # 'PREFIX' => '/usr/local',
100 # Include delegate directories in tests
101 test => { TESTS => $delegate_tests},
103 ($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
108 # Substitutions for "makeaperl" section.
111 package MY; # so that "SUPER" works right
112 my $inherited = shift->SUPER::makeaperl(@_);
114 # Stinky ExtUtils::MM_Unix likes to append its own library path to $(CC),
115 # prior to any user-specified library path so that an installed library is
116 # used rather than the library just built. This substitution function
117 # tries to insert our library path first. Also, use the same compiler used
118 # to build perlmain.c to link so that a C++ compiler may be used if
120 $inherited =~ s:MAP_LINKCMD\s.*\s*\$\(CC\):MAP_LINKCMD = \$(PERLMAINCC) -L/usr/local/lib: ;