commit a58870f63a661211d45b393779ef3ed1dab2e3b8
parent 20eceebc77378727c836f846f8432d20c0ec4ac7
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sat, 1 Jun 2019 23:45:57 +0300
configure: check for 'rand' and 'random' by MHD_CHECK_FUNC
Diffstat:
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
@@ -772,7 +772,23 @@ AC_CHECK_HEADERS([zlib.h],[have_zlib=yes],[have_zlib=no], [AC_INCLUDES_DEFAULT])
AM_CONDITIONAL([HAVE_ZLIB], [[test "x$have_zlib" = xyes]])
# Check for generic functions
-AC_CHECK_FUNCS([rand random])
+MHD_CHECK_FUNC([random],
+ [
+AC_INCLUDES_DEFAULT
+[#include <stdlib.h>
+ ]],
+ [[long int r = random(); (void)r;]],
+ [],
+ [
+ MHD_CHECK_FUNC([rand],
+ [
+AC_INCLUDES_DEFAULT
+[#include <stdlib.h>
+ ]],
+ [[int r = rand(); (void)r;]],
+ )
+ ]
+)
AC_CHECK_MEMBERS([struct sockaddr_in.sin_len, struct sockaddr_in6.sin6_len,
struct sockaddr_storage.ss_len],