[ostree] core: Support being built without libsoup-gnome



commit bcdfe03e7202c1fa56eec6135884b1edf07923ed
Author: Colin Walters <walters verbum org>
Date:   Mon Nov 14 15:08:09 2011 -0500

    core: Support being built without libsoup-gnome
    
    While bootstrapping gnomeos, it's really handy if we can be built
    without pull support, because libsoup-gnome pulls in a huge set of
    dependencies.

 Makefile-ostree.am |    5 ++++-
 configure.ac       |   20 +++++++++++++++++++-
 ostree/main.c      |    2 ++
 3 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/Makefile-ostree.am b/Makefile-ostree.am
index dfc09a0..b39f9bd 100644
--- a/Makefile-ostree.am
+++ b/Makefile-ostree.am
@@ -28,11 +28,14 @@ ostree_SOURCES = ostree/main.c \
 	ostree/ot-builtin-fsck.c \
 	ostree/ot-builtin-init.c \
 	ostree/ot-builtin-log.c \
-	ostree/ot-builtin-pull.c \
 	ostree/ot-builtin-run-triggers.c \
 	ostree/ot-builtin-remote.c \
 	ostree/ot-builtin-rev-parse.c \
 	ostree/ot-builtin-show.c \
 	$(NULL)
+
+if USE_LIBSOUP_GNOME
+ostree_SOURCES += ostree/ot-builtin-pull.c
+endif
 ostree_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libotutil -I$(srcdir)/libostree -I$(srcdir)/ostree  -DLOCALEDIR=\"$(datadir)/locale\" $(OT_COREBIN_DEP_CFLAGS)
 ostree_LDADD = libotutil.la libostree.la $(OT_COREBIN_DEP_LIBS)
diff --git a/configure.ac b/configure.ac
index 71a9e70..a72004b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,8 +25,26 @@ LT_INIT
 
 PKG_PROG_PKG_CONFIG
 
+GIO_DEPENDENCY="gio-unix-2.0 >= 2.28"
 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0 >= 2.28])
-PKG_CHECK_MODULES(OT_COREBIN_DEP, [libsoup-gnome-2.4 >= 2.34.0 gio-unix-2.0 >= 2.28])
+AC_ARG_WITH(soup-gnome,
+	    AS_HELP_STRING([--without-soup-gnome], [Do not use libsoup-gnome (implies no pull support)]),
+	    :, with_soup_gnome=maybe)
+if test x$with_soup_gnome != xno; then
+    PKG_CHECK_MODULES(OT_COREBIN_DEP, [libsoup-gnome-2.4 >= 2.34.0 $GIO_DEPENDENCY], have_soup_gnome=yes, have_soup_gnome=no)
+    if test x$have_soup_gnome = xno && test x$with_soup_gnome != xmaybe; then
+       AC_MSG_ERROR([libsoup-gnome is enabled but could not be found])
+    fi
+    if test x$have_soup_gnome = xyes; then
+        AC_DEFINE([HAVE_LIBSOUP_GNOME], [1], [Define if we have libsoup-gnome])
+    else
+	PKG_CHECK_MODULES(OT_COREBIN_DEP, [$GIO_DEPENDENCY])
+    fi		
+else
+    PKG_CHECK_MODULES(OT_COREBIN_DEP, [$GIO_DEPENDENCY])
+fi
+
+AM_CONDITIONAL(USE_LIBSOUP_GNOME, test $with_soup_gnome != no)
 
 AM_PATH_PYTHON
 
diff --git a/ostree/main.c b/ostree/main.c
index ef67c98..cf0e89c 100644
--- a/ostree/main.c
+++ b/ostree/main.c
@@ -35,7 +35,9 @@ static OstreeBuiltin builtins[] = {
   { "commit", ostree_builtin_commit, 0 },
   { "compose", ostree_builtin_compose, 0 },
   { "log", ostree_builtin_log, 0 },
+#ifdef HAVE_LIBSOUP_GNOME
   { "pull", ostree_builtin_pull, 0 },
+#endif
   { "fsck", ostree_builtin_fsck, 0 },
   { "remote", ostree_builtin_remote, 0 },
   { "rev-parse", ostree_builtin_rev_parse, 0 },



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