libostree: Link with libgpg-error for gpg_strerror_r API
authorKhem Raj <raj.khem@gmail.com>
Mon, 12 Jun 2023 21:04:44 +0000 (14:04 -0700)
committerKhem Raj <raj.khem@gmail.com>
Wed, 14 Jun 2023 16:39:34 +0000 (09:39 -0700)
With f461c02bb55bf2853a3b81ed5c8618040ab54e98 use of gpg_strerror_r
was added this symbol comes from libgpg-error however, therefore its
needed to add -lgpg-error to cmdline to resolve this symbol especially
with gold and lld linker. Fixes

aarch64-yoe-linux-ld.lld: error: undefined reference due to --no-allow-shlib-undefined: gpg_strerror_r
>>> referenced by ./.libs/libostree-1.so

configure.ac

index f7ae2d64b7725b4dafcf3d771a6efa827d3947ca..fab8941b0a79560f7bc92ca3b0608b500a3208b1 100644 (file)
@@ -243,8 +243,7 @@ AC_ARG_WITH(gpgme,
            [], [with_gpgme=yes])
 AS_IF([test x$with_gpgme != xno], [
     have_gpgme=yes
-    PKG_CHECK_MODULES([OT_DEP_GPGME], gpgme >= $LIBGPGME_DEPENDENCY, [], have_gpgme=no)
-    PKG_CHECK_MODULES([OT_DEP_GPG_ERROR], [gpg-error], [], have_gpgme=no)
+    PKG_CHECK_MODULES([OT_DEP_GPGME], [gpgme >= $LIBGPGME_DEPENDENCY gpg-error], [have_gpgme=yes], [have_gpgme=no])
     ]
 )
 AS_IF([test x$with_gpgme != xno && test x$have_gpgme != xyes], [