Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Updating broken and possibly incomplete SWIG Perl module building tutorial on SWIG web siteby hermida (Scribe) |
on Mar 25, 2011 at 14:33 UTC ( [id://895499]=perlquestion: print w/replies, xml ) | Need Help?? |
hermida has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone,
I submitted on the SWIG forums a request to update the Perl Module Building Tutorial for SWIG on their web site. The current tutorial doesn't even work when followed and the gcc compile and link commands appear to be incorrect when working with Perl. The current tutorial commands are: First write or have your C code e.g. example.c then write the SWIG interface file for this code e.g. example.i. Then run the following:
First thing I want to verify with everyone is that when you compile and link C/C++ code with XS that the compile and linking flags should be the same as those used to build Perl itself, is this correct? I believe so and the tutorial commands are not complete, actually they don't work as written. I reviewed how CPAN modules with C code are regularly built during installation using ExtUtils::MakeMaker and they appear to always be at minimum like this: So the new commands I proposed for SWIG are: Any thoughts? Could it be done better or differently? I looked at ExtUtils::Embed but it doesn't seem to have Thanks to all the Perl monks on chatterbox for answering questions and telling me about Config.pm, Intrepid MidLifeXis and others...
Back to
Seekers of Perl Wisdom
|
|