summaryrefslogtreecommitdiff
blob: c6545033b435f1024c0d669ed0501a320cba85ed (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
diff --git a/configure.ac b/configure.ac
index 122fd22..5ab9783 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,10 +31,22 @@ AC_CHECK_HEADER(libgen.h, [], [AC_MSG_ERROR([Couldn't find libgen.h])])
 AC_CHECK_HEADERS([linux/fs.h linux/blkzoned.h])
 
 # Conditionals
+AC_ARG_WITH([gtk3],
+	AS_HELP_STRING([--without-gtk3], [Do not build gzbc even if gtk3 is present]))
+
+AS_IF([test "x$with_gtk3" != "xno"],
+	[PKG_CHECK_MODULES([GTK], [gtk+-3.0], [HAVE_GTK3=1], [HAVE_GTK3=0])],
+	[have_gtk3=no])
+
+AS_IF([test "x$with_gtk3" = "xyes"],
+	[PKG_CHECK_MODULES([GTK], [gtk+-3.0], [HAVE_GTK3=1], [HAVE_GTK3=0])],
+	[AS_IF([test "x$with_gtk3" = "xyes"],
+		[AC_MSG_ERROR([gtk3 requested but not found])
+	])
+])
 
 # Build gzbc only if GTK3 is installed.
-PKG_CHECK_MODULES([GTK], [gtk+-3.0], [HAVE_GTK3=1], [HAVE_GTK3=0])
-AM_CONDITIONAL([BUILD_GZBC], [test "$HAVE_GTK3" -eq 1])
+AM_CONDITIONAL([BUILD_GZBC], [test "$HAVE_GTK3" = 1])
 
 # Build test suite
 AC_ARG_WITH([test],