The Template Toolkit handles this with a command line option to Makefile.PL where you can build the toolkit with compiled code if the compiler is available. I don't think it has automatic detection as well, but it might. In any case you might want to consult with the Template Toolkit authors. Their mailing list is: http://mail.template-toolkit.org/mailman/listinfo/templates
If you come up with a better solution, Template Toolkit might want to use it as well. On Tue, Oct 13, 2009 at 3:17 AM, O. STeffen BEYer <ost...@gmail.com> wrote: > > Dear Perl module authors, > > what would be the best way to detect whether a working C compiler is > available at build time of a module (i.e., in Makefile.PL)? > > I would like to install a (faster) XS version of a module if that is > the case, and a (slower) pure-Perl implementation if not. > > Remember that C compilers are not always available on all systems. > Sometimes they cost heavy extra money, or sometimes you have to work with > what's there on a customer's or provider's server (where frequently > installing a C compiler is not an option due to company policies). > > Thank you! > > Best regards, > > Steffen Beyer > > http://www.engelschall.com/u/sb/download/ > > http://search.cpan.org/author/STBEY > > -- Check out my LEGO blog at http://www.brickpile.com/ View my photos at http://flickr.com/photos/billward/ Follow me at http://twitter.com/williamward