Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Devel-CheckLib for 
openSUSE:Factory checked in at 2022-05-08 21:52:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Devel-CheckLib (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Devel-CheckLib.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Devel-CheckLib"

Sun May  8 21:52:37 2022 rev:12 rq:975434 version:1.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Devel-CheckLib/perl-Devel-CheckLib.changes  
2019-11-17 19:21:13.614915114 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Devel-CheckLib.new.1538/perl-Devel-CheckLib.changes
        2022-05-08 21:52:54.895505590 +0200
@@ -1,0 +2,11 @@
+Thu May  5 03:06:11 UTC 2022 - Tina M??ller <[email protected]>
+
+- updated to 1.16
+   see /usr/share/doc/packages/perl-Devel-CheckLib/CHANGES
+
+  1.16    2022-05-04      Stop all the tests that require a working compiler 
from
+                          skipping on AIX
+
+  1.15    2022-05-04      Refactor, stop GCC optimising away test code
+
+-------------------------------------------------------------------

Old:
----
  Devel-CheckLib-1.14.tar.gz

New:
----
  Devel-CheckLib-1.16.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Devel-CheckLib.spec ++++++
--- /var/tmp/diff_new_pack.0pdwXR/_old  2022-05-08 21:52:55.327506134 +0200
+++ /var/tmp/diff_new_pack.0pdwXR/_new  2022-05-08 21:52:55.331506138 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Devel-CheckLib
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,17 +16,15 @@
 #
 
 
+%define cpan_name Devel-CheckLib
 Name:           perl-Devel-CheckLib
-Version:        1.14
+Version:        1.16
 Release:        0
-%define cpan_name Devel-CheckLib
-Summary:        Check that a library is available
 License:        Artistic-1.0 OR GPL-1.0-or-later
-Group:          Development/Libraries/Perl
-Url:            https://metacpan.org/release/%{cpan_name}
+Summary:        Check that a library is available
+URL:            https://metacpan.org/release/%{cpan_name}
 Source0:        
https://cpan.metacpan.org/authors/id/M/MA/MATTN/%{cpan_name}-%{version}.tar.gz
 Source1:        cpanspec.yml
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
 BuildRequires:  perl(Capture::Tiny)
@@ -39,12 +37,12 @@
 and its headers are available.
 
 %prep
-%setup -q -n %{cpan_name}-%{version}
-find . -type f ! -path "*/t/*" ! -name "*.pl" ! -name "*.sh" ! -path "*/bin/*" 
! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
+%autosetup  -n %{cpan_name}-%{version}
+find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path 
"*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
-make %{?_smp_mflags}
+%make_build
 
 %check
 make test
@@ -55,7 +53,6 @@
 %perl_gen_filelist
 
 %files -f %{name}.files
-%defattr(-,root,root,755)
 %doc CHANGES README TODO VMS-notes
 
 %changelog

++++++ Devel-CheckLib-1.14.tar.gz -> Devel-CheckLib-1.16.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Devel-CheckLib-1.14/CHANGES 
new/Devel-CheckLib-1.16/CHANGES
--- old/Devel-CheckLib-1.14/CHANGES     2019-11-12 06:22:28.000000000 +0100
+++ new/Devel-CheckLib-1.16/CHANGES     2022-05-04 16:31:03.000000000 +0200
@@ -1,3 +1,8 @@
+1.16    2022-05-04      Stop all the tests that require a working compiler from
+                        skipping on AIX
+
+1.15    2022-05-04      Refactor, stop GCC optimising away test code
+
 1.14    2019-11-12      Use Capture::Tiny instead of Capture::Output
 
 1.13    2018-06-23      Improve Makefile.PL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Devel-CheckLib-1.14/META.json 
new/Devel-CheckLib-1.16/META.json
--- old/Devel-CheckLib-1.14/META.json   2019-11-12 06:23:23.000000000 +0100
+++ new/Devel-CheckLib-1.16/META.json   2022-05-04 16:31:40.000000000 +0200
@@ -6,13 +6,13 @@
       "Yasuhiro Matsumoto"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "perl_5"
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec";,
-      "version" : "2"
+      "version" : 2
    },
    "name" : "Devel-CheckLib",
    "no_index" : {
@@ -54,6 +54,6 @@
          "url" : "http://github.com/mattn/p5-Devel-CheckLib";
       }
    },
-   "version" : "1.14",
-   "x_serialization_backend" : "JSON::PP version 2.27400_02"
+   "version" : "1.16",
+   "x_serialization_backend" : "JSON::PP version 4.02"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Devel-CheckLib-1.14/META.yml 
new/Devel-CheckLib-1.16/META.yml
--- old/Devel-CheckLib-1.14/META.yml    2019-11-12 06:23:23.000000000 +0100
+++ new/Devel-CheckLib-1.16/META.yml    2022-05-04 16:31:40.000000000 +0200
@@ -12,7 +12,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 
2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -29,5 +29,5 @@
   perl: '5.00405'
 resources:
   repository: http://github.com/mattn/p5-Devel-CheckLib
-version: '1.14'
+version: '1.16'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Devel-CheckLib-1.14/lib/Devel/CheckLib.pm 
new/Devel-CheckLib-1.16/lib/Devel/CheckLib.pm
--- old/Devel-CheckLib-1.14/lib/Devel/CheckLib.pm       2019-11-12 
06:22:40.000000000 +0100
+++ new/Devel-CheckLib-1.16/lib/Devel/CheckLib.pm       2022-05-04 
16:31:10.000000000 +0200
@@ -5,9 +5,9 @@
 use 5.00405; #postfix foreach
 use strict;
 use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '1.14';
+$VERSION = '1.16';
 use Config qw(%Config);
-use Text::ParseWords 'quotewords';
+use Text::ParseWords qw(quotewords shellwords);
 
 use File::Spec;
 use File::Temp;
@@ -260,21 +260,79 @@
     return(@pieces);
 }
 
+sub _parsewords {
+    return shellwords @_ if $^O ne 'MSWin32';
+    # for Win32, take off "" but leave \
+    map { my $s=$_; $s =~ s/^"(.*)"$/$1/; $s } grep defined && length, 
quotewords '\s+', 1, @_;
+}
+
+sub _compile_cmd {
+    my ($Config_cc, $cc, $cfile, $exefile, $incpaths, $ld, $Config_libs, $lib, 
$libpaths) = @_;
+    my @sys_cmd = @$cc;
+    if ( $Config_cc eq 'cl' ) {                 # Microsoft compiler
+       # this is horribly sensitive to the order of arguments
+       push @sys_cmd,
+           $cfile,
+           (defined $lib ? "${lib}.lib" : ()),
+           "/Fe$exefile",
+           (map '/I'.$_, @$incpaths),
+           "/link",
+           @$ld,
+           _parsewords($Config_libs),
+           (defined $lib ? map '/libpath:'.$_, @$libpaths : ()),
+           ;
+    } elsif($Config_cc =~ /bcc32(\.exe)?/) {    # Borland
+       push @sys_cmd,
+           @$ld,
+           (map "-I$_", @$incpaths),
+           "-o$exefile",
+           (defined $lib ? ((map "-L$_", @$libpaths), "-l$lib") : ()),
+           $cfile,
+           ;
+    } else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ...
+       push @sys_cmd,
+           (map "-I$_", @$incpaths),
+           $cfile,
+           (!defined $lib ? () : (
+             (map "-L$_", @$libpaths),
+             ($^O eq 'darwin' ? (map { "-Wl,-rpath,$_" } @$libpaths) : ()),
+             "-l$lib",
+           )),
+           @$ld,
+           "-o", $exefile,
+           ;
+    }
+    @sys_cmd;
+}
+
+sub _make_cfile {
+    my ($use_headers, $function, $debug) = @_;
+    my $code = '';
+    $code .= qq{#include <$_>\n} for @$use_headers;
+    $code .= "int main(int argc, char *argv[]) { ".($function || 'return 
0;')." }\n";
+    if ($debug) {
+       (my $c = $code) =~ s:^:# :gm;
+       warn "# Code:\n$c\n";
+    }
+    my ($ch, $cfile) = File::Temp::tempfile(
+       'assertlibXXXXXXXX', SUFFIX => '.c'
+    );
+    print $ch $code;
+    close $ch;
+    (my $ofile = $cfile) =~ s/\.c$/$Config{_o}/;
+    ($cfile, $ofile);
+}
+
 sub assert_lib {
     my %args = @_;
-    my (@libs, @libpaths, @headers, @incpaths);
-
-    # FIXME: these four just SCREAM "refactor" at me
-    @libs = (ref($args{lib}) ? @{$args{lib}} : $args{lib}) 
-        if $args{lib};
-    @libpaths = (ref($args{libpath}) ? @{$args{libpath}} : $args{libpath}) 
-        if $args{libpath};
-    @headers = (ref($args{header}) ? @{$args{header}} : $args{header}) 
-        if $args{header};
-    @incpaths = (ref($args{incpath}) ? @{$args{incpath}} : $args{incpath}) 
-        if $args{incpath};
+    $args{$_} = [$args{$_}]
+        for grep $args{$_} && !ref($args{$_}), qw(lib libpath header incpath);
+    my @libs = @{$args{lib} || []};
+    my @libpaths = @{$args{libpath} || []};
+    my @headers = @{$args{header} || []};
+    my @incpaths = @{$args{incpath} || []};
     my $analyze_binary = $args{analyze_binary};
-    my $not_execute = $args{not_execute};
+    my $execute = !$args{not_execute};
 
     my @argv = @ARGV;
     push @argv, _parse_line('\s+', 0, $ENV{PERL_MM_OPT}||'');
@@ -292,15 +350,14 @@
         }
     }
 
-    # using special form of split to trim whitespace
     if(defined($args{LIBS})) {
-        foreach my $arg (split(' ', $args{LIBS})) {
+        foreach my $arg (_parsewords($args{LIBS})) {
             die("LIBS argument badly-formed: $arg\n") unless($arg =~ 
/^-[lLR]/);
             push @{$arg =~ /^-l/ ? \@libs : \@libpaths}, substr($arg, 2);
         }
     }
     if(defined($args{INC})) {
-        foreach my $arg (split(' ', $args{INC})) {
+        foreach my $arg (_parsewords($args{INC})) {
             die("INC argument badly-formed: $arg\n") unless($arg =~ /^-I/);
             push @incpaths, substr($arg, 2);
         }
@@ -315,45 +372,9 @@
     # first figure out which headers we can't find ...
     for my $header (@headers) {
         push @use_headers, $header;
-        my($ch, $cfile) = File::Temp::tempfile(
-            'assertlibXXXXXXXX', SUFFIX => '.c'
-        );
-        my $ofile = $cfile;
-        $ofile =~ s/\.c$/$Config{_o}/;
-        print $ch qq{#include <$_>\n} for @use_headers;
-        print $ch qq{int main(void) { return 0; }\n};
-        close($ch);
+        my ($cfile, $ofile) = _make_cfile(\@use_headers, '', $args{debug});
         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),
-               "/link",
-               @$ld,
-               split(' ', $Config{libs}),
-            );
-        } elsif($Config{cc} =~ /bcc32(\.exe)?/) {    # Borland
-            @sys_cmd = (
-                @$cc,
-                @$ld,
-                (map { "-I$_" } @incpaths),
-                "-o$exefile",
-                $cfile
-            );
-        } else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ...
-            @sys_cmd = (
-                @$cc,
-                (map { "-I$_" } @incpaths),
-                $cfile,
-                @$ld,
-                "-o", "$exefile"
-            );
-        }
+        my @sys_cmd = _compile_cmd($Config{cc}, $cc, $cfile, $exefile, 
\@incpaths, $ld, $Config{libs});
         warn "# @sys_cmd\n" if $args{debug};
         my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
         push @missing, $header if $rv != 0 || ! -f $exefile;
@@ -362,58 +383,13 @@
     }
 
     # now do each library in turn with headers
-    my($ch, $cfile) = File::Temp::tempfile(
-        'assertlibXXXXXXXX', SUFFIX => '.c'
-    );
-    my $ofile = $cfile;
-    $ofile =~ s/\.c$/$Config{_o}/;
-    print $ch qq{#include <$_>\n} foreach (@headers);
-    print $ch "int main(int argc, char *argv[]) { ".($args{function} || 
'return 0;')." }\n";
-    close($ch);
+    my ($cfile, $ofile) = _make_cfile(\@use_headers, @args{qw(function 
debug)});
     for my $lib ( @libs ) {
+        last if $Config{cc} eq 'CC/DECC';          # VMS
         my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . 
$Config{_exe};
-        my @sys_cmd;
-        if ( $Config{cc} eq 'cl' ) {                 # Microsoft compiler
-            require Win32;
-            my @libpath = map { 
-                q{/libpath:} . Win32::GetShortPathName($_)
-            } @libpaths; 
-            # this is horribly sensitive to the order of arguments
-            @sys_cmd = (
-                @$cc,
-                $cfile,
-                "${lib}.lib",
-                "/Fe$exefile", 
-                (map { '/I'.Win32::GetShortPathName($_) } @incpaths),
-                "/link",
-                @$ld,
-                split(' ', $Config{libs}),
-                (map {'/libpath:'.Win32::GetShortPathName($_)} @libpaths),
-            );
-        } elsif($Config{cc} eq 'CC/DECC') {          # VMS
-        } elsif($Config{cc} =~ /bcc32(\.exe)?/) {    # Borland
-            @sys_cmd = (
-                @$cc,
-                @$ld,
-                "-o$exefile",
-                (map { "-I$_" } @incpaths),
-                (map { "-L$_" } @libpaths),
-                "-l$lib",
-                $cfile);
-        } else {                                     # Unix-ish
-                                                     # gcc, Sun, AIX (gcc, cc)
-            @sys_cmd = (
-                @$cc,
-                (map { "-I$_" } @incpaths),
-                $cfile,
-                (map { "-L$_" } @libpaths),
-                "-l$lib",
-                @$ld,
-                "-o", "$exefile",
-            );
-        }
+        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';
+        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) {
@@ -423,24 +399,24 @@
             chmod 0755, $exefile;
             my $absexefile = File::Spec->rel2abs($exefile);
             $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/;
-            if (!$not_execute && system($absexefile) != 0) {
-                push @wrongresult, $lib;
-            }
-            else {
-                if ($analyze_binary) {
-                    push @wronganalysis, $lib if !$analyze_binary->($lib, 
$exefile)
-                }
+            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);
         }
         _cleanup_exe($exefile);
-    } 
+    }
     unlink $cfile;
 
-    my $miss_string = join( q{, }, map { qq{'$_'} } @missing );
+    my $miss_string = join( q{, }, map qq{'$_'}, @missing );
     die("Can't link/include C library $miss_string, aborting.\n") if @missing;
-    my $wrong_string = join( q{, }, map { qq{'$_'} } @wrongresult);
+    my $wrong_string = join( q{, }, map qq{'$_'}, @wrongresult);
     die("wrong result: $wrong_string\n") if @wrongresult;
-    my $analysis_string = join(q{, }, map { qq{'$_'} } @wronganalysis );
+    my $analysis_string = join(q{, }, map qq{'$_'}, @wronganalysis );
     die("wrong analysis: $analysis_string") if @wronganalysis;
 }
 
@@ -459,14 +435,12 @@
         $pdbfile =~ s/$Config{_exe}$/.pdb/;
        push @rmfiles, $ilkfile, $pdbfile;
     }
-    foreach (@rmfiles) {
-       if ( -f $_ ) {
-           unlink $_ or warn "Could not remove $_: $!";
-       }
+    foreach (grep -f, @rmfiles) {
+       unlink $_ or warn "Could not remove $_: $!";
     }
     return
 }
-    
+
 # return ($cc, $ld)
 # where $cc is an array ref of compiler name, compiler flags
 # where $ld is an array ref of linker flags
@@ -474,14 +448,15 @@
     my ($debug, $user_ccflags, $user_ldflags) = @_;
     # Need to use $keep=1 to work with MSWin32 backslashes and quotes
     my $Config_ccflags =  $Config{ccflags};  # use copy so ASPerl will compile
+    $Config_ccflags =~ s:-O\S*::; # stop GCC optimising away test code
     my @Config_ldflags = ();
     for my $config_val ( @Config{qw(ldflags)} ){
         push @Config_ldflags, $config_val if ( $config_val =~ /\S/ );
     }
-    my @ccflags = grep { length } quotewords('\s+', 1, $Config_ccflags||'', 
$user_ccflags||'');
-    my @ldflags = grep { length && $_ !~ m/^-Wl/ } quotewords('\s+', 1, 
@Config_ldflags, $user_ldflags||'');
+    my @ccflags = grep { length } _parsewords($Config_ccflags||'', 
$user_ccflags||'');
+    my @ldflags = grep { length && $_ !~ m/^-Wl/ } 
_parsewords(@Config_ldflags, $user_ldflags||'');
     my @paths = split(/$Config{path_sep}/, $ENV{PATH});
-    my @cc = split(/\s+/, $Config{cc});
+    my @cc = _parsewords($Config{cc});
     if (check_compiler ($cc[0], $debug)) {
        return ( [ @cc, @ccflags ], \@ldflags );
     }
@@ -510,11 +485,10 @@
 {
     my ($compiler, $debug) = @_;
     if (-f $compiler && -x $compiler) {
-       if ($debug) {
-           warn("# Compiler seems to be $compiler\n");
-       }
+       warn "# Compiler seems to be $compiler\n" if $debug;
        return 1;
     }
+    warn "# Compiler was not $compiler\n" if $debug;
     return '';
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Devel-CheckLib-1.14/t/exit_with_message.t 
new/Devel-CheckLib-1.16/t/exit_with_message.t
--- old/Devel-CheckLib-1.14/t/exit_with_message.t       2019-11-12 
06:15:45.000000000 +0100
+++ new/Devel-CheckLib-1.16/t/exit_with_message.t       2022-05-04 
16:30:19.000000000 +0200
@@ -12,7 +12,7 @@
 ENDPRINT
 $fh->close;
 
-my $err = `$^X $fh 2>&1`;
+my $err = `"$^X" $fh 2>&1`;
 
 if($err =~ /Couldn't find your C compiler/) {
     plan skip_all => "Couldn't find your C compiler";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Devel-CheckLib-1.14/t/lib/Helper.pm 
new/Devel-CheckLib-1.16/t/lib/Helper.pm
--- old/Devel-CheckLib-1.14/t/lib/Helper.pm     2019-11-12 06:15:45.000000000 
+0100
+++ new/Devel-CheckLib-1.16/t/lib/Helper.pm     2022-05-04 16:30:24.000000000 
+0200
@@ -43,7 +43,7 @@
     print {$code_fh} "int libversion() { return 42; }\nint foo() { return 0; 
}\n";
     $code_fh->close;
 
-    my $cc = $Config{cc};
+    my $cc = (split(/\s+/, $Config{cc}))[0];
     my $gccv = $Config{gccversion};
     my $rv =
         $cc eq 'gcc'    ? _gcc_lib( $libname )  :
@@ -62,20 +62,19 @@
     my $ar = find_binary('ar') or return;
     my $ranlib = find_binary('ranlib') or return;
     my $ccflags = $Config{ccflags};
-
-    _quiet_system("$cc $ccflags -c ${libname}.c") and return;
-    _quiet_system("$ar rc lib${libname}.a ${libname}.o") and return;
-    _quiet_system("$ranlib lib${libname}.a") and return;
-    return -f "lib${libname}.a"
+    my $libfile = "lib${libname}.a";
+    _quiet_system(qq{"$cc" $ccflags -c ${libname}.c}) and return;
+    _quiet_system($ar, 'rc', $libfile, "${libname}$Config{_o}") and return;
+    _quiet_system($ranlib, $libfile) and return;
+    return -f $libfile
 }
 
 sub _cl_lib {
     my ($libname) = @_;
     my $cc = find_compiler() or return;
     my $ar = find_binary('lib') or return;
-
     _quiet_system($cc, '/c',  "${libname}.c") and return;
-    _quiet_system($ar, "${libname}.obj") and return;
+    _quiet_system($ar, "${libname}$Config{_o}") and return;
     return -f "${libname}.lib";
 }
 
@@ -115,7 +114,14 @@
 }
 
 sub find_compiler {
-    return find_binary($Config{cc});
+    my $result = find_binary($Config{cc});
+    return $result if($result);
+
+    # sometimes $Config{cc} isn't very clean eg it can be 'cc -q32' on AIX
+    return find_binary((split(/\s+/, $Config{cc}))[0])
+        if($Config{cc} =~ /\s/);
+
+    undef;
 }
 
 1; # must be true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Devel-CheckLib-1.14/t/multi-word-compiler.t 
new/Devel-CheckLib-1.16/t/multi-word-compiler.t
--- old/Devel-CheckLib-1.14/t/multi-word-compiler.t     2019-11-12 
06:15:45.000000000 +0100
+++ new/Devel-CheckLib-1.16/t/multi-word-compiler.t     2022-05-04 
16:30:19.000000000 +0200
@@ -20,19 +20,20 @@
     }
 }
 
+my $fake_cc = qq{"$^X" $Config{cc}};
 if ($Mock::Config::VERSION) {
-    Mock::Config->import(cc => "$^X $Config{cc}");
+    Mock::Config->import(cc => $fake_cc);
 }
 elsif (defined($ActivePerl::VERSION) && $Config{cc} =~ /\bgcc\b/) {
     my $obj = tied %Config::Config;
-    $obj->{cc} = "$^X $Config{cc}";
+    $obj->{cc} = $fake_cc;
 }
 else {
-    eval { $Config{cc} = "$^X $Config{cc}"; }
+    eval { $Config{cc} = $fake_cc; }
 }
 
 SKIP: {
     skip "Couldn't update %Config", 1 if $@ =~ /%Config::Config is read-only/;
     eval "use Devel::CheckLib";
-    ok(!$@, "Good multi-word compiler is OK");
+    is $@, "", "Good multi-word compiler is OK";
 }

Reply via email to