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