Move MAIL_USE_FLOCK, MAIL_USE_LOCKF, BLESSMAIL_TARGET from cpp to configure.
[bpt/emacs.git] / src / s / gnu-linux.h
CommitLineData
3a707ba5 1/* This file is the configuration file for Linux-based GNU systems
2f86b22b
GM
2
3Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009, 2010 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. */
566e3587
JB
106#define BSTRING
107
06e111a6 108/* This is used in list_system_processes. */
40c5931c 109#define HAVE_PROCFS 1
40c5931c 110
566e3587
JB
111
112/* Define CLASH_DETECTION if you want lock files to be written
113 so that Emacs can tell instantly when you try to modify
114 a file that someone else has modified in his Emacs. */
b2e209ba 115#define CLASH_DETECTION
566e3587
JB
116
117/* Here, on a separate page, add any special hacks needed
118 to make Emacs work on this system. For example,
119 you might define certain system call names that don't
120 exist on your system, or that do different things on
121 your system and must be used only through an encapsulation
122 (Which you should place, by convention, in sysdep.c). */
123\f
fde448f4 124/* This is needed for dispnew.c:update_frame */
566e3587 125
5e5623c2 126#ifdef emacs
a9c82aaf 127#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
4dee6d0d 128#if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
5e5623c2 129/* new C libio names */
c2c3f859 130#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2 131 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
65f451d0
DN
132#elif defined (__UCLIBC__)
133/* using the uClibc library */
134#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
135 ((FILE)->__bufpos - (FILE)->__bufstart)
136#else /* !_IO_STDIO_H && ! __UCLIBC__ */
5e5623c2 137/* old C++ iostream names */
c2c3f859 138#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2 139 ((FILE)->_pptr - (FILE)->_pbase)
65f451d0 140#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
5e5623c2 141#endif /* emacs */
566e3587 142
5101db23 143/* Ask GCC where to find libgcc.a. */
08ddf771 144#define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
5101db23 145
566e3587 146#ifdef emacs
65953053 147#define INTERRUPT_INPUT
65953053 148#endif
566e3587 149
566e3587 150#define SYSV_SYSTEM_DIR /* use dirent.h */
566e3587 151
1abbab7a 152#define POSIX /* affects getpagesize.h and systty.h */
566e3587 153
08ddf771 154#undef LIB_GCC
4dee6d0d 155#define LIB_GCC
3233bbe1 156
4dee6d0d 157#define UNEXEC unexelf.o
8427dec9 158
639f52d8
RS
159/* This is to work around mysterious gcc failures in some system versions.
160 It is unlikely that Emacs changes will work around this problem;
161 therefore, this should remain permanently. */
e3b89505
RS
162#ifndef HAVE_XRMSETDATABASE
163#define HAVE_XRMSETDATABASE
164#endif
e2000885 165
2327e4a0
GM
166#define NARROWPROTO 1
167
e0a6ee5e
RS
168/* Use mmap directly for allocating larger buffers. */
169#ifdef DOUG_LEA_MALLOC
170#undef REL_ALLOC
171#endif
bb15bd9a
DL
172
173/* Tell that garbage collector that setjmp is known to save all
174 registers relevant for conservative garbage collection in the
175 jmp_buf. */
e7b6b572
DL
176/* Not all the architectures are tested, but there are Debian packages
177 for SCM and/or Guile on them, so the technique must work. See also
178 comments in alloc.c concerning setjmp and gcc. Fixme: it's
179 probably safe to make this conditional just on GCC, except for ia64
180 register window-flushing. */
a8f77aaa
GM
181/* Don't use #cpu here since in newest development versions of GCC,
182 we must call cpp with -traditional, and that disables #cpu. */
183
e7b6b572
DL
184#if defined __i386__ || defined __sparc__ || defined __mc68000__ \
185 || defined __alpha__ || defined __mips__ || defined __s390__ \
e3177e43 186 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
00f37552 187 || defined __ia64__ || defined __sh__
bb15bd9a 188#define GC_SETJMP_WORKS 1
ecf4d726 189#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
72bba9f2
AS
190#ifdef __mc68000__
191#define GC_LISP_OBJECT_ALIGNMENT 2
192#endif
e3177e43
AS
193#ifdef __ia64__
194#define GC_MARK_SECONDARY_STACK() \
195 do { \
196 extern void *__libc_ia64_register_backing_store_base; \
197 __builtin_ia64_flushrs (); \
198 mark_memory (__libc_ia64_register_backing_store_base, \
fbb7c02f 199 __builtin_ia64_bsp (), 0); \
e3177e43
AS
200 } while (0)
201#endif
bb15bd9a 202#endif
ab5796a9
MB
203
204/* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
205 (do not change this comment) */