1# 2# Copyright (C) 1998, 1999 Loic Dachary 3# 4# This program is free software; you can redistribute it and/or modify it 5# under the terms of the GNU General Public License as published by the 6# Free Software Foundation; either version 2, or (at your option) any 7# later version. 8# 9# This program is distributed in the hope that it will be useful, 10# but WITHOUT ANY WARRANTY; without even the implied warranty of 11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12# GNU General Public License for more details. 13# 14# You should have received a copy of the GNU General Public License 15# along with this program; if not, write to the Free Software 16# Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 17# 18# 19# $Header: /cvsroot/TextQuery/Text-Query-SQL/Makefile.PL,v 1.5 2000/12/27 13:14:11 loic Exp $ 20# 21# This -*- perl -*- script writes the Makefile for Text-Query-SQL 22require 5.004; 23use strict; 24 25#--- Configuration section --- 26 27use ExtUtils::MakeMaker; 28 29version_check('Text::Query', '0.07', 'require Text::Query;'); 30version_check('Data::Dumper', '2.101', 'require Data::Dumper;'); 31 32# 33# Check that package $what is installed and that 34# it's version is at least $min_version. 35# Use $test to check that package exists : usually something like 36# $test = 'require MIME::Base64;'; 37# Dies if package not present or wrong version. 38# 39sub version_check { 40 my($what, $min_version, $test) = @_; 41 42 print "Checking for $what... "; 43 $test .= "; die '' if(\$${what}::VERSION < \$min_version); \$${what}::VERSION"; 44 my $got_version = eval $test; 45 $got_version = "undef" unless defined $got_version; 46 if ($@) { 47 print " failed\n"; 48 print <<EOT; 49$@ 50Text-Query-SQL needs $what module, version >= $min_version 51EOT 52 exit; 53 } else { 54 eval "print \" \$${what}::VERSION ok\n\""; 55 } 56} 57 58WriteMakefile( 59 'VERSION_FROM' => 'lib/Text/Query/BuildSQL.pm', 60 'NAME' => 'Text::Query::SQL', 61); 62 63