summaryrefslogtreecommitdiff
path: root/mcon/U/i_termio.U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U/i_termio.U')
-rw-r--r--mcon/U/i_termio.U39
1 files changed, 25 insertions, 14 deletions
diff --git a/mcon/U/i_termio.U b/mcon/U/i_termio.U
index 816c63d..c53cc1e 100644
--- a/mcon/U/i_termio.U
+++ b/mcon/U/i_termio.U
@@ -1,11 +1,11 @@
-?RCS: $Id: i_termio.U 1 2006-08-24 12:32:52Z rmanfredi $
+?RCS: $Id: i_termio.U 167 2013-05-08 17:58:00Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
-?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: i_termio.U,v $
@@ -13,7 +13,7 @@
?RCS: patch36: call ./usg and ./Cppsym explicitely instead of relying on PATH
?RCS:
?RCS: Revision 3.0.1.3 1994/08/29 16:26:38 ram
-?RCS: patch32: don't include all threee I_* symbols in config.h
+?RCS: patch32: don't include all three I_* symbols in config.h
?RCS: patch32: (had forgotten to undo this part last time)
?RCS:
?RCS: Revision 3.0.1.2 1994/05/13 15:25:03 ram
@@ -25,7 +25,8 @@
?RCS: Revision 3.0 1993/08/18 12:08:44 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
-?MAKE:i_termio i_sgtty i_termios: test Inlibc Cppsym Guess Setvar Findhdr Warn
+?MAKE:i_termio i_sgtty i_termios: Trylink Cppsym Guess Setvar Findhdr Warn \
+ test cat
?MAKE: -pick add $@ %<
?S:i_termio:
?S: This variable conditionally defines the I_TERMIO symbol, which
@@ -69,11 +70,21 @@ val="$undef"
val2="$undef"
val3="$undef"
?X: Prefer POSIX-approved termios.h over all else
-if $test `./findhdr termios.h`; then
- set tcsetattr i_termios
- eval $inlibc
- val3="$i_termios"
-fi
+$cat >try.c <<EOC
+#include <termios.h>
+int main(void)
+{
+ static struct termios t;
+ static int ret;
+ ret |= tcsetattr(1, 2, &t);
+ return ret ? 0 : 1;
+}
+EOC
+set i_termios
+eval $trylink
+set tcsetattr i_termios
+val3="$i_termios"
+
echo " "
case "$val3" in
"$define") echo "You have POSIX termios.h... good!" >&4;;
@@ -84,14 +95,14 @@ case "$val3" in
echo "<sgtty.h> found." >&4
else
echo "System is pyramid with BSD universe."
- ./warn "<sgtty.h> not found--you could have problems."
+ ./warn "<sgtty.h> not found--you could have problems." 4>&4
fi;;
*) if $test `./findhdr termio.h`; then
val="$define"
echo "<termio.h> found." >&4
else
echo "System is pyramid with USG universe."
- ./warn "<termio.h> not found--you could have problems."
+ ./warn "<termio.h> not found--you could have problems." 4>&4
fi;;
esac
?X: Start with USG to avoid problems if both usg/bsd was guessed
@@ -103,7 +114,7 @@ case "$val3" in
echo "<sgtty.h> found." >&4
val2="$define"
else
- ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
+ ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!" 4>&4
fi
else
if $test `./findhdr sgtty.h`; then
@@ -113,7 +124,7 @@ case "$val3" in
echo "<termio.h> found." >&4
val="$define"
else
- ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
+ ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!" 4>&4
fi
fi;;
esac