I wouldn't want a module to silently install the pure-perl code and claim success just because it tripped over some trivial, easily-fixed problem building the XS code
Well, that's a good point. Trying to automatically make it fast could just as easily fail and make it silently not-fast.
What about trying to detect presence of a functioning C compiler during Makefile.PL and then spitting out a dependency on the ::XS variant? Something like:
Are there official methods to detect whether XS is supported by a Perl environment? I thought maybe I could find out whether Devel::CheckLib finds a compiler, but it appears that Devel::CheckLib probably can't be installed unless it does find a compiler. So I can't list Devel::CheckLib as a dependency for a module that I want to be installable on compiler-less perls.
Maybe I shouldn't worry about compiler-less perl environments? (are there any where a compiler *can't* be installed?) and just focus on making sure my module can work properly with fat-packing, since I think that is the main reason that people try to avoid XS dependencies?
In reply to Re^2: How to author a module with optional XS
by NERDVANA
in thread How to author a module with optional XS
by NERDVANA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |