* config.nt (HAVE_FACES): Remove, unused.
[bpt/emacs.git] / src / s / gnu-linux.h
1 /* This file is the configuration file for Linux-based GNU systems
2 Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
3 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4
5 This file is part of GNU Emacs.
6
7 GNU Emacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 GNU Emacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* This file was put together by Michael K. Johnson and Rik Faith. */
21
22
23 /*
24 * Define symbols to identify the version of Unix this is.
25 * Define all the symbols that apply correctly.
26 */
27
28 /* #define USG5 */
29 #define USG
30 /* #define BSD_SYSTEM */
31 #define GNU_LINUX
32
33 /* SYSTEM_TYPE should indicate the kind of system you are using.
34 It sets the Lisp variable system-type. */
35
36 #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
37
38 #ifndef NOT_C_CODE
39 #ifdef emacs
40 #ifdef HAVE_LINUX_VERSION_H
41 #include <linux/version.h>
42
43 #if LINUX_VERSION_CODE >= 0x20400
44 /* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */
45 #define SIGNALS_VIA_CHARACTERS
46 #endif /* LINUX_VERSION_CODE >= 0x20400 */
47 #endif /* HAVE_LINUX_VERSION_H */
48 #endif /* emacs */
49 #endif /* NOT_C_CODE */
50
51 #if defined HAVE_GRANTPT
52 #define UNIX98_PTYS
53
54 /* Run only once. We need a `for'-loop because the code uses
55 `continue'. */
56
57 #define PTY_ITERATION for (i = 0; i < 1; i++)
58
59 #ifdef HAVE_GETPT
60 #define PTY_NAME_SPRINTF
61 #define PTY_OPEN fd = getpt ()
62 #else /* not HAVE_GETPT */
63 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
64 #endif /* not HAVE_GETPT */
65
66 /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
67 prevent sigchld_handler from intercepting the child's death. */
68
69 #define PTY_TTY_NAME_SPRINTF \
70 { \
71 char *ptyname; \
72 \
73 sigblock (sigmask (SIGCHLD)); \
74 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
75 || !(ptyname = ptsname(fd))) \
76 { \
77 sigunblock (sigmask (SIGCHLD)); \
78 close (fd); \
79 return -1; \
80 } \
81 strncpy (pty_name, ptyname, sizeof (pty_name)); \
82 pty_name[sizeof (pty_name) - 1] = 0; \
83 sigunblock (sigmask (SIGCHLD)); \
84 }
85
86 #else /* not HAVE_GRANTPT */
87
88 /* Letter to use in finding device name of first pty,
89 if system supports pty's. 'p' means it is /dev/ptyp0 */
90
91 #define FIRST_PTY_LETTER 'p'
92
93 #endif /* not HAVE_GRANDPT */
94
95 /* Define HAVE_TERMIOS if the system provides POSIX-style
96 functions and macros for terminal control. */
97
98 #define HAVE_TERMIOS
99
100 /* Define HAVE_PTYS if the system supports pty devices. */
101
102 #define HAVE_PTYS
103
104 #define HAVE_SOCKETS
105
106 /* Define this symbol if your system has the functions bcopy, etc. */
107
108 #define BSTRING
109
110 /* subprocesses should be defined if you want to
111 have code for asynchronous subprocesses
112 (as used in M-x compile and M-x shell).
113 This is generally OS dependent, and not supported
114 under most USG systems. */
115
116 #define subprocesses
117
118 /* define MAIL_USE_FLOCK if the mailer uses flock
119 to interlock access to /usr/spool/mail/$USER.
120 The alternative is that a lock file named
121 /usr/spool/mail/$USER.lock. */
122
123 /* On GNU/Linux systems, both methods are used by various mail
124 programs. I assume that most people are using newer mailers that
125 have heard of flock. Change this if you need to. */
126 /* Debian contains a patch which says: ``On Debian/GNU/Linux systems,
127 configure gets the right answers, and that means *NOT* using flock.
128 Using flock is guaranteed to be the wrong thing. See Debian Policy
129 for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the
130 Debian maintainer hasn't provided a clean fix for Emacs.
131 movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
132 HAVE_MAILLOCK_H are defined, so the following appears to be the
133 correct logic. -- fx */
134 /* We must check for HAVE_LIBLOCKFILE too, as movemail does.
135 liblockfile is a Free Software replacement for libmail, used on
136 Debian systems and elsewhere. -rfr */
137
138 #if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \
139 defined (HAVE_MAILLOCK_H))
140 #define MAIL_USE_FLOCK
141 #endif
142
143 /* Define CLASH_DETECTION if you want lock files to be written
144 so that Emacs can tell instantly when you try to modify
145 a file that someone else has modified in his Emacs. */
146
147 #define CLASH_DETECTION
148
149 /* Here, on a separate page, add any special hacks needed
150 to make Emacs work on this system. For example,
151 you might define certain system call names that don't
152 exist on your system, or that do different things on
153 your system and must be used only through an encapsulation
154 (Which you should place, by convention, in sysdep.c). */
155 \f
156 /* If you mount the proc file system somewhere other than /proc
157 you will have to uncomment the following and make the proper
158 changes */
159
160 /* #define LINUX_LDAV_FILE "/proc/loadavg" */
161
162 /* This is needed for dispnew.c:update_frame */
163
164 #ifdef emacs
165 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
166 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
167 /* new C libio names */
168 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
169 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
170 #else /* !_IO_STDIO_H */
171 /* old C++ iostream names */
172 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
173 ((FILE)->_pptr - (FILE)->_pbase)
174 #endif /* !_IO_STDIO_H */
175 #endif /* emacs */
176
177 /* Ask GCC where to find libgcc.a. */
178 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
179
180 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
181
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. */
184
185 #ifdef __mips__
186 #define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
187 #else
188 #define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
189 #endif /* __mips__ */
190
191 /* Link temacs with -z nocombreloc so that unexec works right, whether or
192 not -z combreloc is the default. GNU ld ignores unknown -z KEYWORD
193 switches, so this also works with older versions that don't implement
194 -z combreloc. */
195 #define LD_SWITCH_SYSTEM_TEMACS -z nocombreloc
196
197 #ifdef emacs
198 #define INTERRUPT_INPUT
199 #endif
200
201 /* This is needed for sysdep.c */
202
203 #define NO_SIOCTL_H /* don't have sioctl.h */
204
205 #define SYSV_SYSTEM_DIR /* use dirent.h */
206
207 #define POSIX /* affects getpagesize.h and systty.h */
208 #define POSIX_SIGNALS
209
210 /* Best not to include -lg, unless it is last on the command line */
211 #define LIBS_DEBUG
212 #undef LIB_GCC
213 #define LIB_GCC
214 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
215
216 /* Don't use -g in test compiles in configure.
217 This is so we will use the same shared libs for that linking
218 that are used when linking temacs. */
219 #ifdef THIS_IS_CONFIGURE
220 #define C_DEBUG_SWITCH
221 #endif
222
223 /* Rob Malouf <malouf@csli.stanford.edu> says:
224 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
225 and is a very common addition to previous versions. */
226
227 #ifdef TERM
228 #define LIBS_SYSTEM -lclient
229 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
230 #else
231 /* alane@wozzle.linet.org says that -lipc is not a separate library,
232 since libc-4.4.1. So -lipc was deleted. */
233 #define LIBS_SYSTEM
234 /* _BSD_SOURCE is redundant, at least in glibc2, since we define
235 _GNU_SOURCE. Left in in case it's relevant to libc5 systems and
236 anyone's still using Emacs on those. --fx 2002-12-14 */
237 #define C_SWITCH_SYSTEM -D_BSD_SOURCE
238 #endif
239
240 /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
241 #define LIB_MOTIF -lXm -lXpm
242
243 #ifdef HAVE_LIBNCURSES
244 #define TERMINFO
245 #define LIBS_TERMCAP -lncurses
246 #endif
247
248 #define HAVE_SYSVIPC
249
250 #define UNEXEC unexelf.o
251
252 #define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
253 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
254 #define ADJUST_EXEC_HEADER \
255 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
256
257 /* This is to work around mysterious gcc failures in some system versions.
258 It is unlikely that Emacs changes will work around this problem;
259 therefore, this should remain permanently. */
260 #ifndef HAVE_XRMSETDATABASE
261 #define HAVE_XRMSETDATABASE
262 #endif
263
264 /* Use BSD process groups, but use setpgid() instead of setpgrp() to
265 actually set a process group. */
266
267 #define BSD_PGRPS
268
269 #define NARROWPROTO 1
270
271 /* Use mmap directly for allocating larger buffers. */
272 #ifdef DOUG_LEA_MALLOC
273 #undef REL_ALLOC
274 #endif
275
276 /* Tell that garbage collector that setjmp is known to save all
277 registers relevant for conservative garbage collection in the
278 jmp_buf. */
279 /* Not all the architectures are tested, but there are Debian packages
280 for SCM and/or Guile on them, so the technique must work. See also
281 comments in alloc.c concerning setjmp and gcc. Fixme: it's
282 probably safe to make this conditional just on GCC, except for ia64
283 register window-flushing. */
284 /* Don't use #cpu here since in newest development versions of GCC,
285 we must call cpp with -traditional, and that disables #cpu. */
286
287 #if defined __i386__ || defined __sparc__ || defined __mc68000__ \
288 || defined __alpha__ || defined __mips__ || defined __s390__ \
289 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
290 || defined __ia64__
291 #define GC_SETJMP_WORKS 1
292 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
293 #ifdef __mc68000__
294 #define GC_LISP_OBJECT_ALIGNMENT 2
295 #endif
296 #ifdef __ia64__
297 #define GC_MARK_SECONDARY_STACK() \
298 do { \
299 extern void *__libc_ia64_register_backing_store_base; \
300 __builtin_ia64_flushrs (); \
301 mark_memory (__libc_ia64_register_backing_store_base, \
302 __builtin_ia64_bsp (), 0); \
303 } while (0)
304 #endif
305 #endif
306
307 /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
308 (do not change this comment) */