*** empty log message ***
[bpt/emacs.git] / src / s / usg5-4.h
CommitLineData
20c428fd 1/* Definitions file for GNU Emacs running on AT&T's System V Release 4
bb7b4368 2 Copyright (C) 1987, 1990, 1999 Free Software Foundation, Inc.
20c428fd
JB
3
4This file is part of GNU Emacs.
5
bd307392
JB
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
17385adc 8the Free Software Foundation; either version 2, or (at your option)
bd307392
JB
9any later version.
10
20c428fd 11GNU Emacs is distributed in the hope that it will be useful,
bd307392
JB
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
3b7ad313
EN
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20c428fd
JB
20
21/* This file written by James Van Artsdalen of Dell Computer Corporation.
5447018c
JB
22 * james@bigtex.cactus.org. Subsequently improved for Dell 2.2 by Eric
23 * S. Raymond <esr@snark.thyrsus.com>.
20c428fd
JB
24 */
25
26/* Use the SysVr3 file for at least base configuration. */
27
72a8c21e 28#include "usg5-3.h"
20c428fd
JB
29
30#define USG5_4
31
32/* We do have multiple jobs. Handle ^Z. */
33
34#undef NOMULTIPLEJOBS
35
c42b4fab
GM
36/* Motif needs -lgen. */
37#define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen
c21d3ee2 38#define ORDINARY_LINK
20c428fd 39
5cb70bb5 40#if 0
5447018c
JB
41#ifdef ORDINARY_LINK
42#define LIB_STANDARD -lc /usr/ucblib/libucb.a
43#else
c21d3ee2
RS
44#define START_FILES pre-crt0.o /usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o
45#define LIB_STANDARD -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o
46#endif
5cb70bb5
RS
47#else
48
49#ifdef ORDINARY_LINK
50#define LIB_STANDARD
51#else
52#define START_FILES pre-crt0.o /usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o
53#define LIB_STANDARD -lc /usr/ccs/lib/crtn.o
54#endif
55#endif
20c428fd 56
5447018c
JB
57/* there are no -lg libraries on this system, and no libPW */
58
59#define LIBS_DEBUG
08bc143c
RS
60/* This is turned off because nobody actually uses LIBS_STANDARD (Nov 1995).
61 That name is a typo. The next step is to delete this entirely. */
62/* #define LIBS_STANDARD -lc */
5447018c 63
bd307392 64/* No <sioctl.h> */
20c428fd 65
bd307392 66#define NO_SIOCTL_H
20c428fd
JB
67
68/* Undump with ELF */
69
70#undef COFF
71
72#define UNEXEC unexelf.o
73
821188d3
RS
74/* <sys/stat.h> *defines* stat(2) as a static function. If "static"
75 * is blank, then many files will have a public definition for stat(2).
76 */
77
78#undef static
79
20c428fd
JB
80/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct
81 * tchars. But get <termio.h> first to make sure ttold.h doesn't
82 * interfere. And don't try to use SIGIO yet.
83 */
84
f0ce95e7
RS
85#ifndef NOT_C_CODE
86#include <sys/wait.h>
87#endif
88
20c428fd 89#ifdef emacs
f9414412 90#ifndef NO_FILIO_H
20c428fd 91#include <sys/filio.h>
f9414412 92#endif
20c428fd
JB
93#include <termio.h>
94#include <sys/ttold.h>
95#include <signal.h>
bd307392
JB
96#include <sys/stream.h>
97#include <sys/stropts.h>
98#include <sys/termios.h>
bb7b4368 99#define BROKEN_SIGIO
20c428fd
JB
100#endif
101
5447018c
JB
102/* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
103 * instead, there's a system variable _sys_nsig. Unfortunately, we need the
104 * constant to dimension an array. So wire in the appropriate value here.
105 */
bb7b4368 106#define NSIG_MINIMUM 32
5447018c 107
20c428fd
JB
108/* We need bss_end from emacs.c for undumping */
109
110#ifndef USG_SHARED_LIBRARIES
111#define USG_SHARED_LIBRARIES
112#endif
113
114/* We can support this */
115
116#define CLASH_DETECTION
117
118#define HAVE_PTYS
5447018c 119#define HAVE_TERMIOS
2373f91f
RS
120#undef BROKEN_TIOCGWINSZ
121#undef BROKEN_TIOCGETC
20c428fd
JB
122
123/* It is possible to receive SIGCHLD when there are no children
124 waiting, because a previous waitsys(2) cleaned up the carcass of child
125 without clearing the SIGCHLD pending info. So, use a non-blocking
126 wait3 instead, which maps to waitpid(2) in SysVr4. */
127
128#define HAVE_WAIT_HEADER
129#define WAITTYPE int
130#define wait3(status, options, rusage) \
5bf62b08 131 waitpid ((pid_t) -1, (status), (options))
20c428fd
JB
132#define WRETCODE(w) (w >> 8)
133
134/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
135 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
136 this is all we need. */
137
ca493964 138#ifndef IRIX6
20c428fd 139#define TIOCSIGSEND TIOCSIGNAL
ca493964 140#endif
20c428fd
JB
141
142/* This change means that we don't loop through allocate_pty too many
143 times in the (rare) event of a failure. */
144
145#undef FIRST_PTY_LETTER
146#define FIRST_PTY_LETTER 'z'
147
148/* This sets the name of the master side of the PTY. */
149
150#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
151
152/* This sets the name of the slave side of the PTY. On SysVr4,
153 grantpt(3) forks a subprocess, so keep sigchld_handler() from
154 intercepting that death. If any child but grantpt's should die
155 within, it should be caught after sigrelse(2). */
156
5bf62b08
RS
157#define PTY_TTY_NAME_SPRINTF \
158 { \
159 char *ptsname (), *ptyname; \
160 \
161 sighold (SIGCLD); \
162 if (grantpt (fd) == -1) \
bb7b4368 163 { emacs_close (fd); return -1; } \
5bf62b08
RS
164 sigrelse (SIGCLD); \
165 if (unlockpt (fd) == -1) \
bb7b4368 166 { emacs_close (fd); return -1; } \
5bf62b08 167 if (!(ptyname = ptsname (fd))) \
bb7b4368 168 { emacs_close (fd); return -1; } \
5bf62b08
RS
169 strncpy (pty_name, ptyname, sizeof (pty_name)); \
170 pty_name[sizeof (pty_name) - 1] = 0; \
20c428fd
JB
171 }
172
173/* Push various streams modules onto a PTY channel. */
174
175#define SETUP_SLAVE_PTY \
176 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
177 fatal ("ioctl I_PUSH ptem", errno); \
178 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
179 fatal ("ioctl I_PUSH ldterm", errno); \
180 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
181 fatal ("ioctl I_PUSH ttcompat", errno);
182
5447018c 183/* Undo the SVr3 X11 library definition */
8c64cf16 184#undef LIB_X11_LIB
5447018c 185
bd307392
JB
186/* The definition of this in s-usg5-3.h is not needed in 5.4. */
187/* liblnsl_s should never be used. The _s suffix implies a shared
188 library, as opposed to a DLL. Share libraries were used in SVR3, and are
189 available only in order to allow SVR3 binaries to run. They should not be
190 linked in to new binaries. -- caraway!pinkas@caraway.intel.com. */
191#undef LIBX10_SYSTEM
20c428fd 192#undef LIBX11_SYSTEM
bd307392
JB
193
194/* Tell x11term.c and keyboard.c we have the system V streams feature. */
195#define SYSV_STREAMS
196
197/* This definition was suggested for next release.
198 So give it a try. */
199#define HAVE_SOCKETS
5cb70bb5 200
ca493964 201#ifndef IRIX6
5bf62b08
RS
202#define bcopy(src,dst,n) memmove (dst,src,n)
203#define bcmp(src,dst,n) memcmp (src,dst,n)
204#define bzero(s,n) memset (s,0,n)
ca493964 205#endif
c42b4fab
GM
206
207/* Markus Weiand <weiand@khof.com> says this is needed for Motif on
208 SINIX. */
209#undef LIBS_SYSTEM
210#define LIBS_SYSTEM -lgen