Skip Menu |

This queue is for tickets about the Devel-CheckLib CPAN distribution.

Report information
The Basics
Id: 91771
Status: open
Priority: 0/
Queue: Devel-CheckLib

People
Owner: Nobody in particular
Requestors: PLICEASE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.01
Fixed in: (no value)



Subject: can't find gcc-4 on cygwin
The latest version in CPAN doesn't appear able to find my compiler. It is looking for gcc-4.exe, but on my system gcc-4 is a symlink to gcc.exe fs01% dir /usr/bin/gcc-4 lrwxrwxrwx 1 ollisg None 7 Sep 13 10:42 /usr/bin/gcc-4 -> gcc.exe* thus, no gcc-4.exe fs01% perl -MDevel::CheckLib Couldn't find your C compiler Compilation failed in require. BEGIN failed--compilation aborted.
On 2013-12月-31 火 16:53:50, PLICEASE wrote: Show quoted text
> The latest version in CPAN doesn't appear able to find my compiler. > It is looking for gcc-4.exe, but on my system gcc-4 is a symlink to > gcc.exe > > fs01% dir /usr/bin/gcc-4 > lrwxrwxrwx 1 ollisg None 7 Sep 13 10:42 /usr/bin/gcc-4 -> gcc.exe* > > thus, no gcc-4.exe > > fs01% perl -MDevel::CheckLib > Couldn't find your C compiler > Compilation failed in require. > BEGIN failed--compilation aborted.
You need to update $Config{cc} ?
On Tue Apr 22 23:44:37 2014, mattn wrote: Show quoted text
> > > You need to update $Config{cc} ?
Actually cc is already set to gcc-4 (no suffix): fs01% perl -MConfig= -E 'say $Config{cc}' gcc-4
The attached diff fixes this issue for me. Appending $Config{_exe} is unnecessary on cygwin, since -x works with or without the extension if it is present, but only without it if testing a symlink. An alternate fix would be to check both with and without appending $Config{_exe}. observe: fs01% ls -l /bin/cpp* -rwxr-xr-x 1 ollisg None 694301 Dec 6 07:51 /bin/cpp.exe* fs01% perl -E 'say "yes" if -x "/usr/bin/cpp.exe"' yes fs01% perl -E 'say "yes" if -x "/usr/bin/cpp"' yes
Subject: Devel-CheckLib.diff
diff --git a/lib/Devel/CheckLib.pm b/lib/Devel/CheckLib.pm index f80ca22..8581039 100644 --- a/lib/Devel/CheckLib.pm +++ b/lib/Devel/CheckLib.pm @@ -374,7 +374,7 @@ sub _findcc { my @cc = split(/\s+/, $Config{cc}); return ( [ @cc, @ccflags ], \@ldflags ) if -x $cc[0]; foreach my $path (@paths) { - my $compiler = File::Spec->catfile($path, $cc[0]) . $Config{_exe}; + my $compiler = File::Spec->catfile($path, $cc[0]) . ($^O eq 'cygwin' ? '' : $Config{_exe}); return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags) if -x $compiler; }
this appears to have been fixed as of 1.02.
From: Lance
This bug is still affecting me even though I have the "my $compiler = File::Spec->catfile($path, $cc[0]) . ($^O eq 'cygwin' ? '' : $Config{_exe});" fix. I was able to get past it by deleting the symlink and instead making gcc-4 a hardlink to gcc.