[poppler] 2 commits - configure.ac

Adrian Johnson ajohnson at kemper.freedesktop.org
Fri Feb 24 03:40:25 PST 2012


 configure.ac |   39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

New commits:
commit 8f4566c14a727fb75c4c353989cf5eb96516c2e3
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Feb 22 21:21:52 2012 +1030

    autoconf: replace openjpeg compile test with a version test
    
    Now that openjpeg 1.5 is released and supports pkg-config the compile
    test can be replaced with a pkg-config version check.

diff --git a/configure.ac b/configure.ac
index f392c7f..e90632d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,14 +177,9 @@ if test x$enable_libopenjpeg = xyes; then
   AC_SUBST(LIBOPENJPEG_CFLAGS)
   AC_SUBST(LIBOPENJPEG_LIBS)
   AC_DEFINE(ENABLE_LIBOPENJPEG)
-  AC_TRY_COMPILE([
-#include <openjpeg.h>
-], [
-  int foo = OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
-], have_openjpeg_flag="yes", am_cv_proto_iconv_arg1="no")
-  if test x$have_openjpeg_flag = xyes; then
-    AC_DEFINE(WITH_OPENJPEG_IGNORE_PCLR_CMAP_CDEF_FLAG, 1, [OpenJPEG with the OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG flag.])
-  fi
+  PKG_CHECK_EXISTS(LIBOPENJPEG, libopenjpeg >= 1.5,
+      [AC_DEFINE(WITH_OPENJPEG_IGNORE_PCLR_CMAP_CDEF_FLAG, 1, [OpenJPEG with the OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG flag.])],
+      []);
 fi
 
 AM_CONDITIONAL(BUILD_LIBOPENJPEG, test x$enable_libopenjpeg = xyes)
commit 30f38bf425e2f76b3f6cc4c080137ac7219a9dbe
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Feb 22 21:01:59 2012 +1030

    autoconf: Use pkgconfig to check for libopenjpeg
    
    and if not found fallback to using AC_CHECK_LIB/AC_CHECK_HEADERS
    
    openjpeg >= 1.4 installs a pkgconfig file
    
    Bug 21789

diff --git a/configure.ac b/configure.ac
index 91b0d70..f392c7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,27 +148,33 @@ then
 fi
 
 
-dnl Test for libopenjpeg
+dnl Test for libopenjpeg. Versions prior to 1.4 do not provide a pkgconfig file.
 AC_ARG_ENABLE(libopenjpeg,
 	      AC_HELP_STRING([--disable-libopenjpeg],
 	                     [Don't build against libopenjpeg.]),
               enable_libopenjpeg=$enableval,
               enable_libopenjpeg="try")
 if test x$enable_libopenjpeg = xyes; then
-  AC_CHECK_LIB([openjpeg], [opj_cio_open],,
-	       AC_MSG_ERROR("*** libopenjpeg library not found ***"))
-  AC_CHECK_HEADERS([openjpeg.h],,
-		   AC_MSG_ERROR("*** libopenjpeg headers not found ***"))
+  PKG_CHECK_MODULES(LIBOPENJPEG, libopenjpeg,
+  		    [],
+    		    [AC_CHECK_LIB([openjpeg], [opj_cio_open],
+  			LIBOPENJPEG_LIBS="-lopenjpeg",
+		        AC_MSG_ERROR("*** libopenjpeg library not found ***"))
+		     AC_CHECK_HEADERS([openjpeg.h],,
+		     	AC_MSG_ERROR("*** libopenjpeg headers not found ***"))])
 elif test x$enable_libopenjpeg = xtry; then
-  AC_CHECK_LIB([openjpeg], [opj_cio_open],
-               [enable_libopenjpeg="yes"],
-	       [enable_libopenjpeg="no"])
-  AC_CHECK_HEADERS([openjpeg.h],,
-		   [enable_libopenjpeg="no"])
+  PKG_CHECK_MODULES(LIBOPENJPEG, libopenjpeg,
+                    [enable_libopenjpeg="yes"],
+  		    [AC_CHECK_LIB([openjpeg], [opj_cio_open],
+		        [enable_libopenjpeg="yes"
+  			 LIBOPENJPEG_LIBS="-lopenjpeg"],
+	                [enable_libopenjpeg="no"])
+		     AC_CHECK_HEADERS([openjpeg.h],,
+		         [enable_libopenjpeg="no"])])
 fi
 
 if test x$enable_libopenjpeg = xyes; then
-  LIBOPENJPEG_LIBS="-lopenjpeg"
+  AC_SUBST(LIBOPENJPEG_CFLAGS)
   AC_SUBST(LIBOPENJPEG_LIBS)
   AC_DEFINE(ENABLE_LIBOPENJPEG)
   AC_TRY_COMPILE([


More information about the poppler mailing list