use v6;
use Panda::Common;
use Panda::Builder;
use Shell::Command;
use LibraryMake;

class Build is Panda::Builder {
    method build($dir) {
        shell('perl -e "use v5.18;"')
            or die "\nPerl 5 version requirement not met\n";

        shell('perl -MFilter::Simple -e ""')
            or die "\nPlease install the Filter::Simple Perl 5 module!\n";

        shell(q{perl -MConfig -e '$Config{config_args} =~ /-Duseshrplib/ || exit 1'})
            or die "\nYour perl was not configured to build a shared library; unable to build\n";

        my Str $blib = "$dir/blib";
        rm_f("$dir/lib/Inline/p5helper.so");
        rm_rf($blib);
        mkpath("$blib/lib/Inline");
        make($dir, "$blib/lib");
    }
}

# vim: ft=perl6

use v6;
use Panda::Common;
use Panda::Builder;
use Shell::Command;
use LibraryMake;

class Build is Panda::Builder {
    method build($dir) {
        shell('perl -e "use v5.18;"')
            or die "\nPerl 5 version requirement not met\n";

        shell('perl -MFilter::Simple -e ""')
            or die "\nPlease install the Filter::Simple Perl 5 module!\n";

        my Str $blib = "$dir/blib";
        rm_f("$dir/lib/Inline/p5helper.so");
        rm_rf($blib);
        mkpath("$blib/lib/Inline");
        make($dir, "$blib/lib");
    }
}

# vim: ft=perl6

Revert "Detect perls not configured with a shared library"
Revert "Detect perls not configured with a shared library"

This reverts commit f7b4564ae909100d3daaf9fb1b795e587e01903d.

Apparently Inline::Perl5 can also use a libperl.a instead of a libperl.so,
so -Duseshrlib is not really neccessary. We'll have to find another way
to give a better error message to the user.

Thanks to Tux++ for pointing this out.
