Commit | Line | Data |
---|---|---|
3a707ba5 | 1 | /* This file is the configuration file for Linux-based GNU systems |
bb7b4368 | 2 | Copyright (C) 1985, 86, 92, 94, 96, 1999 Free Software Foundation, Inc. |
566e3587 JB |
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 | |
3b7ad313 EN |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. */ | |
566e3587 | 20 | |
b49ef455 JB |
21 | /* This file was put together by Michael K. Johnson and Rik Faith. */ |
22 | ||
566e3587 JB |
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 | |
8e4c450d | 32 | /* #define BSD_SYSTEM */ |
566e3587 JB |
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 | ||
3a707ba5 | 38 | #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */ |
566e3587 | 39 | |
65953053 RS |
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 | |
b764619d | 44 | #ifdef HAVE_LINUX_VERSION_H |
65953053 | 45 | #include <linux/version.h> |
566e3587 | 46 | |
65953053 RS |
47 | #if LINUX_VERSION_CODE > 0x10200 |
48 | #define LINUX_SIGIO_DOES_WORK | |
aa7fcbb0 | 49 | #endif /* LINUX_VERSION_CODE > 0x10200 */ |
2e38d862 AS |
50 | #if LINUX_VERSION_CODE >= 0x20000 |
51 | #define LINUX_MAP_SHARED_DOES_WORK | |
52 | #endif /* LINUX_VERSION_CODE >= 0x20000 */ | |
b764619d | 53 | #endif /* HAVE_LINUX_VERSION_H */ |
aa7fcbb0 RS |
54 | #endif /* emacs */ |
55 | #endif /* NOT_C_CODE */ | |
566e3587 | 56 | |
71125fb8 GM |
57 | #if defined HAVE_GRANTPT |
58 | #define UNIX98_PTYS | |
566e3587 | 59 | |
71125fb8 GM |
60 | /* Run only once. We need a `for'-loop because the code uses |
61 | `continue'. */ | |
566e3587 | 62 | |
71125fb8 | 63 | #define PTY_ITERATION for (i = 0; i < 1; i++) |
fdc5e0fc | 64 | |
71125fb8 GM |
65 | #ifdef HAVE_GETPT |
66 | #define PTY_NAME_SPRINTF | |
67 | #define PTY_OPEN fd = getpt () | |
68 | #else /* not HAVE_GETPT */ | |
69 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); | |
70 | #endif /* not HAVE_GETPT */ | |
71 | ||
72 | /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to | |
73 | prevent sigchld_handler from intercepting the child's death. */ | |
74 | ||
75 | #define PTY_TTY_NAME_SPRINTF \ | |
76 | { \ | |
77 | char *ptyname; \ | |
78 | \ | |
79 | sigblock (sigmask (SIGCHLD)); \ | |
80 | if (grantpt (fd) == -1 || unlockpt (fd) == -1 \ | |
81 | || !(ptyname = ptsname(fd))) \ | |
82 | { \ | |
83 | sigunblock (sigmask (SIGCHLD)); \ | |
84 | close (fd); \ | |
85 | return -1; \ | |
86 | } \ | |
87 | strncpy (pty_name, ptyname, sizeof (pty_name)); \ | |
88 | pty_name[sizeof (pty_name) - 1] = 0; \ | |
89 | sigunblock (sigmask (SIGCHLD)); \ | |
90 | } | |
fdc5e0fc | 91 | |
71125fb8 | 92 | #else /* not HAVE_GRANDPT */ |
fdc5e0fc | 93 | |
71125fb8 GM |
94 | /* Letter to use in finding device name of first pty, |
95 | if system supports pty's. 'p' means it is /dev/ptyp0 */ | |
fdc5e0fc | 96 | |
71125fb8 | 97 | #define FIRST_PTY_LETTER 'p' |
fdc5e0fc | 98 | |
71125fb8 | 99 | #endif /* not HAVE_GRANDPT */ |
fdc5e0fc | 100 | |
71125fb8 GM |
101 | /* Define HAVE_TERMIOS if the system provides POSIX-style |
102 | functions and macros for terminal control. */ | |
566e3587 JB |
103 | |
104 | #define HAVE_TERMIOS | |
105 | ||
71125fb8 | 106 | /* Define HAVE_PTYS if the system supports pty devices. */ |
566e3587 JB |
107 | |
108 | #define HAVE_PTYS | |
109 | ||
110 | /* Uncomment this later when other problems are dealt with -mkj */ | |
111 | ||
dad29761 | 112 | #define HAVE_SOCKETS |
566e3587 JB |
113 | |
114 | /* Define this symbol if your system has the functions bcopy, etc. */ | |
115 | ||
116 | #define BSTRING | |
117 | ||
118 | /* subprocesses should be defined if you want to | |
119 | have code for asynchronous subprocesses | |
120 | (as used in M-x compile and M-x shell). | |
121 | This is generally OS dependent, and not supported | |
122 | under most USG systems. */ | |
123 | ||
124 | #define subprocesses | |
125 | ||
126 | /* define MAIL_USE_FLOCK if the mailer uses flock | |
127 | to interlock access to /usr/spool/mail/$USER. | |
128 | The alternative is that a lock file named | |
129 | /usr/spool/mail/$USER.lock. */ | |
130 | ||
3a707ba5 RS |
131 | /* On GNU/Linux systems, both methods are used by various mail |
132 | programs. I assume that most people are using newer mailers that | |
133 | have heard of flock. Change this if you need to. */ | |
566e3587 JB |
134 | |
135 | #define MAIL_USE_FLOCK | |
136 | ||
137 | /* Define CLASH_DETECTION if you want lock files to be written | |
138 | so that Emacs can tell instantly when you try to modify | |
139 | a file that someone else has modified in his Emacs. */ | |
140 | ||
b2e209ba | 141 | #define CLASH_DETECTION |
566e3587 JB |
142 | |
143 | /* Here, on a separate page, add any special hacks needed | |
144 | to make Emacs work on this system. For example, | |
145 | you might define certain system call names that don't | |
146 | exist on your system, or that do different things on | |
147 | your system and must be used only through an encapsulation | |
148 | (Which you should place, by convention, in sysdep.c). */ | |
149 | \f | |
566e3587 JB |
150 | /* If you mount the proc file system somewhere other than /proc |
151 | you will have to uncomment the following and make the proper | |
152 | changes */ | |
153 | ||
154 | /* #define LINUX_LDAV_FILE "/proc/loadavg" */ | |
155 | ||
fde448f4 | 156 | /* This is needed for dispnew.c:update_frame */ |
566e3587 | 157 | |
5e5623c2 | 158 | #ifdef emacs |
a9c82aaf | 159 | #include <stdio.h> /* Get the definition of _IO_STDIO_H. */ |
4dee6d0d | 160 | #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM) |
5e5623c2 | 161 | /* new C libio names */ |
c2c3f859 | 162 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ |
5e5623c2 RS |
163 | ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base) |
164 | #else /* !_IO_STDIO_H */ | |
165 | /* old C++ iostream names */ | |
c2c3f859 | 166 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ |
5e5623c2 RS |
167 | ((FILE)->_pptr - (FILE)->_pbase) |
168 | #endif /* !_IO_STDIO_H */ | |
169 | #endif /* emacs */ | |
566e3587 | 170 | |
5101db23 | 171 | /* Ask GCC where to find libgcc.a. */ |
08ddf771 | 172 | #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name` |
5101db23 | 173 | |
4dee6d0d | 174 | #ifndef __ELF__ |
3a707ba5 | 175 | /* GNU/Linux usually has crt0.o in a non-standard place */ |
566e3587 | 176 | #define START_FILES pre-crt0.o /usr/lib/crt0.o |
4dee6d0d | 177 | #else |
01b79236 | 178 | #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o |
4dee6d0d | 179 | #endif |
566e3587 | 180 | |
588a9a3e RS |
181 | #ifdef __ELF__ |
182 | /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option | |
183 | says where to find X windows at run time. */ | |
a28c4a8e | 184 | |
f649aa04 RS |
185 | #ifdef __mips__ |
186 | #define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX | |
187 | #else | |
588a9a3e | 188 | #define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX |
f649aa04 | 189 | #endif /* __mips__ */ |
588a9a3e RS |
190 | #endif /* __ELF__ */ |
191 | ||
3a707ba5 RS |
192 | /* As of version 1.1.51, Linux did not actually implement SIGIO. |
193 | But it works in newer versions. */ | |
566e3587 | 194 | #ifdef emacs |
65953053 RS |
195 | #ifdef LINUX_SIGIO_DOES_WORK |
196 | #define INTERRUPT_INPUT | |
197 | #else | |
bb7b4368 | 198 | #define BROKEN_SIGIO |
0f2256ef RS |
199 | /* Some versions of Linux define SIGURG and SIGPOLL as aliases for SIGIO. |
200 | This prevents lossage in process.c. */ | |
bb7b4368 PE |
201 | #define BROKEN_SIGURG |
202 | #define BROKEN_SIGPOLL | |
566e3587 | 203 | #endif |
65953053 | 204 | #endif |
566e3587 JB |
205 | |
206 | /* This is needed for sysdep.c */ | |
207 | ||
566e3587 JB |
208 | #define NO_SIOCTL_H /* don't have sioctl.h */ |
209 | ||
813319d0 | 210 | #define HAVE_WAIT_HEADER |
566e3587 | 211 | |
566e3587 | 212 | #define SYSV_SYSTEM_DIR /* use dirent.h */ |
566e3587 | 213 | |
1abbab7a | 214 | #define POSIX /* affects getpagesize.h and systty.h */ |
566e3587 JB |
215 | #define POSIX_SIGNALS |
216 | ||
566e3587 JB |
217 | /* Best not to include -lg, unless it is last on the command line */ |
218 | #define LIBS_DEBUG | |
4dee6d0d | 219 | #ifndef __ELF__ |
566e3587 | 220 | #define LIB_STANDARD -lc /* avoid -lPW */ |
4dee6d0d | 221 | #else |
08ddf771 | 222 | #undef LIB_GCC |
4dee6d0d | 223 | #define LIB_GCC |
01b79236 | 224 | #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o |
4dee6d0d | 225 | #endif |
3233bbe1 | 226 | |
6f10bc9d RS |
227 | /* Don't use -g in test compiles in configure. |
228 | This is so we will use the same shared libs for that linking | |
229 | that are used when linking temacs. */ | |
230 | #ifdef THIS_IS_CONFIGURE | |
231 | #define C_DEBUG_SWITCH | |
232 | #endif | |
233 | ||
9e479734 JB |
234 | /* Let's try this out, just in case. |
235 | Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */ | |
236 | /* #define SIGNALS_VIA_CHARACTERS */ | |
9199fa7f JB |
237 | |
238 | /* Rob Malouf <malouf@csli.stanford.edu> says: | |
239 | SYSV IPC is standard a standard part of Linux since version 0.99pl10, | |
240 | and is a very common addition to previous versions. */ | |
cafdb68a RS |
241 | |
242 | #ifdef TERM | |
1077bc04 | 243 | #define LIBS_SYSTEM -lclient |
cafdb68a RS |
244 | #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term |
245 | #else | |
edb0cf8d RS |
246 | /* alane@wozzle.linet.org says that -lipc is not a separate library, |
247 | since libc-4.4.1. So -lipc was deleted. */ | |
1077bc04 | 248 | #define LIBS_SYSTEM |
f83a1ae3 | 249 | #define C_SWITCH_SYSTEM -D_BSD_SOURCE |
cafdb68a RS |
250 | #endif |
251 | ||
c7ce28ce RS |
252 | /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */ |
253 | #define LIB_MOTIF -lXm -lXpm | |
254 | ||
be1d1a1a | 255 | #ifdef HAVE_LIBNCURSES |
65953053 | 256 | #define TERMINFO |
565b8b0d | 257 | #define LIBS_TERMCAP -lncurses |
65953053 RS |
258 | #endif |
259 | ||
9199fa7f | 260 | #define HAVE_SYSVIPC |
b04101bb | 261 | |
4dee6d0d KH |
262 | #ifdef __ELF__ |
263 | #define UNEXEC unexelf.o | |
2e38d862 | 264 | #ifndef LINUX_MAP_SHARED_DOES_WORK |
baea3bdd | 265 | #define UNEXEC_USE_MAP_PRIVATE |
4dee6d0d | 266 | #endif |
2e38d862 | 267 | #endif |
4dee6d0d | 268 | |
8427dec9 RS |
269 | #ifdef LINUX_QMAGIC |
270 | ||
271 | #define HAVE_TEXT_START | |
272 | #define UNEXEC unexsunos4.o | |
273 | #define N_PAGSIZ(x) PAGE_SIZE | |
274 | ||
275 | #else /* not LINUX_QMAGIC */ | |
276 | ||
b04101bb RS |
277 | #define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0) |
278 | #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) | |
279 | #define ADJUST_EXEC_HEADER \ | |
280 | unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr) | |
967ac200 | 281 | |
8427dec9 RS |
282 | #endif /* not LINUX_QMAGIC */ |
283 | ||
6f10bc9d | 284 | #if 0 |
967ac200 RS |
285 | /* In 19.23 and 19.24, configure sometimes fails to define these. |
286 | It has to do with the fact that configure uses CFLAGS when linking | |
287 | while Makefile.in.in (erroneously) fails to do so when linking temacs. */ | |
288 | #ifndef HAVE_GETTIMEOFDAY | |
289 | #define HAVE_GETTIMEOFDAY | |
290 | #endif | |
291 | #ifndef HAVE_MKDIR | |
292 | #define HAVE_MKDIR | |
293 | #endif | |
294 | #ifndef HAVE_RMDIR | |
295 | #define HAVE_RMDIR | |
296 | #endif | |
297 | #ifndef HAVE_XSCREENNUMBEROFSCREEN | |
298 | #define HAVE_XSCREENNUMBEROFSCREEN | |
299 | #endif | |
639f52d8 RS |
300 | #endif /* 0 */ |
301 | ||
302 | /* This is to work around mysterious gcc failures in some system versions. | |
303 | It is unlikely that Emacs changes will work around this problem; | |
304 | therefore, this should remain permanently. */ | |
e3b89505 RS |
305 | #ifndef HAVE_XRMSETDATABASE |
306 | #define HAVE_XRMSETDATABASE | |
307 | #endif | |
e2000885 RS |
308 | |
309 | /* The regex.o routines are a part of the GNU C-library used with Linux. */ | |
ea18e284 RS |
310 | /* However, sometimes they disagree with the src/regex.h that comes with Emacs, |
311 | and that can make trouble in etags.c because it gets the regex.h from Emacs | |
312 | and the function definitions in libc. So turn this off. */ | |
313 | /* #define REGEXP_IN_LIBC */ | |
314 | ||
3743c30c RS |
315 | /* Use BSD process groups, but use setpgid() instead of setpgrp() to |
316 | actually set a process group. */ | |
317 | ||
318 | #define BSD_PGRPS | |
e0a6ee5e | 319 | |
2327e4a0 GM |
320 | #define NARROWPROTO 1 |
321 | ||
e0a6ee5e RS |
322 | /* Use mmap directly for allocating larger buffers. */ |
323 | #ifdef DOUG_LEA_MALLOC | |
324 | #undef REL_ALLOC | |
325 | #endif | |
bb15bd9a DL |
326 | |
327 | /* Tell that garbage collector that setjmp is known to save all | |
328 | registers relevant for conservative garbage collection in the | |
329 | jmp_buf. */ | |
330 | /* m68k and alpha aren't tested, but there are Debian packages for SCM | |
331 | and/or Guile on them, so the technique must work. */ | |
332 | #if #cpu (i386) || #cpu (sparc) || #cpu (m68k) || #cpu (alpha) | |
333 | #define GC_SETJMP_WORKS 1 | |
334 | #endif |