WriteMakefile returns a MM object which has has_link_code and needs_linking. Somehow calling these are your safest bet. If I had to try and do it, I would copy EUMM's WriteMakefile into my script, switch packages, define a new WriteMakefile based off EUMM's but without the flush() at the end, switch packages back to main, , run the makefile.pl with a do(), intercept the returning MM obj in my WriteMakefile, and call needs_linking(). The most complex use of EUMM I've ever seen was in Perl TK, and I did something similar to what I described to you to intercept Tk::MMutil::TkExtMakefile. Note this is not a "static" way of determining whether it needs to be compile, so security issues might be a problem for you.

Another solution would be to generate the makefile, then do backticks on your make tool running in "list commands and do not execute" mode, then parse that looking for your local C compiler.

In reply to Re: How to know if a CPAN module uses XS by bulk88
in thread How to know if a CPAN module uses XS by bcarroll

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.