diff options
author | Guillem Jover <guillem@hadrons.org> | 2022-10-06 00:31:30 +0000 |
---|---|---|
committer | Guillem Jover <guillem@hadrons.org> | 2022-10-06 00:31:30 +0000 |
commit | e5ace1c5fe009e5c66fa16f886b13cce2558684a (patch) | |
tree | 070fdf17d6c951432445265ab1250d4258a52a2d | |
parent | b71d34f635d8827db76310a4b127a6926f2df1d7 (diff) |
Switch from libbsd to libbsd-overlay
This is the preferred usage form for libbsd, as it makes the code more
portable and requires no special includes for libbsd, by transparently
injects the needed standard headers that would be used on a BSD.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
-rw-r--r-- | Key.c | 4 | ||||
-rw-r--r-- | configure.ac | 6 |
2 files changed, 5 insertions, 5 deletions
@@ -32,10 +32,6 @@ in this Software without prior written authorization from The Open Group. #include <X11/Xmd.h> #include <X11/Xdmcp.h> -#ifdef HAVE_LIBBSD -#include <bsd/stdlib.h> /* for arc4random_buf() */ -#endif - #ifndef HAVE_ARC4RANDOM_BUF static void getbits (long data, unsigned char *dst) diff --git a/configure.ac b/configure.ac index c8e74b7..3d8d76f 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,11 @@ AC_PROG_LN_S AC_CHECK_HEADERS([sys/random.h]) # Checks for libraries. +PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay], [ + CFLAGS="$CFLAGS $LIBBSD_CFLAGS" + LIBS="$LIBS $LIBBSD_LIBS" +], [:]) + AC_SEARCH_LIBS([recvfrom],[socket]) case $host_os in @@ -67,7 +72,6 @@ case $host_os in esac # Checks for library functions. -AC_CHECK_LIB([bsd], [arc4random_buf]) AC_CHECK_FUNCS([srand48 lrand48 arc4random_buf getentropy]) # Obtain compiler/linker options for dependencies |