# $Id$
use ExtUtils::MakeMaker;

check_prereq( 'Math::Random', 'SVG' );

WriteMakefile(
    'NAME'                => 'Bio::Phylo',
    'AUTHOR'              => 'Rutger Vos <rvos@interchange.ubc.ca>',
    'VERSION_FROM'        => 'lib/Bio/Phylo.pm',
    'ABSTRACT_FROM'       => 'lib/Bio/Phylo.pm',
    'EXE_FILES'           => [
                            'bin/age2bl.pl',
                            'bin/bremer.pl',
                            'bin/dnd2svg.pl',
                            'bin/dndtag.pl',
                            'bin/droptip.pl',
                            'bin/LRmb.pl',
                            'bin/postmb.pl'
                            ],
    'PL_FILES'            => {},
    'PREREQ_PM' => {
        'Scalar::Util'     => 0,
        'Test::More'       => 0.47,
        'IO::String'       => 0,
    },
    'dist'                => { 'COMPRESS' => 'gzip -9f', 'SUFFIX' => 'gz', },
    'clean'               => { 'FILES' => 'Bio-Phylo-*' },
);

sub check_prereq {
	my @classes = @_;
	for my $class ( @classes ) {
		eval "require $class";
		if ( $@ ) {
			print "*** The optional dependency \"$class\" can't be loaded.\n";
			print "    I will continue, but some functionality will not be \n";
			print "    available. Refer to the Bio::Phylo README file for\n";
			print "    more information.\n\n";
		}
	}
}