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;