Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Updating broken and possibly incomplete SWIG Perl module building tutorial on SWIG web site

by educated_foo (Vicar)
on Mar 26, 2011 at 18:44 UTC ( [id://895682]=note: print w/replies, xml ) Need Help??


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

... use a Makefile.PL ...
This is really the best option, and it's not hard once you figure out which of ExtUtils::MakeMaker's many options to tweak:
use ExtUtils::MakeMaker; WriteMakefile( NAME => 'YourModule', OBJECT => 'YourModule_wrap.o', # Add extra include paths here, if needed # INC => '-I/path/to/include', # Add shared and static libraries here, if needed # LDFROM => 'YourModule_wrap.o -L/path/to/lib -lyourmodule', );
Basically, you add Foo_wrap.o to OBJECT, and possibly modify INC and LDFROM if you're compiling against a C library. SWIG could/should even generate a basic Makefile.PL when it generates the wrapper code.
  • Comment on Re^2: Updating broken and possibly incomplete SWIG Perl module building tutorial on SWIG web site
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: Updating broken and possibly incomplete SWIG Perl module building tutorial on SWIG web site
by hermida (Scribe) on Mar 30, 2011 at 09:39 UTC
    Thanks guys for the insightful input, I agree a more robust and elegant end solution would be to have SWIG auto-generate the appropriate Makefile.PL (or Build.PL) that will then be used to do the compilation and linking properly for one's environment.

    I will work on this and present it to the SWIG people. For the time being they have at least updated the Perl quick tutorial which was broken to what I proposed and this has been tested. I know its only for systems with gcc but that is what their original commands had anyway so I guess no harm done.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://895682]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found