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