Partially sync files.el from XEmacs 21.5 for wildcard support.
[sxemacs] / 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 INTERRUPTIBLE_OPEN
26
27 #define LIBS_DEBUG
28 /* FreeBSD 2.2 or later */
29 #ifndef __FreeBSD_version
30 #include <osreldate.h>
31 #endif
32 #if __FreeBSD_version >= 199701 && __FreeBSD_version < 600006
33 #define LIBS_SYSTEM "-lutil -lxpg4"
34 #else
35 #define LIBS_SYSTEM "-lutil"
36 #endif
37
38 #ifndef NOT_C_CODE
39 #ifdef BSD                      /* fixing BSD define */
40 #undef BSD
41 #endif
42 #include <sys/param.h>
43 /* Kludge to work around setlocale(LC_ALL,...) not working after 01/1997 */
44 #if __FreeBSD_version >= 199701 && __FreeBSD_version < 226000
45 #ifdef HAVE_X_WINDOWS
46 #include <X11/Xlocale.h>
47 #define setlocale(locale_category, locale_spec) setlocale(LC_CTYPE, locale_spec)
48 #endif                          /* HAVE X */
49 #endif                          /* FreeBSD >= 199701 && < 226000 */
50 #endif                          /* C code */
51
52 #define LIBS_TERMCAP "-ltermcap"
53
54 #ifdef __ELF__                  /* since from 3.0-CURRENT(maybe 19980831 or later) */
55 #ifndef NOT_C_CODE
56 #include <stddef.h>
57 #endif
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 /*
61  * everything is pdump now. --SY
62  * #define UNEXEC "unexelf.o"
63  */
64 #undef UNEXEC
65 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
66 #define LINKER "$(CC) -nostdlib"
67 #undef LIB_GCC
68 #define LIB_GCC
69
70 #else                           /* not __ELF__ */
71
72 #ifndef NO_SHARED_LIBS
73 #if 0                           /* mrb */
74 #define LIB_GCC "-lgcc"
75 #define LD_SWITCH_SYSTEM "-dc -dp -e start"
76 #define START_FILES "pre-crt0.o /usr/lib/crt0.o"
77 #else                           /* mrb */
78 #define ORDINARY_LINK
79 #undef LIB_GCC
80 #undef LD_SWITCH_SYSTEM
81 #undef START_FILES
82 #endif                          /* mrb */
83
84 #define HAVE_TEXT_START         /* No need to define `start_of_text'. */
85 /* #define UNEXEC "unexfreebsd.o" */
86 #define RUN_TIME_REMAP
87
88 #ifndef N_TRELOFF
89 #define N_PAGSIZ(x) __LDPGSZ
90 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
91 #define N_TRELOFF(x) N_RELOFF(x)
92 #endif
93 #else                           /* NO_SHARED_LIBS */
94 #ifdef __FreeBSD__              /* shared libs are available, but the user prefers
95                                    not to use them.  */
96 #define LD_SWITCH_SYSTEM "-Bstatic"
97 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
98 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
99 #endif                          /* __FreeBSD__ */
100 #endif                          /* NO_SHARED_LIBS */
101
102 #endif                          /* not __ELF__ */
103
104                         /* #define NO_TERMIO *//* detected in configure */
105 #define DECLARE_GETPWUID_WITH_UID_T
106
107 /* freebsd uses OXTABS instead of the expected TAB3. */
108 #define TABDLY OXTABS
109 #define TAB3 OXTABS
110
111 /* Needed to avoid hanging when child process writes an error message
112    and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>.  */
113 #define vfork fork