* progmodes/ada-mode.el: Update copyright notice.
[emacs.git] / src / s / gnu-linux.h
blob6b3f9c35841a1019d3705141f5dfeacf64c34c14
1 /* This file is the configuration file for Linux-based GNU systems
2 Copyright (C) 1985, 86, 92, 94, 96, 1999, 2002 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
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.
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.
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. */
21 /* This file was put together by Michael K. Johnson and Rik Faith. */
25 * Define symbols to identify the version of Unix this is.
26 * Define all the symbols that apply correctly.
29 /* #define UNIPLUS */
30 /* #define USG5 */
31 #define USG
32 /* #define BSD_SYSTEM */
33 #define LINUX
34 #define GNU_LINUX
36 /* SYSTEM_TYPE should indicate the kind of system you are using.
37 It sets the Lisp variable system-type. */
39 #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
41 /* Check the version number of Linux--if it is at least 1.2.0,
42 it is safe to use SIGIO. */
43 #ifndef NOT_C_CODE
44 #ifdef emacs
45 #ifdef HAVE_LINUX_VERSION_H
46 #include <linux/version.h>
48 #if LINUX_VERSION_CODE > 0x10200
49 #define LINUX_SIGIO_DOES_WORK
50 #endif /* LINUX_VERSION_CODE > 0x10200 */
51 #if LINUX_VERSION_CODE >= 0x20000
52 #define LINUX_MAP_SHARED_DOES_WORK
53 #endif /* LINUX_VERSION_CODE >= 0x20000 */
54 #endif /* HAVE_LINUX_VERSION_H */
55 #endif /* emacs */
56 #endif /* NOT_C_CODE */
58 #if defined HAVE_GRANTPT
59 #define UNIX98_PTYS
61 /* Run only once. We need a `for'-loop because the code uses
62 `continue'. */
64 #define PTY_ITERATION for (i = 0; i < 1; i++)
66 #ifdef HAVE_GETPT
67 #define PTY_NAME_SPRINTF
68 #define PTY_OPEN fd = getpt ()
69 #else /* not HAVE_GETPT */
70 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
71 #endif /* not HAVE_GETPT */
73 /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
74 prevent sigchld_handler from intercepting the child's death. */
76 #define PTY_TTY_NAME_SPRINTF \
77 { \
78 char *ptyname; \
80 sigblock (sigmask (SIGCHLD)); \
81 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
82 || !(ptyname = ptsname(fd))) \
83 { \
84 sigunblock (sigmask (SIGCHLD)); \
85 close (fd); \
86 return -1; \
87 } \
88 strncpy (pty_name, ptyname, sizeof (pty_name)); \
89 pty_name[sizeof (pty_name) - 1] = 0; \
90 sigunblock (sigmask (SIGCHLD)); \
93 #else /* not HAVE_GRANTPT */
95 /* Letter to use in finding device name of first pty,
96 if system supports pty's. 'p' means it is /dev/ptyp0 */
98 #define FIRST_PTY_LETTER 'p'
100 #endif /* not HAVE_GRANDPT */
102 /* Define HAVE_TERMIOS if the system provides POSIX-style
103 functions and macros for terminal control. */
105 #define HAVE_TERMIOS
107 /* Define HAVE_PTYS if the system supports pty devices. */
109 #define HAVE_PTYS
111 #define HAVE_SOCKETS
113 /* Define this symbol if your system has the functions bcopy, etc. */
115 #define BSTRING
117 /* subprocesses should be defined if you want to
118 have code for asynchronous subprocesses
119 (as used in M-x compile and M-x shell).
120 This is generally OS dependent, and not supported
121 under most USG systems. */
123 #define subprocesses
125 /* define MAIL_USE_FLOCK if the mailer uses flock
126 to interlock access to /usr/spool/mail/$USER.
127 The alternative is that a lock file named
128 /usr/spool/mail/$USER.lock. */
130 /* On GNU/Linux systems, both methods are used by various mail
131 programs. I assume that most people are using newer mailers that
132 have heard of flock. Change this if you need to. */
134 #define MAIL_USE_FLOCK
136 /* Define CLASH_DETECTION if you want lock files to be written
137 so that Emacs can tell instantly when you try to modify
138 a file that someone else has modified in his Emacs. */
140 #define CLASH_DETECTION
142 /* Here, on a separate page, add any special hacks needed
143 to make Emacs work on this system. For example,
144 you might define certain system call names that don't
145 exist on your system, or that do different things on
146 your system and must be used only through an encapsulation
147 (Which you should place, by convention, in sysdep.c). */
149 /* If you mount the proc file system somewhere other than /proc
150 you will have to uncomment the following and make the proper
151 changes */
153 /* #define LINUX_LDAV_FILE "/proc/loadavg" */
155 /* This is needed for dispnew.c:update_frame */
157 #ifdef emacs
158 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
159 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
160 /* new C libio names */
161 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
162 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
163 #else /* !_IO_STDIO_H */
164 /* old C++ iostream names */
165 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
166 ((FILE)->_pptr - (FILE)->_pbase)
167 #endif /* !_IO_STDIO_H */
168 #endif /* emacs */
170 /* Ask GCC where to find libgcc.a. */
171 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
173 #ifndef __ELF__
174 /* GNU/Linux usually has crt0.o in a non-standard place */
175 #define START_FILES pre-crt0.o /usr/lib/crt0.o
176 #else
177 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
178 #endif
180 #ifdef __ELF__
181 /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
182 says where to find X windows at run time. */
184 #ifdef __mips__
185 #define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
186 #else
187 #define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
188 #endif /* __mips__ */
190 /* Link temacs with -z nocombreloc so that unexec works right, whether or
191 not -z combreloc is the default. GNU ld ignores unknown -z KEYWORD
192 switches, so this also works with older versions that don't implement
193 -z combreloc. */
194 #define LD_SWITCH_SYSTEM_TEMACS -z nocombreloc
195 #endif /* __ELF__ */
197 /* As of version 1.1.51, Linux did not actually implement SIGIO.
198 But it works in newer versions. */
199 #ifdef emacs
200 #ifdef LINUX_SIGIO_DOES_WORK
201 #define INTERRUPT_INPUT
202 #else
203 #define BROKEN_SIGIO
204 /* Some versions of Linux define SIGURG and SIGPOLL as aliases for SIGIO.
205 This prevents lossage in process.c. */
206 #define BROKEN_SIGURG
207 #define BROKEN_SIGPOLL
208 #endif
209 #endif
211 /* This is needed for sysdep.c */
213 #define NO_SIOCTL_H /* don't have sioctl.h */
215 #define HAVE_WAIT_HEADER
217 #define SYSV_SYSTEM_DIR /* use dirent.h */
219 #define POSIX /* affects getpagesize.h and systty.h */
220 #define POSIX_SIGNALS
222 /* Best not to include -lg, unless it is last on the command line */
223 #define LIBS_DEBUG
224 #ifndef __ELF__
225 #define LIB_STANDARD -lc /* avoid -lPW */
226 #else
227 #undef LIB_GCC
228 #define LIB_GCC
229 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
230 #endif
232 /* Don't use -g in test compiles in configure.
233 This is so we will use the same shared libs for that linking
234 that are used when linking temacs. */
235 #ifdef THIS_IS_CONFIGURE
236 #define C_DEBUG_SWITCH
237 #endif
239 /* Let's try this out, just in case.
240 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */
241 /* #define SIGNALS_VIA_CHARACTERS */
243 /* Rob Malouf <malouf@csli.stanford.edu> says:
244 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
245 and is a very common addition to previous versions. */
247 #ifdef TERM
248 #define LIBS_SYSTEM -lclient
249 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
250 #else
251 /* alane@wozzle.linet.org says that -lipc is not a separate library,
252 since libc-4.4.1. So -lipc was deleted. */
253 #define LIBS_SYSTEM
254 #define C_SWITCH_SYSTEM -D_BSD_SOURCE
255 #endif
257 /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
258 #define LIB_MOTIF -lXm -lXpm
260 #ifdef HAVE_LIBNCURSES
261 #define TERMINFO
262 #define LIBS_TERMCAP -lncurses
263 #endif
265 #define HAVE_SYSVIPC
267 #ifdef __ELF__
268 #define UNEXEC unexelf.o
269 #ifndef LINUX_MAP_SHARED_DOES_WORK
270 #define UNEXEC_USE_MAP_PRIVATE
271 #endif
272 #endif
274 #ifdef LINUX_QMAGIC
276 #define HAVE_TEXT_START
277 #define UNEXEC unexsunos4.o
278 #define N_PAGSIZ(x) PAGE_SIZE
280 #else /* not LINUX_QMAGIC */
282 #define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
283 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
284 #define ADJUST_EXEC_HEADER \
285 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
287 #endif /* not LINUX_QMAGIC */
289 #if 0
290 /* In 19.23 and 19.24, configure sometimes fails to define these.
291 It has to do with the fact that configure uses CFLAGS when linking
292 while Makefile.in.in (erroneously) fails to do so when linking temacs. */
293 #ifndef HAVE_GETTIMEOFDAY
294 #define HAVE_GETTIMEOFDAY
295 #endif
296 #ifndef HAVE_MKDIR
297 #define HAVE_MKDIR
298 #endif
299 #ifndef HAVE_RMDIR
300 #define HAVE_RMDIR
301 #endif
302 #ifndef HAVE_XSCREENNUMBEROFSCREEN
303 #define HAVE_XSCREENNUMBEROFSCREEN
304 #endif
305 #endif /* 0 */
307 /* This is to work around mysterious gcc failures in some system versions.
308 It is unlikely that Emacs changes will work around this problem;
309 therefore, this should remain permanently. */
310 #ifndef HAVE_XRMSETDATABASE
311 #define HAVE_XRMSETDATABASE
312 #endif
314 /* The regex.o routines are a part of the GNU C-library used with Linux. */
315 /* However, sometimes they disagree with the src/regex.h that comes with Emacs,
316 and that can make trouble in etags.c because it gets the regex.h from Emacs
317 and the function definitions in libc. So turn this off. */
318 /* #define REGEXP_IN_LIBC */
320 /* Use BSD process groups, but use setpgid() instead of setpgrp() to
321 actually set a process group. */
323 #define BSD_PGRPS
325 #define NARROWPROTO 1
327 /* Use mmap directly for allocating larger buffers. */
328 #ifdef DOUG_LEA_MALLOC
329 #undef REL_ALLOC
330 #endif
332 /* Tell that garbage collector that setjmp is known to save all
333 registers relevant for conservative garbage collection in the
334 jmp_buf. */
335 /* m68k and alpha aren't tested, but there are Debian packages for SCM
336 and/or Guile on them, so the technique must work. */
338 /* Don't use #cpu here since in newest development versions of GCC,
339 we must call cpp with -traditional, and that disables #cpu. */
341 #if defined __i386__ || defined __sparc__ || defined __mc68000__ || defined __alpha__
342 #define GC_SETJMP_WORKS 1
343 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
344 #ifdef __mc68000__
345 #define GC_LISP_OBJECT_ALIGNMENT 2
346 #endif
347 #endif