avoid needing . in @INC in dev mode
[gitmo/Class-C3.git] / Makefile.PL
index 7ca6203..a399b45 100644 (file)
@@ -1,6 +1,8 @@
 use strict;
 use warnings FATAL => 'all';
 use 5.006;
+use lib 'inc';
+use ExtUtils::HasCompiler qw(can_compile_loadable_object);
 
 my %META = (
   name => 'Class-C3',
@@ -8,7 +10,6 @@ my %META = (
   prereqs => {
     configure => { requires => {
       'ExtUtils::MakeMaker'   => 0,
-      'ExtUtils::CBuilder'    => 0.27,
     } },
     build => { requires => {
     } },
@@ -24,13 +25,11 @@ my %META = (
         'perl'          => 5.006,
       },
     },
-    develop   => {
-      requires => { map { $_ => 0 } qw(
-        indirect multidimensional bareword::filehandles
-        Moose Mouse namespace::clean namespace::autoclean
-        MooseX::Types::Common::Numeric
-        Type::Tiny
-      ) },
+    develop => {
+      requires => {
+        'Test::Pod' => 1.14,
+        'Test::Pod::Coverage' => 1.04,
+      },
     },
   },
   resources => {
@@ -47,7 +46,7 @@ my %META = (
     license => [ 'http://dev.perl.org/licenses/' ],
   },
   no_index => {
-    directory => [ 't', 'xt', 'opt' ]
+    directory => [ 't', 'xt', 'opt', 'inc' ]
   },
 );
 
@@ -57,63 +56,18 @@ my %MM_ARGS = (
       ? ( 'Devel::Hide' => 0 ) : ()
   },
   PREREQ_PM => {
-    ( $] < 5.009_005 and can_xs() )
+    ( $] < 5.009_005 and can_compile_loadable_object(quiet => 1) )
       ? ( 'Class::C3::XS'  => '0.13' ) : ()
   },
 );
 
-# Secondary compile testing via ExtUtils::CBuilder
-sub can_xs {
-  # Do we have the configure_requires checker?
-  local $@;
-  eval "require ExtUtils::CBuilder;";
-  if ( $@ ) {
-    # They don't obey configure_requires, so it is
-    # someone old and delicate. Try to avoid hurting
-    # them by falling back to an older simpler test.
-    return can_cc();
-  }
-
-  return ExtUtils::CBuilder->new( quiet => 1 )->have_compiler;
-}
-
-# can we locate a (the) C compiler
-sub can_cc {
-  my @chunks = split(/ /, $Config::Config{cc}) or return;
-
-  # $Config{cc} may contain args; try to find out the program part
-  while (@chunks) {
-    return can_run("@chunks") || (pop(@chunks), next);
-  }
-
-  return;
-}
-
-# check if we can run some command
-sub can_run {
-  my ($cmd) = @_;
-
-  return $cmd if -x $cmd;
-  if (my $found_cmd = MM->maybe_command($cmd)) {
-    return $found_cmd;
-  }
-
-  for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
-    next if $dir eq '';
-    my $abs = File::Spec->catfile($dir, $cmd);
-    return $abs if (-x $abs or $abs = MM->maybe_command($abs));
-  }
-
-  return;
-}
-
 sub is_smoker {
   return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )
 }
 
 ## BOILERPLATE ###############################################################
 require ExtUtils::MakeMaker;
-(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
+(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
 
 # have to do this since old EUMM dev releases miss the eval $VERSION line
 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;