Alien-MeCab

 view release on metacpan or  search on metacpan

inc/Devel/CheckLib.pm  view on Meta::CPAN

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
    # 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;
}
 
# now do each library in turn with no headers
my($ch, $cfile) = File::Temp::tempfile(
    'assertlibXXXXXXXX', SUFFIX => '.c'
);
print $ch "int main(void) { return 0; }\n";

inc/Devel/CheckLib.pm  view on Meta::CPAN

210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
            );
        } 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 )