]> code.delx.au - gnu-emacs/blob - src/s/freebsd.h
Merge from mainline.
[gnu-emacs] / src / s / freebsd.h
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, 2002,
5 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
6 Free Software Foundation, Inc.
7
8 Author: Shawn M. Carey
9 (according to authors.el)
10
11 This file is part of GNU Emacs.
12
13 GNU Emacs is free software: you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 GNU Emacs is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25
26 /* Get most of the stuff from bsd-common */
27 #include "bsd-common.h"
28
29 /* For mem-limits.h. */
30 #define BSD4_2
31
32 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
33
34 #define LIBS_SYSTEM -lutil
35 #if __FreeBSD_version < 400000
36 #define LIBS_TERMCAP -ltermcap
37 #else
38 #define TERMINFO
39 #define LIBS_TERMCAP -lncurses
40 #endif
41
42 /* Let `ld' find image libs and similar things in /usr/local/lib. The
43 system compiler, GCC, has apparently been modified to not look
44 there, contrary to what a stock GCC would do. */
45
46 #define LD_SWITCH_SYSTEM -L/usr/local/lib
47 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
48 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
49 #undef LIB_GCC
50 #define LIB_GCC
51
52 #define HAVE_GETLOADAVG 1
53 #define DECLARE_GETPWUID_WITH_UID_T
54
55 /* this silences a few compilation warnings */
56 #undef BSD_SYSTEM
57 #if __FreeBSD__ == 1
58 #define BSD_SYSTEM 199103
59 #elif __FreeBSD__ == 2
60 #define BSD_SYSTEM 199306
61 #elif __FreeBSD__ >= 3
62 #define BSD_SYSTEM 199506
63 #endif
64
65 /* Don't close pty in process.c to make it as controlling terminal.
66 It is already a controlling terminal of subprocess, because we did
67 ioctl TIOCSCTTY. */
68 #define DONT_REOPEN_PTY
69
70 /* The following is needed to make `configure' find Xpm, Xaw3d and
71 image include and library files if using /usr/bin/gcc. That
72 compiler seems to be modified to not find headers in
73 /usr/local/include or libs in /usr/local/lib by default. */
74
75 #define C_SWITCH_SYSTEM -I/usr/X11R6/include -I/usr/local/include -L/usr/local/lib
76
77 /* Circumvent a bug in FreeBSD. In the following sequence of
78 writes/reads on a PTY, read(2) returns bogus data:
79
80 write(2) 1022 bytes
81 write(2) 954 bytes, get EAGAIN
82 read(2) 1024 bytes in process_read_output
83 read(2) 11 bytes in process_read_output
84
85 That is, read(2) returns more bytes than have ever been written
86 successfully. The 1033 bytes read are the 1022 bytes written
87 successfully after processing (for example with CRs added if the
88 terminal is set up that way which it is here). The same bytes will
89 be seen again in a later read(2), without the CRs. */
90
91 #define BROKEN_PTY_READ_AFTER_EAGAIN 1
92
93 /* Tell that garbage collector that setjmp is known to save all
94 registers relevant for conservative garbage collection in the
95 jmp_buf. */
96
97 #define GC_SETJMP_WORKS 1
98
99 /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the
100 stack. */
101
102 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
103
104 /* Define USE_MMAP_FOR_BUFFERS to let Emacs use mmap(2) to allocate
105 buffer text. This overrides REL_ALLOC. */
106
107 #define USE_MMAP_FOR_BUFFERS 1
108
109 /* Use sigprocmask(2) and friends instead of sigblock(2); the man page
110 of sigblock says it is obsolete. */
111
112 #define POSIX_SIGNALS 1
113
114 /* The `combreloc' setting became the default, and it seems to be
115 incompatible with unexec. Symptom is an immediate SEGV in
116 XtInitializeWidget when starting Emacs under X11. */
117
118 #if defined __FreeBSD_version && __FreeBSD_version >= 500042
119 #define LD_SWITCH_SYSTEM_TEMACS -znocombreloc
120 #endif
121
122 /* arch-tag: 426529ca-b7c4-448f-b10a-d4dcdc9c78eb
123 (do not change this comment) */