Here is just one example of the commands when installing a CPAN module and using ExtUtils::MakeMaker:
/home/hermida/soft/perl/5.12.3/bin/perl /home/hermida/soft/perl/5.12.3 +/lib/5.12.3/ExtUtils/xsubpp -noprototypes -typemap /home/hermida/soft +/perl/5.12.3/lib/5.12.3/ExtUtils/typemap -typemap typemap Expat.xs > + Expat.xsc && mv Expat.xsc Expat.c gcc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-p +rotector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS +=64 -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-prot +ector --param=ssp-buffer-size=4 -m64 -mtune=native -march=native -g - +DVERSION=\"2.40\" -DXS_VERSION=\"2.40\" -fPIC "-I/home/hermida/soft/p +erl/5.12.3/lib/5.12.3/x86_64-linux-thread-multi/CORE" Expat.c gcc -shared -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fsta +ck-protector --param=ssp-buffer-size=4 -m64 -mtune=native -march=nati +ve -g Expat.o -o ../blib/arch/auto/XML/Parser/Expat/Expat.so

This is how all CPAN Perl modules with C + XS code compile and link (yes some have some extra flags that are just relevant to that particular module, but the all have these as the basis). The first command is not necessary for SWIG as you already have the C code and as I showed before swig -perl example.i autogenerates XS and .pm and other wrapping C code automatically. Let's breakdown the above parts that ExtUtils::MakeMaker created for this command:

gcc -c [Config-ccflags] [Config-optimize] [Config-cccdlflags] "-I[Conf +ig-archlib]/CORE" module.c gcc [Config-lddlflags] module.o -o module.so

This creates everything you need to create the Perl module and has been tested successfully by me and by SWIG people just yesterday. We ran Perl code using the modules and they work perfectly.

Please tell me why this is wrong in detail.

In reply to Re^2: 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.