--- lib/Devel/CheckLib.pm.orig	2022-05-05 00:31:10.000000000 +1000
+++ lib/Devel/CheckLib.pm	2022-05-29 00:44:19.000000000 +1000
@@ -456,7 +456,11 @@
     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 = _parsewords($Config{cc});
+    my @cc = _parsewords($ENV{CC});
+    if (defined($ENV{CC}) && check_compiler ($cc[0], $debug)) {
+	return ( [ @cc, @ccflags ], \@ldflags );
+    }
+    @cc = _parsewords($Config{cc});
     if (check_compiler ($cc[0], $debug)) {
 	return ( [ @cc, @ccflags ], \@ldflags );
     }
