From 7e2b65b6650caa393342c0350fc60c317a7f89af Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Wed, 29 Jul 2020 12:09:08 +1200 Subject: Hack around bad toolchain handling in tests Bug: https://github.com/mattn/p5-Devel-CheckLib/issues/32 --- t/lib/Helper.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/lib/Helper.pm b/t/lib/Helper.pm index f298c71..0ebc56e 100644 --- a/t/lib/Helper.pm +++ b/t/lib/Helper.pm @@ -46,9 +46,9 @@ sub create_testlib { my $cc = $Config{cc}; my $gccv = $Config{gccversion}; my $rv = - $cc eq 'gcc' ? _gcc_lib( $libname ) : - $cc eq 'cc' ? _gcc_lib( $libname ) : - $cc eq 'cl' ? _cl_lib( $libname ) : + $cc =~ /gcc\z/ ? _gcc_lib( $libname ) : + $cc =~ /cc\z/ ? _gcc_lib( $libname ) : + $cc =~ /cl\z/ ? _cl_lib( $libname ) : $gccv ? _gcc_lib( $libname ) : undef ; @@ -59,8 +59,8 @@ sub create_testlib { sub _gcc_lib { my ($libname) = @_; my $cc = find_compiler() or return; - my $ar = find_binary('ar') or return; - my $ranlib = find_binary('ranlib') or return; + my $ar = find_binary($ENV{AR} ? $ENV{AR} : 'ar') or return; + my $ranlib = find_binary($ENV{RANLIB} ? $ENV{RANLIB} : 'ranlib') or return; my $ccflags = $Config{ccflags}; _quiet_system("$cc $ccflags -c ${libname}.c") and return; -- 2.27.0