]>
code.delx.au - gnu-emacs/blob - src/s/freebsd.h
1 /* s/ file for freebsd system. */
3 /* Get the correct __FreeBSD_version, even if this is before that was
5 #ifndef __FreeBSD_version
7 #define __FreeBSD_version 199401
9 #define __FreeBSD_version 199405
11 #include <osreldate.h>
13 #endif /* !defined __FreeBSD_version */
15 /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
16 Earlier versions do not have shared libraries, so inhibit them.
17 You can inhibit them on newer systems if you wish
18 by defining NO_SHARED_LIBS. */
20 #define NO_SHARED_LIBS
24 #if 0 /* This much, alone, seemed sufficient as of 19.23.
25 But it seems better to be independent of netbsd.h. */
34 /* Get most of the stuff from bsd4.3 */
37 /* For mem-limits.h. */
40 /* These aren't needed, since we have getloadavg. */
44 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
47 #define LIBS_SYSTEM -lutil
48 #define LIBS_TERMCAP -ltermcap
50 #define SYSV_SYSTEM_DIR
52 /* freebsd has POSIX-style pgrp behavior. */
54 #define GETPGRP_NO_ARG
58 #define LD_SWITCH_SYSTEM
59 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
60 #define UNEXEC unexelf.o
61 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
65 #else /* not __ELF__ */
67 #ifndef NO_SHARED_LIBS
68 #define LD_SWITCH_SYSTEM -e start -dc
69 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
70 #if __FreeBSD_version >= 300002
71 #define START_FILES pre-crt0.o /usr/lib/aout/crt0.o
72 #else /* __FreeBSD_version < 300002 */
73 #define START_FILES pre-crt0.o /usr/lib/crt0.o
74 #endif /* __FreeBSD_version < 300002 */
75 #define UNEXEC unexsunos4.o
76 #define RUN_TIME_REMAP
80 #define N_PAGSIZ(x) __LDPGSZ
81 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
82 #define N_TRELOFF(x) N_RELOFF(x)
84 #else /* NO_SHARED_LIBS */
85 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
87 #define LD_SWITCH_SYSTEM -Bstatic
88 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
89 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
90 #endif /* __FreeBSD__ */
91 #endif /* NO_SHARED_LIBS */
93 #endif /* not __ELF__ */
95 #define HAVE_WAIT_HEADER
97 #define HAVE_GETPAGESIZE /* configure now puts this in config.h */
101 #define DECLARE_GETPWUID_WITH_UID_T
103 /* freebsd uses OXTABS instead of the expected TAB3. */
104 #define TABDLY OXTABS
107 /* this silences a few compilation warnings */
110 #define BSD_SYSTEM 199103
111 #elif __FreeBSD__ == 2
112 #define BSD_SYSTEM 199306
113 #elif __FreeBSD__ >= 3
114 #define BSD_SYSTEM 199506
118 /* get this since it won't be included if WAITTYPE is defined */
120 #include <sys/wait.h>
122 #define WRETCODE(w) (_W_INT(w) >> 8)
124 /* Needed to avoid hanging when child process writes an error message
125 and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>. */
128 /* Don't close pty in process.c to make it as controlling terminal.
129 It is already a controlling terminal of subprocess, because we did
131 #define DONT_REOPEN_PTY
133 /* CLASH_DETECTION is defined in bsd4-3.h.
134 In FreeBSD 2.1.5 (and other 2.1.x), this results useless symbolic links
135 remaining in /tmp or other directories with +t bit.
136 To avoid this problem, you could #undef it to use no file lock. */
137 /* #undef CLASH_DETECTION */
139 /* If the system's imake configuration file defines `NeedWidePrototypes'
140 as `NO', we must define NARROWPROTO manually. Such a define is
141 generated in the Makefile generated by `xmkmf'. If we don't
142 define NARROWPROTO, we will see the wrong function prototypes
143 for X functions taking float or double parameters. */
145 #define NARROWPROTO 1
147 /* The following is needed to make `configure' find Xpm, Xaw3d and
148 image include and library files if using /usr/bin/gcc. That
149 compiler seems to be modified to not find headers in
150 /usr/local/include or libs in /usr/local/lib by default. */
152 #define C_SWITCH_SYSTEM -I /usr/X11R6/include -I /usr/local/include -L /usr/local/lib
154 /* Circumvent a bug in FreeBSD. In the following sequence of
155 writes/reads on a PTY, read(2) returns bogus data:
158 write(2) 954 bytes, get EAGAIN
159 read(2) 1024 bytes in process_read_output
160 read(2) 11 bytes in process_read_output
162 That is, read(2) returns more bytes than have ever been written
163 successfully. The 1033 bytes read are the 1022 bytes written
164 successfully after processing (for example with CRs added if the
165 terminal is set up that way which it is here). The same bytes will
166 be seen again in a later read(2), without the CRs. */
168 #define BROKEN_PTY_READ_AFTER_EAGAIN 1
170 /* Tell that garbage collector that setjmp is known to save all
171 registers relevant for conservative garbage collection in the
174 #define GC_SETJMP_WORKS 1
176 /* In FreeBSD 4, we must use terminfo.o instead of tparam.o. Termcap
177 capabilities use %-specifiers that tparm.o cannot handle.
178 Libtermcap.a contains a `tparm' that terminfo.c can use. */
181 #define TERMCAP_OBJ terminfo.o