aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2018-08-14 22:51:36 +0000
committerRainer Orth <ro@gcc.gnu.org>2018-08-14 22:51:36 +0000
commit864c28e135b9aa6b66b1ccc36495a0d6be8b885e (patch)
tree82c8265f8c4d153b505b42446f8566d038ff3760
parentaa7df52e4f86b6a92ab236895a85ce2cb7b1a98b (diff)
downloadgcc-864c28e135b9aa6b66b1ccc36495a0d6be8b885e.zip
gcc-864c28e135b9aa6b66b1ccc36495a0d6be8b885e.tar.gz
gcc-864c28e135b9aa6b66b1ccc36495a0d6be8b885e.tar.bz2
Include <sys/random.h> for getentropy on Solaris
* configure.ac: Check for <sys/random.h>. * configure, config.h.in: Regenerate. * intrinsics/random.c [HAVE_SYS_RANDOM_H]: Include <sys/random.h>. From-SVN: r263543
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/config.h.in3
-rwxr-xr-xlibgfortran/configure7
-rw-r--r--libgfortran/configure.ac5
-rw-r--r--libgfortran/intrinsics/random.c3
5 files changed, 20 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index b8f238e..c1e236e 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2018-08-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac: Check for <sys/random.h>.
+ * configure, config.h.in: Regenerate.
+ * intrinsics/random.c [HAVE_SYS_RANDOM_H]: Include <sys/random.h>.
+
2018-08-13 Janne Blomqvist <jb@gcc.gnu.org>
* configure.ac: Check for getentropy.
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index 9ad64d5..65fd27c 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -744,6 +744,9 @@
/* Define to 1 if the target supports __sync_fetch_and_add */
#undef HAVE_SYNC_FETCH_AND_ADD
+/* Define to 1 if you have the <sys/random.h> header file. */
+#undef HAVE_SYS_RANDOM_H
+
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
diff --git a/libgfortran/configure b/libgfortran/configure
index 42b4c0b..a583b67 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -2547,6 +2547,7 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
fi
as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/random.h"
as_fn_append ac_header_list " sys/time.h"
as_fn_append ac_header_list " sys/times.h"
as_fn_append ac_header_list " sys/resource.h"
@@ -12513,7 +12514,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12516 "configure"
+#line 12517 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12619,7 +12620,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12622 "configure"
+#line 12623 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16184,6 +16185,8 @@ done
+
+
inttype_headers=`echo inttypes.h sys/inttypes.h | sed -e 's/,/ /g'`
acx_cv_header_stdint=stddef.h
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 900c746..05952aa 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -275,8 +275,9 @@ AC_TYPE_UINTPTR_T
AC_CHECK_TYPES([ptrdiff_t])
# check header files (we assume C89 is available, so don't check for that)
-AC_CHECK_HEADERS_ONCE(unistd.h sys/time.h sys/times.h sys/resource.h \
-sys/types.h sys/stat.h sys/wait.h floatingpoint.h ieeefp.h fenv.h fptrap.h \
+AC_CHECK_HEADERS_ONCE(unistd.h sys/random.h sys/time.h sys/times.h \
+sys/resource.h sys/types.h sys/stat.h sys/wait.h \
+floatingpoint.h ieeefp.h fenv.h fptrap.h \
fpxcp.h pwd.h complex.h xlocale.h)
GCC_HEADER_STDINT(gstdint.h)
diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c
index 229fa69..f84905e 100644
--- a/libgfortran/intrinsics/random.c
+++ b/libgfortran/intrinsics/random.c
@@ -37,6 +37,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <sys/stat.h>
#include <fcntl.h>
#include "time_1.h"
+#ifdef HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#endif
#ifdef __MINGW32__
#define HAVE_GETPID 1