From: Yaakov Selkowitz via Gnupg-devel Date: Mon, 11 Mar 2024 03:19:36 +0000 (-0400) Subject: gnome3: prefer gcr-4 X-Git-Url: https://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commitdiff_plain;h=069c2192234566c14840aefced795039d1f79137 gnome3: prefer gcr-4 Newer distributions are now using gcr-4, while older ones will still have gcr-3. The APIs used by pinentry have not changed in between versions, only the top-level header has changed. Also, for gcr-3, only gcr-base-3 is required. (I have attempted to sign up for a dev.gnupg.org account, but am still awaiting verification.) Signed-off-by: Yaakov Selkowitz --- diff --git a/configure.ac b/configure.ac index f9d090f..7dde8fb 100644 --- a/configure.ac +++ b/configure.ac @@ -458,15 +458,24 @@ AM_CONDITIONAL(BUILD_PINENTRY_GTK_2, test "$pinentry_gtk_2" = "yes") if test "$pinentry_gnome_3" != "no"; then PKG_CHECK_MODULES( GNOME3, - [gcr-3,gcr-base-3], + [gcr-4], [ pinentry_gnome_3=yes AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Nod nod]) + AC_DEFINE(GCR_API_4, 1, [GCR API version]) ], - [ - AC_MSG_WARN([pkg-config could not find the module gcr-3,gcr-base-3]) - pinentry_gnome_3=no - ] + [PKG_CHECK_MODULES( + GNOME3, + [gcr-base-3], + [ + pinentry_gnome_3=yes + AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Nod nod]) + ], + [ + AC_MSG_WARN([pkg-config could not find the module gcr-4 or gcr-base-3]) + pinentry_gnome_3=no + ] + )] ) fi diff --git a/gnome3/pinentry-gnome3.c b/gnome3/pinentry-gnome3.c index 8a8fbed..7f21d6f 100644 --- a/gnome3/pinentry-gnome3.c +++ b/gnome3/pinentry-gnome3.c @@ -23,7 +23,11 @@ # include "config.h" #endif +#ifdef GCR_API_4 +#include +#else #include +#endif #include #include