(cd): When reading arg, use just directory as the default.
[bpt/emacs.git] / src / s / gnu-linux.h
CommitLineData
5101db23 1/* This file is the configuration file for GNU/Linux operating systems.
3a22ee35 2 Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
566e3587
JB
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
b49ef455
JB
20/* This file was put together by Michael K. Johnson and Rik Faith. */
21
566e3587
JB
22
23/*
24 * Define symbols to identify the version of Unix this is.
25 * Define all the symbols that apply correctly.
26 */
27
28/* #define UNIPLUS */
29/* #define USG5 */
30#define USG
d391fe09 31/* #define BSD */
566e3587
JB
32#define LINUX
33
34/* SYSTEM_TYPE should indicate the kind of system you are using.
35 It sets the Lisp variable system-type. */
36
37#define SYSTEM_TYPE "linux" /* All the best software is free. */
38
39/* Emacs can read input using SIGIO and buffering characters itself,
40 or using CBREAK mode and making C-g cause SIGINT.
41 The choice is controlled by the variable interrupt_input.
42 Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
43
44 SIGIO can be used only on systems that implement it (4.2 and 4.3).
eb8c3be9 45 CBREAK mode has two disadvantages
566e3587
JB
46 1) At least in 4.2, it is impossible to handle the Meta key properly.
47 I hear that in system V this problem does not exist.
48 2) Control-G causes output to be discarded.
49 I do not know whether this can be fixed in system V.
50
51 Another method of doing input is planned but not implemented.
52 It would have Emacs fork off a separate process
53 to read the input and send it to the true Emacs process
54 through a pipe.
55*/
56
57/* There have been suggestions made to add SIGIO to Linux. If this
58 is done, you may, at your discretion, uncomment the line below.
59*/
60
61/* #define INTERRUPT_INPUT */
62
63/* Letter to use in finding device name of first pty,
64 if system supports pty's. 'p' means it is /dev/ptyp0 */
65
66#define FIRST_PTY_LETTER 'p'
67
68/*
69 * Define HAVE_TERMIOS if the system provides POSIX-style
70 * functions and macros for terminal control.
71 */
72
73#define HAVE_TERMIOS
74
566e3587
JB
75/*
76 * Define HAVE_PTYS if the system supports pty devices.
77 */
78
79#define HAVE_PTYS
80
81/* Uncomment this later when other problems are dealt with -mkj */
82
dad29761 83#define HAVE_SOCKETS
566e3587
JB
84
85/* Define this symbol if your system has the functions bcopy, etc. */
86
87#define BSTRING
88
89/* subprocesses should be defined if you want to
90 have code for asynchronous subprocesses
91 (as used in M-x compile and M-x shell).
92 This is generally OS dependent, and not supported
93 under most USG systems. */
94
95#define subprocesses
96
97/* define MAIL_USE_FLOCK if the mailer uses flock
98 to interlock access to /usr/spool/mail/$USER.
99 The alternative is that a lock file named
100 /usr/spool/mail/$USER.lock. */
101
102/* Both are used in Linux by different mail programs. I assume that most
103 people are using newer mailers that have heard of flock. Change this
104 if you need to. */
105
106#define MAIL_USE_FLOCK
107
108/* Define CLASH_DETECTION if you want lock files to be written
109 so that Emacs can tell instantly when you try to modify
110 a file that someone else has modified in his Emacs. */
111
b2e209ba 112#define CLASH_DETECTION
566e3587
JB
113
114/* Here, on a separate page, add any special hacks needed
115 to make Emacs work on this system. For example,
116 you might define certain system call names that don't
117 exist on your system, or that do different things on
118 your system and must be used only through an encapsulation
119 (Which you should place, by convention, in sysdep.c). */
120\f
d391fe09
RS
121/* On POSIX systems the system calls are interruptible by signals
122 that the user program has elected to catch. Thus the system call
123 must be retried in these cases. To handle this without massive
124 changes in the source code, we remap the standard system call names
125 to names for our own functions in sysdep.c that do the system call
126 with retries. */
127
128#define read sys_read
129#define write sys_write
130#define open sys_open
131#define close sys_close
132
133#define INTERRUPTIBLE_OPEN
134#define INTERRUPTIBLE_CLOSE
135#define INTERRUPTIBLE_IO
566e3587
JB
136
137/* If you mount the proc file system somewhere other than /proc
138 you will have to uncomment the following and make the proper
139 changes */
140
141/* #define LINUX_LDAV_FILE "/proc/loadavg" */
142
a9c82aaf 143/* This is needed for disknew.c:update_frame */
566e3587 144
5e5623c2 145#ifdef emacs
a9c82aaf 146#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
4dee6d0d 147#if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
5e5623c2 148/* new C libio names */
c2c3f859 149#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2
RS
150 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
151#else /* !_IO_STDIO_H */
152/* old C++ iostream names */
c2c3f859 153#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2
RS
154 ((FILE)->_pptr - (FILE)->_pbase)
155#endif /* !_IO_STDIO_H */
156#endif /* emacs */
566e3587 157
5101db23 158/* Ask GCC where to find libgcc.a. */
08ddf771 159#define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
5101db23 160
4dee6d0d 161#ifndef __ELF__
566e3587
JB
162/* Linux has crt0.o in a non-standard place */
163#define START_FILES pre-crt0.o /usr/lib/crt0.o
4dee6d0d
KH
164#else
165#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
166#endif
566e3587 167
00364e4e
RS
168/* As of version 1.1.51, Linux does not actually implement SIGIO. */
169/* Here we assume that signal.h is already included. */
566e3587 170#ifdef emacs
566e3587
JB
171#undef SIGIO
172#endif
173
174/* This is needed for sysdep.c */
175
566e3587
JB
176#define NO_SIOCTL_H /* don't have sioctl.h */
177
566e3587
JB
178#define HAVE_VFORK
179#define HAVE_SYS_SIGLIST
180#define HAVE_GETWD /* cure conflict with getcwd? */
181
566e3587 182#define SYSV_SYSTEM_DIR /* use dirent.h */
566e3587 183
1abbab7a 184#define POSIX /* affects getpagesize.h and systty.h */
566e3587
JB
185#define POSIX_SIGNALS
186
187/* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */
188/* we cannot get the maximum address for brk */
189#define ULIMIT_BREAK_VALUE (32*1024*1024)
190
97823303
RS
191#define SEGMENT_MASK ((SEGMENT_SIZE)-1)
192
566e3587
JB
193/* Best not to include -lg, unless it is last on the command line */
194#define LIBS_DEBUG
195#define LIBS_TERMCAP -ltermcap -lcurses /* save some space with shared libs*/
4dee6d0d 196#ifndef __ELF__
566e3587 197#define LIB_STANDARD -lc /* avoid -lPW */
4dee6d0d 198#else
08ddf771 199#undef LIB_GCC
4dee6d0d
KH
200#define LIB_GCC
201#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
202#endif
3233bbe1 203
6f10bc9d
RS
204/* Don't use -g in test compiles in configure.
205 This is so we will use the same shared libs for that linking
206 that are used when linking temacs. */
207#ifdef THIS_IS_CONFIGURE
208#define C_DEBUG_SWITCH
209#endif
210
9e479734
JB
211/* Let's try this out, just in case.
212 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */
213/* #define SIGNALS_VIA_CHARACTERS */
9199fa7f
JB
214
215/* Rob Malouf <malouf@csli.stanford.edu> says:
216 SYSV IPC is standard a standard part of Linux since version 0.99pl10,
217 and is a very common addition to previous versions. */
cafdb68a
RS
218
219#ifdef TERM
220#define LIBS_MACHINE -lclient
221#define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
222#else
edb0cf8d
RS
223/* alane@wozzle.linet.org says that -lipc is not a separate library,
224 since libc-4.4.1. So -lipc was deleted. */
225#define LIBS_MACHINE
cafdb68a
RS
226#define C_SWITCH_SYSTEM -D_BSD_SOURCE
227#endif
228
9199fa7f 229#define HAVE_SYSVIPC
b04101bb 230
4dee6d0d
KH
231#ifdef __ELF__
232#define UNEXEC unexelf.o
baea3bdd 233#define UNEXEC_USE_MAP_PRIVATE
4dee6d0d
KH
234#endif
235
8427dec9
RS
236#ifdef LINUX_QMAGIC
237
238#define HAVE_TEXT_START
239#define UNEXEC unexsunos4.o
240#define N_PAGSIZ(x) PAGE_SIZE
241
242#else /* not LINUX_QMAGIC */
243
b04101bb
RS
244#define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
245#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
246#define ADJUST_EXEC_HEADER \
247 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
967ac200 248
8427dec9
RS
249#endif /* not LINUX_QMAGIC */
250
6f10bc9d 251#if 0
967ac200
RS
252/* In 19.23 and 19.24, configure sometimes fails to define these.
253 It has to do with the fact that configure uses CFLAGS when linking
254 while Makefile.in.in (erroneously) fails to do so when linking temacs. */
255#ifndef HAVE_GETTIMEOFDAY
256#define HAVE_GETTIMEOFDAY
257#endif
258#ifndef HAVE_MKDIR
259#define HAVE_MKDIR
260#endif
261#ifndef HAVE_RMDIR
262#define HAVE_RMDIR
263#endif
264#ifndef HAVE_XSCREENNUMBEROFSCREEN
265#define HAVE_XSCREENNUMBEROFSCREEN
266#endif
e3b89505
RS
267#ifndef HAVE_XRMSETDATABASE
268#define HAVE_XRMSETDATABASE
269#endif
6f10bc9d 270#endif /* 0 */
e2000885
RS
271
272/* The regex.o routines are a part of the GNU C-library used with Linux. */
273#define REGEXP_IN_LIBC