]> granicus.if.org Git - imagemagick/blob - PerlMagick/Makefile.PL
(no commit message)
[imagemagick] / PerlMagick / Makefile.PL
1 #  Copyright 1999-2009 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
24 use ExtUtils::MakeMaker;
25 use Config;
26
27 # Compute test specification
28 my $delegate_tests='t/*.t';
29 my $delegate;
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";
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.
44 WriteMakefile
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.5.5',
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 compiler
65    #'CC' => 'gcc -std=gnu99',
66
67    # C pre-processor flags (e.g. -I & -D options)
68    # 'CPPFLAGS' => "$Config{'cppflags'} -I/usr/include/freetype2 -I/usr/include/libxml2",
69
70    # C compiler flags (e.g. -O -g)
71    'CCFLAGS' => "$Config{'ccflags'} -fopenmp -g -O2 -Wall -W -pthread",
72
73    # Linker
74    #'LD' => $Config{'ld'} == $Config{'cc'} ? 'gcc -std=gnu99' : $Config{'ld'},
75
76    # Linker flags for building an executable
77    'LDFLAGS' =>  "-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand $Config{'ldflags'} -lfreetype",
78
79    # Linker flags for building a dynamically loadable module
80    'LDDLFLAGS' => "-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand $Config{'lddlflags'} -lfreetype",
81
82    # Install PerlMagick binary into ImageMagick bin directory
83    'INSTALLBIN' => '/usr/local/bin',
84
85    # Library specification
86    'LIBS' => [ '-L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand -lperl -lm' ],
87
88    # Perl binary name (if a Perl binary is built)
89    'MAP_TARGET' => 'PerlMagick',
90
91    # Let CFLAGS drive optimization flags by setting OPTIMIZE to empty
92    # 'OPTIMIZE' => '',
93
94    # Use same compiler as ImageMagick
95    'PERLMAINCC' => ' -fopenmp',
96
97    # Set Perl installation prefix to ImageMagick installation prefix
98 #   'PREFIX'    => '/usr/local',
99
100    # Include delegate directories in tests
101    test => { TESTS      =>      $delegate_tests},
102
103    ($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
104 );
105
106
107 #
108 # Substitutions for "makeaperl" section.
109 #
110 sub MY::makeaperl {
111      package MY; # so that "SUPER" works right
112      my $inherited = shift->SUPER::makeaperl(@_);
113
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
119      # necessary.
120      $inherited =~ s:MAP_LINKCMD\s.*\s*\$\(CC\):MAP_LINKCMD   = \$(PERLMAINCC) -L/usr/local/lib: ;
121      $inherited;
122  }