Move MAIL_USE_FLOCK, MAIL_USE_LOCKF, BLESSMAIL_TARGET from cpp to configure.
[bpt/emacs.git] / src / s / gnu-linux.h
1 /* This file is the configuration file for Linux-based GNU systems
2
3 Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5
6 This file is part of GNU Emacs.
7
8 GNU Emacs is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 GNU Emacs is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* This file was put together by Michael K. Johnson and Rik Faith. */
22
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 USG
30 #define GNU_LINUX
31
32 /* SYSTEM_TYPE should indicate the kind of system you are using.
33 It sets the Lisp variable system-type. */
34
35 #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
36
37 #ifndef NOT_C_CODE
38 #ifdef emacs
39 #ifdef HAVE_LINUX_VERSION_H
40 #include <linux/version.h>
41
42 #if LINUX_VERSION_CODE >= 0x20400
43 /* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */
44 #define SIGNALS_VIA_CHARACTERS
45 #endif /* LINUX_VERSION_CODE >= 0x20400 */
46 #endif /* HAVE_LINUX_VERSION_H */
47 #endif /* emacs */
48 #endif /* NOT_C_CODE */
49
50 #if defined HAVE_GRANTPT
51 #define UNIX98_PTYS
52
53 /* Run only once. We need a `for'-loop because the code uses
54 `continue'. */
55
56 #define PTY_ITERATION for (i = 0; i < 1; i++)
57
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 }
84
85 #else /* not HAVE_GRANTPT */
86
87 /* Letter to use in finding device name of first pty,
88 if system supports pty's. 'p' means it is /dev/ptyp0 */
89
90 #define FIRST_PTY_LETTER 'p'
91
92 #endif /* not HAVE_GRANTPT */
93
94 /* Define HAVE_TERMIOS if the system provides POSIX-style
95 functions and macros for terminal control. */
96
97 #define HAVE_TERMIOS
98
99 /* Define HAVE_PTYS if the system supports pty devices. */
100
101 #define HAVE_PTYS
102
103 #define HAVE_SOCKETS
104
105 /* Define this symbol if your system has the functions bcopy, etc. */
106 #define BSTRING
107
108 /* This is used in list_system_processes. */
109 #define HAVE_PROCFS 1
110
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. */
115 #define CLASH_DETECTION
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
124 /* This is needed for dispnew.c:update_frame */
125
126 #ifdef emacs
127 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
128 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
129 /* new C libio names */
130 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
131 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
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__ */
137 /* old C++ iostream names */
138 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
139 ((FILE)->_pptr - (FILE)->_pbase)
140 #endif /* !_IO_STDIO_H && ! __UCLIBC__ */
141 #endif /* emacs */
142
143 /* Ask GCC where to find libgcc.a. */
144 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
145
146 #ifdef emacs
147 #define INTERRUPT_INPUT
148 #endif
149
150 #define SYSV_SYSTEM_DIR /* use dirent.h */
151
152 #define POSIX /* affects getpagesize.h and systty.h */
153
154 #undef LIB_GCC
155 #define LIB_GCC
156
157 #define UNEXEC unexelf.o
158
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. */
162 #ifndef HAVE_XRMSETDATABASE
163 #define HAVE_XRMSETDATABASE
164 #endif
165
166 #define NARROWPROTO 1
167
168 /* Use mmap directly for allocating larger buffers. */
169 #ifdef DOUG_LEA_MALLOC
170 #undef REL_ALLOC
171 #endif
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. */
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. */
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
184 #if defined __i386__ || defined __sparc__ || defined __mc68000__ \
185 || defined __alpha__ || defined __mips__ || defined __s390__ \
186 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
187 || defined __ia64__ || defined __sh__
188 #define GC_SETJMP_WORKS 1
189 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
190 #ifdef __mc68000__
191 #define GC_LISP_OBJECT_ALIGNMENT 2
192 #endif
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, \
199 __builtin_ia64_bsp (), 0); \
200 } while (0)
201 #endif
202 #endif
203
204 /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
205 (do not change this comment) */