summaryrefslogtreecommitdiff
blob: bb4b2f76399869df22656f6734a3eb6172dbf132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From bb1c3cb3ffd1081d56e48d87ab05d31ad05d89de Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Fri, 23 Sep 2011 23:09:47 +0200
Subject: [PATCH] Allow specifying a specific slot of GTK

---
 configure.ac |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2157019..fbcadcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,14 +150,22 @@ fi
 
 #################################################
 #Check for GTK
-ifdef([AM_PATH_GTK_3_0],
-[
+AC_ARG_ENABLE(gtk3, [
+AC_HELP_STRING([--enable-gtk3],  [Compile against GTK 3.x explicitly (default: use GTK 3.x if available)])
+AC_HELP_STRING([--disable-gtk3], [Compile against GTK 2.x explicitly (default: use GTK 3.x if available)])],
+    [enable_gtk3=$enableval],[enable_gtk3="auto"])
+
+if test "x$enable_gtk3" = xauto; then
+  AC_MSG_NOTICE([selecting GTK 2.x/3.x automatically])
+  ifdef([AM_PATH_GTK_3_0],[enable_gtk3=yes],[enable_gtk3=no])
+fi
+
+if test "x$enable_gtk3" = xyes; then
   CFLAGS="$CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE"
   AM_PATH_GTK_3_0(3.0.0,,AC_MSG_ERROR(mp3splt-gtk needs GTK+ >= 3.0.0))
-],
-[
+else
   AM_PATH_GTK_2_0(2.20.0,,AC_MSG_ERROR(mp3splt-gtk needs GTK+ >= 2.20.0))
-])
+fi
 
 #################################################
 #Check for libmp3splt
-- 
1.7.6.1