]> code.delx.au - gnu-emacs/blob - src/s/gnu-linux.h
712b5ce5326d58a88d266ae4bc680b17ddd1f8a6
[gnu-emacs] / src / s / gnu-linux.h
1 /* This file is the configuration file for GNU/Linux operating systems.
2 Copyright (C) 1985, 1986, 1992, 1994, 1996 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
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
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Emacs is distributed in the hope that it will be useful,
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
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* This file was put together by Michael K. Johnson and Rik Faith. */
22
23
24 /*
25 * Define symbols to identify the version of Unix this is.
26 * Define all the symbols that apply correctly.
27 */
28
29 /* #define UNIPLUS */
30 /* #define USG5 */
31 #define USG
32 /* #define BSD */
33 #define LINUX
34
35 /* SYSTEM_TYPE should indicate the kind of system you are using.
36 It sets the Lisp variable system-type. */
37
38 #define SYSTEM_TYPE "linux" /* All the best software is free. */
39
40 /* Check the version number of Linux--if it is at least 1.2.0,
41 it is safe to use SIGIO. */
42 #ifndef NOT_C_CODE
43 #ifdef emacs
44 #ifdef HAVE_VERSION_H
45 #include <linux/version.h>
46
47 #if LINUX_VERSION_CODE > 0x10200
48 #define LINUX_SIGIO_DOES_WORK
49 #endif /* LINUX_VERSION_CODE > 0x10200 */
50 #endif /* HAVE_VERSION_H */
51 #endif /* emacs */
52 #endif /* NOT_C_CODE */
53
54 /* Letter to use in finding device name of first pty,
55 if system supports pty's. 'p' means it is /dev/ptyp0 */
56
57 #define FIRST_PTY_LETTER 'p'
58
59 /*
60 * Define HAVE_TERMIOS if the system provides POSIX-style
61 * functions and macros for terminal control.
62 */
63
64 #define HAVE_TERMIOS
65
66 /*
67 * Define HAVE_PTYS if the system supports pty devices.
68 */
69
70 #define HAVE_PTYS
71
72 /* Uncomment this later when other problems are dealt with -mkj */
73
74 #define HAVE_SOCKETS
75
76 /* Define this symbol if your system has the functions bcopy, etc. */
77
78 #define BSTRING
79
80 /* subprocesses should be defined if you want to
81 have code for asynchronous subprocesses
82 (as used in M-x compile and M-x shell).
83 This is generally OS dependent, and not supported
84 under most USG systems. */
85
86 #define subprocesses
87
88 /* define MAIL_USE_FLOCK if the mailer uses flock
89 to interlock access to /usr/spool/mail/$USER.
90 The alternative is that a lock file named
91 /usr/spool/mail/$USER.lock. */
92
93 /* Both are used in Linux by different mail programs. I assume that most
94 people are using newer mailers that have heard of flock. Change this
95 if you need to. */
96
97 #define MAIL_USE_FLOCK
98
99 /* Define CLASH_DETECTION if you want lock files to be written
100 so that Emacs can tell instantly when you try to modify
101 a file that someone else has modified in his Emacs. */
102
103 #define CLASH_DETECTION
104
105 /* Here, on a separate page, add any special hacks needed
106 to make Emacs work on this system. For example,
107 you might define certain system call names that don't
108 exist on your system, or that do different things on
109 your system and must be used only through an encapsulation
110 (Which you should place, by convention, in sysdep.c). */
111 \f
112 /* On POSIX systems the system calls are interruptible by signals
113 that the user program has elected to catch. Thus the system call
114 must be retried in these cases. To handle this without massive
115 changes in the source code, we remap the standard system call names
116 to names for our own functions in sysdep.c that do the system call
117 with retries. */
118
119 #define read sys_read
120 #define write sys_write
121 #define open sys_open
122 #define close sys_close
123
124 #define INTERRUPTIBLE_OPEN
125 #define INTERRUPTIBLE_CLOSE
126 #define INTERRUPTIBLE_IO
127
128 /* If you mount the proc file system somewhere other than /proc
129 you will have to uncomment the following and make the proper
130 changes */
131
132 /* #define LINUX_LDAV_FILE "/proc/loadavg" */
133
134 /* This is needed for dispnew.c:update_frame */
135
136 #ifdef emacs
137 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
138 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
139 /* new C libio names */
140 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
141 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
142 #else /* !_IO_STDIO_H */
143 /* old C++ iostream names */
144 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
145 ((FILE)->_pptr - (FILE)->_pbase)
146 #endif /* !_IO_STDIO_H */
147 #endif /* emacs */
148
149 /* Ask GCC where to find libgcc.a. */
150 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
151
152 #ifndef __ELF__
153 /* Linux has crt0.o in a non-standard place */
154 #define START_FILES pre-crt0.o /usr/lib/crt0.o
155 #else
156 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
157 #endif
158
159 /* As of version 1.1.51, Linux does not actually implement SIGIO. */
160 /* Here we assume that signal.h is already included. */
161 #ifdef emacs
162 #ifdef LINUX_SIGIO_DOES_WORK
163 #define INTERRUPT_INPUT
164 #else
165 #undef SIGIO
166 /* Some versions of Linux define SIGURG and SIGPOLL as aliases for SIGIO.
167 This prevents lossage in process.c. */
168 #undef SIGURG
169 #undef SIGPOLL
170 #endif
171 #endif
172
173 /* This is needed for sysdep.c */
174
175 #define NO_SIOCTL_H /* don't have sioctl.h */
176
177 #define HAVE_VFORK
178 #define HAVE_SYS_SIGLIST
179 #define HAVE_GETWD /* cure conflict with getcwd? */
180
181 #define SYSV_SYSTEM_DIR /* use dirent.h */
182
183 #define POSIX /* affects getpagesize.h and systty.h */
184 #define POSIX_SIGNALS
185
186 /* Best not to include -lg, unless it is last on the command line */
187 #define LIBS_DEBUG
188 #ifndef __ELF__
189 #define LIB_STANDARD -lc /* avoid -lPW */
190 #else
191 #undef LIB_GCC
192 #define LIB_GCC
193 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
194 #endif
195
196 /* Don't use -g in test compiles in configure.
197 This is so we will use the same shared libs for that linking
198 that are used when linking temacs. */
199 #ifdef THIS_IS_CONFIGURE
200 #define C_DEBUG_SWITCH
201 #endif
202
203 /* Let's try this out, just in case.
204 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */
205 /* #define SIGNALS_VIA_CHARACTERS */
206
207 /* Rob Malouf <malouf@csli.stanford.edu> says:
208 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
209 and is a very common addition to previous versions. */
210
211 #ifdef TERM
212 #define LIBS_SYSTEM -lclient
213 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
214 #else
215 /* alane@wozzle.linet.org says that -lipc is not a separate library,
216 since libc-4.4.1. So -lipc was deleted. */
217 #define LIBS_SYSTEM
218 #define C_SWITCH_SYSTEM -D_BSD_SOURCE
219 #endif
220
221 /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
222 #define LIB_MOTIF -lXm -lXpm
223
224 #if 0 /* bobg@ipost.com reports that terminal type unknown, used by
225 comint.el, is broken "on Linux". I don't know which system
226 or version he means. */
227 #ifdef HAVE_NCURSES
228 #define TERMINFO
229 #endif
230 #endif
231
232 #define HAVE_SYSVIPC
233
234 #ifdef __ELF__
235 #define UNEXEC unexelf.o
236 #define UNEXEC_USE_MAP_PRIVATE
237 #endif
238
239 #ifdef LINUX_QMAGIC
240
241 #define HAVE_TEXT_START
242 #define UNEXEC unexsunos4.o
243 #define N_PAGSIZ(x) PAGE_SIZE
244
245 #else /* not LINUX_QMAGIC */
246
247 #define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
248 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
249 #define ADJUST_EXEC_HEADER \
250 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
251
252 #endif /* not LINUX_QMAGIC */
253
254 #if 0
255 /* In 19.23 and 19.24, configure sometimes fails to define these.
256 It has to do with the fact that configure uses CFLAGS when linking
257 while Makefile.in.in (erroneously) fails to do so when linking temacs. */
258 #ifndef HAVE_GETTIMEOFDAY
259 #define HAVE_GETTIMEOFDAY
260 #endif
261 #ifndef HAVE_MKDIR
262 #define HAVE_MKDIR
263 #endif
264 #ifndef HAVE_RMDIR
265 #define HAVE_RMDIR
266 #endif
267 #ifndef HAVE_XSCREENNUMBEROFSCREEN
268 #define HAVE_XSCREENNUMBEROFSCREEN
269 #endif
270 #endif /* 0 */
271
272 /* This is to work around mysterious gcc failures in some system versions.
273 It is unlikely that Emacs changes will work around this problem;
274 therefore, this should remain permanently. */
275 #ifndef HAVE_XRMSETDATABASE
276 #define HAVE_XRMSETDATABASE
277 #endif
278
279 /* The regex.o routines are a part of the GNU C-library used with Linux. */
280 /* However, sometimes they disagree with the src/regex.h that comes with Emacs,
281 and that can make trouble in etags.c because it gets the regex.h from Emacs
282 and the function definitions in libc. So turn this off. */
283 /* #define REGEXP_IN_LIBC */
284