]> code.delx.au - gnu-emacs/blob - src/s/gnu-linux.h
merge trunk
[gnu-emacs] / 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 was put together by Michael K. Johnson and Rik Faith.
7
8 This file is part of GNU Emacs.
9
10 GNU Emacs is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 GNU Emacs is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22
23 /* Define symbols to identify the version of Unix this is.
24 Define all the symbols that apply correctly. */
25 #define USG
26 #define GNU_LINUX
27
28 /* SYSTEM_TYPE should indicate the kind of system you are using.
29 It sets the Lisp variable system-type. */
30 #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
31
32 #ifndef NOT_C_CODE
33 #ifdef emacs
34 #ifdef HAVE_LINUX_VERSION_H
35 #include <linux/version.h>
36
37 #if LINUX_VERSION_CODE >= 0x20400
38 /* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */
39 #define SIGNALS_VIA_CHARACTERS
40 #endif /* LINUX_VERSION_CODE >= 0x20400 */
41 #endif /* HAVE_LINUX_VERSION_H */
42 #endif /* emacs */
43 #endif /* NOT_C_CODE */
44
45 #if defined HAVE_GRANTPT
46 #define UNIX98_PTYS
47
48 /* Run only once. We need a `for'-loop because the code uses `continue'. */
49 #define PTY_ITERATION for (i = 0; i < 1; i++)
50
51 #ifdef HAVE_GETPT
52 #define PTY_NAME_SPRINTF
53 #define PTY_OPEN fd = getpt ()
54 #else /* not HAVE_GETPT */
55 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
56 #endif /* not HAVE_GETPT */
57
58 /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
59 prevent sigchld_handler from intercepting the child's death. */
60 #define PTY_TTY_NAME_SPRINTF \
61 { \
62 char *ptyname; \
63 \
64 sigblock (sigmask (SIGCHLD)); \
65 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
66 || !(ptyname = ptsname(fd))) \
67 { \
68 sigunblock (sigmask (SIGCHLD)); \
69 close (fd); \
70 return -1; \
71 } \
72 strncpy (pty_name, ptyname, sizeof (pty_name)); \
73 pty_name[sizeof (pty_name) - 1] = 0; \
74 sigunblock (sigmask (SIGCHLD)); \
75 }
76
77 #else /* not HAVE_GRANTPT */
78
79 /* Letter to use in finding device name of first pty,
80 if system supports pty's. 'p' means it is /dev/ptyp0 */
81 #define FIRST_PTY_LETTER 'p'
82
83 #endif /* not HAVE_GRANTPT */
84
85 /* Define HAVE_TERMIOS if the system provides POSIX-style
86 functions and macros for terminal control. */
87 #define HAVE_TERMIOS
88
89 /* Define HAVE_PTYS if the system supports pty devices. */
90 #define HAVE_PTYS
91
92 #define HAVE_SOCKETS
93
94 /* Define this symbol if your system has the functions bcopy, etc. */
95 #define BSTRING
96
97 /* This is used in list_system_processes. */
98 #define HAVE_PROCFS 1
99
100
101 /* Define CLASH_DETECTION if you want lock files to be written
102 so that Emacs can tell instantly when you try to modify
103 a file that someone else has modified in his Emacs. */
104 #define CLASH_DETECTION
105
106 /* Here, on a separate page, add any special hacks needed
107 to make Emacs work on this system. For example,
108 you might define certain system call names that don't
109 exist on your system, or that do different things on
110 your system and must be used only through an encapsulation
111 (Which you should place, by convention, in sysdep.c). */
112 \f
113 /* This is needed for dispnew.c:update_frame. */
114 #ifdef emacs
115 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
116 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
117 /* New C libio names. */
118 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
119 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
120 #elif defined (__UCLIBC__)
121 /* Using the uClibc library. */
122 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
123 ((FILE)->__bufpos - (FILE)->__bufstart)
124 #else /* !_IO_STDIO_H && ! __UCLIBC__ */
125 /* Old C++ iostream names. */
126 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
127 ((FILE)->_pptr - (FILE)->_pbase)
128 #endif /* !_IO_STDIO_H && ! __UCLIBC__ */
129 #endif /* emacs */
130
131 #ifdef emacs
132 #define INTERRUPT_INPUT
133 #endif
134
135 #define SYSV_SYSTEM_DIR /* use dirent.h */
136
137 #define POSIX /* affects getpagesize.h and systty.h */
138
139 #define UNEXEC unexelf.o
140
141 /* This is to work around mysterious gcc failures in some system versions.
142 It is unlikely that Emacs changes will work around this problem;
143 therefore, this should remain permanently. */
144 #ifndef HAVE_XRMSETDATABASE
145 #define HAVE_XRMSETDATABASE
146 #endif
147
148 #define NARROWPROTO 1
149
150 /* Use mmap directly for allocating larger buffers. */
151 #ifdef DOUG_LEA_MALLOC
152 #undef REL_ALLOC
153 #endif
154
155 /* Tell that garbage collector that setjmp is known to save all
156 registers relevant for conservative garbage collection in the jmp_buf. */
157 /* Not all the architectures are tested, but there are Debian packages
158 for SCM and/or Guile on them, so the technique must work. See also
159 comments in alloc.c concerning setjmp and gcc. Fixme: it's
160 probably safe to make this conditional just on GCC, except for ia64
161 register window-flushing. */
162 /* Don't use #cpu here since in newest development versions of GCC,
163 we must call cpp with -traditional, and that disables #cpu. */
164 #if defined __i386__ || defined __sparc__ || defined __mc68000__ \
165 || defined __alpha__ || defined __mips__ || defined __s390__ \
166 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
167 || defined __ia64__ || defined __sh__
168 #define GC_SETJMP_WORKS 1
169 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
170 #ifdef __mc68000__
171 #define GC_LISP_OBJECT_ALIGNMENT 2
172 #endif
173 #ifdef __ia64__
174 #define GC_MARK_SECONDARY_STACK() \
175 do { \
176 extern void *__libc_ia64_register_backing_store_base; \
177 __builtin_ia64_flushrs (); \
178 mark_memory (__libc_ia64_register_backing_store_base, \
179 __builtin_ia64_bsp (), 0); \
180 } while (0)
181 #endif
182 #endif
183
184 /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
185 (do not change this comment) */