diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-09-15 00:39:22 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-09-15 00:39:22 +0200 |
commit | 5a0a9201f45ebe908bce076572ebbfaf0e4ede3d (patch) | |
tree | d0930fe909f630e433257df76fb36f8a1ddbcfcb | |
parent | b54bc7252b2587f9840e02c23b7035d37b0ebfd8 (diff) | |
parent | df8e0f9bbe9eb3dc81194bcefc6339bcec6d8b94 (diff) | |
download | arctica-greeter-5a0a9201f45ebe908bce076572ebbfaf0e4ede3d.tar.gz arctica-greeter-5a0a9201f45ebe908bce076572ebbfaf0e4ede3d.tar.bz2 arctica-greeter-5a0a9201f45ebe908bce076572ebbfaf0e4ede3d.zip |
Merge branch 'Ionic-feature/gtk34-chooser'
Attributes GH PR #61: https://github.com/ArcticaProject/arctica-greeter/pull/61
-rw-r--r-- | configure.ac | 67 | ||||
-rw-r--r-- | src/Makefile.am | 15 | ||||
-rw-r--r-- | tests/Makefile.am | 15 |
3 files changed, 80 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 diff --git a/src/Makefile.am b/src/Makefile.am index 4c10950..015bd17 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -44,6 +44,7 @@ logo_generator_SOURCES = logo-generator.vala arctica_greeter_CFLAGS = \ $(ARCTICA_GREETER_CFLAGS) \ + $(GTK_CFLAGS) \ -w \ -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ -DLOCALEDIR=\"$(localedir)\" \ @@ -58,8 +59,21 @@ arctica_greeter_VALAFLAGS = \ $(AM_VALAFLAGS) \ --debug \ --pkg posix \ + $(NULL) + +if HAVE_GTK4 +arctica_greeter_VALAFLAGS += \ + --pkg gtk4 \ + --pkg gtk4-x11 \ + $(NULL) +else +arctica_greeter_VALAFLAGS += \ --pkg gtk+-3.0 \ --pkg gdk-x11-3.0 \ + $(NULL) +endif + +arctica_greeter_VALAFLAGS += \ --pkg gio-unix-2.0 \ --pkg x11 \ --pkg liblightdm-gobject-1 \ @@ -72,6 +86,7 @@ logo_generator_VALAFLAGS = $(arctica_greeter_VALAFLAGS) arctica_greeter_LDADD = \ $(ARCTICA_GREETER_LIBS) \ + $(GTK_LIBS) \ -lm logo_generator_LDADD = $(arctica_greeter_LDADD) diff --git a/tests/Makefile.am b/tests/Makefile.am index d2d0d32..f91abb4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -41,6 +41,7 @@ arctica_greeter_test_SOURCES = \ arctica_greeter_test_CFLAGS = \ $(ARCTICA_GREETER_CFLAGS) \ + $(GTK_CFLAGS) \ -w \ -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ -DLOCALEDIR=\""$(localedir)"\" \ @@ -52,8 +53,21 @@ arctica_greeter_test_CFLAGS = \ arctica_greeter_test_VALAFLAGS = \ --debug \ --pkg posix \ + $(NULL) + +if HAVE_GTK4 +arctica_greeter_test_VALAFLAGS += \ + --pkg gtk4 \ + --pkg gtk4-x11 \ + $(NULL) +else +arctica_greeter_test_VALAFLAGS += \ --pkg gtk+-3.0 \ --pkg gdk-x11-3.0 \ + $(NULL) +endif + +arctica_greeter_test_VALAFLAGS += \ --pkg gio-unix-2.0 \ --pkg x11 \ --pkg liblightdm-gobject-1 \ @@ -64,6 +78,7 @@ arctica_greeter_test_VALAFLAGS = \ arctica_greeter_test_LDADD = \ $(ARCTICA_GREETER_LIBS) \ + $(GTK_LIBS) \ -lm CLEANFILES = \ |