+2018-01-18 Uros Bizjak <ubizjak@gmail.com>
+
+ * configure.ac (AC_CHECK_HEADERS): Add linux/types.h. Conditionally
+ include linux/types.h when checking linux/random.h header.
+ * config.h.in: Regenerate.
+ * configure: Ditto.
+ * src/c++11/random.cc: Conditionally include linux/types.h.
+
2018-01-16 Eric Botcazou <ebotcazou@adacore.com>
* testsuite/17_intro/names.cc: Undefine 'y' on SPARC/Linux.
/* Define to 1 if you have the <linux/random.h> header file. */
#undef HAVE_LINUX_RANDOM_H
+/* Define to 1 if you have the <linux/types.h> header file. */
+#undef HAVE_LINUX_TYPES_H
+
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
-wchar.h wctype.h linux/random.h
+wchar.h wctype.h linux/types.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
done
+for ac_header in linux/random.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "linux/random.h" "ac_cv_header_linux_random_h" "#ifdef HAVE_LINUX_TYPES_H
+# include <linux/types.h>
+#endif
+
+"
+if test "x$ac_cv_header_linux_random_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_RANDOM_H 1
+_ACEOF
+
+fi
+
+done
+
+
# Only do link tests if native. Else, hardcode.
if $GLIBCXX_IS_NATIVE; then
locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
-wchar.h wctype.h linux/random.h])
+wchar.h wctype.h linux/types.h])
+
+AC_CHECK_HEADERS([linux/random.h], [], [],
+[[#ifdef HAVE_LINUX_TYPES_H
+# include <linux/types.h>
+#endif
+]])
# Only do link tests if native. Else, hardcode.
if $GLIBCXX_IS_NATIVE; then
# include <sys/ioctl.h>
#endif
+#ifdef _GLIBCXX_HAVE_LINUX_TYPES_H
+# include <linux/types.h>
+#endif
+
#ifdef _GLIBCXX_HAVE_LINUX_RANDOM_H
# include <linux/random.h>
#endif