2 package Module::Install::External;
4 # Provides dependency declarations for external non-Perl things
7 use Module::Install::Base ();
9 use vars qw{$VERSION $ISCORE @ISA};
13 @ISA = qw{Module::Install::Base};
19 # First check for the basic C compiler
20 $self->requires_external_cc;
22 # We need a C compiler that can build XS files
23 unless ( $self->can_xs ) {
24 print "Unresolvable missing external dependency.\n";
25 print "This package requires perl's header files.\n";
26 print STDERR "NA: Unable to build distribution on this platform.\n";
33 sub requires_external_cc {
36 # We need a C compiler, use the can_cc method for this
37 unless ( $self->can_cc ) {
38 print "Unresolvable missing external dependency.\n";
39 print "This package requires a C compiler.\n";
40 print STDERR "NA: Unable to build distribution on this platform.\n";
44 # Unlike some of the other modules, while we need to specify a
45 # C compiler as a dep, it needs to be a build-time dependency.
50 sub requires_external_bin {
51 my ($self, $bin, $version) = @_;
53 die "requires_external_bin does not support versions yet";
56 # Load the package containing can_run early,
57 # to avoid breaking the message below.
58 $self->load('can_run');
61 print "Locating bin:$bin...";
62 my $found_bin = $self->can_run( $bin );
64 print " found at $found_bin.\n";
67 print "Unresolvable missing external dependency.\n";
68 print "Please install '$bin' seperately and try again.\n";
69 print STDERR "NA: Unable to build distribution on this platform.\n";
73 # Once we have some way to specify external deps, do it here.
74 # In the mean time, continue as normal.