]> git.0d.be Git - empathy.git/commitdiff
Build with GTK+3 if available (#621753)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 7 Jul 2010 14:11:39 +0000 (16:11 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 8 Jul 2010 09:40:30 +0000 (11:40 +0200)
configure.ac

index 12d9cac08890a07de32191501b4bff0416e7846b..03e0620fcefb8b442328c9fecb49274a8458a887 100644 (file)
@@ -57,9 +57,6 @@ WEBKIT_REQUIRED=1.1.15
 # maintainer mode is forced
 ifelse(empathy_released, 1, [], [enable_maintainer_mode="yes"])
 GNOME_MAINTAINER_MODE_DEFINES
-if test $USE_MAINTAINER_MODE = yes; then
-  AC_DEFINE(GSEAL_ENABLE, [], [Seal public structs to force usage of accessors])
-fi
 
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])
@@ -165,10 +162,33 @@ PKG_CHECK_MODULES(EMPATHY,
    x11
 ])
 
-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
-
 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
 
+# -----------------------------------------------------------
+# GTK+
+# -----------------------------------------------------------
+AC_ARG_ENABLE(gtk3,
+              AS_HELP_STRING([--enable-gtk3=@<:@no/yes/auto@:>@],
+                             [build with GTK+3]), ,
+                             enable_gtk3=auto)
+
+# Try to use GTK+3 if available
+if test "x$enable_gtk3" != "xno"; then
+  PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= $GTK_REQUIRED],
+      enable_gtk3="yes", enable_gtk3="no")
+fi
+
+# ...if not use GTK+2
+if test "x$enable_gtk3" == "xno"; then
+  enable_gtk3=no
+  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
+
+  # Enable GSEAL checks if needed
+  if test $USE_MAINTAINER_MODE = yes; then
+    AC_DEFINE(GSEAL_ENABLE, [], [Seal public structs to force usage of accessors])
+  fi
+fi
+
 # -----------------------------------------------------------
 # Enable debug
 # -----------------------------------------------------------
@@ -489,6 +509,7 @@ Configure summary:
        Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
        Prefix......................:  ${prefix}
        Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
+       Use GTK+3...................:  ${enable_gtk3}
 
     Features:
        Spell checking (enchant)....:  ${have_enchant}