Skip to content

Commit 4e0fd96

Browse files
committed
Merge #2971: [Build] Check for libgmp directly
18b7faa [Build] Check for libgmp directly (Fuzzbawls) Pull request description: 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. ACKs for top commit: 18b7faa Duddino: ACK 18b7faa Liquid369: ACK 18b7faa Tree-SHA512: 89fb95dcb94768bfb44e45e6dc57e92572a300d5dfe30a79a44871ba5f7605320df9f3f0a2eda5ca456ffdb5e90756ea1495de57e7d97a0484e2c3a4d5bfb157
2 parents fa016fd + 18b7faa commit 4e0fd96

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
@@ -1169,6 +1169,7 @@ 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.])])
11721173
fi
11731174
11741175
if test "x$use_zmq" = "xyes"; then
@@ -1192,6 +1193,8 @@ else
11921193
fi
11931194
AC_CHECK_HEADER([sodium/core.h], [], [AC_MSG_ERROR([libsodium headers missing])])
11941195
AC_CHECK_LIB([sodium], [main], [SODIUM_LIBS=-lsodium], [AC_MSG_ERROR([libsodium missing])])
1196+
AC_CHECK_HEADER([gmp.h], [], [AC_MSG_ERROR([libgmp headers missing])])
1197+
AC_CHECK_LIB([gmp], [__gmpz_init], [LIBS="$LIBS -lgmp"], [AC_MSG_ERROR([libgmp missing])])
11951198
fi
11961199

11971200
if test "x$use_zmq" = "xyes"; then
@@ -1225,12 +1228,6 @@ else
12251228
fi
12261229
fi
12271230

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

12361233
need_bundled_univalue=yes

0 commit comments

Comments
 (0)