[gegl] jp2: fallback to AC_CHECK on configure



commit 618b59121412ada221424fc8aec53e84b51a65cd
Author: Danny Robson <danny blubinc net>
Date:   Thu Jul 15 19:19:08 2010 +1000

    jp2: fallback to AC_CHECK on configure
    
    Some systems do not include the pkg-config data in their jasper package
    (it does not form part of the upstream release). Try to find the library
    using AC_CHECK when pkg-config fails.

 configure.ac |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1729b4a..69b46e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -775,9 +775,21 @@ AC_ARG_WITH(jasper, [  --without-jasper    build without Jasper support])
 
 have_jasper="no"
 if test "x$with_jasper" != "xno"; then
+  ## Some systems have pkg-config patches in their packages (Eg, Fedora but
+  ## not Gentoo). Try this first though.
   PKG_CHECK_MODULES(JASPER, jasper >= jasper_required_version,
-    have_jasper="yes",
-    have_jasper="no  (jasper library not found)")
+    have_jasper="yes", [
+      ## For systems without pkg-config data, check for the existence of a
+      ## function introduced into the latest version (1.900.1).
+      AC_CHECK_LIB([jasper], [jas_stream_freopen], [
+          have_jasper="yes"
+          JASPER_LIBS="-ljasper"
+          JASPER_CFLAGS=""
+      ], [
+        have_jasper="no  (jasper library not found)"
+      ])
+    ]
+  )
 fi
 
 AM_CONDITIONAL(HAVE_JASPER, test "$have_jasper" = "yes")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]