in reply to Detect library in Makefile.PL

It's intended that Devel::CheckLib can help with this. I haven't taken a close look - ymmv.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Detect library in Makefile.PL
by andreas1234567 (Vicar) on Nov 13, 2008 at 12:25 UTC
    Devel::CheckLib looks promising, but it silently converts gcc's compiling errors to "Can't link/include":
    use strict; use warnings; use Devel::CheckLib; our $debug ||= 0; my @headers = qw ( php_main.h ); my @incpath = qw( /usr/local/include /usr/local/include/php /usr/local/include/php/main /usr/local/include/php/TSRM /usr/local/include/php/Zend /usr/local/include/php/ext /usr/local/include/php/ext/date/lib ); check_lib_or_exit( header => \@headers, incpath => \@incpath, debug => $debug, ); __END__
    $ perl -sl devel.checklib.pl Can't link/include 'php_main.h' $ perl -sl devel.checklib.pl -debug 1 # /usr/bin/gcc assertlibSu6peu8p.c -I/usr/local/include -I/usr/local/i +nclude/php -I/usr/local/include/php/main -I/usr/local/include/php/TSR +M -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/l +ocal/include/php/ext/date/lib -o assertlib27VD0sdi In file included from /usr/local/include/php/Zend/zend_globals.h:28, from /usr/local/include/php/main/php_main.h:25, from assertlibSu6peu8p.c:1: /usr/local/include/php/Zend/zend_globals_macros.h: In function `BEGIN_ +EXTERN_C':/usr/local/include/php/Zend/zend_globals_macros.h:37: error +: storage class specified for parameter `ZEND_API' /usr/local/include/php/Zend/zend_globals_macros.h:37: error: syntax er +ror before "struct"
    Is it a bug, or am I missing something?
    --
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]