summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2016-12-03 02:18:58 +0100
committerAlbert Astals Cid <aacid@kde.org>2016-12-03 02:18:58 +0100
commit21cd08e34bd317b2ecc7c8b4e0d122d85bdf6714 (patch)
tree8f431397b731eefd88084292286e6ced864901c1
parentb5f3e935c3a1f4824fcd681e291c35852966bb45 (diff)
Default to libopenjpeg2 instead of libopenjpeg1
Tested 2.1.1 and it's better or equal than the old libopenjpeg1 I thought of doing a version check but i don't think it's common someone will be building a new poppler with an old libopenjpeg2
-rw-r--r--CMakeLists.txt16
-rw-r--r--configure.ac31
2 files changed, 24 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c25e961f..6e0340b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -168,13 +168,13 @@ set(USE_OPENJPEG1 FALSE)
set(USE_OPENJPEG2 FALSE)
set(WITH_OPENJPEG FALSE)
if(ENABLE_LIBOPENJPEG STREQUAL "auto")
- find_package(LIBOPENJPEG)
- set(USE_OPENJPEG1 ${LIBOPENJPEG_FOUND})
- set(WITH_OPENJPEG ${LIBOPENJPEG_FOUND})
- if(NOT LIBOPENJPEG_FOUND)
- find_package(LIBOPENJPEG2)
- set(USE_OPENJPEG2 ${LIBOPENJPEG2_FOUND})
- set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
+ find_package(LIBOPENJPEG2)
+ set(USE_OPENJPEG2 ${LIBOPENJPEG2_FOUND})
+ set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
+ if(NOT LIBOPENJPEG2_FOUND)
+ find_package(LIBOPENJPEG)
+ set(USE_OPENJPEG1 ${LIBOPENJPEG_FOUND})
+ set(WITH_OPENJPEG ${LIBOPENJPEG_FOUND})
endif()
elseif(ENABLE_LIBOPENJPEG STREQUAL "openjpeg1")
find_package(LIBOPENJPEG)
@@ -779,5 +779,5 @@ if(ENABLE_ZLIB_UNCOMPRESS)
endif(ENABLE_ZLIB_UNCOMPRESS)
if(NOT WITH_OPENJPEG)
- message("Warning: Using libopenjpeg is recommended. The internal JPX decoder is unmaintained.")
+ message("Warning: Using libopenjpeg2 is recommended. The internal JPX decoder is unmaintained.")
endif(NOT WITH_OPENJPEG)
diff --git a/configure.ac b/configure.ac
index 0ba420ad..e7ef44fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,25 +207,26 @@ AC_ARG_ENABLE(libopenjpeg,
openjpeg_header=yes
-dnl test for libopenjpeg1
-if test x$enable_libopenjpeg = xopenjpeg1 || test x$enable_libopenjpeg = xauto; then
- PKG_CHECK_MODULES(LIBOPENJPEG, libopenjpeg,
- [openjpeg1="yes"],
- [AC_CHECK_LIB([openjpeg], [opj_cio_open],
- [openjpeg1="yes"
- LIBOPENJPEG_LIBS="-lopenjpeg"],[openjpeg_header=no])
- AC_CHECK_HEADERS([openjpeg.h],,
- [openjpeg_header="no"])])
+dnl test for libopenjpeg2
+if test x$enable_libopenjpeg = xopenjpeg2 || test x$enable_libopenjpeg = xauto; then
+ PKG_CHECK_MODULES(LIBOPENJPEG, libopenjp2,
+ [openjpeg2=yes],[openjpeg2=no])
fi
-dnl test for libopenjpeg2
-if test x$openjpeg1 = xno; then
- if test x$enable_libopenjpeg = xopenjpeg2 || test x$enable_libopenjpeg = xauto; then
- PKG_CHECK_MODULES(LIBOPENJPEG, libopenjp2,
- [openjpeg2=yes],[openjpeg2=no])
+dnl test for libopenjpeg1
+if test x$openjpeg2 = xno; then
+ if test x$enable_libopenjpeg = xopenjpeg1 || test x$enable_libopenjpeg = xauto; then
+ PKG_CHECK_MODULES(LIBOPENJPEG, libopenjpeg,
+ [openjpeg1="yes"],
+ [AC_CHECK_LIB([openjpeg], [opj_cio_open],
+ [openjpeg1="yes"
+ LIBOPENJPEG_LIBS="-lopenjpeg"],[openjpeg_header=no])
+ AC_CHECK_HEADERS([openjpeg.h],,
+ [openjpeg_header="no"])])
fi
fi
+
if test x$enable_libopenjpeg = xopenjpeg1 && test x$openjpeg1 = xno; then
if test x$openjpeg_header = xno; then
AC_MSG_ERROR("*** libopenjpeg headers not found ***")
@@ -1085,5 +1086,5 @@ if test x$enable_zlib_uncompress != xno; then
fi
if test x$enable_libopenjpeg != xyes; then
- echo " Warning: Using libopenjpeg is recommended. The internal JPX decoder is unmaintained."
+ echo " Warning: Using libopenjpeg2 is recommended. The internal JPX decoder is unmaintained."
fi