Just to give people an update, I looked into ExtUtils::MM and wrote the correct Makefile.PL that works for building a SWIG Perl module and recommended on the SWIG user list that I talked to people on Perlmonks and they recommended what you wrote on this thread.

I was criticized by a person on the list saying "why in the world would you recommend using ExtUtils::MM that's so 15 years ago, you should use Module::Build, Module::Install or Dist::Zilla". I told him just because ExtUtils::MM is older for these purposes its just as capable and suitable as all the others mentioned. There are probably other reasons all of you mentioned using it instead of the others, even though the others are newer and have certain advantages.

I was then criticized for recommending that SWIG should auto-generate the Makefile.PL as it already auto-generates wrapper code and such. The reason was that SWIG doesn't generate any of these build helper files for the other languages (like the ant file for Java for example) then it shouldn't do it for Perl.

Sometimes I think why do I even try to help? This all started because the Perl quick start tutorial on the SWIG web site didn't even work and wasn't correct for building C/C++ code modules in Perl (and just to add that list user who said these recommendations are stupid never bothered to help and fix the tutorial!). So I fixed it by examining how ExtUtils::MM and others compile and link C/C++ code in Perl and as you guys know I recommended replacing the bad tutorial commands with those commands above. You guys then went one step further and recommended to me that its more robust to use a Makefile.PL and let ExtUtils::MM deal with the commands as it will do it better for each particular Perl installation, OS, environment, etc.

So these recommendations were made and I just get shut down. The user who said it was stupid to auto-generate a Makefile.PL said that people will just write what they want manually and they don't need it anyway. But I say why can't SWIG just generate a minimum correct Makefile.PL or Build.PL that by itself would at least correctly build the SWIG code since it auto-generates other code and files? Users can add/change to it if they want. I mean how hard is that? SWIG generates these other code files that need to be compiled and linked properly and nothing in order to do that. I totally disagree with this person that if you have a development tool that more easily integrates C/C++ code with your target language shouldn't it also come with the minimum file to properly build your code?

I don't think that if SWIG doesn't do it for any language that it shouldn't start. Thoughts?


In reply to Re: Updating broken and possibly incomplete SWIG Perl module building tutorial on SWIG web site by hermida
in thread Updating broken and possibly incomplete SWIG Perl module building tutorial on SWIG web site by hermida

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.