summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-20 16:54:52 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-20 17:09:46 -0700
commit76fd1cf6534358426cddaed045514d79270275b5 (patch)
tree156d8cdf09da414b1027b9833ec7027deebab0ff /configure.ac
parent0124a9ea65118ae70bcc155e2a9a36a6c4869310 (diff)
Only link to libbsd for arc4random_buf if it is not found in libc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 74cd4da..387a66b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,10 +33,11 @@ XORG_CHECK_SGML_DOCTOOLS(1.8)
PKG_CHECK_MODULES(ICE, xproto xtrans)
# Checks for library functions.
-AC_CHECK_LIB([bsd], [arc4random_buf])
+AC_SEARCH_LIBS([arc4random_buf], [bsd])
AC_CHECK_FUNCS([asprintf arc4random_buf getentropy])
-if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes; then
+if test "x$ac_cv_search_arc4random_buf" = x-lbsd; then
+ AC_DEFINE([HAVE_LIBBSD], [1], [Define to use libbsd])
BSDLIB=-lbsd
fi
AC_SUBST(BSDLIB)