summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-25 21:41:17 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-11-03 22:02:49 +0100
commitea00220b6f44a00c2efa792c538f1804ebe183c2 (patch)
tree6963c78b1c21441bfad8e3f181862837b38df413 /configure.ac
parent9878f31b79bd0dcc9c6ae7ab7083410c30bbd404 (diff)
downloadlibgphoto2-ea00220b6f44a00c2efa792c538f1804ebe183c2.tar.gz
Update the checks for libjpeg (GP_LIBJPEG)
Update the checks for libjpeg to try libjpeg.pc with PKG_CHECK_MODULES first, and also to allow explicitly set LIBJPEG_CFLAGS and LIBJPEG_LIBS. The old detection logic did not allow specifying the location of libjpeg at all. It only allowed either disabling libjpeg or using libjpeg from the default include and linker paths. So this also changes the places in the Makefiles where we used to add @LIBJPEG@ to the linker to both link with $(LIBJPEG_LIBS) and compile with $(LIBJPEG_CFLAGS). The new configure logic keeps --without-jpeg to force- disable libjpeg, but updates the detection of libjpeg to first try the LIBJPEG_* variables if given, otherwise try PKG_CHECK_MODULES for libjpeg, and only then falls back to the old way of just trying the default include and link locations for libjpeg. This mentions more information in the configure summary if not building with libjpeg. This is the first time we make it possible to build with libjpeg from e.g. FreeBSD ports' or MacOS homebrew's jpeg-turbo packages.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 4 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 2c1607e74..d235f9f0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -310,22 +310,10 @@ dnl AC_MSG_ERROR([gp-set.m4 testsuite done.])
dnl ---------------------------------------------------------------------------
-dnl check for libjpeg
-dnl ---------------------------------------------------------------------------
-LIBJPEG=""
-libjpeg_msg="no"
-AC_SUBST(LIBJPEG)
-AC_ARG_WITH([jpeg], AS_HELP_STRING([--without-jpeg], [Build without jpeg library (default: no)]))
-AS_IF([test "x$with_jpeg" != "xno"], [
- AC_CHECK_LIB(jpeg,jpeg_start_decompress,[
- AC_CHECK_HEADER(jpeglib.h,[
- AC_DEFINE(HAVE_LIBJPEG,1,[define if we found LIBJPEG and its headers])
- LIBJPEG="-ljpeg"
- libjpeg_msg="yes"
- ])
- ])
-])
-GP_CONFIG_MSG([JPEG mangling support],[${libjpeg_msg}])
+dnl libjpeg (from libjpeg-turbo or a number of other implementations)
+dnl ---------------------------------------------------------------------------
+GP_LIBJPEG
+
dnl ---------------------------------------------------------------------------
dnl check for ws2_32