Alien-Iconv

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

# Filenames 
my $ICONV_SOURCE_DIR = File::Spec->catfile("src", "libiconv-$ICONV_VERSION");
my $ICONV_BASENAME   = "libiconv-$ICONV_VERSION.tar.gz";
my $ICONV_SOURCE     = File::Spec->catfile("src", $ICONV_BASENAME);

# Absolut-ize all paths
$ICONV_SOURCE_DIR    = File::Spec->rel2abs($ICONV_SOURCE_DIR);
$ICONV_SOURCE        = File::Spec->rel2abs($ICONV_SOURCE);

# Construct the necessary flags
my $CCFLAGS = $ENV{CCFLAGS};
my $LDFLAGS = $ENV{LDFLAGS};
if (! $RUNNING_IN_HELL) {
    $CCFLAGS ||= '-I/usr/local/include';
    $LDFLAGS ||= '-L/usr/local/lib';
}

eval {
    Devel::CheckLib::assert_lib(lib => "iconv", LIBS => $LDFLAGS )
};
if (! $@) {
    print <<EOM;

Makefile.PL  view on Meta::CPAN

        my $configure_args = '';
        $configure_args .= "--prefix=$prefix " if $prefix;

        $configure_args .= prompt("Are there any other arguments you would like to pass to configure?" );

        print "\nIconv will be configured with the following arguments:\n",
            "  $configure_args\n";

        chdir $ICONV_SOURCE_DIR;

        local $ENV{CFLAGS}  = $CCFLAGS;
        local $ENV{LDFLAGS} = $LDFLAGS;
        my @cmd = (File::Spec->catfile($ICONV_SOURCE_DIR, "configure"),
            split(/\s+/, $configure_args));
        if (system(@cmd) != 0) {
            print <<"END";
configure $configure_args failed: $!
    Something went wrong with the Iconv configuration.
    You should correct it and re-run Makefile.PL.
END
            chdir $CURDIR;
            exit 0;



( run in 0.589 second using v1.01-cache-2.11-cpan-8d75d55dd25 )