(Fmake_temp_name): forgot the \n\ in the docstring
[emacs.git] / src / s / freebsd.h
blob730b05fc759da32b3d4efbc95dee5f1e53a22bd6
1 /* s/ file for freebsd system. */
3 /* Get the correct __FreeBSD_version, even if this is before that was
4 defined. */
5 #ifndef __FreeBSD_version
6 #ifndef __FreeBSD__
7 #define __FreeBSD_version 199401
8 #elif __FreeBSD__ == 1
9 #define __FreeBSD_version 199405
10 #else
11 #include <osreldate.h>
12 #endif
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. */
19 #ifndef __FreeBSD__
20 #define NO_SHARED_LIBS
21 #endif
24 #if 0 /* This much, alone, seemed sufficient as of 19.23.
25 But it seems better to be independent of netbsd.h. */
26 #include "netbsd.h"
28 #undef LIB_GCC
29 #define LIB_GCC -lgcc
30 #undef NEED_ERRNO
31 #endif /* 0 */
34 /* Get most of the stuff from bsd4.3 */
35 #include "bsd4-3.h"
37 /* For mem-limits.h. */
38 #define BSD4_2
40 /* These aren't needed, since we have getloadavg. */
41 #undef KERNEL_FILE
42 #undef LDAV_SYMBOL
44 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
46 #define LIBS_DEBUG
47 #define LIBS_SYSTEM -lutil
48 #define LIBS_TERMCAP -ltermcap
50 #define SYSV_SYSTEM_DIR
52 /* freebsd has POSIX-style pgrp behavior. */
53 #undef BSD_PGRPS
54 #define GETPGRP_NO_ARG
56 #ifdef __ELF__
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
62 #undef LIB_GCC
63 #define LIB_GCC
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
77 #define LIB_GCC -lgcc
79 #ifndef N_TRELOFF
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)
83 #endif
84 #else /* NO_SHARED_LIBS */
85 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
86 not to use them. */
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
96 #define HAVE_GETLOADAVG
97 #if 0
98 #define HAVE_GETPAGESIZE /* configure now puts this in config.h */
99 #endif
100 #define HAVE_TERMIOS
101 #define NO_TERMIO
102 #define DECLARE_GETPWUID_WITH_UID_T
104 /* freebsd uses OXTABS instead of the expected TAB3. */
105 #define TABDLY OXTABS
106 #define TAB3 OXTABS
108 /* this silences a few compilation warnings */
109 #undef BSD_SYSTEM
110 #if __FreeBSD__ == 1
111 #define BSD_SYSTEM 199103
112 #elif __FreeBSD__ == 2
113 #define BSD_SYSTEM 199306
114 #elif __FreeBSD__ >= 3
115 #define BSD_SYSTEM 199506
116 #endif
118 #define WAITTYPE int
119 /* get this since it won't be included if WAITTYPE is defined */
120 #ifdef emacs
121 #include <sys/wait.h>
122 #endif
123 #define WRETCODE(w) (_W_INT(w) >> 8)
125 /* Needed to avoid hanging when child process writes an error message
126 and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>. */
127 #define vfork fork
129 /* Don't close pty in process.c to make it as controlling terminal.
130 It is already a controlling terminal of subprocess, because we did
131 ioctl TIOCSCTTY. */
132 #define DONT_REOPEN_PTY
134 /* CLASH_DETECTION is defined in bsd4-3.h.
135 In FreeBSD 2.1.5 (and other 2.1.x), this results useless symbolic links
136 remaining in /tmp or other directories with +t bit.
137 To avoid this problem, you could #undef it to use no file lock. */
138 /* #undef CLASH_DETECTION */
140 /* If the system's imake configuration file defines `NeedWidePrototypes'
141 as `NO', we must define NARROWPROTO manually. Such a define is
142 generated in the Makefile generated by `xmkmf'. If we don't
143 define NARROWPROTO, we will see the wrong function prototypes
144 for X functions taking float or double parameters. */
146 #define NARROWPROTO 1
148 /* The following is needed to make `configure' find Xpm and Xaw3d
149 headers, which are checked for with AC_CHECK_HEADER. */
151 #define C_SWITCH_SYSTEM -I /usr/X11R6/include