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