[gnome-online-accounts] build: Make it possible to disable the backend build
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] build: Make it possible to disable the backend build
- Date: Fri, 11 Sep 2015 15:57:13 +0000 (UTC)
commit 74319643f1a5627a7480c33b2c999256ae32ae1c
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Jun 17 14:01:07 2015 -0700
build: Make it possible to disable the backend build
The backend will typically be a core OS component, where the client
library can be bundled with applications. Make it possible to build the
latter without the former.
https://bugzilla.gnome.org/show_bug.cgi?id=751128
Makefile.am | 14 +++++-
configure.ac | 115 ++++++++++++++++++++++++++--------------------
data/Makefile.am | 4 +-
src/Makefile.am | 8 +++-
src/examples/Makefile.am | 14 ++++--
5 files changed, 97 insertions(+), 58 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 354c316..f70b001 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,19 @@
NULL =
-SUBDIRS = data telepathy-account-widgets src doc po
+SUBDIRS = data
+
+if BUILD_BACKEND
+SUBDIRS += telepathy-account-widgets
+endif
+
+SUBDIRS += src
+
+if BUILD_BACKEND
+SUBDIRS += doc
+endif
+
+SUBDIRS += po
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
diff --git a/configure.ac b/configure.ac
index e410b07..389636a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,56 +89,71 @@ PKG_CHECK_MODULES(GLIB, [glib-2.0 gio-2.0 gio-unix-2.0 >= 2.35])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
-PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.11.1])
-AC_SUBST(GTK_CFLAGS)
-AC_SUBST(GTK_LIBS)
-
-PKG_CHECK_MODULES(WEBKIT_GTK, [webkit2gtk-4.0 >= 2.7.2])
-AC_SUBST(WEBKIT_GTK_CFLAGS)
-AC_SUBST(WEBKIT_GTK_LIBS)
-
-PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.42])
-AC_SUBST(LIBSOUP_CFLAGS)
-AC_SUBST(LIBSOUP_LIBS)
-
-PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0])
-AC_SUBST(JSON_GLIB_CFLAGS)
-AC_SUBST(JSON_GLIB_LIBS)
-
-PKG_CHECK_MODULES(REST, [rest-0.7])
-AC_SUBST(REST_CFLAGS)
-AC_SUBST(REST_LIBS)
-
-PKG_CHECK_MODULES(SECRET, [libsecret-1])
-AC_SUBST(SECRET_CFLAGS)
-AC_SUBST(SECRET_LIBS)
-
-PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
-AC_SUBST(LIBXML_CFLAGS)
-AC_SUBST(LIBXML_LIBS)
-
GOBJECT_INTROSPECTION_CHECK([0.6.2])
-# telepathy-account-widgets
-prev_top_build_prefix=$ac_top_build_prefix
-prev_ac_configure_args=$ac_configure_args
-ac_configure_args="$ac_configure_args --with-cheese=no --disable-gudev"
-# install the data together with the rest of GOA's data
-ac_configure_args="$ac_configure_args --with-pkgdatadir=${datadir}/gnome-online-accounts"
-# GOA ships its icons directly in ${datadir}/icons (usually /usr/share/icons/) and not
-# in its own data directory
-ac_configure_args="$ac_configure_args --with-icondir=${datadir}/icons"
-# Change the name of tpaw's .mo files to avoid conflicts with other packages using tp-aw
-ac_configure_args="$ac_configure_args --with-gettext-package=gnome-online-accounts-tpaw"
-# Disable the installation of the GSettings schema to avoid multiple components shipping
-# the same file. See https://bugzilla.gnome.org/show_bug.cgi?id=706803
-ac_configure_args="$ac_configure_args --disable-schemas-compile --disable-settings"
-AX_CONFIG_DIR([telepathy-account-widgets])
-ac_top_build_prefix=$prev_top_build_prefix
-ac_configure_args=$prev_ac_configure_args
-
-export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"telepathy-account-widgets/
-PKG_CHECK_MODULES(TPAW, telepathy-account-widgets)
+AC_ARG_ENABLE([backend],
+ [AS_HELP_STRING([--enable-backend],
+ [Enable goabackend library])],
+ [],
+ [enable_backend=yes])
+AM_CONDITIONAL(BUILD_BACKEND, [test x$enable_backend != xno])
+
+if test "$enable_backend" != "no"; then
+ AC_DEFINE(GOA_BACKEND_ENABLED, 1, [Enable goabackend library])
+
+ PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.11.1])
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+
+ PKG_CHECK_MODULES(WEBKIT_GTK, [webkit2gtk-4.0 >= 2.7.2])
+ AC_SUBST(WEBKIT_GTK_CFLAGS)
+ AC_SUBST(WEBKIT_GTK_LIBS)
+
+ PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.42])
+ AC_SUBST(LIBSOUP_CFLAGS)
+ AC_SUBST(LIBSOUP_LIBS)
+
+ PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0])
+ AC_SUBST(JSON_GLIB_CFLAGS)
+ AC_SUBST(JSON_GLIB_LIBS)
+
+ PKG_CHECK_MODULES(REST, [rest-0.7])
+ AC_SUBST(REST_CFLAGS)
+ AC_SUBST(REST_LIBS)
+
+ PKG_CHECK_MODULES(SECRET, [libsecret-1])
+ AC_SUBST(SECRET_CFLAGS)
+ AC_SUBST(SECRET_LIBS)
+
+ PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
+ AC_SUBST(LIBXML_CFLAGS)
+ AC_SUBST(LIBXML_LIBS)
+
+ PKG_CHECK_MODULES(TP, [telepathy-glib])
+ AC_SUBST(TP_CFLAGS)
+ AC_SUBST(TP_LIBS)
+
+ # telepathy-account-widgets
+ prev_top_build_prefix=$ac_top_build_prefix
+ prev_ac_configure_args=$ac_configure_args
+ ac_configure_args="$ac_configure_args --with-cheese=no --disable-gudev"
+ # install the data together with the rest of GOA's data
+ ac_configure_args="$ac_configure_args --with-pkgdatadir=${datadir}/gnome-online-accounts"
+ # GOA ships its icons directly in ${datadir}/icons (usually /usr/share/icons/) and not
+ # in its own data directory
+ ac_configure_args="$ac_configure_args --with-icondir=${datadir}/icons"
+ # Change the name of tpaw's .mo files to avoid conflicts with other packages using tp-aw
+ ac_configure_args="$ac_configure_args --with-gettext-package=gnome-online-accounts-tpaw"
+ # Disable the installation of the GSettings schema to avoid multiple components shipping
+ # the same file. See https://bugzilla.gnome.org/show_bug.cgi?id=706803
+ ac_configure_args="$ac_configure_args --disable-schemas-compile --disable-settings"
+ AX_CONFIG_DIR([telepathy-account-widgets])
+ ac_top_build_prefix=$prev_top_build_prefix
+ ac_configure_args=$prev_ac_configure_args
+
+ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"telepathy-account-widgets/
+ PKG_CHECK_MODULES(TPAW, telepathy-account-widgets)
+fi
AC_ARG_ENABLE([inspector],
[AS_HELP_STRING([--enable-inspector],
@@ -326,8 +341,6 @@ if test "$enable_telepathy" != "no"; then
AC_DEFINE(GOA_TELEPATHY_ENABLED, 1, [Enable Telepathy data provider])
fi
-PKG_CHECK_MODULES(TP, telepathy-glib)
-
# Pocket
AC_DEFINE(GOA_POCKET_NAME, ["pocket"], [ProviderType and extension point name])
AC_ARG_ENABLE([pocket], [AS_HELP_STRING([--enable-pocket],
@@ -526,6 +539,8 @@ echo "
compiler: ${CC}
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
+
+ backend: ${enable_backend}
inspector: ${enable_inspector}
introspection: ${found_introspection}
diff --git a/data/Makefile.am b/data/Makefile.am
index a080424..c63ef4b 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -4,10 +4,12 @@ NULL =
SUBDIRS = icons
gsettings_in_files = org.gnome.online-accounts.gschema.xml.in
-gsettings_SCHEMAS = $(gsettings_in_files:.xml.in=.xml)
+if BUILD_BACKEND
+gsettings_SCHEMAS = $(gsettings_in_files:.xml.in=.xml)
@INTLTOOL_XML_RULE@
@GSETTINGS_RULES@
+endif
servicedir = $(datadir)/dbus-1/services
service_in_files = org.gnome.OnlineAccounts.service.in
diff --git a/src/Makefile.am b/src/Makefile.am
index 63a20e5..378f2f5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,12 @@
NULL =
-SUBDIRS = goa goaidentity goabackend daemon examples
+SUBDIRS = goa
+
+if BUILD_BACKEND
+SUBDIRS += goaidentity goabackend daemon
+endif
+
+SUBDIRS += examples
-include $(top_srcdir)/git.mk
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index d70fc0d..3e9458c 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -15,19 +15,23 @@ AM_CPPFLAGS = \
$(WARN_CFLAGS) \
$(NULL)
-noinst_PROGRAMS = list-providers list-accounts add-pocket
-
-list_providers_SOURCES = list-providers.c
-list_providers_CFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS)
-list_providers_LDADD = $(GLIB_LIBS) $(GTK_LIBS) ../goabackend/libgoa-backend-1.0.la ../goa/libgoa-1.0.la
+noinst_PROGRAMS = list-accounts
list_accounts_SOURCES = list-accounts.c
list_accounts_CFLAGS = $(GLIB_CFLAGS)
list_accounts_LDADD = $(GLIB_LIBS) ../goa/libgoa-1.0.la
+if BUILD_BACKEND
+noinst_PROGRAMS += list-providers add-pocket
+
+list_providers_SOURCES = list-providers.c
+list_providers_CFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS)
+list_providers_LDADD = $(GLIB_LIBS) $(GTK_LIBS) ../goabackend/libgoa-backend-1.0.la ../goa/libgoa-1.0.la
+
add_pocket_SOURCES = add-pocket.c
add_pocket_CFLAGS = $(GLIB_CFLAGS) $(REST_CFLAGS)
add_pocket_LDADD = $(GLIB_LIBS) $(REST_LIBS) ../goa/libgoa-1.0.la
+endif
clean-local :
rm -f *~
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]