summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-03-05 19:28:08 +1100
committerDarren Tucker <dtucker@dtucker.net>2018-03-05 19:28:08 +1100
commit58fd4c5c0140f6636227ca7acbb149ab0c2509b9 (patch)
tree51a79fa23c4140148ba59f9c43107fedefe9bbae /configure.ac
parent71e48bc7945f867029e50e06c665c66aed6d3c64 (diff)
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.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
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 <stdio.h>]], [[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