Skip to content

Commit 18b7faa

Browse files
committed
[Build] Check for libgmp directly
Refactors the libgmp check during configure to use pkgconfig if available, and fallback to using autoconf's check header/check lib. Removes the m4 script as these checks can just be done directly in configure.ac.
1 parent 38f5978 commit 18b7faa

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

build-aux/m4/gmp.m4

Lines changed: 0 additions & 16 deletions
This file was deleted.

configure.ac

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,7 @@ if test x$use_pkgconfig = xyes; then
11681168
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads], [], [AC_MSG_ERROR([libevent_pthreads not found.])])
11691169
fi
11701170
PKG_CHECK_MODULES([SODIUM], [libsodium], [], [AC_MSG_ERROR([libsodium not found.])])
1171+
PKG_CHECK_MODULES([GMP], [gmp], [], [AC_MSG_ERROR([libgmp not found.])])
11711172
fi
11721173
11731174
if test "x$use_zmq" = "xyes"; then
@@ -1191,6 +1192,8 @@ else
11911192
fi
11921193
AC_CHECK_HEADER([sodium/core.h], [], [AC_MSG_ERROR([libsodium headers missing])])
11931194
AC_CHECK_LIB([sodium], [main], [SODIUM_LIBS=-lsodium], [AC_MSG_ERROR([libsodium missing])])
1195+
AC_CHECK_HEADER([gmp.h], [], [AC_MSG_ERROR([libgmp headers missing])])
1196+
AC_CHECK_LIB([gmp], [__gmpz_init], [LIBS="$LIBS -lgmp"], [AC_MSG_ERROR([libgmp missing])])
11941197
fi
11951198

11961199
if test "x$use_zmq" = "xyes"; then
@@ -1224,12 +1227,6 @@ else
12241227
fi
12251228
fi
12261229

1227-
dnl gmp check
1228-
GMP_CHECK
1229-
if test x"$has_gmp" != x"yes"; then
1230-
AC_MSG_ERROR([libgmp not found])
1231-
fi
1232-
12331230
dnl univalue check
12341231

12351232
need_bundled_univalue=yes

0 commit comments

Comments
 (0)