Beatnik has asked for the wisdom of the Perl Monks concerning the following question:

Hey,
I've been getting reports from testers.cpan.org about modules I have on CPAN. One module report in particular contains errors about loading gdlib. I'm using libgd 2.07 in the current release of the module. How can I assure the user has that certain C library installed, similar as the PREREQ_PM option in a general Makefile.PL. The testers.cpan.org report can be found here. It's saying something about having a
PREREQ_PM => { 'auto::Image::Filter::newFromJpeg.al' => '0', # or a minimum wo +rkable version
but I'm not sure how this will help me get a mimimum required gdlib. Any help is appreciated :)

Greetz
Beatnik
...Perl is like sex: if you're doing it wrong, there's no fun to it.

Replies are listed 'Best First'.
Re: C lib prereq in Makefile.PL
by fokat (Deacon) on Nov 29, 2002 at 00:36 UTC
    Your best bet here, is to add some custom Perl code before the invocation to the MakeMaker code, which looks for the library. You could try driving a compilation of a small C program that attempts to use the features you need. If it fails, you can bail out with an error or explanation stating what the user needs to do.

    Best regards

    -lem, but some call me fokat

Re: C lib prereq in Makefile.PL
by mpeppler (Vicar) on Nov 29, 2002 at 21:24 UTC
    I use strings | grep to check the version of the Sybase libs in DBD::Sybase and sybperl, which of course isn't portable to Win32 systems...

    The suggestion to build a minimal C program that checks the version is probably better as it should be portable to just about any environment.

    Michael