1 /* Synched up with: FSF 19.31. */
3 /* s/ file for freebsd system. */
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. */
10 #define NO_SHARED_LIBS
13 /* Get most of the stuff from bsd4.3 */
16 /* For mem-limits.h. */
19 /* These aren't needed, since we have getloadavg. */
23 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
26 /* FreeBSD 2.2 or later */
27 #ifndef __FreeBSD_version
28 #include <osreldate.h>
30 #if __FreeBSD_version >= 199701
31 #define LIBS_SYSTEM "-lutil -lxpg4"
33 #define LIBS_SYSTEM "-lutil"
37 #ifdef BSD /* fixing BSD define */
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
44 #include <X11/Xlocale.h>
45 #define setlocale(locale_category, locale_spec) setlocale(LC_CTYPE, locale_spec)
47 #endif /* FreeBSD >= 199701 && < 226000 */
50 #define LIBS_TERMCAP "-ltermcap"
52 #ifndef NO_SHARED_LIBS
54 #define LIB_GCC "-lgcc"
55 #define LD_SWITCH_SYSTEM "-dc -dp -e start"
56 #define START_FILES "pre-crt0.o /usr/lib/crt0.o"
60 #undef LD_SWITCH_SYSTEM
64 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
65 #define UNEXEC "unexfreebsd.o"
66 #define RUN_TIME_REMAP
69 #define N_PAGSIZ(x) __LDPGSZ
70 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
71 #define N_TRELOFF(x) N_RELOFF(x)
73 #else /* NO_SHARED_LIBS */
74 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
76 #define LD_SWITCH_SYSTEM "-Bstatic"
77 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
78 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
79 #endif /* __FreeBSD__ */
80 #endif /* NO_SHARED_LIBS */
82 #define HAVE_GETLOADAVG
83 /* #define NO_TERMIO */ /* detected in configure */
84 #define DECLARE_GETPWUID_WITH_UID_T
86 /* freebsd uses OXTABS instead of the expected TAB3. */
90 /* Needed to avoid hanging when child process writes an error message
91 and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>. */