summaryrefslogtreecommitdiff
blob: 6092d3a1e98092adc2612dbd2c2d7a458ce728e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From d970fc512ecef1b78418156dba34cf6e77e41f94 Mon Sep 17 00:00:00 2001
From: Alessandro Decina <alessandro.d@gmail.com>
Date: Sat, 28 Dec 2013 15:10:09 +0100
Subject: configure: fix libjpeg check

We were setting HAVE_JPEG=no JPEG_LIBS=-ljpeg if libjpeg wasn't found. Unset
JPEG_LIBS too so that linking doesn't fail.

diff --git a/configure.ac b/configure.ac
index 6ccb1aa..c4e8e9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -862,12 +862,18 @@ AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
 JPEG_LIBS="$LIBS -ljpeg-mmx"
 LIBS="$OLD_LIBS"
 if test x$HAVE_JPEG != xyes; then
-  AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
   JPEG_LIBS="-ljpeg"
-  AC_DEFINE(HAVE_JPEG, [1] , [Use libjpeg])
+  AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
+fi
+
+if test x$HAVE_JPEG = xyes; then
+  AC_DEFINE(HAVE_JPEG, [1], [Use libjpeg])
+else
+  AC_DEFINE(HAVE_JPEG, [0], [Use libjpeg])
+  JPEG_LIBS=
 fi
-AC_SUBST(HAVE_JPEG)
 AC_SUBST(JPEG_LIBS)
+AC_SUBST(HAVE_JPEG)
 AM_CONDITIONAL(HAVE_JPEG, test "x$HAVE_JPEG" = "xyes")
 
 
-- 
cgit v0.10.2