Trailing whitespace deleted.
[bpt/emacs.git] / src / s / freebsd.h
CommitLineData
e3efab9c
GM
1/* System description header for FreeBSD systems.
2 This file describes the parameters that system description files
3 should define or not.
4 Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
5 Free Software Foundation, Inc.
6
7This file is part of GNU Emacs.
8
9GNU Emacs is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)
12any later version.
13
14GNU Emacs is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU Emacs; see the file COPYING. If not, write to
21the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22Boston, MA 02111-1307, USA. */
be210740 23
62bb752f
RS
24/* Get the correct __FreeBSD_version, even if this is before that was
25 defined. */
177c0ea7 26#ifndef __FreeBSD_version
62bb752f
RS
27#ifndef __FreeBSD__
28#define __FreeBSD_version 199401
29#elif __FreeBSD__ == 1
30#define __FreeBSD_version 199405
31#else
32#include <osreldate.h>
33#endif
7e6c20e8 34#endif /* !defined __FreeBSD_version */
62bb752f 35
3051bc72 36/* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
d05c42e4
RS
37 Earlier versions do not have shared libraries, so inhibit them.
38 You can inhibit them on newer systems if you wish
39 by defining NO_SHARED_LIBS. */
3051bc72
RS
40#ifndef __FreeBSD__
41#define NO_SHARED_LIBS
42#endif
be210740 43
c0096c73
RS
44
45#if 0 /* This much, alone, seemed sufficient as of 19.23.
46 But it seems better to be independent of netbsd.h. */
3051bc72 47#include "netbsd.h"
be210740 48
3051bc72
RS
49#undef LIB_GCC
50#define LIB_GCC -lgcc
51#undef NEED_ERRNO
c0096c73
RS
52#endif /* 0 */
53
54
55/* Get most of the stuff from bsd4.3 */
56#include "bsd4-3.h"
57
58/* For mem-limits.h. */
59#define BSD4_2
60
e57d8da0 61/* These aren't needed, since we have getloadavg. */
c0096c73
RS
62#undef KERNEL_FILE
63#undef LDAV_SYMBOL
64
65#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
66
c0096c73
RS
67#define LIBS_DEBUG
68#define LIBS_SYSTEM -lutil
7e0ba6da 69#if __FreeBSD_version < 400000
c0096c73 70#define LIBS_TERMCAP -ltermcap
7e0ba6da 71#endif
c0096c73 72
c0096c73
RS
73#define SYSV_SYSTEM_DIR
74
75/* freebsd has POSIX-style pgrp behavior. */
76#undef BSD_PGRPS
9f9d7a9a 77#define GETPGRP_NO_ARG
c0096c73 78
62bb752f
RS
79#ifdef __ELF__
80
1f71352b 81#define LD_SWITCH_SYSTEM_1
62bb752f
RS
82#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
83#define UNEXEC unexelf.o
84#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
85#undef LIB_GCC
86#define LIB_GCC
87
88#else /* not __ELF__ */
89
c0096c73 90#ifndef NO_SHARED_LIBS
1f71352b 91#define LD_SWITCH_SYSTEM_1 -e start -dc -L/usr/local/lib
c0096c73 92#define HAVE_TEXT_START /* No need to define `start_of_text'. */
62bb752f
RS
93#if __FreeBSD_version >= 300002
94#define START_FILES pre-crt0.o /usr/lib/aout/crt0.o
95#else /* __FreeBSD_version < 300002 */
c0096c73 96#define START_FILES pre-crt0.o /usr/lib/crt0.o
62bb752f 97#endif /* __FreeBSD_version < 300002 */
c0096c73
RS
98#define UNEXEC unexsunos4.o
99#define RUN_TIME_REMAP
62bb752f 100#define LIB_GCC -lgcc
c0096c73
RS
101
102#ifndef N_TRELOFF
103#define N_PAGSIZ(x) __LDPGSZ
104#define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
105#define N_TRELOFF(x) N_RELOFF(x)
106#endif
d05c42e4
RS
107#else /* NO_SHARED_LIBS */
108#ifdef __FreeBSD__ /* shared libs are available, but the user prefers
109 not to use them. */
1f71352b 110#define LD_SWITCH_SYSTEM_1 -Bstatic -L/usr/local/lib
d05c42e4
RS
111#define A_TEXT_OFFSET(x) (sizeof (struct exec))
112#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
113#endif /* __FreeBSD__ */
114#endif /* NO_SHARED_LIBS */
c0096c73 115
62bb752f
RS
116#endif /* not __ELF__ */
117
1f71352b
GM
118/* Let `ld' find image libs and similar things in /usr/local/lib. The
119 system compiler, GCC, has apparently been modified to not look
120 there, contrary to what a stock GCC would do. */
121
122#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_1 -L/usr/local/lib
123
c0096c73 124#define HAVE_WAIT_HEADER
8fffa182 125#define HAVE_GETLOADAVG 1
2327e4a0
GM
126#if 0
127#define HAVE_GETPAGESIZE /* configure now puts this in config.h */
128#endif
c0096c73
RS
129#define HAVE_TERMIOS
130#define NO_TERMIO
d05c42e4 131#define DECLARE_GETPWUID_WITH_UID_T
c0096c73
RS
132
133/* freebsd uses OXTABS instead of the expected TAB3. */
134#define TABDLY OXTABS
135#define TAB3 OXTABS
136
137/* this silences a few compilation warnings */
6df54671 138#undef BSD_SYSTEM
69d87222 139#if __FreeBSD__ == 1
6df54671 140#define BSD_SYSTEM 199103
69d87222 141#elif __FreeBSD__ == 2
6df54671 142#define BSD_SYSTEM 199306
165e2d55 143#elif __FreeBSD__ >= 3
3e7562b1 144#define BSD_SYSTEM 199506
69d87222 145#endif
c0096c73 146
177c0ea7 147#if 0 /* Shouldn't be necessary and produces warnings with the
026d2a71 148 experimental Autoconf test. */
c0096c73
RS
149#define WAITTYPE int
150/* get this since it won't be included if WAITTYPE is defined */
151#ifdef emacs
152#include <sys/wait.h>
153#endif
154#define WRETCODE(w) (_W_INT(w) >> 8)
026d2a71 155#endif
22fcc83e 156
b68f1a63
RS
157/* Don't close pty in process.c to make it as controlling terminal.
158 It is already a controlling terminal of subprocess, because we did
159 ioctl TIOCSCTTY. */
160#define DONT_REOPEN_PTY
145eec6f
RS
161
162/* CLASH_DETECTION is defined in bsd4-3.h.
163 In FreeBSD 2.1.5 (and other 2.1.x), this results useless symbolic links
164 remaining in /tmp or other directories with +t bit.
165 To avoid this problem, you could #undef it to use no file lock. */
166/* #undef CLASH_DETECTION */
2327e4a0
GM
167
168/* If the system's imake configuration file defines `NeedWidePrototypes'
169 as `NO', we must define NARROWPROTO manually. Such a define is
177c0ea7 170 generated in the Makefile generated by `xmkmf'. If we don't
2327e4a0
GM
171 define NARROWPROTO, we will see the wrong function prototypes
172 for X functions taking float or double parameters. */
173
174#define NARROWPROTO 1
ab5d1ddf 175
ef539202
GM
176/* The following is needed to make `configure' find Xpm, Xaw3d and
177 image include and library files if using /usr/bin/gcc. That
178 compiler seems to be modified to not find headers in
179 /usr/local/include or libs in /usr/local/lib by default. */
ab5d1ddf 180
1f71352b 181#define C_SWITCH_SYSTEM -I/usr/X11R6/include -I/usr/local/include -L/usr/local/lib
aace035e
GM
182
183/* Circumvent a bug in FreeBSD. In the following sequence of
184 writes/reads on a PTY, read(2) returns bogus data:
185
186 write(2) 1022 bytes
187 write(2) 954 bytes, get EAGAIN
188 read(2) 1024 bytes in process_read_output
189 read(2) 11 bytes in process_read_output
190
191 That is, read(2) returns more bytes than have ever been written
192 successfully. The 1033 bytes read are the 1022 bytes written
193 successfully after processing (for example with CRs added if the
194 terminal is set up that way which it is here). The same bytes will
195 be seen again in a later read(2), without the CRs. */
196
197#define BROKEN_PTY_READ_AFTER_EAGAIN 1
4b3fd719
GM
198
199/* Tell that garbage collector that setjmp is known to save all
200 registers relevant for conservative garbage collection in the
201 jmp_buf. */
202
203#define GC_SETJMP_WORKS 1
cbf5ca04 204
fc653ef2
GM
205/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the
206 stack. */
207
fc40e215 208#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
fc653ef2 209
67cdbf16
GM
210/* Define USE_MMAP_FOR_BUFFERS to let Emacs use mmap(2) to allocate
211 buffer text. This overrides REL_ALLOC. */
fc653ef2 212
67cdbf16 213#define USE_MMAP_FOR_BUFFERS 1
76bb714a
GM
214
215/* Use sigprocmask(2) and friends instead of sigblock(2); the man page
216 of sigblock says it is obsolete. */
217
218#define POSIX_SIGNALS 1