(LD_SWITCH_SYSTEM): New definition.
[bpt/emacs.git] / src / s / freebsd.h
1 /* s/ file for freebsd system. */
2
3 /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
4 Earlier versions do not have shared libraries, so inhibit them.
5 You can inhibit them on newer systems if you wish
6 by defining NO_SHARED_LIBS. */
7 #ifndef __FreeBSD__
8 #define NO_SHARED_LIBS
9 #endif
10
11
12 #if 0 /* This much, alone, seemed sufficient as of 19.23.
13 But it seems better to be independent of netbsd.h. */
14 #include "netbsd.h"
15
16 #undef LIB_GCC
17 #define LIB_GCC -lgcc
18 #undef NEED_ERRNO
19 #endif /* 0 */
20
21
22 /* Get most of the stuff from bsd4.3 */
23 #include "bsd4-3.h"
24
25 /* For mem-limits.h. */
26 #define BSD4_2
27
28 /* thses aren't needed, since we have getloadavg() */
29 #undef KERNEL_FILE
30 #undef LDAV_SYMBOL
31
32 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
33
34 #define LIBS_DEBUG
35 #define LIBS_SYSTEM -lutil
36 #define LIBS_TERMCAP -ltermcap
37 #define LIB_GCC -lgcc
38
39 /* Reread the time zone on startup. */
40 #define LOCALTIME_CACHE
41
42 #define SYSV_SYSTEM_DIR
43
44 /* freebsd has POSIX-style pgrp behavior. */
45 #undef BSD_PGRPS
46
47 #ifndef NO_SHARED_LIBS
48 #define LD_SWITCH_SYSTEM -e start
49 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
50 #define START_FILES pre-crt0.o /usr/lib/crt0.o
51 #define UNEXEC unexsunos4.o
52 #define RUN_TIME_REMAP
53
54 #ifndef N_TRELOFF
55 #define N_PAGSIZ(x) __LDPGSZ
56 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
57 #define N_TRELOFF(x) N_RELOFF(x)
58 #endif
59 #else /* NO_SHARED_LIBS */
60 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
61 not to use them. */
62 #define LD_SWITCH_SYSTEM -Bstatic
63 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
64 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
65 #endif /* __FreeBSD__ */
66 #endif /* NO_SHARED_LIBS */
67
68 #define HAVE_WAIT_HEADER
69 #define HAVE_GETLOADAVG
70 #define HAVE_TERMIOS
71 #define NO_TERMIO
72 #define DECLARE_GETPWUID_WITH_UID_T
73
74 /* freebsd uses OXTABS instead of the expected TAB3. */
75 #define TABDLY OXTABS
76 #define TAB3 OXTABS
77
78 /* this silences a few compilation warnings */
79 #undef BSD
80 #if __FreeBSD__ == 1
81 #define BSD 199103
82 #elif __FreeBSD__ == 2
83 #define BSD 199306
84 #endif
85
86 #define WAITTYPE int
87 /* get this since it won't be included if WAITTYPE is defined */
88 #ifdef emacs
89 #include <sys/wait.h>
90 #endif
91 #define WRETCODE(w) (_W_INT(w) >> 8)