]> 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 /* Define CLASH_DETECTION if you want lock files to be written
101 so that Emacs can tell instantly when you try to modify
102 a file that someone else has modified in his Emacs. */
103 #define CLASH_DETECTION
104
105 /* Here, on a separate page, add any special hacks needed
106 to make Emacs work on this system. For example,
107 you might define certain system call names that don't
108 exist on your system, or that do different things on
109 your system and must be used only through an encapsulation
110 (Which you should place, by convention, in sysdep.c). */
111 \f
112 /* This is needed for dispnew.c:update_frame. */
113 #ifdef emacs
114 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
115 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
116 /* New C libio names. */
117 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
118 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
119 #elif defined (__UCLIBC__)
120 /* Using the uClibc library. */
121 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
122 ((FILE)->__bufpos - (FILE)->__bufstart)
123 #else /* !_IO_STDIO_H && ! __UCLIBC__ */
124 /* Old C++ iostream names. */
125 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
126 ((FILE)->_pptr - (FILE)->_pbase)
127 #endif /* !_IO_STDIO_H && ! __UCLIBC__ */
128
129 #define INTERRUPT_INPUT
130 #endif /* emacs */
131
132 #define SYSV_SYSTEM_DIR /* use dirent.h */
133
134 #define POSIX /* affects getpagesize.h and systty.h */
135
136 #define UNEXEC unexelf.o
137
138 /* This is to work around mysterious gcc failures in some system versions.
139 It is unlikely that Emacs changes will work around this problem;
140 therefore, this should remain permanently. */
141 #ifndef HAVE_XRMSETDATABASE
142 #define HAVE_XRMSETDATABASE
143 #endif
144
145 #define NARROWPROTO 1
146
147 /* Tell that garbage collector that setjmp is known to save all
148 registers relevant for conservative garbage collection in the jmp_buf. */
149 /* Not all the architectures are tested, but there are Debian packages
150 for SCM and/or Guile on them, so the technique must work. See also
151 comments in alloc.c concerning setjmp and gcc. Fixme: it's
152 probably safe to make this conditional just on GCC, except for ia64
153 register window-flushing. */
154 /* Don't use #cpu here since in newest development versions of GCC,
155 we must call cpp with -traditional, and that disables #cpu. */
156 #if defined __i386__ || defined __sparc__ || defined __mc68000__ \
157 || defined __alpha__ || defined __mips__ || defined __s390__ \
158 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
159 || defined __ia64__ || defined __sh__
160 #define GC_SETJMP_WORKS 1
161 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
162 #ifdef __mc68000__
163 #define GC_LISP_OBJECT_ALIGNMENT 2
164 #endif
165 #ifdef __ia64__
166 #define GC_MARK_SECONDARY_STACK() \
167 do { \
168 extern void *__libc_ia64_register_backing_store_base; \
169 __builtin_ia64_flushrs (); \
170 mark_memory (__libc_ia64_register_backing_store_base, \
171 __builtin_ia64_bsp (), 0); \
172 } while (0)
173 #endif
174 #endif
175
176 /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
177 (do not change this comment) */