Subject: | Configuration fails on debian systems with libjpeg62-turbo installed |
On a debian/jessie system with libjpeg62-turbo-dev installed:
$ perl5.22.2 Makefile.PL
Unable to read /usr/include/jconfig.h
Problem is that jconfig.h is in an architecture-dependent directory, unlinke jpeglib.h and the other header files:
...
/usr/include/jpeglib.h
/usr/include/jmorecfg.h
/usr/include/jerror.h
/usr/include/jpegint.h
/usr/include/x86_64-linux-gnu/jconfig.h
...
I tried a workaround to this problem (see patch below) --- this helps to get me through the configuration and build phase, but tests fail. I think the problem here is that the jpeg version is 62, but the generated images do not match.
Regards,
Slaven
diff --git a/Makefile.PL b/Makefile.PL
index c74fd3c..d08b708 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -105,7 +105,18 @@ for my $incdir ( $jpeg_inc, @check ) {
$JPEG_VERSION = _re_find( catfile($incdir, 'jpeglib.h'), qr/JPEG_LIB_VERSION\s+(\d+)/ ) || 'unknown';
if ( $JPEG_VERSION eq 'unknown' ) {
# Also check jconfig.h as it contains the version when using libjpeg-turbo
- $JPEG_VERSION = _re_find( catfile($incdir, 'jconfig.h'), qr/JPEG_LIB_VERSION\s+(\d+)/ ) || 'unknown';
+ TRY: {
+ for my $h_candidate (
+ catfile($incdir, 'jconfig.h'),
+ catfile($incdir, 'x86_64-linux-gnu', 'jconfig.h'),
+ ) {
+ if (-r $h_candidate) {
+ $JPEG_VERSION = _re_find( $h_candidate, qr/JPEG_LIB_VERSION\s+(\d+)/ );
+ last TRY if $JPEG_VERSION;
+ }
+ }
+ $JPEG_VERSION = 'unknown';
+ }
}
}