[folks/folks-0-1] Bug 629666 — libfolks should not hard autodetect libxml



commit 24bd03de440fedc3bddbab9432995a2c62861a1d
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Tue Sep 14 17:25:03 2010 +0100

    Bug 629666 â?? libfolks should not hard autodetect libxml
    
    Add an --enable-import-tool configure option which requires libxml2 when
    passed, doesn't require it when --disable-import-tool is passed, and builds
    the tool if possible (but doesn't require libxml2)  when nothing's passed.
    Closes: bgo#629666

 configure.ac      |   15 ++++++++++++---
 tools/Makefile.am |    2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6877308..314df7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,8 +120,17 @@ AC_SUBST([BACKEND_DIR])
 # Tools
 # -----------------------------------------------------------
 
-PKG_CHECK_MODULES(LIBXML, libxml-2.0, [have_libxml=yes], [have_libxml=no])
-AM_CONDITIONAL([HAVE_LIBXML], [test "$have_libxml" = "yes"])
+AC_ARG_ENABLE([import-tool],
+              AS_HELP_STRING([--enable-import-tool],
+                             [Enable building the meta-contact import tool]),
+              [enable_import_tool=$enableval with_import_tool=$enableval],
+              [enable_import_tool=maybe with_import_tool=no])
+AS_IF([test "$enable_import_tool" != "no"],
+      [PKG_CHECK_MODULES([LIBXML], [libxml-2.0],
+                         [with_import_tool=yes], [with_import_tool=no])])
+AS_IF([test "$enable_import_tool" = "yes" -a "$with_import_tool" = "no"],
+      [AC_MSG_ERROR([Import tool explicitly enabled, but libxml2 not found])])
+AM_CONDITIONAL([ENABLE_IMPORT_TOOL], [test "$with_import_tool" = "yes"])
 
 # -----------------------------------------------------------
 # Documentation
@@ -223,7 +232,7 @@ Configure summary:
         Bugreporting URL............:  ${PACKAGE_BUGREPORT}
         Documentation...............:  ${enable_docs}
         Tests.......................:  ${have_tp_glib_for_tests}
-        Import tool.................:  ${have_libxml}
+        Import tool.................:  ${with_import_tool}
 
 
 "
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 5c38564..a538a99 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,4 +1,4 @@
-if HAVE_LIBXML
+if ENABLE_IMPORT_TOOL
 bin_PROGRAMS = folks-import
 endif
 



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