1 /* This file is the configuration file for Linux-based GNU systems
2 Copyright (C) 1985, 86, 92, 94, 96, 1999 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
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)
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.
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. */
21 /* This file was put together by Michael K. Johnson and Rik Faith. */
25 * Define symbols to identify the version of Unix this is.
26 * Define all the symbols that apply correctly.
32 /* #define BSD_SYSTEM */
35 /* SYSTEM_TYPE should indicate the kind of system you are using.
36 It sets the Lisp variable system-type. */
38 #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
40 /* Check the version number of Linux--if it is at least 1.2.0,
41 it is safe to use SIGIO. */
44 #ifdef HAVE_LINUX_VERSION_H
45 #include <linux/version.h>
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 */
55 #endif /* NOT_C_CODE */
57 #if defined HAVE_GRANTPT
60 /* Run only once. We need a `for'-loop because the code uses
63 #define PTY_ITERATION for (i = 0; i < 1; i++)
66 #define PTY_NAME_SPRINTF
67 #define PTY_OPEN fd = getpt ()
68 #else /* not HAVE_GETPT */
69 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
70 #endif /* not HAVE_GETPT */
72 /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
73 prevent sigchld_handler from intercepting the child's death. */
75 #define PTY_TTY_NAME_SPRINTF \
79 sigblock (sigmask (SIGCHLD)); \
80 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
81 || !(ptyname = ptsname(fd))) \
83 sigunblock (sigmask (SIGCHLD)); \
87 strncpy (pty_name, ptyname, sizeof (pty_name)); \
88 pty_name[sizeof (pty_name) - 1] = 0; \
89 sigunblock (sigmask (SIGCHLD)); \
92 #else /* not HAVE_GRANDPT */
94 /* Letter to use in finding device name of first pty,
95 if system supports pty's. 'p' means it is /dev/ptyp0 */
97 #define FIRST_PTY_LETTER 'p'
99 #endif /* not HAVE_GRANDPT */
101 /* Define HAVE_TERMIOS if the system provides POSIX-style
102 functions and macros for terminal control. */
106 /* Define HAVE_PTYS if the system supports pty devices. */
110 /* Uncomment this later when other problems are dealt with -mkj */
114 /* Define this symbol if your system has the functions bcopy, etc. */
118 /* subprocesses should be defined if you want to
119 have code for asynchronous subprocesses
120 (as used in M-x compile and M-x shell).
121 This is generally OS dependent, and not supported
122 under most USG systems. */
126 /* define MAIL_USE_FLOCK if the mailer uses flock
127 to interlock access to /usr/spool/mail/$USER.
128 The alternative is that a lock file named
129 /usr/spool/mail/$USER.lock. */
131 /* On GNU/Linux systems, both methods are used by various mail
132 programs. I assume that most people are using newer mailers that
133 have heard of flock. Change this if you need to. */
135 #define MAIL_USE_FLOCK
137 /* Define CLASH_DETECTION if you want lock files to be written
138 so that Emacs can tell instantly when you try to modify
139 a file that someone else has modified in his Emacs. */
141 #define CLASH_DETECTION
143 /* Here, on a separate page, add any special hacks needed
144 to make Emacs work on this system. For example,
145 you might define certain system call names that don't
146 exist on your system, or that do different things on
147 your system and must be used only through an encapsulation
148 (Which you should place, by convention, in sysdep.c). */
150 /* If you mount the proc file system somewhere other than /proc
151 you will have to uncomment the following and make the proper
154 /* #define LINUX_LDAV_FILE "/proc/loadavg" */
156 /* This is needed for dispnew.c:update_frame */
159 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
160 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
161 /* new C libio names */
162 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
163 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
164 #else /* !_IO_STDIO_H */
165 /* old C++ iostream names */
166 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
167 ((FILE)->_pptr - (FILE)->_pbase)
168 #endif /* !_IO_STDIO_H */
171 /* Ask GCC where to find libgcc.a. */
172 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
175 /* GNU/Linux usually has crt0.o in a non-standard place */
176 #define START_FILES pre-crt0.o /usr/lib/crt0.o
178 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
182 /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
183 says where to find X windows at run time. */
186 #define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
188 #define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
189 #endif /* __mips__ */
192 /* As of version 1.1.51, Linux did not actually implement SIGIO.
193 But it works in newer versions. */
195 #ifdef LINUX_SIGIO_DOES_WORK
196 #define INTERRUPT_INPUT
199 /* Some versions of Linux define SIGURG and SIGPOLL as aliases for SIGIO.
200 This prevents lossage in process.c. */
201 #define BROKEN_SIGURG
202 #define BROKEN_SIGPOLL
206 /* This is needed for sysdep.c */
208 #define NO_SIOCTL_H /* don't have sioctl.h */
210 #define HAVE_GETWD /* cure conflict with getcwd? */
211 #define HAVE_WAIT_HEADER
213 #define SYSV_SYSTEM_DIR /* use dirent.h */
215 #define POSIX /* affects getpagesize.h and systty.h */
216 #define POSIX_SIGNALS
218 /* Best not to include -lg, unless it is last on the command line */
221 #define LIB_STANDARD -lc /* avoid -lPW */
225 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
228 /* Don't use -g in test compiles in configure.
229 This is so we will use the same shared libs for that linking
230 that are used when linking temacs. */
231 #ifdef THIS_IS_CONFIGURE
232 #define C_DEBUG_SWITCH
235 /* Let's try this out, just in case.
236 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */
237 /* #define SIGNALS_VIA_CHARACTERS */
239 /* Rob Malouf <malouf@csli.stanford.edu> says:
240 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
241 and is a very common addition to previous versions. */
244 #define LIBS_SYSTEM -lclient
245 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
247 /* alane@wozzle.linet.org says that -lipc is not a separate library,
248 since libc-4.4.1. So -lipc was deleted. */
250 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -D_XOPEN_SOURCE
253 /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
254 #define LIB_MOTIF -lXm -lXpm
256 #ifdef HAVE_LIBNCURSES
258 #define LIBS_TERMCAP -lncurses
264 #define UNEXEC unexelf.o
265 #ifndef LINUX_MAP_SHARED_DOES_WORK
266 #define UNEXEC_USE_MAP_PRIVATE
272 #define HAVE_TEXT_START
273 #define UNEXEC unexsunos4.o
274 #define N_PAGSIZ(x) PAGE_SIZE
276 #else /* not LINUX_QMAGIC */
278 #define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
279 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
280 #define ADJUST_EXEC_HEADER \
281 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
283 #endif /* not LINUX_QMAGIC */
286 /* In 19.23 and 19.24, configure sometimes fails to define these.
287 It has to do with the fact that configure uses CFLAGS when linking
288 while Makefile.in.in (erroneously) fails to do so when linking temacs. */
289 #ifndef HAVE_GETTIMEOFDAY
290 #define HAVE_GETTIMEOFDAY
298 #ifndef HAVE_XSCREENNUMBEROFSCREEN
299 #define HAVE_XSCREENNUMBEROFSCREEN
303 /* This is to work around mysterious gcc failures in some system versions.
304 It is unlikely that Emacs changes will work around this problem;
305 therefore, this should remain permanently. */
306 #ifndef HAVE_XRMSETDATABASE
307 #define HAVE_XRMSETDATABASE
310 /* The regex.o routines are a part of the GNU C-library used with Linux. */
311 /* However, sometimes they disagree with the src/regex.h that comes with Emacs,
312 and that can make trouble in etags.c because it gets the regex.h from Emacs
313 and the function definitions in libc. So turn this off. */
314 /* #define REGEXP_IN_LIBC */
316 /* Use BSD process groups, but use setpgid() instead of setpgrp() to
317 actually set a process group. */
321 #define NARROWPROTO 1
323 /* Use mmap directly for allocating larger buffers. */
324 #ifdef DOUG_LEA_MALLOC
328 /* Tell that garbage collector that setjmp is known to save all
329 registers relevant for conservative garbage collection in the
331 /* m68k and alpha aren't tested, but there are Debian packages for SCM
332 and/or Guile on them, so the technique must work. */
333 #if #cpu (i386) || #cpu (sparc) || #cpu (m68k) || #cpu (alpha)
334 #define GC_SETJMP_WORKS 1