use ExtUtils::MakeMaker;


require 5.008_000;


# eval 'use Carp::Assert;';
# if( @$ ) {
#   print 
# "You need Carp::Assert module if you plan to use ReDIF::Record.\n",
# "It will help you avoid some errors during make test.\n",
# "Otherwise it is not necessary.\n";
# }

sub test_mod ($) {
  my $m = shift;
  eval "use $m;";
  if ( $@ ) {
    undef $@;
    return 0;

  } else {
    return 1;
  }
}


use Config;
my $cp = $Config{cp};
if ( not test_mod 'ReDIF::Parser' ) {
  system( "$cp -r lib.ReDIF/* lib/");
}


WriteMakefile(
              NAME    => 'AMF-perl',
              VERSION => '0.32',
              PREREQ_PM => {
                            'XML::Parser::Expat' => 2,
#                            'ReDIF::Parser' => "2.30",
                            'Carp::Assert'  => "0.17",
              },
              EXE_FILES   => [qw( amfch )],
              dist      => {
                  TARFLAGS => '-cvf',
                  COMPRESS => 'gzip -9f', 
                  SUFFIX   => '.gz',
              },
              
);
