summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorFabrice Fontaine <fontaine.fabrice@gmail.com>2022-02-14 21:17:39 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-02-15 13:36:35 -0800
commitfb57ad9b9d107856e5f1c8135da04ffa2f7a11ac (patch)
tree50b56120715eefaeab8632d8cb16d8e2f19f937d /configure.ac
parentb5ff08b267445f9407d6eefad86cde45ec3a50a2 (diff)
downloadbluez-fb57ad9b9d107856e5f1c8135da04ffa2f7a11ac.tar.gz
build: Fix errors with glibc < 2.25
getrandom and sys/random.h are only available since glibc 2.25: https://www.gnu.org/software/gnulib/manual/html_node/sys_002frandom_002eh.html resulting in the following build failures since version 5.63 and https://git.kernel.org/pub/scm/bluetooth/bluez.git/log/?qt=grep&q=getrandom: plugins/autopair.c:20:24: fatal error: sys/random.h: No such file or directory #include <sys/random.h> ^ To fix this build failure, add util_getrandom and a fallback (borrowed from pipewire and licensed under MIT): https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/pipewire/utils.c Fixes: - http://autobuild.buildroot.org/results/6b8870d12e0804d6154230a7322c49416c1dc0e2
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 07d068a4d..441bd5f29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,8 @@ AC_ARG_ENABLE(threads, AS_HELP_STRING([--enable-threads],
AC_CHECK_FUNCS(explicit_bzero)
+AC_CHECK_FUNCS(getrandom)
+
AC_CHECK_FUNCS(rawmemchr)
AC_CHECK_FUNC(signalfd, dummy=yes,
@@ -68,7 +70,7 @@ AC_CHECK_LIB(pthread, pthread_create, dummy=yes,
AC_CHECK_LIB(dl, dlopen, dummy=yes,
AC_MSG_ERROR(dynamic linking loader is required))
-AC_CHECK_HEADERS(linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h)
+AC_CHECK_HEADERS(linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h)
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
AC_MSG_ERROR(GLib >= 2.28 is required))