| 1 |
# random_r.m4 |
| 2 |
# serial 5 |
| 3 |
dnl Copyright (C) 2008-2025 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
AC_DEFUN([gl_FUNC_RANDOM_R], |
| 10 |
[ |
| 11 |
AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) |
| 12 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 13 |
|
| 14 |
AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT]) |
| 15 |
if test $ac_cv_header_random_h = no; then |
| 16 |
HAVE_RANDOM_H=0 |
| 17 |
fi |
| 18 |
|
| 19 |
AC_CHECK_TYPES([struct random_data], |
| 20 |
[], [HAVE_STRUCT_RANDOM_DATA=0], |
| 21 |
[[#include <stdlib.h> |
| 22 |
#if HAVE_RANDOM_H |
| 23 |
# include <random.h> |
| 24 |
#endif |
| 25 |
]]) |
| 26 |
|
| 27 |
dnl On AIX and OSF/1, these functions exist, but with different declarations. |
| 28 |
dnl Override them all. |
| 29 |
case "$host_os" in |
| 30 |
aix* | osf*) |
| 31 |
REPLACE_RANDOM_R=1 |
| 32 |
;; |
| 33 |
*) |
| 34 |
AC_CHECK_FUNCS([random_r]) |
| 35 |
if test $ac_cv_func_random_r = no; then |
| 36 |
HAVE_RANDOM_R=0 |
| 37 |
fi |
| 38 |
;; |
| 39 |
esac |
| 40 |
]) |
| 41 |
|
| 42 |
# Prerequisites of lib/random_r.c. |
| 43 |
AC_DEFUN([gl_PREREQ_RANDOM_R], [ |
| 44 |
: |
| 45 |
]) |