summaryrefslogtreecommitdiff
path: root/x11/9term
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2001-05-01 09:35:40 +0000
committeragc <agc@pkgsrc.org>2001-05-01 09:35:40 +0000
commit8744bbe3b0242c5e2c382a67c7b731570b83f4fb (patch)
tree0efa6dd31c55e654ad0c180136d60807976e8c0f /x11/9term
parent89c9aae9839a59cb13cedd14a1f1536fb6613856 (diff)
downloadpkgsrc-8744bbe3b0242c5e2c382a67c7b731570b83f4fb.tar.gz
+ Now that editors/sam installs header files and libraries, use a
conventional DEPENDS mechanism. + Avoid hardcoded "/usr/X11R6" in Makefiles + Split patch-ab into multiple patches. Should fix bulk-build problems, as well as getting rid of one more "eccentric" package.
Diffstat (limited to 'x11/9term')
-rw-r--r--x11/9term/Makefile12
-rw-r--r--x11/9term/distinfo11
-rw-r--r--x11/9term/patches/patch-aa8
-rw-r--r--x11/9term/patches/patch-ab235
-rw-r--r--x11/9term/patches/patch-ae66
-rw-r--r--x11/9term/patches/patch-af38
-rw-r--r--x11/9term/patches/patch-ag26
-rw-r--r--x11/9term/patches/patch-ah31
-rw-r--r--x11/9term/patches/patch-ai82
9 files changed, 259 insertions, 250 deletions
diff --git a/x11/9term/Makefile b/x11/9term/Makefile
index 3596ea67418..da6477da5d3 100644
--- a/x11/9term/Makefile
+++ b/x11/9term/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2001/04/02 18:46:38 wiz Exp $
+# $NetBSD: Makefile,v 1.5 2001/05/01 09:35:40 agc Exp $
# FreeBSD Id: Makefile,v 1.5 1996/12/07 23:43:56 asami Exp
#
@@ -11,6 +11,8 @@ MAINTAINER= packages@netbsd.org
HOMEPAGE= http://www.psrg.cs.usyd.edu.au/~matty/9term/index.html
COMMENT= X11 program which emulates a plan9 window
+DEPENDS+= sam-4.3nb1:../../editors/sam
+
USE_X11= yes
NOT_FOR_PLATFORM= *-*-alpha #LP64 Problems
@@ -19,12 +21,4 @@ MANCOMPRESSED= yes
NO_WRKSUBDIR= yes
MAKE_ENV+= WRKDIR=${WRKDIR} PKGSRCDIR=${PKGSRCDIR}
-pre-configure:
- if [ ! -e ${BUILD_ROOT}/editors/sam/${WRKDIR:T}/libframe/libframe.a ]; then \
- cd ../../editors/sam && ${MAKE} all; \
- fi
-
-pre-clean:
- cd ../../editors/sam && ${MAKE} clean
-
.include "../../mk/bsd.pkg.mk"
diff --git a/x11/9term/distinfo b/x11/9term/distinfo
index 3749d8d48b0..d10641baa35 100644
--- a/x11/9term/distinfo
+++ b/x11/9term/distinfo
@@ -1,8 +1,13 @@
-$NetBSD: distinfo,v 1.2 2001/04/19 11:07:33 skrll Exp $
+$NetBSD: distinfo,v 1.3 2001/05/01 09:35:40 agc Exp $
SHA1 (9term.1.6.3.tar.gz) = deb6248c9e441934ad8af522871034e24cb2bf5b
Size (9term.1.6.3.tar.gz) = 135169 bytes
-SHA1 (patch-aa) = 8f6736cb197d89b0518e69e2e1a5cb6f2659a3b4
-SHA1 (patch-ab) = 4724df42df3021bfe0878462a6d3529be06e681f
+SHA1 (patch-aa) = ec6ef2bec9b34407f46e4d7d4483272fd6e8a68e
+SHA1 (patch-ab) = c79dc4ef6bbc75112f8fe1e9ef3dafeb380a2d09
SHA1 (patch-ac) = 500feea9198682d720314081d13a31e0e841940d
SHA1 (patch-ad) = c9993356b66653c231be106e6f96d6e55a688f89
+SHA1 (patch-ae) = 4d6ae599a53a9fbc8b97fc83e3d57950e881854e
+SHA1 (patch-af) = d8de61ee74a08a58842fda21c4db3a471083faf3
+SHA1 (patch-ag) = 2dcdadff6afa4307a54d4517599d7834d085eaf3
+SHA1 (patch-ah) = fc5340b1d11a9e70266180302e312d15acd05347
+SHA1 (patch-ai) = 4875cdb9a89a559ae7e8274cb8240fbd0805a16e
diff --git a/x11/9term/patches/patch-aa b/x11/9term/patches/patch-aa
index 9b82f7dc544..597bc3f5f3c 100644
--- a/x11/9term/patches/patch-aa
+++ b/x11/9term/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1.1.1 2000/12/14 00:57:41 wiz Exp $
+$NetBSD: patch-aa,v 1.2 2001/05/01 09:35:41 agc Exp $
--- libtext/Makefile.orig Thu Jun 2 03:01:19 1994
+++ libtext/Makefile Fri Sep 26 16:44:27 1997
@@ -8,12 +8,12 @@ $NetBSD: patch-aa,v 1.1.1.1 2000/12/14 00:57:41 wiz Exp $
# if your compiler supports posix-compatible compilation
-OS=-DSOLARIS
+OS=-DSUNOS -O2
-+SAMDIR=${PKGSRCDIR}/editors/sam/${WRKDIR:T}
++SAMDIR=${PREFIX}/include/sam
# add -Iincludedir for any include directories that need to be searched
# for posix header files
-INCS=-I. -I../include
-+INCS=-I. -I$(SAMDIR)/include
++INCS=-I. -I${SAMDIR}
# add name of library orderer - use ":" if none exists
-RANLIB=:
@@ -26,4 +26,4 @@ $NetBSD: patch-aa,v 1.1.1.1 2000/12/14 00:57:41 wiz Exp $
install: $(LIB)
-$(OBJ): ../include/u.h ../include/libc.h ../include/libg.h ../include/frame.h ../include/text.h
-+$(OBJ): $(SAMDIR)/include/u.h $(SAMDIR)/include/libc.h $(SAMDIR)/include/libg.h $(SAMDIR)/include/frame.h text.h
++$(OBJ): ${SAMDIR}/u.h ${SAMDIR}/libc.h ${SAMDIR}/libg.h ${SAMDIR}/frame.h text.h
diff --git a/x11/9term/patches/patch-ab b/x11/9term/patches/patch-ab
index 81c7f4e862b..3ea38a85c22 100644
--- a/x11/9term/patches/patch-ab
+++ b/x11/9term/patches/patch-ab
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.1.1.1 2000/12/14 00:57:42 wiz Exp $
+$NetBSD: patch-ab,v 1.2 2001/05/01 09:35:41 agc Exp $
--- 9term/9term.c.orig Fri Jun 3 09:35:39 1994
+++ 9term/9term.c Fri Sep 26 16:45:48 1997
@@ -46,236 +46,3 @@ $NetBSD: patch-ab,v 1.1.1.1 2000/12/14 00:57:42 wiz Exp $
{
char *p;
---- 9term/9term.h.orig Thu Dec 15 14:49:15 1994
-+++ 9term/9term.h Wed Oct 1 09:50:47 1997
-@@ -31,7 +31,7 @@
- extern int isig;
-
- extern void specialchars(int);
--extern int setenv(char *, char *, int);
-+extern int O_setenv(char *, char *, int);
- extern void init_display(int *, char **, char**, char*);
- #ifdef NEEDVARARG
- extern void error();
-@@ -58,13 +58,24 @@
- extern void setborder(void);
- extern void ctlmsg(Event *);
-
-+#ifndef MAX
- #define MAX(x, y) (((x) > (y)) ? (x) : (y))
-+#endif
-+#ifndef MIN
- #define MIN(x, y) (((x) < (y)) ? (x) : (y))
-+#endif
- #ifndef NULL
- #define NULL ((void *)0)
- #endif
-
- #ifdef SUNOS
-+#define POSIXPTYS
-+#define BSDPTYS
-+#endif
-+
-+#include <sys/param.h>
-+
-+#if (defined(BSD) && BSD >= 199306)
- #define POSIXPTYS
- #define BSDPTYS
- #endif
---- 9term/Makefile.orig Mon Mar 14 04:50:54 1994
-+++ 9term/Makefile Fri Sep 26 16:44:27 1997
-@@ -11,27 +11,29 @@
- # Define RISCOS for Mips RISC/os
- # Define BSDPTYS for BSD-style pty support
- # Define POSIXPTYS for POSIX ptys
--OS=-DSOLARIS
-
--# where we'll install it
--BINDIR=/usr/pgrad/matty/bin/$(cputype)
-+OS= -D_LIBXG_EXTENSION -DSUNOS
-+
-+SAMPATH=${PKGSRCDIR}/editors/sam/${WRKDIR:T}
-+
-+BINDIR=. # where we'll install it
-
- HEADERFILE=9term.h
- TARGET=9term
--INCLUDES=-I. -I../include -I/usr/openwin/include
--CFLAGS=-g $(OS) $(INCLUDES) -fno-builtin -D_LIBXG_EXTENSION
--LDFLAGS=-g -R/usr/openwin/lib -L/usr/openwin/lib -R/usr/ucblib -L/usr/ucblib
-+INCLUDES=-I. -I../libtext -I$(SAMPATH)/include -I/usr/X11R6/include
-+CFLAGS= -O2 $(OS) $(INCLUDES)
-+LDFLAGS?=
- CC=gcc
-
- # change this if your X11 libraries are in different places
- # or if you need extra libraries to load with X11 applications
--LIBS=../libtext/libtext.a ../libframe/libframe.a ../libXg/libXg.a
--XLIBS=-lXt -lX11
-+LIBS=../libtext/libtext.a $(SAMPATH)/libframe/libframe.a $(SAMPATH)/libXg/libXg.a
-+XLIBS= -L/usr/X11R6/lib -lXt -lX11
-
- OBJECTS=9term.o command.o display.o pty.o
-
- $(TARGET): $(OBJECTS)
-- $(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(XLIBS) -lm -lucb
-+ $(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(XLIBS) -lm
-
- wloc: wloc.o
- $(CC) $(LDFLAGS) -o wloc wloc.o $(LIBS) $(XLIBS) -lm
-@@ -39,21 +41,17 @@
- label: wloc
- ln wloc label
-
--unicode: unicode.o
-- $(CC) $(LDFLAGS) -o unicode unicode.o $(LIBS) $(XLIBS) -lm
--
- install: $(TARGET) wloc label
- cp $(TARGET) $(BINDIR)
- chown root $(BINDIR)/$(TARGET)
- chmod 04755 $(BINDIR)/$(TARGET)
- mv wloc $(BINDIR)
- mv label $(BINDIR)
-- mv unicode $(BINDIR)
-
- clean:
- rm -f *.o core
-
- nuke: clean
-- rm -f $(TARGET) wloc label unicode
-+ rm -f $(TARGET) wloc label
-
- $(OBJECTS): 9term.h
---- 9term/command.c.orig Mon Mar 7 01:50:51 1994
-+++ 9term/command.c Fri Sep 26 16:46:53 1997
-@@ -13,7 +13,12 @@
- #include <sys/wait.h>
- #include <signal.h>
- #include <grp.h>
-+#include <sys/param.h>
-+#if (defined(BSD) && BSD >= 199306)
-+#include <termios.h>
-+#else
- #include <termio.h>
-+#endif
- #ifdef SOLARIS
- #include <sys/stropts.h>
- #endif
-@@ -204,7 +209,7 @@
- */
-
- void
--killpg(int sig)
-+O_killpg(int sig)
- {
- if (comm_pid)
- kill(-comm_pid, sig);
---- 9term/display.c.orig Thu Dec 15 14:48:28 1994
-+++ 9term/display.c Fri Sep 26 16:44:28 1997
-@@ -114,7 +114,7 @@
- delwin(Widget w, XEvent *event, String *params, Cardinal *n)
- {
- if (w == _toplevel)
-- killpg(SIGHUP);
-+ O_killpg(SIGHUP);
- }
-
- /*
-@@ -185,7 +185,7 @@
- else if (!strcasecmp(s, "plan9"))
- kbdmode = PLAN9;
- if (s = get_resource(resource, class, "p9font", "P9font"))
-- setenv("font", s, 1);
-+ O_setenv("font", s, 1);
- if (s = get_resource(resource, class, "highwater", "Highwater"))
- highwater = atoi(s);
- if (s = get_resource(resource, class, "lowwater", "Lowwater"))
-@@ -230,7 +230,7 @@
- #endif
- /* export window id to environment */
- sprintf(id, "%d", XtWindow(_toplevel));
-- setenv("WINDOWID", id, 1);
-+ O_setenv("WINDOWID", id, 1);
-
- /* register mouse and keyboard events */
- einit(Ekeyboard | Emouse);
---- 9term/pty.c.orig Fri Jul 22 16:47:29 1994
-+++ 9term/pty.c Fri Sep 26 16:49:08 1997
-@@ -12,7 +12,18 @@
-
- #include <utmp.h>
- #include <errno.h>
--#ifdef SUNOS
-+
-+#include <sys/param.h>
-+
-+#if (defined(BSD) && BSD >= 199306)
-+# include <termios.h>
-+
-+/* # include <stropts.h> */
-+ /* Isn't POSIX and portability so much fun? */
-+# define VRPRNT VREPRINT
-+#endif
-+
-+#if defined(SUNOS) && !(defined(BSD) && BSD >= 199306)
- # undef _POSIX_SOURCE
- # include <sys/termio.h>
- # include <stropts.h>
-@@ -41,7 +52,7 @@
- # define VEOL2 _VEOL2
- #endif
-
--#ifdef RISCOS
-+#ifdef RISCOS
- # include <sys/stat.h>
- # include </usr/include/ctype.h> /* to defeat posix version */
- # define VLNEXT V_LNEXT
-@@ -49,10 +60,12 @@
- # define VRPRNT V_RPRNT
- # define VWERASE V_WERAS
- #else
-+#if !(defined(BSD) && BSD >= 199306)
- # include <ctype.h>
- #endif
-+#endif
-
--#ifdef OSF1
-+#if defined(OSF1)
- # define V_START VSTART
- # define V_STOP VSTOP
- # define V_SUSP VSUSP
-@@ -115,7 +128,7 @@
- char udef, p9def;
- };
-
--#if defined(SUNOS) || defined(IRIX) || defined(SOLARIS)
-+#if defined(SUNOS) || defined(IRIX) || defined(SOLARIS) || (defined(BSD) && BSD >= 199306)
- # define V_START VSTART
- # define V_STOP VSTOP
- # define V_SUSP VSUSP
-@@ -139,7 +152,7 @@
- #ifndef _POSIX_SOURCE
- { "eol2", 4, VEOL2, 0, 0 },
- #endif
--#if !defined(_OSF_SOURCE) && !defined(_POSIX_SOURCE)
-+#if !defined(_OSF_SOURCE) && !defined(_POSIX_SOURCE) && !(defined(BSD) && BSD >= 199306)
- { "swtch", 5, VSWTCH, 0, 0 },
- #endif
- { "start", 5, V_START, ctrl('q'), ctrl('q') },
-@@ -292,10 +305,16 @@
- /* Insure some sanity. */
- ttmode.c_lflag |= ECHO;
- ttmode.c_oflag &= ~(ONLCR);
-+#if !(defined(BSD) && BSD >= 199306)
- ttmode.c_oflag |= ONLRET;
-+#endif
- } else {
- ttmode.c_iflag = BRKINT | IGNPAR | ICRNL | IXON;
-+#if (defined(BSD) && BSD >= 199306)
-+ ttmode.c_oflag = OPOST;
-+#else
- ttmode.c_oflag = OPOST | ONLRET;
-+#endif
- ttmode.c_cflag = B9600 | PARENB | CS8 | CREAD;
- ttmode.c_lflag = ISIG | ICANON | ECHO | ECHOK;
- #ifdef __ultrix
diff --git a/x11/9term/patches/patch-ae b/x11/9term/patches/patch-ae
new file mode 100644
index 00000000000..c03427d5a32
--- /dev/null
+++ b/x11/9term/patches/patch-ae
@@ -0,0 +1,66 @@
+$NetBSD: patch-ae,v 1.1 2001/05/01 09:35:41 agc Exp $
+
+--- 9term/Makefile.orig Mon Mar 14 04:50:54 1994
++++ 9term/Makefile Tue May 1 09:59:01 2001
+@@ -11,27 +11,29 @@
+ # Define RISCOS for Mips RISC/os
+ # Define BSDPTYS for BSD-style pty support
+ # Define POSIXPTYS for POSIX ptys
+-OS=-DSOLARIS
+
+-# where we'll install it
+-BINDIR=/usr/pgrad/matty/bin/$(cputype)
++OS= -D_LIBXG_EXTENSION -DSUNOS
++
++SAMPATH=${PREFIX}/include/sam
++
++BINDIR=. # where we'll install it
+
+ HEADERFILE=9term.h
+ TARGET=9term
+-INCLUDES=-I. -I../include -I/usr/openwin/include
+-CFLAGS=-g $(OS) $(INCLUDES) -fno-builtin -D_LIBXG_EXTENSION
+-LDFLAGS=-g -R/usr/openwin/lib -L/usr/openwin/lib -R/usr/ucblib -L/usr/ucblib
++INCLUDES=-I. -I../libtext -I$(SAMPATH) -I${X11BASE}/include
++CFLAGS= -O2 $(OS) $(INCLUDES)
++LDFLAGS?=
+ CC=gcc
+
+ # change this if your X11 libraries are in different places
+ # or if you need extra libraries to load with X11 applications
+-LIBS=../libtext/libtext.a ../libframe/libframe.a ../libXg/libXg.a
+-XLIBS=-lXt -lX11
++LIBS=../libtext/libtext.a $(PREFIX)/lib/libframe.a $(PREFIX)/lib/libXg.a
++XLIBS= -Wl,-R${X11BASE}/lib -L${X11BASE}/lib -lXt -lX11
+
+ OBJECTS=9term.o command.o display.o pty.o
+
+ $(TARGET): $(OBJECTS)
+- $(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(XLIBS) -lm -lucb
++ $(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(XLIBS) -lm
+
+ wloc: wloc.o
+ $(CC) $(LDFLAGS) -o wloc wloc.o $(LIBS) $(XLIBS) -lm
+@@ -39,21 +41,17 @@
+ label: wloc
+ ln wloc label
+
+-unicode: unicode.o
+- $(CC) $(LDFLAGS) -o unicode unicode.o $(LIBS) $(XLIBS) -lm
+-
+ install: $(TARGET) wloc label
+ cp $(TARGET) $(BINDIR)
+ chown root $(BINDIR)/$(TARGET)
+ chmod 04755 $(BINDIR)/$(TARGET)
+ mv wloc $(BINDIR)
+ mv label $(BINDIR)
+- mv unicode $(BINDIR)
+
+ clean:
+ rm -f *.o core
+
+ nuke: clean
+- rm -f $(TARGET) wloc label unicode
++ rm -f $(TARGET) wloc label
+
+ $(OBJECTS): 9term.h
diff --git a/x11/9term/patches/patch-af b/x11/9term/patches/patch-af
new file mode 100644
index 00000000000..af015a20fce
--- /dev/null
+++ b/x11/9term/patches/patch-af
@@ -0,0 +1,38 @@
+$NetBSD: patch-af,v 1.1 2001/05/01 09:35:42 agc Exp $
+
+--- 9term/9term.h.orig Thu Dec 15 14:49:15 1994
++++ 9term/9term.h Wed Oct 1 09:50:47 1997
+@@ -31,7 +31,7 @@
+ extern int isig;
+
+ extern void specialchars(int);
+-extern int setenv(char *, char *, int);
++extern int O_setenv(char *, char *, int);
+ extern void init_display(int *, char **, char**, char*);
+ #ifdef NEEDVARARG
+ extern void error();
+@@ -58,13 +58,24 @@
+ extern void setborder(void);
+ extern void ctlmsg(Event *);
+
++#ifndef MAX
+ #define MAX(x, y) (((x) > (y)) ? (x) : (y))
++#endif
++#ifndef MIN
+ #define MIN(x, y) (((x) < (y)) ? (x) : (y))
++#endif
+ #ifndef NULL
+ #define NULL ((void *)0)
+ #endif
+
+ #ifdef SUNOS
++#define POSIXPTYS
++#define BSDPTYS
++#endif
++
++#include <sys/param.h>
++
++#if (defined(BSD) && BSD >= 199306)
+ #define POSIXPTYS
+ #define BSDPTYS
+ #endif
diff --git a/x11/9term/patches/patch-ag b/x11/9term/patches/patch-ag
new file mode 100644
index 00000000000..64342ea571d
--- /dev/null
+++ b/x11/9term/patches/patch-ag
@@ -0,0 +1,26 @@
+$NetBSD: patch-ag,v 1.1 2001/05/01 09:35:42 agc Exp $
+
+--- 9term/command.c.orig Mon Mar 7 01:50:51 1994
++++ 9term/command.c Fri Sep 26 16:46:53 1997
+@@ -13,7 +13,12 @@
+ #include <sys/wait.h>
+ #include <signal.h>
+ #include <grp.h>
++#include <sys/param.h>
++#if (defined(BSD) && BSD >= 199306)
++#include <termios.h>
++#else
+ #include <termio.h>
++#endif
+ #ifdef SOLARIS
+ #include <sys/stropts.h>
+ #endif
+@@ -204,7 +209,7 @@
+ */
+
+ void
+-killpg(int sig)
++O_killpg(int sig)
+ {
+ if (comm_pid)
+ kill(-comm_pid, sig);
diff --git a/x11/9term/patches/patch-ah b/x11/9term/patches/patch-ah
new file mode 100644
index 00000000000..c1f1148f0b3
--- /dev/null
+++ b/x11/9term/patches/patch-ah
@@ -0,0 +1,31 @@
+$NetBSD: patch-ah,v 1.1 2001/05/01 09:35:42 agc Exp $
+
+--- 9term/display.c.orig Thu Dec 15 14:48:28 1994
++++ 9term/display.c Fri Sep 26 16:44:28 1997
+@@ -114,7 +114,7 @@
+ delwin(Widget w, XEvent *event, String *params, Cardinal *n)
+ {
+ if (w == _toplevel)
+- killpg(SIGHUP);
++ O_killpg(SIGHUP);
+ }
+
+ /*
+@@ -185,7 +185,7 @@
+ else if (!strcasecmp(s, "plan9"))
+ kbdmode = PLAN9;
+ if (s = get_resource(resource, class, "p9font", "P9font"))
+- setenv("font", s, 1);
++ O_setenv("font", s, 1);
+ if (s = get_resource(resource, class, "highwater", "Highwater"))
+ highwater = atoi(s);
+ if (s = get_resource(resource, class, "lowwater", "Lowwater"))
+@@ -230,7 +230,7 @@
+ #endif
+ /* export window id to environment */
+ sprintf(id, "%d", XtWindow(_toplevel));
+- setenv("WINDOWID", id, 1);
++ O_setenv("WINDOWID", id, 1);
+
+ /* register mouse and keyboard events */
+ einit(Ekeyboard | Emouse);
diff --git a/x11/9term/patches/patch-ai b/x11/9term/patches/patch-ai
new file mode 100644
index 00000000000..ae3b23d61df
--- /dev/null
+++ b/x11/9term/patches/patch-ai
@@ -0,0 +1,82 @@
+$NetBSD: patch-ai,v 1.1 2001/05/01 09:35:42 agc Exp $
+
+--- 9term/pty.c.orig Fri Jul 22 16:47:29 1994
++++ 9term/pty.c Fri Sep 26 16:49:08 1997
+@@ -12,7 +12,18 @@
+
+ #include <utmp.h>
+ #include <errno.h>
+-#ifdef SUNOS
++
++#include <sys/param.h>
++
++#if (defined(BSD) && BSD >= 199306)
++# include <termios.h>
++
++/* # include <stropts.h> */
++ /* Isn't POSIX and portability so much fun? */
++# define VRPRNT VREPRINT
++#endif
++
++#if defined(SUNOS) && !(defined(BSD) && BSD >= 199306)
+ # undef _POSIX_SOURCE
+ # include <sys/termio.h>
+ # include <stropts.h>
+@@ -41,7 +52,7 @@
+ # define VEOL2 _VEOL2
+ #endif
+
+-#ifdef RISCOS
++#ifdef RISCOS
+ # include <sys/stat.h>
+ # include </usr/include/ctype.h> /* to defeat posix version */
+ # define VLNEXT V_LNEXT
+@@ -49,10 +60,12 @@
+ # define VRPRNT V_RPRNT
+ # define VWERASE V_WERAS
+ #else
++#if !(defined(BSD) && BSD >= 199306)
+ # include <ctype.h>
+ #endif
++#endif
+
+-#ifdef OSF1
++#if defined(OSF1)
+ # define V_START VSTART
+ # define V_STOP VSTOP
+ # define V_SUSP VSUSP
+@@ -115,7 +128,7 @@
+ char udef, p9def;
+ };
+
+-#if defined(SUNOS) || defined(IRIX) || defined(SOLARIS)
++#if defined(SUNOS) || defined(IRIX) || defined(SOLARIS) || (defined(BSD) && BSD >= 199306)
+ # define V_START VSTART
+ # define V_STOP VSTOP
+ # define V_SUSP VSUSP
+@@ -139,7 +152,7 @@
+ #ifndef _POSIX_SOURCE
+ { "eol2", 4, VEOL2, 0, 0 },
+ #endif
+-#if !defined(_OSF_SOURCE) && !defined(_POSIX_SOURCE)
++#if !defined(_OSF_SOURCE) && !defined(_POSIX_SOURCE) && !(defined(BSD) && BSD >= 199306)
+ { "swtch", 5, VSWTCH, 0, 0 },
+ #endif
+ { "start", 5, V_START, ctrl('q'), ctrl('q') },
+@@ -292,10 +305,16 @@
+ /* Insure some sanity. */
+ ttmode.c_lflag |= ECHO;
+ ttmode.c_oflag &= ~(ONLCR);
++#if !(defined(BSD) && BSD >= 199306)
+ ttmode.c_oflag |= ONLRET;
++#endif
+ } else {
+ ttmode.c_iflag = BRKINT | IGNPAR | ICRNL | IXON;
++#if (defined(BSD) && BSD >= 199306)
++ ttmode.c_oflag = OPOST;
++#else
+ ttmode.c_oflag = OPOST | ONLRET;
++#endif
+ ttmode.c_cflag = B9600 | PARENB | CS8 | CREAD;
+ ttmode.c_lflag = ISIG | ICANON | ECHO | ECHOK;
+ #ifdef __ultrix