# -*-perl-*- # # $Id$ # # Makefile for Catacomb/Perl # # (c) 2000 Straylight/Edgeware # #----- Licensing notice ----------------------------------------------------- # # This file is part of the Perl interface to Catacomb. # # Catacomb/Perl is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Catacomb/Perl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Catacomb/Perl; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. use ExtUtils::MakeMaker; use Config; sub pmfix { my $h = {}; foreach my $i (@_) { my $f = $i; $f =~ s!::!/!; $f .= ".pm"; $h->{$f} = "\$(INST_LIBDIR)/$f"; } return $h; } WriteMakefile(NAME => "Catacomb", DISTNAME => "catacomb-perl", AUTHOR => "Mark Wooding (mdw\@nsict.org)", OPTIMIZE => "-O2 -g", XS => { "catacomb.xs" => "catacomb.c" }, OBJECT => join(" ", grep { s/$/$Config{_o}/ } @{[qw(algs mpstuff catacomb algstuff keystuff pgproc utils)]}), CONFIGURE => \&configure, PM => pmfix(Catacomb, Catacomb::Base, Catacomb::Cache, Catacomb::MP, Catacomb::Field, Catacomb::EC, Catacomb::Group, Catacomb::GF, Catacomb::Rand, Catacomb::Crypto, Catacomb::Key), PERL_MALLOC_OK => 1, PL_FILES => { 'algs.PL' => 'algs.c' }, depend => { '$(MAKEFILE)' => '$(VERSION_FROM)', 'catacomb.c' => join(" ", grep { s/$/.xs/ } @{[qw(catacomb algorithms mp field ec gf misc pgen key group pubkey)]}) }, VERSION_FROM => "Catacomb.pm"); sub libconfig_item { my $lib = shift; my $what = shift; my $out = `$lib-config --$what`; $? and die("nonzero exit status from $lib-config --$what"); chomp $out; $config{$what} .= " " if defined($config{$what}); $config{$what} .= $out; } sub libconfig { my $lib = shift; my $version = shift; system("$lib-config --check $version") and die("$lib version $version not found"); libconfig_item($lib, "cflags"); libconfig_item($lib, "libs"); } sub configure { local %config; libconfig("mLib", "2.0.0pre4"); libconfig("catacomb", "2.0.0pre8"); return { CCFLAGS => $config{cflags}, LIBS => [ $config{libs} ] }; } #----- That's all, folks ----------------------------------------------------