aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac67
1 files changed, 50 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index fdaa27f..7f0a76d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,8 +20,6 @@ dnl ###########################################################################
dnl #### removed from PKG_CHECK_MODULES: libido3-0.
PKG_CHECK_MODULES(ARCTICA_GREETER, [
- gtk+-3.0
- gdk-x11-3.0
libayatana-ido3-0.4 >= 0.4.0
ayatana-indicator3-0.4 >= 0.6.0
liblightdm-gobject-1 >= 1.12.0
@@ -33,6 +31,47 @@ PKG_CHECK_MODULES(ARCTICA_GREETER, [
xext
])
+dnl GTK version selection.
+AC_MSG_CHECKING([whether to enable GTK 4 support])
+AC_ARG_ENABLE([gtk4],
+ [AS_HELP_STRING([--disable-gtk4],
+ [disable support for GTK 4])],
+ [enable_gtk4=$enableval],
+ [enable_gtk4=auto])
+AC_MSG_RESULT([$enable_gtk4])
+with_gtk4=$enable_gtk4
+
+AS_IF([test "x$enable_gtk4" != 'xno'],
+ [PKG_CHECK_MODULES([GTK],
+ [gtk4
+ gtk4-x11],
+ [gtk4_modules=yes],
+ [gtk4_modules=no])
+ AC_MSG_CHECKING([for GTK 4 libraries])
+ AC_MSG_RESULT([$gtk4_modules])
+ AS_IF([test "x$gtk4_modules" = 'xno'],
+ [AS_IF([test "x$enable_gtk4" != 'xauto'],
+ [AC_MSG_ERROR([requested GTK 4, but not found])],
+ [with_gtk4=no])],
+ [with_gtk4=yes
+ AM_VALAFLAGS="$AM_VALAFLAGS -D HAVE_GTK_4_0"
+ AC_SUBST([AM_VALAFLAGS])])])
+AS_IF([test "x$with_gtk4" = 'xno'],
+ [PKG_CHECK_MODULES([GTK],
+ [gtk+-3.0
+ gdk-x11-3.0],
+ [gtk3_modules=yes],
+ [gtk3_modules=no])
+ AC_MSG_CHECKING([for GTK+ 3 libraries])
+ AC_MSG_RESULT([$gtk3_modules])
+ AS_IF([test "x$gtk3_modules" = 'xno'],
+ [AS_IF([test "x$enable_gtk4" = 'xauto'],
+ [AC_MSG_ERROR([fallback to GTK+ 3, but not found])],
+ [AC_MSG_ERROR([requested GTK+ 3, but not found])])])])
+AC_SUBST([GTK_CFLAGS])
+AC_SUBST([GTK_LIBS])
+AM_CONDITIONAL([HAVE_GTK4], [test "x$with_gtk4" != 'xno'])
+
AC_DEFINE_UNQUOTED([INDICATOR_FILE_DIR], ["${prefix}/share/ayatana/indicators"], [Indicator files are searched for in this directory])
INDICATORDIR=`$PKG_CONFIG --variable=indicatordir ayatana-indicator3-0.4`
@@ -86,21 +125,13 @@ dnl ###########################################################################
dnl Check for GTK version - 3.20
dnl ###########################################################################
-PKG_CHECK_MODULES(GTK_3_20_0, gtk+-3.0 >= 3.20.0 , gtk_check_pass=yes, gtk_check_pass=no)
-if test x$gtk_check_pass = xyes ; then
- AM_VALAFLAGS="$AM_VALAFLAGS -D HAVE_GTK_3_20_0"
- AC_SUBST([AM_VALAFLAGS])
-fi
-
-dnl ###########################################################################
-dnl Check for GTK version - 4.0
-dnl ###########################################################################
-
-PKG_CHECK_MODULES(GTK_4_0, gtk4 >= 4.0.0 , gtk4_check_pass=yes, gtk4_check_pass=no)
-if test x$gtk4_check_pass = xyes ; then
- AM_VALAFLAGS="$AM_VALAFLAGS -D HAVE_GTK_4_0"
- AC_SUBST([AM_VALAFLAGS])
-fi
+AS_IF([test "x$with_gtk4" != 'xno'],
+ [AM_VALAFLAGS="$AM_VALAFLAGS -D HAVE_GTK_3_20_0"
+ AC_SUBST([AM_VALAFLAGS])],
+ [PKG_CHECK_MODULES([GTK_3_20_0], [gtk+-3.0 >= 3.20.0], [gtk_check_pass=yes], [gtk_check_pass=no])
+ AS_IF([test "x$gtk_check_pass" = 'xyes'],
+ [AM_VALAFLAGS="$AM_VALAFLAGS -D HAVE_GTK_3_20_0"
+ AC_SUBST([AM_VALAFLAGS])])])
dnl ##########################################################################
dnl Remote Logon Dependencies
@@ -141,6 +172,8 @@ echo "
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
+ GTK 4: ${with_gtk4}
+
GETTEXT_PACKAGE: ${GETTEXT_PACKAGE}
INDICATOR_FILE_DIR: ${prefix}/share/ayatana/indicators