root/trunk/src/s/freebsd.h

Revision 4220, 7.0 kB (checked in by miyoshi, 8 months ago)

Sync up with Emacs22.2.

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