[evolution-data-server/openismus-work-3-8: 116/121] Fixed build with regards to GTK+ dependency.



commit f31966f704703047d2bd89c9e15a40ff6866915d
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Tue Oct 1 21:46:29 2013 +0200

    Fixed build with regards to GTK+ dependency.
    
    Now we use separate flags to build the cursor example
    program, those flags can use a more recent version
    of GTK+ than the version required for the prompter
    module.

 configure.ac                     |   30 ++++++++++++++++++++++++++++--
 tests/Makefile.am                |    2 +-
 tests/cursor-example/Makefile.am |   11 ++++++++---
 3 files changed, 37 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index efe4be1..3d173c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,8 +39,8 @@ m4_define([glib_minimum_version], [2.34])
 m4_define([glib_encoded_version], [GLIB_VERSION_2_34])
 
 dnl Keep these two definitions in agreement.
-m4_define([gdk_minimum_version], [3.9])
-m4_define([gdk_encoded_version], [GDK_VERSION_3_10])
+m4_define([gdk_minimum_version], [3.2])
+m4_define([gdk_encoded_version], [GDK_VERSION_3_2])
 
 dnl Keep these two definitions in agreement.
 m4_define([soup_minimum_version], [2.40.3])
@@ -466,6 +466,31 @@ if test "x$enable_gtk" = xyes; then
 fi
 AM_CONDITIONAL(HAVE_GTK, [test x$enable_gtk = xyes])
 
+
+dnl ******************************************
+dnl Check whether to build examples/demos
+dnl ******************************************
+AC_ARG_ENABLE([examples],
+       [AS_HELP_STRING([--enable-examples],
+       [enable the building examples (default=yes)])],
+       [enable_examples=$enableval], [enable_examples=yes])
+AC_MSG_CHECKING([if examples should be built])
+AC_MSG_RESULT([$enable_examples])
+if test "x$enable_examples" = xyes; then
+       PKG_CHECK_MODULES([EXAMPLES],
+               [gtk+-3.0 >= 3.10 glib-2.0 >= 2.38],,
+       [AC_MSG_ERROR([
+       Some packages were not available to build the example program(s).
+
+       If you want to disable examples, please
+       append --disable-examples to configure.
+       ])])
+
+       AC_DEFINE(BUILD_EXAMPLES, 1, [Define to 1 if the examples should be built.])
+fi
+AM_CONDITIONAL(BUILD_EXAMPLES, [test x$enable_examples = xyes])
+
+
 dnl *******************************
 dnl Check for GNOME Online Accounts
 dnl *******************************
@@ -1819,6 +1844,7 @@ echo "
        Ubuntu Online Accounts  $enable_uoa
        Google Contacts         $enable_google
        GTK+:                   $enable_gtk
+       Examples:               $enable_examples
        Code coverage (gcov):   $enable_code_coverage
        Strict building:        $enable_strict
 "
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7287065..c77168b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
 SUBDIRS = test-server-utils libedataserver libebook-contacts libedata-book libebook libecal libedata-cal
 
-if HAVE_GTK
+if BUILD_EXAMPLES
 SUBDIRS += cursor-example
 endif
 
diff --git a/tests/cursor-example/Makefile.am b/tests/cursor-example/Makefile.am
index de7252e..729c3cb 100644
--- a/tests/cursor-example/Makefile.am
+++ b/tests/cursor-example/Makefile.am
@@ -15,8 +15,13 @@ cursor_example_SOURCES =     \
        cursor-slot.h           \
        main.c
 
+# Here we intentionally leave out $(AM_CPPFLAGS) from
+# $(cursor_example_CPPFLAGS), this is because we're
+# compiling the example with a newer GTK+ than the soft
+# dependency EDS has on GTK+, and we dont want the
+# -DGDK_VERSION_MAX_ALLOWED and -DGLIB_VERSION_MAX_ALLOWED
+# flags passed in.
 cursor_example_CPPFLAGS =                                      \
-       $(AM_CPPFLAGS)                                          \
        -DG_LOG_DOMAIN=\"cursor-example\"                       \
        -I$(top_srcdir)                                         \
        -I$(top_builddir)                                       \
@@ -26,7 +31,7 @@ cursor_example_CPPFLAGS =                                     \
        -I$(top_builddir)/calendar                              \
        -DSRCDIR=\""$(abs_srcdir)"\"                            \
        $(EVOLUTION_ADDRESSBOOK_CFLAGS)                         \
-       $(GTK_CFLAGS) $(CAMEL_CFLAGS)                           \
+       $(EXAMPLES_CFLAGS) $(CAMEL_CFLAGS)                      \
        $(CODE_COVERAGE_CFLAGS)                                 \
        $(NULL)
 cursor_example_CFLAGS   = 
@@ -35,7 +40,7 @@ cursor_example_LDFLAGS  = \
        $(top_builddir)/tests/test-server-utils/libetestserverutils.la  \
        $(top_builddir)/private/libedbus-private.la             \
        $(EVOLUTION_ADDRESSBOOK_LIBS)                           \
-       $(GTK_LIBS) $(CAMEL_LIBS)                               \
+       $(EXAMPLES_LIBS) $(CAMEL_LIBS)                          \
        $(NULL)
 cursor_example_LDADD =
 


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