From 3e4c23188fc0c0ac9aea53daffb36c2514f1f4f0 Mon Sep 17 00:00:00 2001 From: Fuzzbawls Date: Wed, 2 Jul 2025 20:07:07 -0700 Subject: [PATCH] Build: Ubuntu Bionic gmp detection workaround Ubuntu Bionic's libgmp-dev package doesn't include pkgconfig files, so we need to do some fallback checking during the configure process. --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8abbc384bf4d..4fe76b2f43cd 100644 --- a/configure.ac +++ b/configure.ac @@ -1169,7 +1169,14 @@ if test x$use_pkgconfig = xyes; then PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads], [], [AC_MSG_ERROR([libevent_pthreads not found.])]) fi PKG_CHECK_MODULES([SODIUM], [libsodium], [], [AC_MSG_ERROR([libsodium not found.])]) - PKG_CHECK_MODULES([GMP], [gmp], [], [AC_MSG_ERROR([libgmp not found.])]) + dnl Ubuntu Bionic's libgmp-dev package doesn't include pkgconfig files, + dnl so we need to do some gymnastics here. + dnl TODO: Remove this drill down once Ubuntu Bionic is no longer supported. + PKG_CHECK_MODULES([GMP], [gmp], [], [ + AC_CHECK_HEADER([gmp.h], [ + AC_CHECK_LIB([gmp], [__gmpz_init], [LIBS="$LIBS -lgmp"], [AC_MSG_ERROR([libgmp missing])]) + ], [AC_MSG_ERROR([libgmp headers missing])]) + ]) fi if test "x$use_zmq" = "xyes"; then