aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Herbert Valerio Riedel <hvr@gnu.org>2016-01-30 16:46:56 +0100
committerGravatar Herbert Valerio Riedel <hvr@gnu.org>2016-01-30 16:56:57 +0100
commitd17b03d4d4525103f1995441045eae4c2c73355d (patch)
tree4fda6f1009df39f4a87b8cd9c7e887e6fc2f59e6 /configure.ac
parent4f3b5d8b87eef07d8df62a8d7240830bb81a8a6b (diff)
Don't assume `tcdrain` and `ctermid` exist always
This follows the scheme suggested in #24 This fixes #55
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 24ea3a5..f883624 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,19 @@ AC_CHECK_DECLS([fdatasync],[AC_CHECK_FUNCS([fdatasync])])
AC_CHECK_FUNCS([posix_fadvise posix_fallocate])
+# Some termios(3) functions known to be missing sometimes (see also #55)
+AC_CHECK_DECLS([tcdrain],[AC_DEFINE([HAVE_TCDRAIN],[1],[Define to 1 if you have the `tcdrain' function.])],[],[AC_INCLUDES_DEFAULT
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+])
+
+AC_CHECK_DECLS([ctermid],[AC_DEFINE([HAVE_CTERMID],[1],[Define to 1 if you have the `ctermid' function.])],[],[AC_INCLUDES_DEFAULT
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+])
+
# Avoid adding rt if absent or unneeded
# shm_open needs -lrt on linux
AC_SEARCH_LIBS(shm_open, rt, [AC_CHECK_FUNCS([shm_open shm_unlink])])