# This Makefile.PL for UV-Util was generated by
# Dist::Zilla::Plugin::MakeMaker::Awesome 0.41.
# Don't edit it but the dist.ini and plugins used to construct it.

use strict;
use warnings;

use 5.008001;
use ExtUtils::MakeMaker;

use Config;
use Alien::libuv ();

# make sure we actually get stuff back from Alien::libuv
sub TRIM {
    my $s = shift;
    return '' unless $s;
    $s =~ s/\A\s*//;
    $s =~ s/\s*\z//;
    return $s;
}

my @flags = ('-I.', $Config{ccflags});
my $libs = Alien::libuv->libs();
{
    my $cflags = TRIM(Alien::libuv->cflags);
    my $cflags_s = TRIM(Alien::libuv->cflags_static);
    if ($cflags eq $cflags_s) {
        unshift @flags, $cflags if $cflags;
    }
    else {
        unshift @flags, $cflags if $cflags;
        unshift @flags, $cflags_s if $cflags_s;
    }
}

# this will get merged into the meta
my %xsbuild = (
    XSMULTI => 1,
    LIBS => [$libs],
    CCFLAGS => join(' ', @flags),
);

my %WriteMakefileArgs = (
  "ABSTRACT" => "Some utility functions from libUV.",
  "AUTHOR" => "Chase Whitener <capoeirab\@cpan.org>",
  "BUILD_REQUIRES" => {
    "Alien::libuv" => "1.000",
    "Config" => 0,
    "ExtUtils::MakeMaker" => "7.12"
  },
  "CONFIGURE_REQUIRES" => {
    "Alien::libuv" => 0,
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "UV-Util",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.008001",
  "NAME" => "UV::Util",
  "PREREQ_PM" => {
    "Alien::libuv" => "1.000",
    "Exporter" => "5.57",
    "XSLoader" => "0.14",
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Alien::libuv" => "1.000",
    "ExtUtils::MakeMaker" => "7.12",
    "File::Spec" => 0,
    "Test::More" => "0.88"
  },
  "VERSION" => "1.000",
  "test" => {
    "TESTS" => "t/*.t"
  }
);

%WriteMakefileArgs = (
    %WriteMakefileArgs,
    %xsbuild,
);

my %FallbackPrereqs = (
  "Alien::libuv" => "1.000",
  "Config" => 0,
  "Exporter" => "5.57",
  "ExtUtils::MakeMaker" => "7.12",
  "File::Spec" => 0,
  "Test::More" => "0.88",
  "XSLoader" => "0.14",
  "strict" => 0,
  "warnings" => 0
);

unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

WriteMakefile(%WriteMakefileArgs);