summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-04-04 19:11:16 (GMT)
committerhobbs <hobbs>2001-04-04 19:11:16 (GMT)
commit8c319f69584261fce6e52e52b63efb91642a940f (patch)
treeed00b9c8eec807e0b5fabde9d9e72337c9586e10 /unix/tcl.m4
parent1bc23f4977493306750102c044b833c0b2b73244 (diff)
downloadtcl-8c319f69584261fce6e52e52b63efb91642a940f.zip
tcl-8c319f69584261fce6e52e52b63efb91642a940f.tar.gz
tcl-8c319f69584261fce6e52e52b63efb91642a940f.tar.bz2
* unix/configure:
* unix/tcl.m4: extended test of termios vs. termio vs. sgtty to better detect result on Linux and when certain configure redirections are being used. (max) [Patch #402923; Bug #227412, #219194]
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m460
1 files changed, 60 insertions, 0 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index e4587ea..0bef313 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1287,8 +1287,68 @@ main()
}
return 1;
}], tk_ok=sgtty, tk_ok=none, tk_ok=none)
+
if test $tk_ok = sgtty; then
AC_DEFINE(USE_SGTTY)
+ else
+ AC_TRY_RUN([
+#include <termios.h>
+#include <errno.h>
+
+main()
+{
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tk_ok=termios, tk_ok=no, tk_ok=no)
+
+ if test $tk_ok = termios; then
+ AC_DEFINE(USE_TERMIOS)
+ else
+ AC_TRY_RUN([
+#include <termio.h>
+#include <errno.h>
+
+main()
+{
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }], tk_ok=termio, tk_ok=no, tk_ok=no)
+
+ if test $tk_ok = termio; then
+ AC_DEFINE(USE_TERMIO)
+ else
+ AC_TRY_RUN([
+#include <sgtty.h>
+#include <errno.h>
+
+main()
+{
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tk_ok=sgtty, tk_ok=none, tk_ok=none)
+
+ if test $tk_ok = sgtty; then
+ AC_DEFINE(USE_SGTTY)
+ fi
+ fi
+ fi
fi
fi
fi