Alien-MeCab
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
my $CURDIR = Cwd::cwd();
# Here's the file that we're going to use to extract some data
my $SPEC_FILE = 'lib/Alien/MeCab.pm';
# Check for hellish-ness
my $RUNNING_IN_HELL = $^O eq 'MSWin32';
# Get the version
my $DIST_VERSION = do {
require ExtUtils::MM_Unix;
ExtUtils::MM_Unix->parse_version($SPEC_FILE);
};
# Actual mecab version. This is the number up to the second fractional digit
# of the dist version
my $MECAB_VERSION = substr($DIST_VERSION, 0, 4);
# Filenames
my $MECAB_SOURCE_DIR = File::Spec->catfile("src", "mecab-$MECAB_VERSION");
my $MECAB_BASENAME = "mecab-$MECAB_VERSION.tar.gz";
my $MECAB_SOURCE = File::Spec->catfile("src", $MECAB_BASENAME);
inc/Devel/CheckLib.pm view on Meta::CPAN
print $ch qq{#include <$header>\nint main(void) { return 0; }\n};
close($ch);
my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
my @sys_cmd;
# FIXME: re-factor - almost identical code later when linking
if ( $Config{cc} eq 'cl' ) { # Microsoft compiler
require Win32;
@sys_cmd = (@cc, $cfile, "/Fe$exefile", (map { '/I'.Win32::GetShortPathName($_) } @incpaths));
} elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
@sys_cmd = (@cc, (map { "-I$_" } @incpaths), "-o$exefile", $cfile);
} else { # Unix-ish
# gcc, Sun, AIX (gcc, cc)
@sys_cmd = (@cc, $cfile, (map { "-I$_" } @incpaths), "-o", "$exefile");
}
warn "# @sys_cmd\n" if $args{debug};
my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
push @missing, $header if $rv != 0 || ! -x $exefile;
_cleanup_exe($exefile);
unlink $cfile;
}
inc/Devel/CheckLib.pm view on Meta::CPAN
my @libpath = map {
q{/libpath:} . Win32::GetShortPathName($_)
} @libpaths;
@sys_cmd = (@cc, $cfile, "${lib}.lib", "/Fe$exefile",
"/link", @libpath
);
} elsif($Config{cc} eq 'CC/DECC') { # VMS
} elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
my @libpath = map { "-L$_" } @libpaths;
@sys_cmd = (@cc, "-o$exefile", "-l$lib", @libpath, $cfile);
} else { # Unix-ish
# gcc, Sun, AIX (gcc, cc)
my @libpath = map { "-L$_" } @libpaths;
@sys_cmd = (@cc, $cfile, "-o", "$exefile", "-l$lib", @libpath);
}
warn "# @sys_cmd\n" if $args{debug};
my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
push @missing, $lib if $rv != 0 || ! -x $exefile;
_cleanup_exe($exefile);
}
unlink $cfile;
( run in 0.896 second using v1.01-cache-2.11-cpan-64ef6c95b5d )