Add function prototype for resize_mini_window.
[bpt/emacs.git] / src / s / gnu-linux.h
1 /* This file is the configuration file for Linux-based GNU systems
2 Copyright (C) 1985, 1986, 1992, 1994, 1996 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* This file was put together by Michael K. Johnson and Rik Faith. */
22
23
24 /*
25 * Define symbols to identify the version of Unix this is.
26 * Define all the symbols that apply correctly.
27 */
28
29 /* #define UNIPLUS */
30 /* #define USG5 */
31 #define USG
32 /* #define BSD_SYSTEM */
33 #define LINUX
34
35 /* SYSTEM_TYPE should indicate the kind of system you are using.
36 It sets the Lisp variable system-type. */
37
38 #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
39
40 /* Check the version number of Linux--if it is at least 1.2.0,
41 it is safe to use SIGIO. */
42 #ifndef NOT_C_CODE
43 #ifdef emacs
44 #ifdef HAVE_LINUX_VERSION_H
45 #include <linux/version.h>
46
47 #if LINUX_VERSION_CODE > 0x10200
48 #define LINUX_SIGIO_DOES_WORK
49 #endif /* LINUX_VERSION_CODE > 0x10200 */
50 #if LINUX_VERSION_CODE >= 0x20000
51 #define LINUX_MAP_SHARED_DOES_WORK
52 #endif /* LINUX_VERSION_CODE >= 0x20000 */
53 #endif /* HAVE_LINUX_VERSION_H */
54 #endif /* emacs */
55 #endif /* NOT_C_CODE */
56
57 /* Letter to use in finding device name of first pty,
58 if system supports pty's. 'p' means it is /dev/ptyp0 */
59
60 #define FIRST_PTY_LETTER 'p'
61
62 /*
63 * Define HAVE_TERMIOS if the system provides POSIX-style
64 * functions and macros for terminal control.
65 */
66
67 #define HAVE_TERMIOS
68
69 /*
70 * Define HAVE_PTYS if the system supports pty devices.
71 */
72
73 #define HAVE_PTYS
74
75 /* Uncomment this later when other problems are dealt with -mkj */
76
77 #define HAVE_SOCKETS
78
79 /* Define this symbol if your system has the functions bcopy, etc. */
80
81 #define BSTRING
82
83 /* subprocesses should be defined if you want to
84 have code for asynchronous subprocesses
85 (as used in M-x compile and M-x shell).
86 This is generally OS dependent, and not supported
87 under most USG systems. */
88
89 #define subprocesses
90
91 /* define MAIL_USE_FLOCK if the mailer uses flock
92 to interlock access to /usr/spool/mail/$USER.
93 The alternative is that a lock file named
94 /usr/spool/mail/$USER.lock. */
95
96 /* On GNU/Linux systems, both methods are used by various mail
97 programs. I assume that most people are using newer mailers that
98 have heard of flock. Change this if you need to. */
99
100 #define MAIL_USE_FLOCK
101
102 /* Define CLASH_DETECTION if you want lock files to be written
103 so that Emacs can tell instantly when you try to modify
104 a file that someone else has modified in his Emacs. */
105
106 #define CLASH_DETECTION
107
108 /* Here, on a separate page, add any special hacks needed
109 to make Emacs work on this system. For example,
110 you might define certain system call names that don't
111 exist on your system, or that do different things on
112 your system and must be used only through an encapsulation
113 (Which you should place, by convention, in sysdep.c). */
114 \f
115 /* On POSIX systems the system calls are interruptible by signals
116 that the user program has elected to catch. Thus the system call
117 must be retried in these cases. To handle this without massive
118 changes in the source code, we remap the standard system call names
119 to names for our own functions in sysdep.c that do the system call
120 with retries. */
121
122 #define read sys_read
123 #define write sys_write
124 #define open sys_open
125 #define close sys_close
126
127 #define INTERRUPTIBLE_OPEN
128 #define INTERRUPTIBLE_CLOSE
129 #define INTERRUPTIBLE_IO
130
131 /* If you mount the proc file system somewhere other than /proc
132 you will have to uncomment the following and make the proper
133 changes */
134
135 /* #define LINUX_LDAV_FILE "/proc/loadavg" */
136
137 /* This is needed for dispnew.c:update_frame */
138
139 #ifdef emacs
140 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
141 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
142 /* new C libio names */
143 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
144 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
145 #else /* !_IO_STDIO_H */
146 /* old C++ iostream names */
147 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
148 ((FILE)->_pptr - (FILE)->_pbase)
149 #endif /* !_IO_STDIO_H */
150 #endif /* emacs */
151
152 /* Ask GCC where to find libgcc.a. */
153 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
154
155 #ifndef __ELF__
156 /* GNU/Linux usually has crt0.o in a non-standard place */
157 #define START_FILES pre-crt0.o /usr/lib/crt0.o
158 #else
159 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
160 #endif
161
162 #ifdef __ELF__
163 /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
164 says where to find X windows at run time. */
165
166 #ifdef __mips__
167 #define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
168 #else
169 #define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
170 #endif /* __mips__ */
171 #endif /* __ELF__ */
172
173 /* As of version 1.1.51, Linux did not actually implement SIGIO.
174 But it works in newer versions. */
175 /* Here we assume that signal.h is already included. */
176 #ifdef emacs
177 #ifdef LINUX_SIGIO_DOES_WORK
178 #define INTERRUPT_INPUT
179 #else
180 #undef SIGIO
181 /* Some versions of Linux define SIGURG and SIGPOLL as aliases for SIGIO.
182 This prevents lossage in process.c. */
183 #undef SIGURG
184 #undef SIGPOLL
185 #endif
186 #endif
187
188 /* This is needed for sysdep.c */
189
190 #define NO_SIOCTL_H /* don't have sioctl.h */
191
192 #define HAVE_VFORK
193 #define HAVE_SYS_SIGLIST
194 #define HAVE_GETWD /* cure conflict with getcwd? */
195 #define HAVE_WAIT_HEADER
196
197 #define SYSV_SYSTEM_DIR /* use dirent.h */
198
199 #define POSIX /* affects getpagesize.h and systty.h */
200 #define POSIX_SIGNALS
201
202 /* Best not to include -lg, unless it is last on the command line */
203 #define LIBS_DEBUG
204 #ifndef __ELF__
205 #define LIB_STANDARD -lc /* avoid -lPW */
206 #else
207 #undef LIB_GCC
208 #define LIB_GCC
209 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
210 #endif
211
212 /* Don't use -g in test compiles in configure.
213 This is so we will use the same shared libs for that linking
214 that are used when linking temacs. */
215 #ifdef THIS_IS_CONFIGURE
216 #define C_DEBUG_SWITCH
217 #endif
218
219 /* Let's try this out, just in case.
220 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */
221 /* #define SIGNALS_VIA_CHARACTERS */
222
223 /* Rob Malouf <malouf@csli.stanford.edu> says:
224 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
225 and is a very common addition to previous versions. */
226
227 #ifdef TERM
228 #define LIBS_SYSTEM -lclient
229 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
230 #else
231 /* alane@wozzle.linet.org says that -lipc is not a separate library,
232 since libc-4.4.1. So -lipc was deleted. */
233 #define LIBS_SYSTEM
234 #define C_SWITCH_SYSTEM -D_BSD_SOURCE
235 #endif
236
237 /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
238 #define LIB_MOTIF -lXm -lXpm
239
240 #ifdef HAVE_LIBNCURSES
241 #define TERMINFO
242 #define LIBS_TERMCAP -lncurses
243 #endif
244
245 #define HAVE_SYSVIPC
246
247 #ifdef __ELF__
248 #define UNEXEC unexelf.o
249 #ifndef LINUX_MAP_SHARED_DOES_WORK
250 #define UNEXEC_USE_MAP_PRIVATE
251 #endif
252 #endif
253
254 #ifdef LINUX_QMAGIC
255
256 #define HAVE_TEXT_START
257 #define UNEXEC unexsunos4.o
258 #define N_PAGSIZ(x) PAGE_SIZE
259
260 #else /* not LINUX_QMAGIC */
261
262 #define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
263 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
264 #define ADJUST_EXEC_HEADER \
265 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
266
267 #endif /* not LINUX_QMAGIC */
268
269 #if 0
270 /* In 19.23 and 19.24, configure sometimes fails to define these.
271 It has to do with the fact that configure uses CFLAGS when linking
272 while Makefile.in.in (erroneously) fails to do so when linking temacs. */
273 #ifndef HAVE_GETTIMEOFDAY
274 #define HAVE_GETTIMEOFDAY
275 #endif
276 #ifndef HAVE_MKDIR
277 #define HAVE_MKDIR
278 #endif
279 #ifndef HAVE_RMDIR
280 #define HAVE_RMDIR
281 #endif
282 #ifndef HAVE_XSCREENNUMBEROFSCREEN
283 #define HAVE_XSCREENNUMBEROFSCREEN
284 #endif
285 #endif /* 0 */
286
287 /* This is to work around mysterious gcc failures in some system versions.
288 It is unlikely that Emacs changes will work around this problem;
289 therefore, this should remain permanently. */
290 #ifndef HAVE_XRMSETDATABASE
291 #define HAVE_XRMSETDATABASE
292 #endif
293
294 /* The regex.o routines are a part of the GNU C-library used with Linux. */
295 /* However, sometimes they disagree with the src/regex.h that comes with Emacs,
296 and that can make trouble in etags.c because it gets the regex.h from Emacs
297 and the function definitions in libc. So turn this off. */
298 /* #define REGEXP_IN_LIBC */
299
300 /* Use BSD process groups, but use setpgid() instead of setpgrp() to
301 actually set a process group. */
302
303 #define BSD_PGRPS
304 #define setpgrp(pid,pgid) setpgid(pid,pgid)
305
306 #define NARROWPROTO 1
307
308 /* Use mmap directly for allocating larger buffers. */
309 #ifdef DOUG_LEA_MALLOC
310 #undef REL_ALLOC
311 #endif