summaryrefslogtreecommitdiff
path: root/gdbsupport/common.m4
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-10-20 12:47:07 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2023-01-05 14:38:51 -0500
commit8b35ed1febd786c7aec34bbd7080c73a7c91bfca (patch)
treeca39491788734538b4d8cfbb6547cc466738ff81 /gdbsupport/common.m4
parent2b16913cdca20ae1dafdbd816b025a6efdc6c06f (diff)
downloadbinutils-gdb-8b35ed1febd786c7aec34bbd7080c73a7c91bfca.tar.gz
gdbsupport: move libxxhash configure check to gdbsupport
The following patch moves the fast_hash function, which uses libxxhash, to gdbsupport. Move the libxxhash configure check to gdbsupport (and transitively to gdbserver). Change-Id: I242499e50c8cd6fe9f51e6e92dc53a1b3daaa96e Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdbsupport/common.m4')
-rw-r--r--gdbsupport/common.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
index 7b100262c29..c6b9a25b744 100644
--- a/gdbsupport/common.m4
+++ b/gdbsupport/common.m4
@@ -215,6 +215,30 @@ AC_DEFUN([GDB_AC_COMMON], [
BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
fi
+
+ dnl xxhash support
+ # Check for xxhash
+ AC_ARG_WITH(xxhash,
+ AS_HELP_STRING([--with-xxhash], [use libxxhash for hashing (faster) (auto/yes/no)]),
+ [], [with_xxhash=auto])
+
+ if test "x$with_xxhash" != "xno"; then
+ AC_LIB_HAVE_LINKFLAGS([xxhash], [],
+ [#include <xxhash.h>],
+ [XXH32("foo", 3, 0);
+ ])
+ if test "$HAVE_LIBXXHASH" != yes; then
+ if test "$with_xxhash" = yes; then
+ AC_MSG_ERROR([xxhash is missing or unusable])
+ fi
+ fi
+ if test "x$with_xxhash" = "xauto"; then
+ with_xxhash="$HAVE_LIBXXHASH"
+ fi
+ fi
+
+ AC_MSG_CHECKING([whether to use xxhash])
+ AC_MSG_RESULT([$with_xxhash])
])
dnl Check that the provided value ($1) is either "yes" or "no". If not,