summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac11
-rw-r--r--ice.pc.in2
-rw-r--r--src/iceauth.c4
3 files changed, 7 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index e131ba8..1c9bcf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,17 +31,14 @@ XORG_CHECK_SGML_DOCTOOLS(1.8)
# Obtain compiler/linker options for dependencies
PKG_CHECK_MODULES(ICE, [xproto >= 7.0.25 xtrans])
+PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay], [
+ CFLAGS="$CFLAGS $LIBBSD_CFLAGS"
+ LIBS="$LIBS $LIBBSD_LIBS"
+], [:])
# Checks for library functions.
-AC_SEARCH_LIBS([arc4random_buf], [bsd])
AC_CHECK_FUNCS([asprintf arc4random_buf getentropy])
-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)
-
# Transport selection macro from xtrans.m4
XTRANS_CONNECTION_FLAGS
AC_DEFINE(ICE_t, 1, [Xtrans transport type])
diff --git a/ice.pc.in b/ice.pc.in
index c88962d..b126404 100644
--- a/ice.pc.in
+++ b/ice.pc.in
@@ -9,4 +9,4 @@ Version: @PACKAGE_VERSION@
Requires: xproto
Cflags: -I${includedir}
Libs: -L${libdir} -lICE
-Libs.Private: @BSDLIB@
+Libs.Private: @LIBBSD_LIBS@
diff --git a/src/iceauth.c b/src/iceauth.c
index 807e5d7..5a4d400 100644
--- a/src/iceauth.c
+++ b/src/iceauth.c
@@ -35,8 +35,8 @@ Author: Ralph Mor, X Consortium
#include <time.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/stdlib.h> /* for arc4random_buf() */
+#ifdef HAVE_ARC4RANDOM_BUF
+#include <stdlib.h> /* for arc4random_buf() */
#endif
#include <unistd.h>