[gegl/soc-2011-seamless-clone: 32/49] Allow GEGL to be built without poly2tri-c, disabling the seamless clone op



commit 08030ab83567f1cfd81ace046103507dbd89d24a
Author: Barak Itkin <lightningismyname gmail com>
Date:   Fri Jul 20 18:06:03 2012 +0300

    Allow GEGL to be built without poly2tri-c, disabling the seamless clone op

 configure.ac                                 |   27 ++++++++++++++++++-------
 operations/common/seamless-clone/Makefile.am |    2 +
 2 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 77b68fc..40b8333 100644
--- a/configure.ac
+++ b/configure.ac
@@ -459,14 +459,6 @@ PKG_CHECK_MODULES(DEP,
 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES gthread-2.0`
 DEP_LIBS=`$PKG_CONFIG --libs $GLIB_PACKAGES gthread-2.0`
 
-
-PKG_CHECK_MODULES(P2TC,
-                  poly2tri-c >= poly2tri-c_required_version, ,
-                  AC_MSG_ERROR([
-        *** Poly2tri-C not found. You can find it on http://code.google.com/p/poly2tri-c/
-        *** Errors follow:
-            $P2TC_PKG_ERRORS]))
-
 ######################
 # gettext i18n support
 ######################
@@ -1034,6 +1026,24 @@ AM_CONDITIONAL(HAVE_UMFPACK, test "x$have_umfpack" = "xyes")
 AC_SUBST(UMFPACK_CFLAGS)
 AC_SUBST(UMFPACK_LIBS)
 
+######################
+# Check for poly2tri-c
+######################
+
+AC_ARG_WITH(p2tc, AS_HELP_STRING([--without-p2tc], [build without poly2tri-c support]))
+
+have_p2tc="no"
+if test "x$with_p2tc" != "xno"; then
+  PKG_CHECK_MODULES(P2TC, poly2tri-c >= poly2tri-c_required_version,
+    have_p2tc="yes",
+    have_p2tc="no  (poly2tri-c not found)")
+fi
+
+AM_CONDITIONAL(HAVE_P2TC, test "$have_p2tc" = "yes")
+
+AC_SUBST(P2TC_CFLAGS)
+AC_SUBST(P2TC_LIBS)
+
 #######################
 # Check for other items
 #######################
@@ -1173,4 +1183,5 @@ Optional dependencies:
   spiro:           $spiro_ok
   EXIV:            $have_exiv2
   umfpack:         $have_umfpack
+  poly2tri-c:      $have_p2tc
 ]);
diff --git a/operations/common/seamless-clone/Makefile.am b/operations/common/seamless-clone/Makefile.am
index 96820b1..144a61e 100644
--- a/operations/common/seamless-clone/Makefile.am
+++ b/operations/common/seamless-clone/Makefile.am
@@ -17,4 +17,6 @@ seamless_clone_prepare_la_SOURCES = seamless-clone-prepare.c $(sc_common_files)
 
 opdir = $(libdir)/gegl- GEGL_API_VERSION@
 
+if HAVE_P2TC
 op_LTLIBRARIES = seamless-clone.la seamless-clone-render.la seamless-clone-prepare.la
+endif



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