EAV-XS

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

    }
    elsif ($with_idn =~ /^idn2$/i) {
        $cfg = &build_with_idnX('idn2');
    }
    elsif ($with_idn =~ /^idnkit$/i) {
        $cfg = &build_with_idnkit();
    }
    else {
        print <<'EOF';

 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

ERROR: Invalid IDN library.

Bye!
EOF
        exit 3;
    }

    my @rfc_opts = &set_rfc_options();
    my $rfc_list = join(" ", @rfc_opts);
    my $rfc_defs = "";
    for my $opt (@rfc_opts) {
        $opt =~ s/\=ON//;
        $rfc_defs .= " -D${opt}";
    }
    $cfg->{'DEFINE'} .= $rfc_defs;
    $cfg->{'macro'}->{'LIBEAV_OPTIONS'} .= " ${rfc_list}";

    if ($^O =~ /^(free|net)bsd$/i) {
        $cfg->{'macro'}->{'LIBEAV_MAKEFILE'} = "-f Makefile.bsd";
    }
    elsif ($^O eq "openbsd") {
        $cfg->{'macro'}->{'LIBEAV_MAKEFILE'} = "-f Makefile.openbsd";
    }
    elsif ($^O eq "solaris") {
        $cfg->{'DEFINE'} = "-DEAV_EXTRA -m64";
        $cfg->{'dynamic_lib'}->{'OTHERLDFLAGS'} = "-m64";
    }
    elsif ($^O eq "MSWin32") {
        $cfg->{'macro'}->{'LIBEAV_MAKEFILE'} = "-f Makefile.windows-gmake";

        if ($Config{'cf_by'} eq "strawberry-perl") {
            $cfg->{'macro'}->{'LIBEAV_OPTIONS'} .= " CC=$Config{'ccname'}";
        }
    }
    elsif ($^O eq "cygwin") {
        $cfg->{'macro'}->{'LIBEAV_MAKEFILE'} = "-f Makefile.windows-gmake";
        $cfg->{'macro'}->{'LIBEAV_OPTIONS'} .= ' RM="rm -f"';
        $cfg->{'LD'} = "cc";
    }

    return $cfg;
}


WriteMakefile(
    dist              => {
        'PREOP'    => 'pod2text lib/EAV/XS.pm'
                    . ' | tee README >$(DISTVNAME)/README;'
                    . ' chmod -R u=rwX,go=rX . ;',
        'COMPRESS' => 'gzip -9v',
        'SUFFIX'   => '.gz',
    },
    NAME              => 'EAV::XS',
    VERSION_FROM      => 'lib/EAV/XS.pm',
    PREREQ_PM         => {
        'XSLoader' => 0,
    },
    TEST_REQUIRES     => {
        'Test::More' => 0,
    },
    CONFIGURE_REQUIRES => {
        'ExtUtils::MakeMaker' => 5.62,
        'ExtUtils::PkgConfig' => 1.16,
    },
    ABSTRACT          => 'Email Address Validation Library',
    AUTHOR            => 'Vitaliy V. Tokarev <vitaliy.tokarev@gmail.com>',
    LICENSE           => 'freebsd',
    INC               => '-Ilibeav/include',
    DEFINE            => '-DEAV_EXTRA',
    OBJECT            => '$(O_FILES)',
    MYEXTLIB          => 'libeav/libeav.a',
    depend => {
        # also clean libeav files
        'clean_subdirs'     => 'clean-libeav',
        # libeav internal checks
        'check'             => 'check-libeav',
    },
    CONFIGURE => \&myconfigure,
    META_MERGE => {
        'meta-spec' => { 'version' => 2 },
        'resources' => {
            'repository' => {
                'type'  => 'git',
                'url'   => 'https://github.com/gh0stwizard/p5-EAV-XS.git',
                'web'   => 'https://github.com/gh0stwizard/p5-EAV-XS',
            }
        }
    },
);


# We don't want the default subdir rule, as it creates 
# a race condition with the rule we add below.
sub MY::subdir_x {
    return '';
}


sub MY::postamble {
    return <<'EOL';
$(MYEXTLIB): libeav/Makefile
	$(MAKE) -C libeav $(LIBEAV_MAKEFILE) $(LIBEAV_OPTIONS) INCLUDES="$(DEFINE)" \
		static

clean-libeav:
	$(MAKE) -C libeav $(LIBEAV_MAKEFILE) $(LIBEAV_OPTIONS) INCLUDES="$(DEFINE)" \
		clean

check-libeav:



( run in 0.492 second using v1.01-cache-2.11-cpan-d8267643d1d )