NAME
Devel::AssertLib - check that a library is available
DESCRIPTION
Devel::AssertLib is a perl module that checks whether a particular C library is available, and dies if it is not.
SYNOPSIS
use Devel::AssertLib (
lib => 'jpeg'
);
print "You can link to libjpeg\n";
HOW IT WORKS
Everything is done at module 'use' time. You pass named parameters describing how to build and link to the library. Currently the only parameter supported is 'lib', which can be a string or an arrayref of several libraries. In the future, expect me to add something for checking that header files are available as well.
It works by trying to compile this:
int main(void) { return 0; }
and linking it to the specified libraries. If something pops out the end which looks executable, then the module simply returns. If not, it dies.
As a shiny side-effect, you can also check to see if the C compiler works by simply not passing any 'lib' option.
PLATFORMS SUPPORTED
You must have a C compiler installed. We assume that we will find either cc
or gcc
in the $PATH and simply use that.
Probably contains unsupportable assumptions about how to invoke the compilers and stuff.
WARNINGS, BUGS and FEEDBACK
This is a very early release intended primarily for feedback from people who have discussed it. The interface may change and it has not been adequately tested.
I welcome feedback about my code, including constructive criticism. Bug reports should be made using http://rt.cpan.org/ or by email.
If you are feeling particularly generous you can encourage me in my open source endeavours by buying me something from my wishlist: http://www.cantrell.org.uk/david/wishlist/
SEE ALSO
AUTHOR
David Cantrell <david@cantrell.org.uk>
Thanks to the cpan-testers-discuss mailing list for prompting me to write it in the first place.
COPYRIGHT and LICENCE
Copyright 2007 David Cantrell
This module is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself.
CONSPIRACY
This module is also free-as-in-mason software.