From 58fd4c5c0140f6636227ca7acbb149ab0c2509b9 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 5 Mar 2018 19:28:08 +1100 Subject: Check for and work around buggy fflush(NULL). Some really old platforms (eg SunOS4) segfault on fflush(NULL) so check for and work around. With klausz at haus-gisela.de. --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 70e72be7..d2fb4469 100644 --- a/configure.ac +++ b/configure.ac @@ -2059,6 +2059,16 @@ AC_CHECK_FUNCS([realpath], [ ) ]) +AC_MSG_CHECKING([for working fflush(NULL)]) +AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[#include ]], [[fflush(NULL); exit(0);]])], + AC_MSG_RESULT([yes]), + [AC_MSG_RESULT([no]) + AC_DEFINE([FFLUSH_NULL_BUG], [1], + [define if fflush(NULL) does not work])], + AC_MSG_WARN([cross compiling: assuming working]) +) + dnl Checks for time functions AC_CHECK_FUNCS([gettimeofday time]) dnl Checks for utmp functions -- cgit v1.2.3