diff options
author | Stefano Karapetsas <[email protected]> | 2013-07-28 11:33:01 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-07-28 11:33:01 +0200 |
commit | 634e6ec6270ac14847d8ab78b3e10cacca1bdcf0 (patch) | |
tree | 508d26bc314206eb7632d119eb3c88c1d9fd52dc | |
parent | 1ac0fec2c683c2ecbf569d9b2b96c1334a821d20 (diff) | |
download | libmateweather-634e6ec6270ac14847d8ab78b3e10cacca1bdcf0.tar.bz2 libmateweather-634e6ec6270ac14847d8ab78b3e10cacca1bdcf0.tar.xz |
Add support for multiple GTK versions in configure
-rw-r--r-- | configure.ac | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 6a26a1d..e554661 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,25 @@ esac AC_MSG_RESULT([$mateweather_native_win32]) AM_CONDITIONAL(OS_WIN32, [test "$mateweather_native_win32" = "yes"]) -GTK_REQUIRED=2.11.0 +AC_MSG_CHECKING([which gtk+ version to compile against]) +AC_ARG_WITH([gtk], + [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])], + [case "$with_gtk" in + 2.0|3.0) ;; + *) AC_MSG_ERROR([invalid gtk version specified]) ;; + esac], + [with_gtk=2.0]) +AC_MSG_RESULT([$with_gtk]) + +case "$with_gtk" in + 2.0) GTK_API_VERSION=2.0 + GTK_REQUIRED=2.11.0 + ;; + 3.0) GTK_API_VERSION=3.0 + GTK_REQUIRED=3.0.0 + ;; +esac + GLIB_REQUIRED=2.13.0 LIBSOUP_REQUIRED=2.4.0 LIBSOUP_GNOME_REQUIRED=1.1.0 @@ -114,8 +132,8 @@ if test "x$enable_maintainer_mode" = "xyes"; then CFLAGS="$CFLAGS $DISABLE_DEPRECATED" fi -dnl -- Check for GTK+ 2.0 (required) ------------------------------------------ -PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED) +dnl -- Check for GTK+ (required) ------------------------------------------ +PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED) GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES" AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) @@ -279,4 +297,5 @@ libmateweather-$VERSION configure summary: Python bindings: ${enable_python} Locations.xml translations: ${LOCATIONS_XML_TRANSLATIONS} Locations.xml compression: ${enable_locations_compression} + Gtk+ version: ${GTK_API_VERSION} " >&2 |