Skip Menu |

This queue is for tickets about the Devel-CheckLib CPAN distribution.

Report information
The Basics
Id: 61297
Status: resolved
Priority: 0/
Queue: Devel-CheckLib

People
Owner: Nobody in particular
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.7
Fixed in: (no value)



Subject: no way to test for dependent headers
Some libraries have headers that depend on either standard headers or other library headers. eg. libjpeg jpeglib.h requires size_t but doesn't include stddef.h itself. The solution I'll be using in Imager is as below, supplying the headers to test in order of dependence. Index: inc/Devel/CheckLib.pm =================================================================== --- inc/Devel/CheckLib.pm (revision 1824) +++ inc/Devel/CheckLib.pm (working copy) @@ -234,11 +234,14 @@ my @wrongresult; # first figure out which headers we can't find ... + my @use_headers; for my $header (@headers) { + push @use_headers, $header; my($ch, $cfile) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c' ); - print $ch qq{#include <$header>\nint main(void) { return 0; }\n}; + print $ch qq{#include <$_>\n} for @use_headers; + print $ch qq{int main(void) { return 0; }\n}; close($ch); my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe}; my @sys_cmd;
Hi. Your patch seems ok to me. I'll include it. Thanks. On 2010-9月-13 月 06:10:56, TONYC wrote: Show quoted text
> Some libraries have headers that depend on either standard headers or > other library headers. eg. libjpeg jpeglib.h requires size_t but > doesn't include stddef.h itself. > > The solution I'll be using in Imager is as below, supplying the
headers Show quoted text
> to test in order of dependence. > > Index: inc/Devel/CheckLib.pm > =================================================================== > --- inc/Devel/CheckLib.pm (revision 1824) > +++ inc/Devel/CheckLib.pm (working copy) > @@ -234,11 +234,14 @@ > my @wrongresult; > > # first figure out which headers we can't find ... > + my @use_headers; > for my $header (@headers) { > + push @use_headers, $header; > my($ch, $cfile) = File::Temp::tempfile( > 'assertlibXXXXXXXX', SUFFIX => '.c' > ); > - print $ch qq{#include <$header>\nint main(void) { return 0;
}\n}; Show quoted text
> + print $ch qq{#include <$_>\n} for @use_headers; > + print $ch qq{int main(void) { return 0; }\n}; > close($ch); > my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . > $Config{_exe}; > my @sys_cmd;