Alien-MeCab
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
my $MECAB_EXE = File::Spec->catfile("src", "mecab-$MECAB_VERSION.exe");
# Absolut-ize all paths
$MECAB_SOURCE_DIR = File::Spec->rel2abs($MECAB_SOURCE_DIR);
$MECAB_SOURCE = File::Spec->rel2abs($MECAB_SOURCE);
$MECAB_EXE = File::Spec->rel2abs($MECAB_EXE);
my %REQUIRES;
# 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';
}
if (! $RUNNING_IN_HELL) {
eval {
Devel::CheckLib::assert_lib(lib => "iconv", LIBS => $LDFLAGS);
};
if ($@) {
Makefile.PL view on Meta::CPAN
$configure_args .= "--prefix=$prefix " if $prefix;
$configure_args .= "--with-charset=$charset " if $charset;
$configure_args .= prompt("Are there any other arguments you would like to pass to configure?" );
print "\nMeCab will be configured with the following arguments:\n",
" $configure_args\n";
chdir $MECAB_SOURCE_DIR;
local $ENV{CFLAGS} = $CCFLAGS;
local $ENV{LDFLAGS} = $LDFLAGS;
my @cmd = (File::Spec->catfile($MECAB_SOURCE_DIR, "configure"),
split(/\s+/, $configure_args));
if (system(@cmd) != 0) {
print <<"END";
configure $configure_args failed: $!
Something went wrong with the MeCab configuration.
You should correct it and re-run Makefile.PL.
END
chdir $CURDIR;
exit 0;
( run in 0.857 second using v1.01-cache-2.11-cpan-8d75d55dd25 )