[libgdata] build: Make gnome-online-accounts optional as well



commit b4d828e002adf21a5ef671ec1b62bed2f48382af
Author: Nirbheek Chauhan <nirbheek chauhan collabora co uk>
Date:   Mon Dec 17 23:18:12 2012 +0530

    build: Make gnome-online-accounts optional as well
    
    It already was optional under --enable-gnome; just split that out into its own
    configure option
    
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=690225

 Makefile.am    |    6 +++---
 configure.ac   |   16 +++++++++++++++-
 libgdata.pc.in |    1 +
 3 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 0e04d3d..0c2368d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -168,7 +168,7 @@ gdata_headers = \
 	gdata/gdata-client-login-authorizer.h	\
 	gdata/gdata-oauth1-authorizer.h
 
-if ENABLE_GNOME
+if ENABLE_GOA
 gdata_headers += \
 	gdata/gdata-goa-authorizer.h \
 	$(NULL)
@@ -400,7 +400,7 @@ gdata_sources = \
 	gdata/services/youtube/gdata-youtube-category.c		\
 	gdata/services/youtube/gdata-youtube-comment.c
 
-if ENABLE_GNOME
+if ENABLE_GOA
 gdata_sources += \
 	gdata/gdata-goa-authorizer.c \
 	$(NULL)
@@ -486,7 +486,7 @@ EXTRA_DIST += introspection.m4
 if HAVE_INTROSPECTION
 gdata/GData- GDATA_API_VERSION_MAJOR@  GDATA_API_VERSION_MINOR@.gir: gdata/libgdata.la
 gdata_GData_ GDATA_API_VERSION_MAJOR@_ GDATA_API_VERSION_MINOR@_gir_INCLUDES = GObject-2.0 libxml2-2.0 Soup-2.4
-if ENABLE_GNOME
+if ENABLE_GOA
 gdata_GData_ GDATA_API_VERSION_MAJOR@_ GDATA_API_VERSION_MINOR@_gir_INCLUDES += Goa-1.0
 endif
 gdata_GData_ GDATA_API_VERSION_MAJOR@_ GDATA_API_VERSION_MINOR@_gir_CFLAGS = $(GDATA_CFLAGS) $(GNOME_CFLAGS) $(gdata_libgdata_la_CPPFLAGS)
diff --git a/configure.ac b/configure.ac
index b4698c2..f66999b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,9 +91,22 @@ AC_ARG_ENABLE(gnome, AS_HELP_STRING([--enable-gnome], [Whether to enable GNOME s
 AC_MSG_RESULT($enable_gnome)
 AM_CONDITIONAL([ENABLE_GNOME], [test "x$enable_gnome" = "xyes"])
 
+# GNOME Online Accounts support -- only used if GNOME support is also enabled
+# Pulls in gdata/gdata-goa-authorizer.[ch]
+AC_MSG_CHECKING(whether to build with GOA support)
+AC_ARG_ENABLE(goa, AS_HELP_STRING([--enable-goa], [Whether to enable GOA support]),, enable_goa=yes)
+AC_MSG_RESULT($enable_goa)
+AM_CONDITIONAL([ENABLE_GOA], [test "x$enable_goa" = "xyes" -a "x$enable_gnome" = "xyes"])
+
 if test "x$enable_gnome" = "xyes"; then
 	GNOME_PACKAGES_PUBLIC=""
-	GNOME_PACKAGES_PRIVATE="libsoup-gnome-2.4 gcr-base-3 libxml-2.0 goa-1.0 >= $GOA_REQS"
+	GNOME_PACKAGES_PRIVATE="libsoup-gnome-2.4 gcr-base-3 libxml-2.0"
+	if test "x$enable_goa" = "xyes"; then
+		GNOME_PACKAGES_PUBLIC="$GNOME_PACKAGES_PUBLIC"
+		GNOME_PACKAGES_PRIVATE="$GNOME_PACKAGES_PRIVATE goa-1.0 >= $GOA_REQS"
+		GOA_ENABLED="true"
+		AC_DEFINE(HAVE_GOA, 1, [Define if GOA support is enabled])
+	fi
 	GNOME_PACKAGES="$GNOME_PACKAGES_PUBLIC $GNOME_PACKAGES_PRIVATE"
 	AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
 	PKG_CHECK_MODULES([GNOME], [$GNOME_PACKAGES])
@@ -105,6 +118,7 @@ fi
 AC_SUBST([GNOME_PACKAGES_PUBLIC])
 AC_SUBST([GNOME_PACKAGES_PRIVATE])
 AC_SUBST([GNOME_PACKAGES])
+AC_SUBST([GOA_ENABLED])
 
 # Various necessary functions and headers
 AC_CHECK_FUNCS([strchr])
diff --git a/libgdata.pc.in b/libgdata.pc.in
index cc927a7..3e93433 100644
--- a/libgdata.pc.in
+++ b/libgdata.pc.in
@@ -2,6 +2,7 @@ prefix= prefix@
 exec_prefix= exec_prefix@
 libdir= libdir@
 includedir= includedir@
+goa_enabled= GOA_ENABLED@
 
 Name: libgdata
 Description: GData client library



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