Alien-LibJIT

 view release on metacpan or  search on metacpan

inc/Module/Build/AlienLibJIT.pm  view on Meta::CPAN

use Config;

our $LIBJIT_HOME = 'libjit';
our $LIBJIT_M4 = 'm4';
our $LIBJIT_INCLUDE = File::Spec->catfile($LIBJIT_HOME, 'include');
our $LIBJIT_RESULT = File::Spec->catfile($LIBJIT_HOME, 'jit', '.libs', 'libjit'.$Config::Config{lib_ext});

sub new {
    my ($class, @args) = @_;

    return $class->SUPER::new(
        #include_dirs       => [$LIBJIT_INCLUDE],
        #extra_linker_flags => [$LIBJIT_RESULT, '-lpthread'],
        @args,
    );
}

sub ACTION_code {
    my ($self) = @_;

    $self->depends_on('libjit');

    return $self->SUPER::ACTION_code(@_);
}

sub ACTION_depcheck {
    my ($self) = @_;
    foreach my $cmd (qw/autoreconf libtool flex bison/) {
        $self->log_info("Checking if '$cmd' is available\n");
        system("$cmd --help > /dev/null 2>&1")
            and die "You need to make sure you have a recent '$cmd' installed and " .
                'that it can be found in your PATH';
    }



( run in 0.555 second using v1.01-cache-2.11-cpan-49f99fa48dc )