]> code.delx.au - gnu-emacs/blob - src/s/freebsd.h
(LD_SWITCH_SYSTEM): Delete -dp.
[gnu-emacs] / src / s / freebsd.h
1 /* s/ file for freebsd system. */
2
3 /* Get the correct __FreeBSD_version, even if this is before that was
4 defined. */
5 #ifndef __FreeBSD__
6 #define __FreeBSD_version 199401
7 #elif __FreeBSD__ == 1
8 #define __FreeBSD_version 199405
9 #else
10 #include <osreldate.h>
11 #endif
12
13 /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
14 Earlier versions do not have shared libraries, so inhibit them.
15 You can inhibit them on newer systems if you wish
16 by defining NO_SHARED_LIBS. */
17 #ifndef __FreeBSD__
18 #define NO_SHARED_LIBS
19 #endif
20
21
22 #if 0 /* This much, alone, seemed sufficient as of 19.23.
23 But it seems better to be independent of netbsd.h. */
24 #include "netbsd.h"
25
26 #undef LIB_GCC
27 #define LIB_GCC -lgcc
28 #undef NEED_ERRNO
29 #endif /* 0 */
30
31
32 /* Get most of the stuff from bsd4.3 */
33 #include "bsd4-3.h"
34
35 /* For mem-limits.h. */
36 #define BSD4_2
37
38 /* These aren't needed, since we have getloadavg. */
39 #undef KERNEL_FILE
40 #undef LDAV_SYMBOL
41
42 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
43
44 #define LIBS_DEBUG
45 #define LIBS_SYSTEM -lutil
46 #define LIBS_TERMCAP -ltermcap
47
48 #define SYSV_SYSTEM_DIR
49
50 /* freebsd has POSIX-style pgrp behavior. */
51 #undef BSD_PGRPS
52 #define GETPGRP_NO_ARG
53
54 #ifdef __ELF__
55
56 #define LD_SWITCH_SYSTEM
57 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
58 #define UNEXEC unexelf.o
59 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
60 #undef LIB_GCC
61 #define LIB_GCC
62
63 #else /* not __ELF__ */
64
65 #ifndef NO_SHARED_LIBS
66 #define LD_SWITCH_SYSTEM -e start -dc
67 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
68 #if __FreeBSD_version >= 300002
69 #define START_FILES pre-crt0.o /usr/lib/aout/crt0.o
70 #else /* __FreeBSD_version < 300002 */
71 #define START_FILES pre-crt0.o /usr/lib/crt0.o
72 #endif /* __FreeBSD_version < 300002 */
73 #define UNEXEC unexsunos4.o
74 #define RUN_TIME_REMAP
75 #define LIB_GCC -lgcc
76
77 #ifndef N_TRELOFF
78 #define N_PAGSIZ(x) __LDPGSZ
79 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
80 #define N_TRELOFF(x) N_RELOFF(x)
81 #endif
82 #else /* NO_SHARED_LIBS */
83 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
84 not to use them. */
85 #define LD_SWITCH_SYSTEM -Bstatic
86 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
87 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
88 #endif /* __FreeBSD__ */
89 #endif /* NO_SHARED_LIBS */
90
91 #endif /* not __ELF__ */
92
93 #define HAVE_WAIT_HEADER
94 #define HAVE_GETLOADAVG
95 /*#define HAVE_GETPAGESIZE /* configure now puts this in config.h */
96 #define HAVE_TERMIOS
97 #define NO_TERMIO
98 #define DECLARE_GETPWUID_WITH_UID_T
99
100 /* freebsd uses OXTABS instead of the expected TAB3. */
101 #define TABDLY OXTABS
102 #define TAB3 OXTABS
103
104 /* this silences a few compilation warnings */
105 #undef BSD_SYSTEM
106 #if __FreeBSD__ == 1
107 #define BSD_SYSTEM 199103
108 #elif __FreeBSD__ == 2
109 #define BSD_SYSTEM 199306
110 #elif __FreeBSD__ == 3
111 #define BSD_SYSTEM 199506
112 #endif
113
114 #define WAITTYPE int
115 /* get this since it won't be included if WAITTYPE is defined */
116 #ifdef emacs
117 #include <sys/wait.h>
118 #endif
119 #define WRETCODE(w) (_W_INT(w) >> 8)
120
121 /* Needed to avoid hanging when child process writes an error message
122 and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>. */
123 #define vfork fork
124
125 /* Don't close pty in process.c to make it as controlling terminal.
126 It is already a controlling terminal of subprocess, because we did
127 ioctl TIOCSCTTY. */
128 #define DONT_REOPEN_PTY
129
130 /* CLASH_DETECTION is defined in bsd4-3.h.
131 In FreeBSD 2.1.5 (and other 2.1.x), this results useless symbolic links
132 remaining in /tmp or other directories with +t bit.
133 To avoid this problem, you could #undef it to use no file lock. */
134 /* #undef CLASH_DETECTION */