Patch from rms.
[bpt/emacs.git] / src / s / gnu-linux.h
CommitLineData
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
4This file is part of GNU Emacs.
5
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
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
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. */
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
JB
56
57/* Letter to use in finding device name of first pty,
58 if system supports pty's. 'p' means it is /dev/ptyp0 */
59
60#define FIRST_PTY_LETTER 'p'
61
62/*
63 * Define HAVE_TERMIOS if the system provides POSIX-style
64 * functions and macros for terminal control.
65 */
66
67#define HAVE_TERMIOS
68
566e3587
JB
69/*
70 * Define HAVE_PTYS if the system supports pty devices.
71 */
72
73#define HAVE_PTYS
74
75/* Uncomment this later when other problems are dealt with -mkj */
76
dad29761 77#define HAVE_SOCKETS
566e3587
JB
78
79/* Define this symbol if your system has the functions bcopy, etc. */
80
81#define BSTRING
82
83/* subprocesses should be defined if you want to
84 have code for asynchronous subprocesses
85 (as used in M-x compile and M-x shell).
86 This is generally OS dependent, and not supported
87 under most USG systems. */
88
89#define subprocesses
90
91/* define MAIL_USE_FLOCK if the mailer uses flock
92 to interlock access to /usr/spool/mail/$USER.
93 The alternative is that a lock file named
94 /usr/spool/mail/$USER.lock. */
95
3a707ba5
RS
96/* On GNU/Linux systems, both methods are used by various mail
97 programs. I assume that most people are using newer mailers that
98 have heard of flock. Change this if you need to. */
566e3587
JB
99
100#define MAIL_USE_FLOCK
101
102/* Define CLASH_DETECTION if you want lock files to be written
103 so that Emacs can tell instantly when you try to modify
104 a file that someone else has modified in his Emacs. */
105
b2e209ba 106#define CLASH_DETECTION
566e3587
JB
107
108/* Here, on a separate page, add any special hacks needed
109 to make Emacs work on this system. For example,
110 you might define certain system call names that don't
111 exist on your system, or that do different things on
112 your system and must be used only through an encapsulation
113 (Which you should place, by convention, in sysdep.c). */
114\f
566e3587
JB
115/* If you mount the proc file system somewhere other than /proc
116 you will have to uncomment the following and make the proper
117 changes */
118
119/* #define LINUX_LDAV_FILE "/proc/loadavg" */
120
fde448f4 121/* This is needed for dispnew.c:update_frame */
566e3587 122
5e5623c2 123#ifdef emacs
a9c82aaf 124#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
4dee6d0d 125#if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
5e5623c2 126/* new C libio names */
c2c3f859 127#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2
RS
128 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
129#else /* !_IO_STDIO_H */
130/* old C++ iostream names */
c2c3f859 131#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2
RS
132 ((FILE)->_pptr - (FILE)->_pbase)
133#endif /* !_IO_STDIO_H */
134#endif /* emacs */
566e3587 135
5101db23 136/* Ask GCC where to find libgcc.a. */
08ddf771 137#define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
5101db23 138
4dee6d0d 139#ifndef __ELF__
3a707ba5 140/* GNU/Linux usually has crt0.o in a non-standard place */
566e3587 141#define START_FILES pre-crt0.o /usr/lib/crt0.o
4dee6d0d 142#else
01b79236 143#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
4dee6d0d 144#endif
566e3587 145
588a9a3e
RS
146#ifdef __ELF__
147/* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
148 says where to find X windows at run time. */
a28c4a8e 149
f649aa04
RS
150#ifdef __mips__
151#define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
152#else
588a9a3e 153#define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
f649aa04 154#endif /* __mips__ */
588a9a3e
RS
155#endif /* __ELF__ */
156
3a707ba5
RS
157/* As of version 1.1.51, Linux did not actually implement SIGIO.
158 But it works in newer versions. */
566e3587 159#ifdef emacs
65953053
RS
160#ifdef LINUX_SIGIO_DOES_WORK
161#define INTERRUPT_INPUT
162#else
bb7b4368 163#define BROKEN_SIGIO
0f2256ef
RS
164/* Some versions of Linux define SIGURG and SIGPOLL as aliases for SIGIO.
165 This prevents lossage in process.c. */
bb7b4368
PE
166#define BROKEN_SIGURG
167#define BROKEN_SIGPOLL
566e3587 168#endif
65953053 169#endif
566e3587
JB
170
171/* This is needed for sysdep.c */
172
566e3587
JB
173#define NO_SIOCTL_H /* don't have sioctl.h */
174
566e3587
JB
175#define HAVE_VFORK
176#define HAVE_SYS_SIGLIST
177#define HAVE_GETWD /* cure conflict with getcwd? */
813319d0 178#define HAVE_WAIT_HEADER
566e3587 179
566e3587 180#define SYSV_SYSTEM_DIR /* use dirent.h */
566e3587 181
1abbab7a 182#define POSIX /* affects getpagesize.h and systty.h */
566e3587
JB
183#define POSIX_SIGNALS
184
566e3587
JB
185/* Best not to include -lg, unless it is last on the command line */
186#define LIBS_DEBUG
4dee6d0d 187#ifndef __ELF__
566e3587 188#define LIB_STANDARD -lc /* avoid -lPW */
4dee6d0d 189#else
08ddf771 190#undef LIB_GCC
4dee6d0d 191#define LIB_GCC
01b79236 192#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
4dee6d0d 193#endif
3233bbe1 194
6f10bc9d
RS
195/* Don't use -g in test compiles in configure.
196 This is so we will use the same shared libs for that linking
197 that are used when linking temacs. */
198#ifdef THIS_IS_CONFIGURE
199#define C_DEBUG_SWITCH
200#endif
201
9e479734
JB
202/* Let's try this out, just in case.
203 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */
204/* #define SIGNALS_VIA_CHARACTERS */
9199fa7f
JB
205
206/* Rob Malouf <malouf@csli.stanford.edu> says:
207 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
208 and is a very common addition to previous versions. */
cafdb68a
RS
209
210#ifdef TERM
1077bc04 211#define LIBS_SYSTEM -lclient
cafdb68a
RS
212#define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
213#else
edb0cf8d
RS
214/* alane@wozzle.linet.org says that -lipc is not a separate library,
215 since libc-4.4.1. So -lipc was deleted. */
1077bc04 216#define LIBS_SYSTEM
cafdb68a
RS
217#define C_SWITCH_SYSTEM -D_BSD_SOURCE
218#endif
219
c7ce28ce
RS
220/* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
221#define LIB_MOTIF -lXm -lXpm
222
be1d1a1a 223#ifdef HAVE_LIBNCURSES
65953053 224#define TERMINFO
565b8b0d 225#define LIBS_TERMCAP -lncurses
65953053
RS
226#endif
227
9199fa7f 228#define HAVE_SYSVIPC
b04101bb 229
4dee6d0d
KH
230#ifdef __ELF__
231#define UNEXEC unexelf.o
2e38d862 232#ifndef LINUX_MAP_SHARED_DOES_WORK
baea3bdd 233#define UNEXEC_USE_MAP_PRIVATE
4dee6d0d 234#endif
2e38d862 235#endif
4dee6d0d 236
8427dec9
RS
237#ifdef LINUX_QMAGIC
238
239#define HAVE_TEXT_START
240#define UNEXEC unexsunos4.o
241#define N_PAGSIZ(x) PAGE_SIZE
242
243#else /* not LINUX_QMAGIC */
244
b04101bb
RS
245#define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
246#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
247#define ADJUST_EXEC_HEADER \
248 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
967ac200 249
8427dec9
RS
250#endif /* not LINUX_QMAGIC */
251
6f10bc9d 252#if 0
967ac200
RS
253/* In 19.23 and 19.24, configure sometimes fails to define these.
254 It has to do with the fact that configure uses CFLAGS when linking
255 while Makefile.in.in (erroneously) fails to do so when linking temacs. */
256#ifndef HAVE_GETTIMEOFDAY
257#define HAVE_GETTIMEOFDAY
258#endif
259#ifndef HAVE_MKDIR
260#define HAVE_MKDIR
261#endif
262#ifndef HAVE_RMDIR
263#define HAVE_RMDIR
264#endif
265#ifndef HAVE_XSCREENNUMBEROFSCREEN
266#define HAVE_XSCREENNUMBEROFSCREEN
267#endif
639f52d8
RS
268#endif /* 0 */
269
270/* This is to work around mysterious gcc failures in some system versions.
271 It is unlikely that Emacs changes will work around this problem;
272 therefore, this should remain permanently. */
e3b89505
RS
273#ifndef HAVE_XRMSETDATABASE
274#define HAVE_XRMSETDATABASE
275#endif
e2000885
RS
276
277/* The regex.o routines are a part of the GNU C-library used with Linux. */
ea18e284
RS
278/* However, sometimes they disagree with the src/regex.h that comes with Emacs,
279 and that can make trouble in etags.c because it gets the regex.h from Emacs
280 and the function definitions in libc. So turn this off. */
281/* #define REGEXP_IN_LIBC */
282
3743c30c
RS
283/* Use BSD process groups, but use setpgid() instead of setpgrp() to
284 actually set a process group. */
285
286#define BSD_PGRPS
9e1348ee 287#define setpgrp(pid,pgid) setpgid(pid,pgid)
e0a6ee5e 288
2327e4a0
GM
289#define NARROWPROTO 1
290
e0a6ee5e
RS
291/* Use mmap directly for allocating larger buffers. */
292#ifdef DOUG_LEA_MALLOC
293#undef REL_ALLOC
294#endif