Move SIGNALS_VIA_CHARACTERS from src/s 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-2012
4 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 #if defined HAVE_GRANTPT
29 #define UNIX98_PTYS
30
31 /* Run only once. We need a `for'-loop because the code uses `continue'. */
32 #define PTY_ITERATION int i; for (i = 0; i < 1; i++)
33
34 #ifdef HAVE_GETPT
35 #define PTY_NAME_SPRINTF
36 #define PTY_OPEN fd = getpt ()
37 #else /* not HAVE_GETPT */
38 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
39 #endif /* not HAVE_GETPT */
40
41 /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
42 prevent sigchld_handler from intercepting the child's death. */
43 #define PTY_TTY_NAME_SPRINTF \
44 { \
45 char *ptyname; \
46 \
47 sigblock (sigmask (SIGCHLD)); \
48 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
49 || !(ptyname = ptsname(fd))) \
50 { \
51 sigunblock (sigmask (SIGCHLD)); \
52 close (fd); \
53 return -1; \
54 } \
55 snprintf (pty_name, sizeof pty_name, "%s", ptyname); \
56 sigunblock (sigmask (SIGCHLD)); \
57 }
58
59 #else /* not HAVE_GRANTPT */
60
61 /* Letter to use in finding device name of first pty,
62 if system supports pty's. 'p' means it is /dev/ptyp0 */
63 #define FIRST_PTY_LETTER 'p'
64
65 #endif /* not HAVE_GRANTPT */
66
67 /* Define HAVE_PTYS if the system supports pty devices. */
68 #define HAVE_PTYS
69
70 #define HAVE_SOCKETS
71
72 /* Here, on a separate page, add any special hacks needed
73 to make Emacs work on this system. For example,
74 you might define certain system call names that don't
75 exist on your system, or that do different things on
76 your system and must be used only through an encapsulation
77 (Which you should place, by convention, in sysdep.c). */
78 \f
79 #ifdef emacs
80 #define INTERRUPT_INPUT
81 #endif
82
83 #define POSIX /* affects getpagesize.h and systty.h */
84
85 /* This is to work around mysterious gcc failures in some system versions.
86 It is unlikely that Emacs changes will work around this problem;
87 therefore, this should remain permanently. */
88 #ifndef HAVE_XRMSETDATABASE
89 #define HAVE_XRMSETDATABASE
90 #endif
91
92 #define NARROWPROTO 1
93
94 /* Tell that garbage collector that setjmp is known to save all
95 registers relevant for conservative garbage collection in the jmp_buf. */
96 /* Not all the architectures are tested, but there are Debian packages
97 for SCM and/or Guile on them, so the technique must work. See also
98 comments in alloc.c concerning setjmp and gcc. Fixme: it's
99 probably safe to make this conditional just on GCC, except for ia64
100 register window-flushing. */
101 /* Don't use #cpu here since in newest development versions of GCC,
102 we must call cpp with -traditional, and that disables #cpu. */
103 #if defined __i386__ || defined __sparc__ || defined __mc68000__ \
104 || defined __alpha__ || defined __mips__ || defined __s390__ \
105 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
106 || defined __ia64__ || defined __sh__
107 #define GC_SETJMP_WORKS 1
108 #ifdef __ia64__
109 #define GC_MARK_SECONDARY_STACK() \
110 do { \
111 extern void *__libc_ia64_register_backing_store_base; \
112 __builtin_ia64_flushrs (); \
113 mark_memory (__libc_ia64_register_backing_store_base, \
114 __builtin_ia64_bsp ()); \
115 } while (0)
116 #endif
117 #else
118 #define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE
119 #endif
120
121 #ifdef __i386__
122 /* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */
123 /* we cannot get the maximum address for brk */
124 # define ULIMIT_BREAK_VALUE (32*1024*1024)
125 #endif