use lib '/Library/WebServer/perl/lib';
use FileUpload;

# Check for required modules.
$| = 1;
my $missing_modules = 0;

print "Checking for CGI...";
eval {
        require CGI;
};
if ($@) {
        print "failed\n";
        $missing_modules++;
        print <<"AMEN";

ERROR: $@
CGI wasn't found.  You must install the CGI module to use FileUpload.

AMEN
}
else {
    print "ok\n";
}

print "Checking for IO...";
eval {
        require IO;
	$IO::VERSION >= 1.20 || die "Lower version, $IO::VERSION, of IO module";
};
if ($@) {
        print "failed\n";
        $missing_modules++;
        print <<"AMEN";

ERROR: $@
IO wasn't found.  You must install the IO module to use FileUpload.

AMEN
}
else {
    print "ok\n";
}

if ($missing_modules) {
        die <<"AMEN";
Missing modules can be obtained from the Comprehensive Perl Archive
Network (CPAN) at <URL:http://www.perl.org/CPAN/>.

*** You can't use FileUpload until any missing modules are installed ***

AMEN
}

use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
    'NAME'	=> 'FileUpload',
    'VERSION_FROM' => 'FileUpload.pm', # finds $VERSION
);
