Alien-MeCab
view release on metacpan or search on metacpan
inc/Devel/CheckLib.pm view on Meta::CPAN
177178179180181182183184185186187188189190191192193194195196197198
# FIXME: re-factor - almost identical code later when linking
if
(
$Config
{cc} eq
'cl'
) {
# Microsoft compiler
@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
;
}
# now do each library in turn with no headers
my
(
$ch
,
$cfile
) = File::Temp::tempfile(
'assertlibXXXXXXXX'
,
SUFFIX
=>
'.c'
);
$ch
"int main(void) { return 0; }\n"
;
inc/Devel/CheckLib.pm view on Meta::CPAN
210211212213214215216217218219220221222223224225226227228229230231
);
}
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
;
my
$miss_string
=
join
(
q{, }
,
map
{
qq{'$_'}
}
@missing
);
die
(
"Can't link/include $miss_string\n"
)
if
@missing
;
}
sub
_cleanup_exe {
( run in 0.234 second using v1.01-cache-2.11-cpan-cba739cd03b )