On Fri, Feb 12, 1999 at 04:02:31PM +0100, Niels Möller wrote:
> Rafal Maszkowski <[EMAIL PROTECTED]> writes:
> > Another missing function is cfmakeraw() - I defined it as desribed in Linux man
> > page:
> > #define     cfmakeraw(termios_p)    { (termios_p)->c_iflag &= 
>~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); (termios_p)->c_oflag &= 
>~OPOST; (termios_p)->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 
>(termios_p)->c_cflag &= ~(CSIZE|PARENB); (termios_p)->c_cflag |= CS8; }
> So we'll need a configure test and a fallback for this function.

> > - add another compatibility function and test - cfmakeraw()
> That would be good. Something like #if !HAVE_CFMAKERAW #define
> cfmakeraw(... should do.

Done, seems to work (on Solaris). Diff between 1999-01-29 and my changes:

diff -ru lsh-snapshot-1999-01-28.orig/configure.in lsh-snapshot-1999-01-28/configure.in
--- lsh-snapshot-1999-01-28.orig/configure.in   Thu Jan 28 08:55:06 1999
+++ lsh-snapshot-1999-01-28/configure.in        Sun Feb 14 05:20:42 1999
@@ -178,9 +178,11 @@
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(select socket strerror strtol)
 AC_CHECK_FUNCS(getspnam)
-AC_CHECK_FUNCS(vsnprintf inet_aton)
+AC_CHECK_FUNCS(inet_aton)
+AC_CHECK_FUNCS(snprintf,,[LIBOBJS="snprintf.o $LIBOBJS"])
 AC_CHECK_FUNCS(openpty)
 AC_CHECK_FUNCS(poll,,[LIBOBJS="jpoll.o $LIBOBJS"])
+AC_CHECK_FUNCS(cfmakeraw)
 
 dnl This macro is mentioned in the automake manual, but where is it
 dnl supposed to be defined?
@@ -291,8 +293,8 @@
 fi
 
 AC_MSG_CHECKING(for BSD pty names)
-AC_DEFINE_UNQUOTED(PTY_BSD_SCHEME_FIRST_CHARS, "`ls /dev/pty* | cut -c 9-9 | uniq | 
tr -d '\n'`")
-AC_DEFINE_UNQUOTED(PTY_BSD_SCHEME_SECOND_CHARS, "`ls /dev/pty* | cut -c 10-10 | sort 
| uniq | tr -d '\n'`")
+AC_DEFINE_UNQUOTED(PTY_BSD_SCHEME_FIRST_CHARS, "`ls /dev/pty* | cut -c 9-9 | uniq | 
+tr -d '\012'`")
+AC_DEFINE_UNQUOTED(PTY_BSD_SCHEME_SECOND_CHARS, "`ls /dev/pty* | cut -c 10-10 | sort 
+| uniq | tr -d '\012'`")
 AC_DEFINE(PTY_BSD_SCHEME)
 AC_MSG_RESULT([done])
 

diff -ru lsh-snapshot-1999-01-28.orig/src/tty.h lsh-snapshot-1999-01-28/src/tty.h
--- lsh-snapshot-1999-01-28.orig/src/tty.h      Thu Jan 28 09:56:37 1999
+++ lsh-snapshot-1999-01-28/src/tty.h   Sun Feb 14 05:19:56 1999
@@ -42,4 +42,8 @@
 struct lsh_string *tty_encode_term_mode(struct termios *ios);
 int tty_decode_term_mode(struct termios *ios, UINT32 t_len, UINT8 *t_modes);
 
+#ifndef HAVE_CFMAKERAW
+#define        cfmakeraw(termios_p)    { (termios_p)->c_iflag &= 
+~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); (termios_p)->c_oflag &= 
+~OPOST; (termios_p)->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 
+(termios_p)->c_cflag &= ~(CSIZE|PARENB); (termios_p)->c_cflag |= CS8; }
+#endif
+
 #endif

R.

Reply via email to