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