Compiling Libraries, part II

In a previous post I wrote about the lack of a Perl module to build standalone C libraries. I suggested the creation of a new module, and I did it. I have my first working code available at github. I am happy to add patches as far as the main objective of the module remains intact.

At the moment I tested it with Mac OS X (Leopard) and Windows (with Strawberry Perl). In both cases, with Perl 5.12.x. So, the Build.PL might be missing a Perl version if there is anything that doesn't work on previous Perl versions.

Also, documentation is still missing. Refer to test 01-simple.t for directions on how to use it.

3 Comments

Call me a purist, but I disagree with the principle of taking a non-Perl C library and bundling the code with a Perl module. You haven't fundamentally solved anything, because that C library will almost certainly have its own dependencies, you've simply moved the goal posts.

Instead, I do it like this:

http://cpansearch.perl.org/src/PEVANS/Term-TermKey-0.06/Build.PL

Were I to bundle the termkey.tar.gz source in the Perl module, I fundamentally made it any easier. That library still depends on its own build-time deps (likely a few rounds of apt-get install libfoo-dev or similar).

Ahhh.. I see. Then yes, that makes much more sense that way.

Leave a comment

About Alberto Simões

user-pic I blog about Perl. D'uh!