1 /* This file is the configuration file for Linux-based GNU systems
2 Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
3 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5 This file is part of GNU Emacs.
7 GNU Emacs is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GNU Emacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
22 /* This file was put together by Michael K. Johnson and Rik Faith. */
26 * Define symbols to identify the version of Unix this is.
27 * Define all the symbols that apply correctly.
33 /* #define BSD_SYSTEM */
37 /* SYSTEM_TYPE should indicate the kind of system you are using.
38 It sets the Lisp variable system-type. */
40 #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
44 #ifdef HAVE_LINUX_VERSION_H
45 #include <linux/version.h>
47 #if LINUX_VERSION_CODE >= 0x20400
48 #define LINUX_SIGNALS_VIA_CHARACTERS_DOES_WORK
49 #endif /* LINUX_VERSION_CODE >= 0x20400 */
50 #endif /* HAVE_LINUX_VERSION_H */
52 #endif /* NOT_C_CODE */
54 #if defined HAVE_GRANTPT
57 /* Run only once. We need a `for'-loop because the code uses
60 #define PTY_ITERATION for (i = 0; i < 1; i++)
63 #define PTY_NAME_SPRINTF
64 #define PTY_OPEN fd = getpt ()
65 #else /* not HAVE_GETPT */
66 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
67 #endif /* not HAVE_GETPT */
69 /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
70 prevent sigchld_handler from intercepting the child's death. */
72 #define PTY_TTY_NAME_SPRINTF \
76 sigblock (sigmask (SIGCHLD)); \
77 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
78 || !(ptyname = ptsname(fd))) \
80 sigunblock (sigmask (SIGCHLD)); \
84 strncpy (pty_name, ptyname, sizeof (pty_name)); \
85 pty_name[sizeof (pty_name) - 1] = 0; \
86 sigunblock (sigmask (SIGCHLD)); \
89 #else /* not HAVE_GRANTPT */
91 /* Letter to use in finding device name of first pty,
92 if system supports pty's. 'p' means it is /dev/ptyp0 */
94 #define FIRST_PTY_LETTER 'p'
96 #endif /* not HAVE_GRANDPT */
98 /* Define HAVE_TERMIOS if the system provides POSIX-style
99 functions and macros for terminal control. */
103 /* Define HAVE_PTYS if the system supports pty devices. */
109 /* Define this symbol if your system has the functions bcopy, etc. */
113 /* subprocesses should be defined if you want to
114 have code for asynchronous subprocesses
115 (as used in M-x compile and M-x shell).
116 This is generally OS dependent, and not supported
117 under most USG systems. */
121 /* define MAIL_USE_FLOCK if the mailer uses flock
122 to interlock access to /usr/spool/mail/$USER.
123 The alternative is that a lock file named
124 /usr/spool/mail/$USER.lock. */
126 /* On GNU/Linux systems, both methods are used by various mail
127 programs. I assume that most people are using newer mailers that
128 have heard of flock. Change this if you need to. */
129 /* Debian contains a patch which says: ``On Debian/GNU/Linux systems,
130 configure gets the right answers, and that means *NOT* using flock.
131 Using flock is guaranteed to be the wrong thing. See Debian Policy
132 for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the
133 Debian maintainer hasn't provided a clean fix for Emacs.
134 movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
135 HAVE_MAILLOCK_H are defined, so the following appears to be the
136 correct logic. -- fx */
137 /* We must check for HAVE_LIBLOCKFILE too, as movemail does.
138 liblockfile is a Free Software replacement for libmail, used on
139 Debian systems and elsewhere. -rfr */
141 #if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \
142 defined (HAVE_MAILLOCK_H))
143 #define MAIL_USE_FLOCK
146 /* Define CLASH_DETECTION if you want lock files to be written
147 so that Emacs can tell instantly when you try to modify
148 a file that someone else has modified in his Emacs. */
150 #define CLASH_DETECTION
152 /* Here, on a separate page, add any special hacks needed
153 to make Emacs work on this system. For example,
154 you might define certain system call names that don't
155 exist on your system, or that do different things on
156 your system and must be used only through an encapsulation
157 (Which you should place, by convention, in sysdep.c). */
159 /* If you mount the proc file system somewhere other than /proc
160 you will have to uncomment the following and make the proper
163 /* #define LINUX_LDAV_FILE "/proc/loadavg" */
165 /* This is needed for dispnew.c:update_frame */
168 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
169 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
170 /* new C libio names */
171 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
172 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
173 #else /* !_IO_STDIO_H */
174 /* old C++ iostream names */
175 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
176 ((FILE)->_pptr - (FILE)->_pbase)
177 #endif /* !_IO_STDIO_H */
180 /* Ask GCC where to find libgcc.a. */
181 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
183 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
185 /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
186 says where to find X windows at run time. */
189 #define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
191 #define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
192 #endif /* __mips__ */
194 /* Link temacs with -z nocombreloc so that unexec works right, whether or
195 not -z combreloc is the default. GNU ld ignores unknown -z KEYWORD
196 switches, so this also works with older versions that don't implement
198 #define LD_SWITCH_SYSTEM_TEMACS -z nocombreloc
201 #define INTERRUPT_INPUT
204 /* This is needed for sysdep.c */
206 #define NO_SIOCTL_H /* don't have sioctl.h */
208 #define HAVE_WAIT_HEADER
210 #define SYSV_SYSTEM_DIR /* use dirent.h */
212 #define POSIX /* affects getpagesize.h and systty.h */
213 #define POSIX_SIGNALS
215 /* Best not to include -lg, unless it is last on the command line */
219 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
221 /* Don't use -g in test compiles in configure.
222 This is so we will use the same shared libs for that linking
223 that are used when linking temacs. */
224 #ifdef THIS_IS_CONFIGURE
225 #define C_DEBUG_SWITCH
228 /* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */
229 #ifdef LINUX_SIGNALS_VIA_CHARACTERS_DOES_WORK
230 #define SIGNALS_VIA_CHARACTERS
233 /* Rob Malouf <malouf@csli.stanford.edu> says:
234 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
235 and is a very common addition to previous versions. */
238 #define LIBS_SYSTEM -lclient
239 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
241 /* alane@wozzle.linet.org says that -lipc is not a separate library,
242 since libc-4.4.1. So -lipc was deleted. */
244 /* _BSD_SOURCE is redundant, at least in glibc2, since we define
245 _GNU_SOURCE. Left in in case it's relevant to libc5 systems and
246 anyone's still using Emacs on those. --fx 2002-12-14 */
247 #define C_SWITCH_SYSTEM -D_BSD_SOURCE
250 /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
251 #define LIB_MOTIF -lXm -lXpm
253 #ifdef HAVE_LIBNCURSES
255 #define LIBS_TERMCAP -lncurses
260 #define UNEXEC unexelf.o
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)
267 /* This is to work around mysterious gcc failures in some system versions.
268 It is unlikely that Emacs changes will work around this problem;
269 therefore, this should remain permanently. */
270 #ifndef HAVE_XRMSETDATABASE
271 #define HAVE_XRMSETDATABASE
274 /* Use BSD process groups, but use setpgid() instead of setpgrp() to
275 actually set a process group. */
279 #define NARROWPROTO 1
281 /* Use mmap directly for allocating larger buffers. */
282 #ifdef DOUG_LEA_MALLOC
286 /* Tell that garbage collector that setjmp is known to save all
287 registers relevant for conservative garbage collection in the
289 /* Not all the architectures are tested, but there are Debian packages
290 for SCM and/or Guile on them, so the technique must work. See also
291 comments in alloc.c concerning setjmp and gcc. Fixme: it's
292 probably safe to make this conditional just on GCC, except for ia64
293 register window-flushing. */
294 /* Don't use #cpu here since in newest development versions of GCC,
295 we must call cpp with -traditional, and that disables #cpu. */
297 #if defined __i386__ || defined __sparc__ || defined __mc68000__ \
298 || defined __alpha__ || defined __mips__ || defined __s390__ \
299 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
301 #define GC_SETJMP_WORKS 1
302 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
304 #define GC_LISP_OBJECT_ALIGNMENT 2
307 #define GC_MARK_SECONDARY_STACK() \
309 extern void *__libc_ia64_register_backing_store_base; \
310 __builtin_ia64_flushrs (); \
311 mark_memory (__libc_ia64_register_backing_store_base, \
312 __builtin_ia64_bsp (), 0); \
317 /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
318 (do not change this comment) */