note
Cody Pendant
Makefile.PL from Perl::Magick:
<readmore>
<code>
# Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
# dedicated to making software imaging solutions freely available.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at
#
# http://www.imagemagick.org/script/license.php
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use ExtUtils::MakeMaker;
use Config;
# Compute test specification
my $delegate_tests='t/*.t';
my $delegate;
foreach $delegate (qw/ bzlib jpeg lcms mpeg png ps tiff x xfig zlib/) {
if( -d "t/$delegate" ) {
$delegate_tests .= " t/$delegate/*.t";
}
}
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile
(
# Module description
'ABSTRACT' => 'ImageMagick PERL Extension',
# Perl module name is Image::Magick
'NAME' => 'Image::Magick',
# Module author
'AUTHOR' => 'ImageMagick Studio LLC',
# Module version
'VERSION' => '6.3.2',
# Preprocessor defines
'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING'
# Header search specfication and preprocessor flags
'INC' => '-I../ -I.. -I/usr/include/librsvg-2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libxml2',
# C pre-processor flags (e.g. -I & -D options)
# 'CPPFLAGS' => "$Config{'cppflags'} -I/usr/include/librsvg-2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libxml2",
# C compiler flags (e.g. -O -g)
'CCFLAGS' => "$Config{'ccflags'} -g -O2 -Wall -W -pthread",
# Linker flags for building an executable
'LDFLAGS' => "-L../magick/.libs -lMagick $Config{'ldflags'}",
# Linker flags for building a dynamically loadable module
'LDDLFLAGS' => "-L../magick/.libs -lMagick $Config{'lddlflags'}",
# Install PerlMagick binary into ImageMagick bin directory
'INSTALLBIN' => '/usr/local/bin',
# Library specification
'LIBS' => [ '-L/home/cristy/ImageMagick/ImageMagick/magick/.libs -L/usr/lib64 -lfreetype -llcms -ltiff -lfreetype -ljpeg -lgs -lpng -lXext -lXt -lSM -lICE -lX11 -lbz2 -lrsvg-2 -lgdk_pixbuf-2.0 -lpng12 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lxml2 -lgvc -lz -lpthread -lm -lpthread' ],
# Perl binary name (if a Perl binary is built)
'MAP_TARGET' => 'PerlMagick',
# Let CFLAGS drive optimization flags by setting OPTIMIZE to empty
# 'OPTIMIZE' => '',
# Use same compiler as ImageMagick
'PERLMAINCC' => 'g++',
# Set Perl installation prefix to ImageMagick installation prefix
# 'PREFIX' => '/usr/local',
# Include delegate directories in tests
test => { TESTS => $delegate_tests},
($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
);
#
# Substitutions for "makeaperl" section.
#
sub MY::makeaperl {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::makeaperl(@_);
# Stinky ExtUtils::MM_Unix likes to append its own library path to $(CC),
# prior to any user-specified library path so that an installed library is
# used rather than the library just built. This substitution function
# tries to insert our library path first. Also, use the same compiler used
# to build perlmain.c to link so that a C++ compiler may be used if
# necessary.
$inherited =~ s:MAP_LINKCMD\s.*\s*\$\(CC\):MAP_LINKCMD = \$(PERLMAINCC) -L/home/cristy/ImageMagick/ImageMagick/magick/.libs: ;
$inherited;
}
#
# Substitutions for "test" section.
#
sub MY::test {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::test(@_);
# Run tests in our environment
$inherited =~ s:PERL_DL_NONLAZY=1:/bin/sh ../magick.sh PERL_DL_NONLAZY=1:g ;
$inherited;
}
</code>
</readmore>
and the Makefile.nt version:
<readmore><c>
# Copyright (C) 1999-2005 ImageMagick Studio LLC
#
# This program is covered by multiple licenses, which are described in
# LICENSE. You should have received a copy of LICENSE with this
# package; otherwise see http://www.imagemagick.org/script/license.php.
#
# Makefile for building PerlMagick under Windows
#
#
#
use ExtUtils::MakeMaker;
use Config;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
#
# NOTE: The current ActiveState binary distribution does not completely setup
# the values in C:/Perl/lib/Config.pm. You must manually modify the values of
# libpth to add the VisualC++ library path. It should look similar to one of
# the following examples in order to work properly.
#
# Random developer
# libpth='"C:\Perl\lib\CORE" "D:\DevStudio\VC98\lib"'
#
# Visual Studio 6.0 default install:
# libpth='"C:\Program Files\Microsoft Visual Studio\VC98\lib" "C:\Perl\lib\CORE"'
#
# Visual Studio 7.0 default install:
# libpth='"C:\Program Files\Microsoft Visual Studio .NET\vc7\lib" "C:\Perl\lib\CORE"'
#
# Visual Studio 7.1 default install:
# libpth='"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib" "C:\Perl\lib\CORE"'
#
WriteMakefile(
'ABSTRACT' => 'ImageMagick PERL Extension',
'AUTHOR' => 'ImageMagick Studio',
'NAME' => 'Image::Magick',
'VERSION_FROM' => 'Magick.pm', # finds $VERSION
'LIBS' => ['-L..\VisualMagick\lib -L..\VisualMagick\bin -lCORE_RL_magick_.lib'],
'DEFINE' => '-D_VISUALC_ -D_WINDOWS', # e.g., '-DHAVE_SOMETHING'
'INC' => '-I.. -I..\xlib\include',
'BINARY_LOCATION' => 'x86/Image-Magick.tar.gz',
'dist' => {ZIP => "zip.exe", ZIPFLAGS=>"-r"},
'clean' => {FILES => "Image-Magick.ppd Image-Magick.tar.gz PerlMagick.zip " },
($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
);
#
# Add a targets for building ActiveState ppm distribution modules
# Dylan Beattie <dylan@zepler.org>, April 2002
#
# Requires tar, gzip, and zip. This produces PerlMagick.zip
# Get GNU tar and gzip from http://sourceware.cygnus.com/
# Get Win32 command line PKZIP from http://www.pkware.com/
# and rename PKZIP.EXE to ZIP.EXE and PKUNZIP.EXE to UNZIP.EXE
# Make sure tar.exe, gzip.exe and zip.exe are in your system path
#
# 'nmake ppm' will include only the PerlMagick module
# 'nmake ppm-full' also includes all ImageMagick DLLs and MGK files
sub MY::postamble
{
'
Image-Magick.tar.gz: ppd pure_all #htmlifypods manifypods
if exist Image-Magick.tar.gz del Image-Magick.tar.gz
if exist Image-Magick.tar del Image-Magick.tar
$(TAR) $(TARFLAGS) Image-Magick.tar blib
$(COMPRESS) -q Image-Magick.tar
release: Image-Magick.tar.gz
ppm: ppd pure_all htmlifypods manifypods
if exist PerlMagick.zip del PerlMagick.zip
$(TAR) $(TARFLAGS) Image-Magick.tar blib
$(COMPRESS) -q Image-Magick.tar
if exist x86 del x86 /f /q
if exist x86 rd x86
md x86
copy Image-Magick.tar$(SUFFIX) x86
del Image-Magick.tar$(SUFFIX)
if exist ppm-readme.txt copy ppm-readme.txt readme
$(ZIP) $(ZIPFLAGS) PerlMagick.zip readme Image-Magick.ppd x86/Image-Magick.tar$(SUFFIX)
del x86\Image-Magick.tar$(SUFFIX)
rd x86
ppm-full: ppd pure_all htmlifypods manifypods
if exist PerlMagick-full.zip del PerlMagick-full.zip
copy ..\VisualMagick\bin\*.dll blib\arch\auto\Image\Magick
copy ..\VisualMagick\bin\*.xml blib\arch\auto\Image\Magick
$(TAR) $(TARFLAGS) Image-Magick.tar blib
$(COMPRESS) -q Image-Magick.tar
if exist x86 del x86 /f /q
if exist x86 rd x86
md x86
copy Image-Magick.tar$(SUFFIX) x86
del Image-Magick.tar$(SUFFIX)
if exist ppm-readme.txt copy ppm-readme.txt readme
$(ZIP) $(ZIPFLAGS) PerlMagick-full.zip readme Image-Magick.ppd x86/Image-Magick.tar$(SUFFIX)
del x86\Image-Magick.tar$(SUFFIX)
rd x86
'
}
#
# Modify the MakeMaker test fragment
#
sub MY::test
{
#
# List any ImageMagick features derived from add-on libraries
# or programs you would like to test.
#
# Valid choices are:
#
# Feature Formats Tested Prerequisites
# ======= ====================== ======================================
# bzlib BZip compression BZip library
# cgm CGM format 'ralcgm' program
# hdf HDF format HDF library
# jbig JBIG format JBIG library
# jpeg JPEG format JPEG library
# mpeg MPEG format 'mpeg2decode' & 'mpeg2encode' programs
# png PNG format PNG and Zlib libraries
# ps Postscript format 'gs' program and/or DPS library
# rad Radiance format 'ra_ppm' program
# tiff TIFF format TIFF library
# ttf TrueType font format FreeType library
# x X11 support X-windows libraries and server
# xfig Xfig format 'transfig' program
# zlib Zip compression Zlib library
#
my @DELEGATES = qw/ bzlib cgm jbig jpeg mpeg png ps tiff wmf x xfig zlib/;
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::test(@_);
my $delegate_tests=
" t/setattribute.t" .
" t/getattribute.t" .
" t/filter.t" .
" t/read.t" .
" t/montage.t" .
" t/write.t" .
" t/hpgl/read.t" .
" t/jbig/read.t" .
" t/jbig/write.t" .
" t/jng/read.t" .
" t/jng/write.t" .
" t/jp2/read.t" .
" t/jpeg/read.t" .
" t/jpeg/write.t" .
" t/png/read.t" .
" t/png/write.t" .
" t/ps/read.t" .
" t/ps/write.t" .
" t/tiff/read.t" .
" t/tiff/write.t" . " t/ttf/read.t" .
" t/wmf/read.t" .
" t/zlib/read.t" .
" t/zlib/write.t";
if ( defined $ENV{'DISPLAY'} ) {
$delegate_tests .= " t/x/write.t t/x/read.t";
}
$inherited =~ s:^TEST_FILES =.*:TEST_FILES = ${delegate_tests}:m;
$inherited;
}
</c></readmore>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-87399">
<HR>
<BR>
<blockquote>
Nobody says perl looks like line-noise any more<br>
kids today don't know what line-noise IS ...
</blockquote>
</div></div>
661216
661268