Switch license to GPLv3 or later.
[bpt/emacs.git] / src / s / netbsd.h
1 /* s/ file for netbsd system.
2
3 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
4 2007 Free Software Foundation, Inc.
5
6 This file is part of GNU Emacs.
7
8 GNU Emacs is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GNU Emacs is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Emacs; see the file COPYING. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
22
23
24 /* Get most of the stuff from bsd4.3 */
25 #include "bsd4-3.h"
26
27 #if defined (__alpha__) && !defined (__ELF__)
28 #define NO_SHARED_LIBS
29 #endif
30
31 /* For mem-limits.h. */
32 #define BSD4_2
33
34 #undef KERNEL_FILE
35 #undef LDAV_SYMBOL
36 #define HAVE_GETLOADAVG 1
37
38 #define HAVE_UNION_WAIT
39
40 #define SIGNALS_VIA_CHARACTERS
41
42 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
43
44 /* netbsd uses OXTABS instead of the expected TAB3. */
45 #define TABDLY OXTABS
46 #define TAB3 OXTABS
47
48 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
49 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
50
51 #define HAVE_TERMIOS
52 #define NO_TERMIO
53
54 #define LIBS_DEBUG
55 /* -lutil is not needed for NetBSD >0.9. */
56 /* #define LIBS_SYSTEM -lutil */
57 #define LIBS_TERMCAP -ltermcap
58
59 #define NEED_ERRNO
60 #define SYSV_SYSTEM_DIR
61
62 /* Netbsd has POSIX-style pgrp behavior. */
63 #undef BSD_PGRPS
64
65 #define GETPGRP_NO_ARG
66
67 #if !defined (NO_SHARED_LIBS) && ! defined (__ELF__)
68 /* These definitions should work for either dynamic or static linking,
69 whichever is the default for `cc -nostdlib'. */
70 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
71 #define START_FILES pre-crt0.o /usr/lib/crt0.o
72 #define UNEXEC unexsunos4.o
73 #define RUN_TIME_REMAP
74
75 /* Try to make this work for both 0.9 and >0.9. */
76 #ifndef N_TRELOFF
77 #define N_PAGSIZ(x) __LDPGSZ
78 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
79 #define N_TRELOFF(x) N_RELOFF(x)
80 #endif
81 #endif /* not NO_SHARED_LIBS and not ELF */
82
83 #if !defined (NO_SHARED_LIBS) && defined (__ELF__)
84 #define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o
85 #define UNEXEC unexelf.o
86 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1
87 #undef LIB_GCC
88 #define LIB_GCC
89 #endif
90
91 #ifdef HAVE_CRTIN
92 #define START_FILES_1 /usr/lib/crti.o
93 #define END_FILES_1 /usr/lib/crtn.o
94 #else
95 #define START_FILES_1
96 #define END_FILES_1
97 #endif
98
99 #define HAVE_WAIT_HEADER
100 #define WAIT_USE_INT
101
102 #define AMPERSAND_FULL_NAME
103
104 #ifdef __ELF__
105 /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
106 says where to find X windows at run time. We convert it to a -rpath option
107 which is what OSF1 uses. */
108 #define LD_SWITCH_SYSTEM_tmp `echo LD_SWITCH_X_SITE_AUX | sed -e 's/-R/-Wl,-rpath,/'`
109 #define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib
110
111 /* The following is needed to make `configure' find Xpm, Xaw3d and
112 image include and library files if using /usr/bin/gcc. That
113 compiler seems to be modified to not find headers in
114 /usr/local/include or libs in /usr/local/lib by default. */
115
116 #define C_SWITCH_SYSTEM -I/usr/X11R6/include -I/usr/pkg/include -I/usr/local/include -L/usr/pkg/lib -L/usr/local/lib
117
118 /* Link temacs with -z nocombreloc so that unexec works right, whether or
119 not -z combreloc is the default. GNU ld ignores unknown -z KEYWORD
120 switches, so this also works with older versions that don't implement
121 -z combreloc. */
122
123 #define LD_SWITCH_SYSTEM_TEMACS -Wl,-z,nocombreloc
124
125 #endif /* __ELF__ */
126
127 /* On post 1.3 releases of NetBSD, gcc -nostdlib also clears
128 the library search parth, i.e. it won't search /usr/lib
129 for libc and friends. Using -nostartfiles instead avoids
130 this problem, and will also work on earlier NetBSD releases */
131
132 #define LINKER $(CC) -nostartfiles
133
134 #define NARROWPROTO 1
135
136 #define DEFAULT_SOUND_DEVICE "/dev/audio"
137
138 /* Greg A. Woods <woods@weird.com> says we must include signal.h
139 before syssignal.h is included, to work around interface conflicts
140 that are handled with CPP __RENAME() macro in signal.h. */
141
142 #ifndef NOT_C_CODE
143 #include <signal.h>
144 #endif
145
146 /* Don't close pty in process.c to make it as controlling terminal.
147 It is already a controlling terminal of subprocess, because we did
148 ioctl TIOCSCTTY. */
149
150 #define DONT_REOPEN_PTY
151
152 /* Tell that garbage collector that setjmp is known to save all
153 registers relevant for conservative garbage collection in the
154 jmp_buf. */
155
156 #define GC_SETJMP_WORKS 1
157
158 /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method. */
159
160 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
161
162 /* Use sigprocmask and friends instead of sigblock;
163 sigblock is considered obsolete on NetBSD. */
164
165 #define POSIX_SIGNALS 1
166
167 /* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81
168 (do not change this comment) */