On Mon, 19 Jan 2009, David Golden wrote: > On Mon, Jan 19, 2009 at 6:30 AM, Martin Evans > <martin.ev...@easysoft.com>wrote: > > > I didn't get the impression this person was doing a single report - he is > > 16th on the leader board of test submissions. If the C compiler is not set > > up properly (and see below because I did not generate the compiler error) he > > could generate thousands of UNKNOWN for any module that has XS - does not > > seem any point in that. > > > > There's a debate at the moment on #p5p about whether it's an error to have > $Config{cc} and not have the named compiler. If so, every AS perl is > "broken".
This would be trivial to change. ActivePerl already determines the value of $Config{cc} dynamically. It sets it to 'gcc' if cl.exe can't be found on the PATH but gcc.exe is there. When neither is found $Config{cl} remains at 'cl', indicating the compiler this version of Perl was built with. Setting it to '' or even undef instead would be trivial. However: > There *is* a point -- it's how well does a distribution that requires a > compiler deal with the situation where a compiler doesn't exist. Does it > die with a reasonable error to a user? Or does it fail with something > unintelligible. It's just a prerequisite like any other. Right now you'll get a nice explanation from MakeMaker that your compiler is set to Microsoft's Visual Studio compiler, but your LIB and INCLUDE variables haven't been set up to match. It then doesn't generate a Makefile at all. If you set $Config{cc} to the empty string MakeMaker will blindly insert this into the generated Makefile and you get a bunch of warnings when you run `nmake` that the '-c' command cannot be found. If the "broken" version produces a sensible error message, and the "correct" version produces a bunch of gibberish, then I prefer the brokenness. I'm happy to get ActivePerl to change the value of $Config{cc} when no compiler is found once the build tools do something sensible with an empty setting. Cheers, -Jan