You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-block/libzbc/files/libzbc-no-automagic-gtk-dep...

30 lines
976 B

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],