in reply to Re: How to know if a CPAN module uses XS
in thread How to know if a CPAN module uses XS

I think the first difficulty (not necessarily a show-stopper) I see with that approach is that it relies on WriteMakefile() being run.
However, some Makefile.PL's may abort prior to that happening - eg because $] is too low, or because $^O is inappropriate, or because some pre-requisite could not be found.

Handle that, and you're probably on a winner.
It may even be that if $] is too low or $^O is inappropriate, then you don't even need to know whether the module needs to be compiled ... and if the Makefile.PL aborts because a pre-requisite C library can't be found, then it should be safe to assume it's a module that needs compiling. But if the Makefile.PL aborts because a pre-requisite perl module could not be found, then all bets are off. (I've a notion that there are some modules that do that, though I can't provide an example.)

then do backticks on your make tool running in "list commands and do not execute" mode

And then there's Inline/Inline::C ... run make in "list commands and do not execute" mode when building Inline/Inline::C and you'll see no mention of any compiler. (But perhaps that's the right result anyway ... not sure about that one.)

And, of course, not every distro has a Makefile.PL - and there's presumably a need to handle them, too. (That's the beauty of having a choice of 2 build systems - instead of solving a problem once, you get the added joy of having to solve it twice :-)

Cheers,
Rob
  • Comment on Re^2: How to know if a CPAN module uses XS

Replies are listed 'Best First'.
Re^3: How to know if a CPAN module uses XS
by bulk88 (Priest) on Jun 20, 2012 at 10:59 UTC