$OpenBSD: patch-configure_ac,v 1.2 2017/09/27 08:36:53 robert Exp $

Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -53,11 +53,13 @@ case "$host_os" in
 	openbsd*)
 		BUILDOS="openbsd"
 		ZCPPFLAGS="$ZCPPFLAGS -DOPENBSD"
+		TINFO_LIB=""
 		LN_TFSV="ln -fs"
 		;;
 	linux*)
 		BUILDOS="linux"
 		ZCPPFLAGS="$ZCPPFLAGS -DLINUX"
+		TINFO_LIB="-ltinfo"
 		LN_TFSV="ln -Tfsv"
 		;;
 esac
@@ -259,7 +261,7 @@ AC_DEFUN([LIBNCURSES_WITH_CONFIG],[
 		[
 			dnl just pick the lowest common denominator
 			NCURSES_FLAGS=""
-			NCURSES_LIBS="-lncurses -ltinfo"
+			NCURSES_LIBS="-lncurses ${TINFO_LIB}"
 		]
 	)
 	dnl We should be using ncurses.h - or is portability to non-ncurses
@@ -520,11 +522,11 @@ AC_SEARCH_LIBS([crypt_r], [crypt], [
 ])
 LIBS="$LIBS_system"
 AC_SEARCH_LIBS([clock_gettime], [rt], [
-	AS_IF([test "$LIBS" = "$LIBS_system"], [clock_LIBS=""], [clock_LIBS="-lrt"])
+	AS_IF([test "$LIBS" = "$LIBS_system"], [clock_LIBS=""], [clock_LIBS=""])
 ])
 LIBS="$LIBS_system"
 AC_SEARCH_LIBS([timer_create], [rt], [
-	AS_IF([test "$LIBS" = "$LIBS_system"], [timer_LIBS=""], [timer_LIBS="-lrt"])
+	AS_IF([test "$LIBS" = "$LIBS_system"], [timer_LIBS=""], [timer_LIBS=""])
 ])
 dnl AC_SEARCH_LIBS does not set any define in config.h, so check again
 AC_CHECK_FUNCS([timer_create])
@@ -704,6 +706,8 @@ ZCPPFLAGS="$ZCPPFLAGS $icu_uc_CFLAGS $icu_i18n_CFLAGS"
 # all libs for programs, because functions are in static common stuff
 PROG_LIBS="$UUID_LIBS $INTL_LIBS $ICONV_LIBS $GZ_LIBS"
 AC_SUBST(PROG_LIBS)
+
+AC_CHECK_FUNCS([arc4random_buf])
 
 # done testing C++ requirements
 AC_LANG_POP
