Devel-CheckLib

 view release on metacpan or  search on metacpan

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

        my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
        my @sys_cmd = _compile_cmd($Config{cc}, $cc, $cfile, $exefile, \@incpaths, $ld, $Config{libs}, $lib, \@libpaths);
        warn "# @sys_cmd\n" if $args{debug};
        local $ENV{LD_RUN_PATH} = join(":", grep $_, @libpaths, $ENV{LD_RUN_PATH}) unless $^O eq 'MSWin32' or $^O eq 'darwin';
        local $ENV{PATH} = join(";", @libpaths).";".$ENV{PATH} if $^O eq 'MSWin32';
        my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
        if ($rv != 0 || ! -f $exefile) {
            push @missing, $lib;
        }
        else {
            chmod 0755, $exefile;
            my $absexefile = File::Spec->rel2abs($exefile);
            $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/;
            warn "# Execute($execute): $absexefile\n" if $args{debug};
            if ($execute) {
                my $retval = system($absexefile);
                warn "# return value: $retval\n" if $args{debug};
                push @wrongresult, $lib if $retval != 0;
            }
            push @wronganalysis, $lib
                if $analyze_binary and !$analyze_binary->($lib, $exefile);



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