XEmacs 21.2.5
[chise/xemacs-chise.git.1] / src / s / freebsd.h
1 /* Synched up with: FSF 19.31. */
2
3 /* s/ file for freebsd system.  */
4
5 /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
6    Earlier versions do not have shared libraries, so inhibit them.
7    You can inhibit them on newer systems if you wish
8    by defining NO_SHARED_LIBS.  */
9 #ifndef __FreeBSD__
10 #define NO_SHARED_LIBS
11 #endif
12
13 /* Get most of the stuff from bsd4.3 */
14 #include "bsd4-3.h"
15
16 /* For mem-limits.h. */
17 #define BSD4_2
18
19 /* These aren't needed, since we have getloadavg.  */
20 #undef KERNEL_FILE
21 #undef LDAV_SYMBOL
22
23 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
24
25 #define LIBS_DEBUG
26 /* FreeBSD 2.2 or later */
27 #ifndef __FreeBSD_version
28 #include <osreldate.h>
29 #endif
30 #if __FreeBSD_version >= 199701
31 #define LIBS_SYSTEM "-lutil -lxpg4"
32 #else
33 #define LIBS_SYSTEM "-lutil"
34 #endif
35
36 #ifndef NOT_C_CODE
37 #ifdef BSD /* fixing BSD define */
38 #undef BSD
39 #endif
40 #include <sys/param.h>
41 /* Kludge to work around setlocale(LC_ALL,...) not working after 01/1997 */
42 #if __FreeBSD_version >= 199701 && __FreeBSD_version < 226000
43 #ifdef HAVE_X_WINDOWS
44 #include <X11/Xlocale.h>
45 #define setlocale(locale_category, locale_spec) setlocale(LC_CTYPE, locale_spec)
46 #endif /* HAVE X */
47 #endif /* FreeBSD >= 199701 && < 226000 */
48 #endif /* C code */
49
50 #define LIBS_TERMCAP "-ltermcap"
51
52 #ifdef __ELF__ /* since from 3.0-CURRENT(maybe 19980831 or later) */
53 #ifndef NOT_C_CODE
54 #include <stddef.h>
55 #endif
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 #define LINKER "$(CC) -nostdlib"
61 #undef LIB_GCC
62 #define LIB_GCC
63
64 #else /* not __ELF__ */
65
66 #ifndef NO_SHARED_LIBS
67 #if 0 /* mrb */
68 #define LIB_GCC "-lgcc"
69 #define LD_SWITCH_SYSTEM "-dc -dp -e start"
70 #define START_FILES "pre-crt0.o /usr/lib/crt0.o"
71 #else /* mrb */
72 #define ORDINARY_LINK
73 #undef LIB_GCC
74 #undef LD_SWITCH_SYSTEM
75 #undef START_FILES
76 #endif /* mrb */
77
78 #define HAVE_TEXT_START         /* No need to define `start_of_text'. */
79 #define UNEXEC "unexfreebsd.o"
80 #define RUN_TIME_REMAP
81
82 #ifndef N_TRELOFF
83 #define N_PAGSIZ(x) __LDPGSZ
84 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
85 #define N_TRELOFF(x) N_RELOFF(x)
86 #endif
87 #else /* NO_SHARED_LIBS */
88 #ifdef __FreeBSD__  /* shared libs are available, but the user prefers
89                      not to use them.  */
90 #define LD_SWITCH_SYSTEM "-Bstatic"
91 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
92 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
93 #endif /* __FreeBSD__ */
94 #endif /* NO_SHARED_LIBS */
95
96 #endif /* not __ELF__ */
97
98 #define HAVE_GETLOADAVG
99 /* #define NO_TERMIO */ /* detected in configure */
100 #define DECLARE_GETPWUID_WITH_UID_T
101
102 /* freebsd uses OXTABS instead of the expected TAB3. */
103 #define TABDLY OXTABS
104 #define TAB3 OXTABS
105
106 /* Needed to avoid hanging when child process writes an error message
107    and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>.  */
108 #define vfork fork