* minibuffer.el (comps): Declare for byte-compiler.
[bpt/emacs.git] / src / s / gnu-linux.h
CommitLineData
3a707ba5 1/* This file is the configuration file for Linux-based GNU systems
429ab54e 2 Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
27a2cdfc
GM
3 2005, 2006, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc.
566e3587
JB
5
6This file is part of GNU Emacs.
7
4b158629 8GNU Emacs is free software: you can redistribute it and/or modify
566e3587 9it under the terms of the GNU General Public License as published by
4b158629
GM
10the Free Software Foundation, either version 3 of the License, or
11(at your option) any later version.
566e3587
JB
12
13GNU Emacs is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
4b158629 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
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
566e3587 29#define USG
8db5530a 30#define GNU_LINUX
566e3587
JB
31
32/* SYSTEM_TYPE should indicate the kind of system you are using.
33 It sets the Lisp variable system-type. */
34
3a707ba5 35#define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
566e3587 36
65953053
RS
37#ifndef NOT_C_CODE
38#ifdef emacs
b764619d 39#ifdef HAVE_LINUX_VERSION_H
65953053 40#include <linux/version.h>
566e3587 41
85a71b37 42#if LINUX_VERSION_CODE >= 0x20400
c5e7567d
DN
43/* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */
44#define SIGNALS_VIA_CHARACTERS
85a71b37 45#endif /* LINUX_VERSION_CODE >= 0x20400 */
b764619d 46#endif /* HAVE_LINUX_VERSION_H */
aa7fcbb0
RS
47#endif /* emacs */
48#endif /* NOT_C_CODE */
566e3587 49
71125fb8
GM
50#if defined HAVE_GRANTPT
51#define UNIX98_PTYS
566e3587 52
71125fb8
GM
53/* Run only once. We need a `for'-loop because the code uses
54 `continue'. */
566e3587 55
71125fb8 56#define PTY_ITERATION for (i = 0; i < 1; i++)
fdc5e0fc 57
71125fb8
GM
58#ifdef HAVE_GETPT
59#define PTY_NAME_SPRINTF
60#define PTY_OPEN fd = getpt ()
61#else /* not HAVE_GETPT */
62#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
63#endif /* not HAVE_GETPT */
64
65/* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
66 prevent sigchld_handler from intercepting the child's death. */
67
68#define PTY_TTY_NAME_SPRINTF \
69 { \
70 char *ptyname; \
71 \
72 sigblock (sigmask (SIGCHLD)); \
73 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
74 || !(ptyname = ptsname(fd))) \
75 { \
76 sigunblock (sigmask (SIGCHLD)); \
77 close (fd); \
78 return -1; \
79 } \
80 strncpy (pty_name, ptyname, sizeof (pty_name)); \
81 pty_name[sizeof (pty_name) - 1] = 0; \
82 sigunblock (sigmask (SIGCHLD)); \
83 }
fdc5e0fc 84
dacbb818 85#else /* not HAVE_GRANTPT */
fdc5e0fc 86
71125fb8
GM
87/* Letter to use in finding device name of first pty,
88 if system supports pty's. 'p' means it is /dev/ptyp0 */
fdc5e0fc 89
71125fb8 90#define FIRST_PTY_LETTER 'p'
fdc5e0fc 91
132d0475 92#endif /* not HAVE_GRANTPT */
fdc5e0fc 93
71125fb8
GM
94/* Define HAVE_TERMIOS if the system provides POSIX-style
95 functions and macros for terminal control. */
566e3587
JB
96
97#define HAVE_TERMIOS
98
71125fb8 99/* Define HAVE_PTYS if the system supports pty devices. */
566e3587
JB
100
101#define HAVE_PTYS
102
dad29761 103#define HAVE_SOCKETS
566e3587
JB
104
105/* Define this symbol if your system has the functions bcopy, etc. */
106
107#define BSTRING
108
06e111a6 109/* This is used in list_system_processes. */
40c5931c 110#define HAVE_PROCFS 1
40c5931c 111
566e3587
JB
112/* define MAIL_USE_FLOCK if the mailer uses flock
113 to interlock access to /usr/spool/mail/$USER.
114 The alternative is that a lock file named
115 /usr/spool/mail/$USER.lock. */
116
3a707ba5
RS
117/* On GNU/Linux systems, both methods are used by various mail
118 programs. I assume that most people are using newer mailers that
119 have heard of flock. Change this if you need to. */
828a3791
DL
120/* Debian contains a patch which says: ``On Debian/GNU/Linux systems,
121 configure gets the right answers, and that means *NOT* using flock.
122 Using flock is guaranteed to be the wrong thing. See Debian Policy
123 for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the
124 Debian maintainer hasn't provided a clean fix for Emacs.
125 movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
126 HAVE_MAILLOCK_H are defined, so the following appears to be the
127 correct logic. -- fx */
47a0ee40
RF
128/* We must check for HAVE_LIBLOCKFILE too, as movemail does.
129 liblockfile is a Free Software replacement for libmail, used on
130 Debian systems and elsewhere. -rfr */
828a3791 131
47a0ee40
RF
132#if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \
133 defined (HAVE_MAILLOCK_H))
566e3587 134#define MAIL_USE_FLOCK
828a3791 135#endif
566e3587
JB
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
fde448f4 150/* This is needed for dispnew.c:update_frame */
566e3587 151
5e5623c2 152#ifdef emacs
a9c82aaf 153#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
4dee6d0d 154#if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
5e5623c2 155/* new C libio names */
c2c3f859 156#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2 157 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
65f451d0
DN
158#elif defined (__UCLIBC__)
159/* using the uClibc library */
160#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
161 ((FILE)->__bufpos - (FILE)->__bufstart)
162#else /* !_IO_STDIO_H && ! __UCLIBC__ */
5e5623c2 163/* old C++ iostream names */
c2c3f859 164#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2 165 ((FILE)->_pptr - (FILE)->_pbase)
65f451d0 166#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
5e5623c2 167#endif /* emacs */
566e3587 168
5101db23 169/* Ask GCC where to find libgcc.a. */
08ddf771 170#define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
5101db23 171
588a9a3e 172/* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
27a2cdfc 173 that says where to find X windows at run time. */
a28c4a8e 174
f649aa04 175#ifdef __mips__
27a2cdfc 176#define LD_SWITCH_SYSTEM -G 0 $(LD_SWITCH_X_SITE_AUX)
f649aa04 177#else
27a2cdfc 178#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX)
f649aa04 179#endif /* __mips__ */
854ad2d5 180
566e3587 181#ifdef emacs
65953053 182#define INTERRUPT_INPUT
65953053 183#endif
566e3587 184
566e3587 185#define SYSV_SYSTEM_DIR /* use dirent.h */
566e3587 186
1abbab7a 187#define POSIX /* affects getpagesize.h and systty.h */
566e3587 188
08ddf771 189#undef LIB_GCC
4dee6d0d 190#define LIB_GCC
3233bbe1 191
be1d1a1a 192#ifdef HAVE_LIBNCURSES
65953053 193#define TERMINFO
565b8b0d 194#define LIBS_TERMCAP -lncurses
65953053
RS
195#endif
196
4dee6d0d 197#define UNEXEC unexelf.o
8427dec9 198
639f52d8
RS
199/* This is to work around mysterious gcc failures in some system versions.
200 It is unlikely that Emacs changes will work around this problem;
201 therefore, this should remain permanently. */
e3b89505
RS
202#ifndef HAVE_XRMSETDATABASE
203#define HAVE_XRMSETDATABASE
204#endif
e2000885 205
2327e4a0
GM
206#define NARROWPROTO 1
207
e0a6ee5e
RS
208/* Use mmap directly for allocating larger buffers. */
209#ifdef DOUG_LEA_MALLOC
210#undef REL_ALLOC
211#endif
bb15bd9a
DL
212
213/* Tell that garbage collector that setjmp is known to save all
214 registers relevant for conservative garbage collection in the
215 jmp_buf. */
e7b6b572
DL
216/* Not all the architectures are tested, but there are Debian packages
217 for SCM and/or Guile on them, so the technique must work. See also
218 comments in alloc.c concerning setjmp and gcc. Fixme: it's
219 probably safe to make this conditional just on GCC, except for ia64
220 register window-flushing. */
a8f77aaa
GM
221/* Don't use #cpu here since in newest development versions of GCC,
222 we must call cpp with -traditional, and that disables #cpu. */
223
e7b6b572
DL
224#if defined __i386__ || defined __sparc__ || defined __mc68000__ \
225 || defined __alpha__ || defined __mips__ || defined __s390__ \
e3177e43 226 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
00f37552 227 || defined __ia64__ || defined __sh__
bb15bd9a 228#define GC_SETJMP_WORKS 1
ecf4d726 229#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
72bba9f2
AS
230#ifdef __mc68000__
231#define GC_LISP_OBJECT_ALIGNMENT 2
232#endif
e3177e43
AS
233#ifdef __ia64__
234#define GC_MARK_SECONDARY_STACK() \
235 do { \
236 extern void *__libc_ia64_register_backing_store_base; \
237 __builtin_ia64_flushrs (); \
238 mark_memory (__libc_ia64_register_backing_store_base, \
fbb7c02f 239 __builtin_ia64_bsp (), 0); \
e3177e43
AS
240 } while (0)
241#endif
bb15bd9a 242#endif
ab5796a9
MB
243
244/* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
245 (do not change this comment) */