Commit | Line | Data |
---|---|---|
3a707ba5 | 1 | /* This file is the configuration file for Linux-based GNU systems |
2f86b22b GM |
2 | |
3 | Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004, | |
e9bffc61 GM |
4 | 2005, 2006, 2007, 2008, 2009, 2010, 2011 |
5 | Free Software Foundation, Inc. | |
566e3587 | 6 | |
e05aebe9 GM |
7 | This file was put together by Michael K. Johnson and Rik Faith. |
8 | ||
566e3587 JB |
9 | This file is part of GNU Emacs. |
10 | ||
4b158629 | 11 | GNU Emacs is free software: you can redistribute it and/or modify |
566e3587 | 12 | it under the terms of the GNU General Public License as published by |
4b158629 GM |
13 | the Free Software Foundation, either version 3 of the License, or |
14 | (at your option) any later version. | |
566e3587 JB |
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 | |
4b158629 | 22 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
566e3587 | 23 | |
e05aebe9 GM |
24 | /* Define symbols to identify the version of Unix this is. |
25 | Define all the symbols that apply correctly. */ | |
566e3587 | 26 | #define USG |
8db5530a | 27 | #define GNU_LINUX |
566e3587 JB |
28 | |
29 | /* SYSTEM_TYPE should indicate the kind of system you are using. | |
e05aebe9 | 30 | It sets the Lisp variable system-type. */ |
3a707ba5 | 31 | #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */ |
566e3587 | 32 | |
65953053 | 33 | #ifdef emacs |
b764619d | 34 | #ifdef HAVE_LINUX_VERSION_H |
65953053 | 35 | #include <linux/version.h> |
566e3587 | 36 | |
85a71b37 | 37 | #if LINUX_VERSION_CODE >= 0x20400 |
c5e7567d DN |
38 | /* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */ |
39 | #define SIGNALS_VIA_CHARACTERS | |
85a71b37 | 40 | #endif /* LINUX_VERSION_CODE >= 0x20400 */ |
b764619d | 41 | #endif /* HAVE_LINUX_VERSION_H */ |
aa7fcbb0 | 42 | #endif /* emacs */ |
566e3587 | 43 | |
71125fb8 GM |
44 | #if defined HAVE_GRANTPT |
45 | #define UNIX98_PTYS | |
566e3587 | 46 | |
e05aebe9 | 47 | /* Run only once. We need a `for'-loop because the code uses `continue'. */ |
71125fb8 | 48 | #define PTY_ITERATION for (i = 0; i < 1; i++) |
fdc5e0fc | 49 | |
71125fb8 GM |
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. */ | |
71125fb8 GM |
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 | } | |
fdc5e0fc | 75 | |
dacbb818 | 76 | #else /* not HAVE_GRANTPT */ |
fdc5e0fc | 77 | |
71125fb8 GM |
78 | /* Letter to use in finding device name of first pty, |
79 | if system supports pty's. 'p' means it is /dev/ptyp0 */ | |
71125fb8 | 80 | #define FIRST_PTY_LETTER 'p' |
fdc5e0fc | 81 | |
132d0475 | 82 | #endif /* not HAVE_GRANTPT */ |
fdc5e0fc | 83 | |
e05aebe9 | 84 | /* Define HAVE_PTYS if the system supports pty devices. */ |
566e3587 JB |
85 | #define HAVE_PTYS |
86 | ||
dad29761 | 87 | #define HAVE_SOCKETS |
566e3587 | 88 | |
06e111a6 | 89 | /* This is used in list_system_processes. */ |
40c5931c | 90 | #define HAVE_PROCFS 1 |
40c5931c | 91 | |
566e3587 JB |
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. */ | |
b2e209ba | 95 | #define CLASH_DETECTION |
566e3587 JB |
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 | |
e05aebe9 | 104 | /* This is needed for dispnew.c:update_frame. */ |
5e5623c2 | 105 | #ifdef emacs |
a9c82aaf | 106 | #include <stdio.h> /* Get the definition of _IO_STDIO_H. */ |
4dee6d0d | 107 | #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM) |
e05aebe9 | 108 | /* New C libio names. */ |
c2c3f859 | 109 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ |
5e5623c2 | 110 | ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base) |
65f451d0 | 111 | #elif defined (__UCLIBC__) |
e05aebe9 | 112 | /* Using the uClibc library. */ |
65f451d0 DN |
113 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ |
114 | ((FILE)->__bufpos - (FILE)->__bufstart) | |
115 | #else /* !_IO_STDIO_H && ! __UCLIBC__ */ | |
e05aebe9 | 116 | /* Old C++ iostream names. */ |
c2c3f859 | 117 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ |
5e5623c2 | 118 | ((FILE)->_pptr - (FILE)->_pbase) |
65f451d0 | 119 | #endif /* !_IO_STDIO_H && ! __UCLIBC__ */ |
566e3587 | 120 | |
65953053 | 121 | #define INTERRUPT_INPUT |
9539dc5d | 122 | #endif /* emacs */ |
566e3587 | 123 | |
1abbab7a | 124 | #define POSIX /* affects getpagesize.h and systty.h */ |
566e3587 | 125 | |
639f52d8 RS |
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. */ | |
e3b89505 RS |
129 | #ifndef HAVE_XRMSETDATABASE |
130 | #define HAVE_XRMSETDATABASE | |
131 | #endif | |
e2000885 | 132 | |
2327e4a0 GM |
133 | #define NARROWPROTO 1 |
134 | ||
bb15bd9a | 135 | /* Tell that garbage collector that setjmp is known to save all |
e05aebe9 | 136 | registers relevant for conservative garbage collection in the jmp_buf. */ |
e7b6b572 DL |
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. */ | |
a8f77aaa GM |
142 | /* Don't use #cpu here since in newest development versions of GCC, |
143 | we must call cpp with -traditional, and that disables #cpu. */ | |
e7b6b572 DL |
144 | #if defined __i386__ || defined __sparc__ || defined __mc68000__ \ |
145 | || defined __alpha__ || defined __mips__ || defined __s390__ \ | |
e3177e43 | 146 | || defined __arm__ || defined __powerpc__ || defined __amd64__ \ |
00f37552 | 147 | || defined __ia64__ || defined __sh__ |
bb15bd9a | 148 | #define GC_SETJMP_WORKS 1 |
ecf4d726 | 149 | #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS |
72bba9f2 AS |
150 | #ifdef __mc68000__ |
151 | #define GC_LISP_OBJECT_ALIGNMENT 2 | |
152 | #endif | |
e3177e43 AS |
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, \ | |
fbb7c02f | 159 | __builtin_ia64_bsp (), 0); \ |
e3177e43 AS |
160 | } while (0) |
161 | #endif | |
bb15bd9a | 162 | #endif |
ab5796a9 | 163 |