On Mon, Feb 25, 2008 at 03:59:14PM +0000, Andy Armstrong wrote:
> Is there a generally approved way for an XS module to test for the
> existence of a C compiler before attempting to build?
Personally I'd like such a test to be standard in MakeMaker, because I am
of the (old fashioned) opinion that if %Config says that there is a C
compiler and there isn't one, then it's lying (and the instalation is broken,
for a small value of broken)
Oh, and I don't want wheels re-invented.
> I guess I could just try running whatever $Config{cc} suggests. Are
> there any edge cases that that misses? Does $(CC) -o foo.o foo.c work
> just about everywhere?
Not sure. Certainly don't test that there is a file of that name in $PATH,
as it's acceptable for it to be a series of shell commands.
Also, you're already making assumptions about object file extension.
You can get that from $Config:
$ perl -V:obj_ext
obj_ext='.o';
Nicholas Clark