Skip to content

Commit 8761711

Browse files
committed
Build: Ubuntu Bionic gmp detection workaround
1 parent 4e0fd96 commit 8761711

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

configure.ac

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,14 @@ if test x$use_pkgconfig = xyes; then
11691169
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads], [], [AC_MSG_ERROR([libevent_pthreads not found.])])
11701170
fi
11711171
PKG_CHECK_MODULES([SODIUM], [libsodium], [], [AC_MSG_ERROR([libsodium not found.])])
1172-
PKG_CHECK_MODULES([GMP], [gmp], [], [AC_MSG_ERROR([libgmp not found.])])
1172+
dnl Ubuntu Bionic's libgmp-dev package doesn't include pkgconfig files,
1173+
dnl so we need to do some gymnastics here.
1174+
dnl TODO: Remove this drill down once Ubuntu Bionic is no longer supported.
1175+
PKG_CHECK_MODULES([GMP], [gmp], [], [
1176+
AC_CHECK_HEADER([gmp.h], [
1177+
AC_CHECK_LIB([gmp], [__gmpz_init], [LIBS="$LIBS -lgmp"], [AC_MSG_ERROR([libgmp missing])])
1178+
], [AC_MSG_ERROR([libgmp headers missing])])
1179+
], [AC_MSG_ERROR([libgmp not found.])])
11731180
fi
11741181
11751182
if test "x$use_zmq" = "xyes"; then

0 commit comments

Comments
 (0)