comparison src/s/linux.h @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents 3bb7ccffb0c0
children 5a88923fcbfe
comparison
equal deleted inserted replaced
162:4de2936b4e77 163:0132846995bd
20 Boston, MA 02111-1307, USA. */ 20 Boston, MA 02111-1307, USA. */
21 21
22 /* Synched up with: FSF 19.31 (called, ahem ... lignux.h in FSF). */ 22 /* Synched up with: FSF 19.31 (called, ahem ... lignux.h in FSF). */
23 23
24 /* This file was put together by Michael K. Johnson and Rik Faith. */ 24 /* This file was put together by Michael K. Johnson and Rik Faith. */
25
26
27 /*
28 * Define symbols to identify the version of Unix this is.
29 * Define all the symbols that apply correctly.
30 */
31 25
32 /* #define UNIPLUS */ 26 /* #define UNIPLUS */
33 /* #define USG5 */ 27 /* #define USG5 */
34 #define USG 28 #define USG
35 /* #define BSD */ 29 /* #define BSD */
38 /* SYSTEM_TYPE should indicate the kind of system you are using. 32 /* SYSTEM_TYPE should indicate the kind of system you are using.
39 It sets the Lisp variable system-type. */ 33 It sets the Lisp variable system-type. */
40 34
41 #define SYSTEM_TYPE "linux" /* All the best software is free. */ 35 #define SYSTEM_TYPE "linux" /* All the best software is free. */
42 36
43 /* Letter to use in finding device name of first pty,
44 if system supports pty's. 'p' means it is /dev/ptyp0 */
45
46 #define FIRST_PTY_LETTER 'p' 37 #define FIRST_PTY_LETTER 'p'
47
48 /*
49 * Define HAVE_PTYS if the system supports pty devices.
50 */
51
52 #define HAVE_PTYS 38 #define HAVE_PTYS
53 39
54 /* define MAIL_USE_FLOCK if the mailer uses flock 40 /* define MAIL_USE_FLOCK if the mailer uses flock
55 to interlock access to /usr/spool/mail/$USER. 41 to interlock access to /usr/spool/mail/$USER.
56 The alternative is that a lock file named 42 The alternative is that a lock file named
86 72
87 /* #define LINUX_LDAV_FILE "/proc/loadavg" */ 73 /* #define LINUX_LDAV_FILE "/proc/loadavg" */
88 74
89 /* This is needed for dispnew.c:update_frame */ 75 /* This is needed for dispnew.c:update_frame */
90 76
91 #ifdef emacs 77 #ifndef NOT_C_CODE
92 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */ 78 #include <stdio.h> /* Get the definition of _IO_STDIO_H. */
93 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM) 79 #if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
94 /* new C libio names */ 80 /* new C libio names */
95 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ 81 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
96 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base) 82 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
97 #else /* !_IO_STDIO_H */ 83 #else /* !_IO_STDIO_H */
98 /* old C++ iostream names */ 84 /* old C++ iostream names */
99 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ 85 #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
100 ((FILE)->_pptr - (FILE)->_pbase) 86 ((FILE)->_pptr - (FILE)->_pbase)
101 #endif /* !_IO_STDIO_H */ 87 #endif /* !_IO_STDIO_H */
102 #endif /* emacs */ 88 #endif /* C_CODE */
103 89
104 /* Ask GCC where to find libgcc.a. */ 90 /* Ask GCC where to find libgcc.a. */
105 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name` 91 #define LIB_GCC "`$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`"
106 92
107 #ifndef __ELF__ 93 #ifndef __ELF__
108 /* Linux has crt0.o in a non-standard place */ 94 /* Linux has crt0.o in a non-standard place */
109 #define START_FILES pre-crt0.o /usr/lib/crt0.o 95 #define START_FILES "pre-crt0.o /usr/lib/crt0.o"
110 #else 96 #else
111 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o 97 #define START_FILES "pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o"
112 #endif 98 #endif
113
114 /* Check the version number of Linux--if it is at least 1.1.56,
115 it is safe to use SIGIO. If we can't find version.h (could happen
116 if the user did a `make distclean' or something similar on the
117 kernel distribution) just assume that SIGIO works, because nearly
118 everybody should be running Linux 1.2 or later by now. */
119 #ifndef NOT_C_CODE
120 #ifdef emacs
121 #ifdef HAVE_LINUX_VERSION_H
122 #include <linux/version.h>
123
124 #if LINUX_VERSION_CODE < 0x10138
125 #define BROKEN_SIGIO
126 #endif /* LINUX_VERSION_CODE < 0x10138 */
127 #endif /* HAVE_LINUX_VERSION_H */
128 #endif /* emacs */
129 #endif /* NOT_C_CODE */
130 99
131 /* This is needed for sysdep.c */ 100 /* This is needed for sysdep.c */
132 101
133 #define NO_SIOCTL_H /* don't have sioctl.h */ 102 #define NO_SIOCTL_H /* don't have sioctl.h */
134 103
137 106
138 #define POSIX /* affects getpagesize.h and systty.h */ 107 #define POSIX /* affects getpagesize.h and systty.h */
139 108
140 /* Best not to include -lg, unless it is last on the command line */ 109 /* Best not to include -lg, unless it is last on the command line */
141 #define LIBS_DEBUG 110 #define LIBS_DEBUG
142 #define LIBS_TERMCAP -ltermcap -lcurses /* save some space with shared libs*/ 111 #define LIBS_TERMCAP "-ltermcap -lcurses" /* save some space with shared libs*/
143 #ifndef __ELF__ 112 #ifndef __ELF__
144 #define LIB_STANDARD -lc /* avoid -lPW */ 113 #define LIB_STANDARD "-lc" /* avoid -lPW */
145 #else 114 #else
146 #undef LIB_GCC 115 #undef LIB_GCC
147 #define LIB_GCC 116 #define LIB_GCC
148 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o 117 #define LIB_STANDARD "-lgcc -lc -lgcc /usr/lib/crtn.o"
149 #endif 118 #endif
150 119
151 /* Don't use -g in test compiles in configure. 120 /* Don't use -g in test compiles in configure.
152 This is so we will use the same shared libs for that linking 121 This is so we will use the same shared libs for that linking
153 that are used when linking temacs. */ 122 that are used when linking temacs. */
158 /* Let's try this out, just in case. 127 /* Let's try this out, just in case.
159 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */ 128 Nah. Rik Faith <faith@cs.unc.edu> says it doesn't work well. */
160 /* #define SIGNALS_VIA_CHARACTERS */ 129 /* #define SIGNALS_VIA_CHARACTERS */
161 130
162 #ifdef TERM 131 #ifdef TERM
163 #define LIBS_SYSTEM -lclient 132 #define LIBS_SYSTEM "-lclient"
164 #define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term 133 /* #define C_SWITCH_SYSTEM "-D_BSD_SOURCE -I/usr/src/term" - mrb */
134 #define C_SWITCH_SYSTEM "-I/usr/src/term"
165 #else 135 #else
166 /* alane@wozzle.linet.org says that -lipc is not a separate library, 136 /* alane@wozzle.linet.org says that -lipc is not a separate library,
167 since libc-4.4.1. So -lipc was deleted. */ 137 since libc-4.4.1. So -lipc was deleted. */
168 #define LIBS_SYSTEM 138 #define LIBS_SYSTEM
169 139 /* #define _BSD_SOURCE 1 - mrb */
170 #if 0 /* these options should either be cross-platform or removed - mrb */
171 /* XFree86 is built with -DFUNCPROTO=11 -DNARROWPROTO so we better build
172 XEmacs with these switches too so that X functions get called correctly.
173 At least XawScrollbarSetThumb needs this. */
174 #define C_SWITCH_SYSTEM -DFUNCPROTO=11 -DNARROWPROTO -D_BSD_SOURCE
175 #endif
176 /* #define C_SWITCH_SYSTEM -DNARROWPROTO -D_BSD_SOURCE */
177 #define _BSD_SOURCE 1
178 #endif 140 #endif
179 141
180 142
181 /* XEmacs change: configure doesn't find this because math.h aliases 143 /* XEmacs change: configure doesn't find this because math.h aliases
182 rint to __rint so that it's not found. */ 144 rint to __rint so that it's not found. */
183 #define HAVE_RINT 1 145 #define HAVE_RINT 1
184 146
185 #ifdef __ELF__ 147 #ifdef __ELF__
186 #define UNEXEC "unexelf.o" 148 #define UNEXEC "unexelf.o"
187 #define UNEXEC_USE_MAP_PRIVATE 149 #define UNEXEC_USE_MAP_PRIVATE
188 #endif 150 /* mrb - Ordinary link is simple and effective */
151 #define ORDINARY_LINK
152 #undef LIB_STANDARD
153 #undef START_FILES
154 #undef LIB_GCC
155 #endif /* __ELF__ */
189 156
190 #ifdef LINUX_QMAGIC 157 #ifdef LINUX_QMAGIC
191 158
192 #define HAVE_TEXT_START 159 #define HAVE_TEXT_START
193 #define UNEXEC "unexsunos4.o" 160 #define UNEXEC "unexsunos4.o"
199 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) 166 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
200 #define ADJUST_EXEC_HEADER \ 167 #define ADJUST_EXEC_HEADER \
201 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr) 168 unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
202 169
203 #endif /* not LINUX_QMAGIC */ 170 #endif /* not LINUX_QMAGIC */
204
205 #if 0
206 /* In 19.23 and 19.24, configure sometimes fails to define these.
207 It has to do with the fact that configure uses CFLAGS when linking
208 while Makefile.in.in (erroneously) fails to do so when linking temacs. */
209 #ifndef HAVE_GETTIMEOFDAY
210 #define HAVE_GETTIMEOFDAY
211 #endif
212 #ifndef HAVE_MKDIR
213 #define HAVE_MKDIR
214 #endif
215 #ifndef HAVE_RMDIR
216 #define HAVE_RMDIR
217 #endif
218 #ifndef HAVE_XSCREENNUMBEROFSCREEN
219 #define HAVE_XSCREENNUMBEROFSCREEN
220 #endif
221 #endif /* 0 */
222 171
223 /* This is to work around mysterious gcc failures in some system versions. 172 /* This is to work around mysterious gcc failures in some system versions.
224 It is unlikely that Emacs changes will work around this problem; 173 It is unlikely that Emacs changes will work around this problem;
225 therefore, this should remain permanently. */ 174 therefore, this should remain permanently. */
226 #ifndef HAVE_XRMSETDATABASE 175 #ifndef HAVE_XRMSETDATABASE
227 #define HAVE_XRMSETDATABASE 176 #define HAVE_XRMSETDATABASE
228 #endif 177 #endif
229 178
230 /* XEmacs addition: */
231 /* Linux defines these in <values.h>, but they can't be used in #if's
232 Include values.h now so that we don't get complaints if it's included
233 later. This loses with glibc-2 (libc-6) */
234
235 /* # include <features.h> */
236 #if 0
237 #if !(defined (__GLIBC__) && (__GLIBC__ >= 2))
238
239 #include <values.h>
240 #undef SHORTBITS
241 #undef INTBITS
242 #undef LONGBITS
243
244 #endif
245 #endif
246 /* The regex.o routines are a part of the GNU C-library used with Linux. */ 179 /* The regex.o routines are a part of the GNU C-library used with Linux. */
247 /* However, sometimes they disagree with the src/regex.h that comes with Emacs, 180 /* However, sometimes they disagree with the src/regex.h that comes with Emacs,
248 and that can make trouble in etags.c because it gets the regex.h from Emacs 181 and that can make trouble in etags.c because it gets the regex.h from Emacs
249 and the function definitions in libc. So turn this off. */ 182 and the function definitions in libc. So turn this off. */
250 /* XEmacs: in any case, Mule uses different regex routines. */ 183 /* XEmacs: in any case, Mule uses different regex routines. */
265 #define regcomp sys_regcomp 198 #define regcomp sys_regcomp
266 #define regexec sys_regexec 199 #define regexec sys_regexec
267 #define regerror sys_regerror 200 #define regerror sys_regerror
268 #define regfree sys_regfree 201 #define regfree sys_regfree
269 202
203 #if 0 /* mrb - if autoconf 2 is wrong, we should fix the test */
270 /* XEmacs: Damon Lipparelli says that he incorrectly gets this 204 /* XEmacs: Damon Lipparelli says that he incorrectly gets this
271 defined on his system */ 205 defined on his system */
272 #undef GETTIMEOFDAY_ONE_ARGUMENT 206 #undef GETTIMEOFDAY_ONE_ARGUMENT
207 #endif /* 0 */
273 208
274 /* Use BSD process groups, but use setpgid() instead of setpgrp() to 209 /* Use BSD process groups, but use setpgid() instead of setpgrp() to
275 actually set a process group. */ 210 actually set a process group. */
276 211
277 /* Formerly "BSD_PGRPS" */
278
279 #if 0 /* XEmacs (ben): I'm not convinced this is necessary and it has
280 lots of possibility of fuckup. */
281 #define SIGIO_REQUIRES_SEPARATE_PROCESS_GROUP
282 #endif
283 /* XEmacs: removed setpgrp() definition because we use setpgid() when 212 /* XEmacs: removed setpgrp() definition because we use setpgid() when
284 it's available, and autodetect it. */ 213 it's available, and autodetect it. */
285 214
286 /* glibc fuckage */ 215 /* glibc fuckage */
287 #if defined __GLIBC__ && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ > 2) 216 #if defined __GLIBC__ && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ > 2)
288 # define GETPGRP_NEEDS_ARG 217 # define GETPGRP_NEEDS_ARG
289 #endif 218 #endif
290
291 #ifdef __ELF__
292 /* mrb - Ordinary link is simple and effective */
293 #define ORDINARY_LINK
294 #undef LIB_STANDARD
295 #undef START_FILES
296 #undef LIB_GCC
297 #endif /* __ELF__ */