summaryrefslogtreecommitdiff
path: root/include/mconfig.h
blob: ee356eca64f3d87fb897093589f1ebfa058128b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
/*
 * This file has been modified for the cdrkit suite.
 *
 * The behaviour and appearence of the program code below can differ to a major
 * extent from the version distributed by the original author(s).
 *
 * For details, see Changelog file distributed with the cdrkit package. If you
 * received this file from another source then ask the distributing person for
 * a log of modifications.
 *
 */

/* @(#)mconfig.h	1.50 04/07/11 Copyright 1995 J. Schilling */
/*
 *	definitions for machine configuration
 *
 *	Copyright (c) 1995 J. Schilling
 *
 *	This file must be included before any other file.
 *	If this file is not included before stdio.h you will not be
 *	able to get LARGEFILE support
 *
 *	Use only cpp instructions.
 *
 *	NOTE: SING: (Schily Is Not Gnu)
 */
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; see the file COPYING.  If not, write to the Free Software
 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef _MCONFIG_H
#define	_MCONFIG_H

/* whatever, just shut up */
#define __sccsid "forked version from cdrkit"
#define _sccsid "forked version from cdrkit"

/*
 * This hack that is needed as long as VMS has no POSIX shell.
 */
#ifdef	VMS
#	define	USE_STATIC_CONF
#endif

#ifdef	USE_STATIC_CONF
#include <xmconfig.h>	/* This is the current static autoconf stuff */
#else
#include <xconfig.h>	/* This is the current dynamic autoconf stuff */
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
 * The NetBSD people want to bother us.
 * They removed the definition for 'unix' and are bleating for every test
 * for #if defined(unix). So we need to check for NetBSD early.
 */
#ifndef	IS_UNIX
#	if defined(__NetBSD__)
#		define	IS_UNIX
#	endif
#endif

#ifndef	IS_UNIX
#	if (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__DJGPP__)
#		define	IS_UNIX
#	endif
#endif

#ifdef	__MSDOS__
#	define	IS_MSDOS
#endif

#if defined(tos) || defined(__tos)
#	define	IS_TOS
#endif

#ifdef	THINK_C
#	define	IS_MAC
#endif

#if defined(sun) || defined(__sun) || defined(__sun__)
#	define	IS_SUN
#endif

#if defined(__CYGWIN32__) || defined(__CYGWIN__)
#	define	IS_GCC_WIN32
#	define	IS_CYGWIN

#if	defined(unix) || defined(_X86)
#	define	IS_CYGWIN_1
#endif
#endif

/*--------------------------------------------------------------------------*/
/*
 * Some magic that cannot (yet) be figured out with autoconf.
 */

#if defined(sun3) || defined(mc68000) || defined(mc68020)
#	ifndef	HAVE_SCANSTACK
#	define	HAVE_SCANSTACK
#	endif
#endif
#ifdef sparc
#	ifndef	HAVE_LDSTUB
#	define	HAVE_LDSTUB
#	endif
#	ifndef	HAVE_SCANSTACK
#	define	HAVE_SCANSTACK
#	endif
#endif
#if	defined(__i386_) || defined(i386)
#	ifndef	HAVE_XCHG
#	define	HAVE_XCHG
#	endif
#	ifndef	HAVE_SCANSTACK
#	define	HAVE_SCANSTACK
#	endif
#endif

/*
 * Use of SCANSTACK is disabled by default
 */
#ifndef	USE_SCANSTACK
#	undef	HAVE_SCANSTACK
#else
/*
 * But ....
 * The tests are much better now, so always give it a chance.
 */
#ifndef	HAVE_SCANSTACK
#	define	HAVE_SCANSTACK
#endif
#endif

/*
 * Allow to overwrite the defines in the makefiles by calling
 *
 *	make COPTX=-DFORCE_SCANSTACK
 */
#ifdef	FORCE_SCANSTACK
#	undef	NO_SCANSTACK
#ifndef	HAVE_SCANSTACK
#	define	HAVE_SCANSTACK
#endif
#ifndef	USE_SCANSTACK
#	define	USE_SCANSTACK
#endif
#endif

/*
 * This is the global switch to deactivate stack scanning
 */
#ifdef	NO_SCANSTACK
#	ifdef	HAVE_SCANSTACK
#	undef	HAVE_SCANSTACK
#	endif
#endif

#ifdef	NO_FORK
#	ifdef	HAVE_FORK
#	undef	HAVE_FORK
#	endif
#	ifdef	HAVE_VFORK
#	undef	HAVE_VFORK
#	endif
#endif
#ifdef	NO_VFORK
#	ifdef	HAVE_VFORK
#	undef	HAVE_VFORK
#	endif
#endif

#if	defined(SOL2) || defined(SOL2) || \
	defined(S5R4) || defined(__S5R4) || defined(SVR4)
#	ifndef	__SVR4
#		define	__SVR4
#	endif
#endif

#ifdef	__SVR4
#	ifndef	SVR4
#		define	SVR4
#	endif
#endif

/*
 * SunOS 4.x / SunOS 5.x
 */
#if defined(IS_SUN)
#	define	HAVE_GETAV0
#endif

/*
 * AIX
 */
#if	defined(_IBMR2) || defined(_AIX)
#	ifndef	IS_UNIX
#	define	IS_UNIX		/* ??? really ??? */
#	endif
#endif

/*
 * QNX
 */
#if defined(__QNX__)
#	ifndef	IS_UNIX
#	define	IS_UNIX
#	endif
#endif

/*
 * Silicon Graphics	(must be before SVR4)
 */
#if defined(sgi) || defined(__sgi)
#	define	__NOT_SVR4__	/* Not a real SVR4 implementation */
#endif

/*
 * Data General
 */
#if defined(__DGUX__)
#ifdef	XXXXXXX
#	undef	HAVE_MTGET_DSREG
#	undef	HAVE_MTGET_RESID
#	undef	HAVE_MTGET_FILENO
#	undef	HAVE_MTGET_BLKNO
#endif
#	define	mt_type		mt_model
#	define	mt_dsreg	mt_status1
#	define	mt_erreg	mt_status2
	/*
	 * DGUX hides its flock as dg_flock.
	 */
#	define	HAVE_FLOCK
#	define	flock	dg_flock
	/*
	 * Use the BSD style wait on DGUX to get the resource usages of child
	 * processes.
	 */
#	define	_BSD_WAIT_FLAVOR
#endif

/*
 * Apple Rhapsody (This is the name for Mac OS X beta)
 */
#if defined(__NeXT__) && defined(__TARGET_OSNAME) && __TARGET_OSNAME == rhapsody
#	define	HAVE_OSDEF /* prevent later definitions to overwrite current */
#	ifndef	IS_UNIX
#	define	IS_UNIX
#	endif
#endif

/*
 * NextStep
 */
#if defined(__NeXT__) && !defined(HAVE_OSDEF)
#define	NO_PRINT_OVR
#undef	HAVE_USG_STDIO		/*
				 * NeXT Step 3.x uses __flsbuf(unsigned char, FILE *)
				 * instead of __flsbuf(int, FILE *)
				 */
#	ifndef	IS_UNIX
#	define	IS_UNIX
#	endif
#endif

/*
 * Mac OS X
 */
#if defined(__APPLE__) && defined(__MACH__)
#	ifndef	IS_UNIX
#	define	IS_UNIX
#	endif
#	define	IS_MACOS_X
#endif

/*
 * NextStep 3.x has a broken linker that does not allow us to override
 * these functions.
 */
#ifndef	__OPRINTF__

#ifdef	NO_PRINT_OVR
#	define	printf	Xprintf
#	define	fprintf	Xfprintf
#	define	sprintf	Xsprintf
#endif

#endif	/* __OPRINTF__ */

/*--------------------------------------------------------------------------*/
/*
 * If there is no flock defined by the system, use emulation
 * through fcntl record locking.
 */
#ifndef HAVE_FLOCK
#define	LOCK_SH		1	/* shared lock */
#define	LOCK_EX		2	/* exclusive lock */
#define	LOCK_NB		4	/* don't block when locking */
#define	LOCK_UN		8	/* unlock */
#endif

#ifndef	_PROTOTYP_H
#include <prototyp.h>
#endif

/*
 * gcc 2.x generally implements the long long type.
 */
#ifdef	__GNUC__
#	if	__GNUC__ > 1
#		ifndef	HAVE_LONGLONG
#			define	HAVE_LONGLONG
#		endif
#	endif
#endif

/*
 * Convert to GNU name
 */
#ifdef	HAVE_STDC_HEADERS
#	ifndef	STDC_HEADERS
#		define	STDC_HEADERS
#	endif
#endif
/*
 * Convert to SCHILY name
 */
#ifdef	STDC_HEADERS
#	ifndef	HAVE_STDC_HEADERS
#		define	HAVE_STDC_HEADERS
#	endif
#endif

#ifdef	IS_UNIX
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'/'
#	define	PATH_DELIM_STR		"/"
#	define	PATH_ENV_DELIM		':'
#	define	PATH_ENV_DELIM_STR	":"
#	define	far
#	define	near
#endif

/*
 * Win32 with Gygwin
 */
#ifdef	IS_GCC_WIN32
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'/'
#	define	PATH_DELIM_STR		"/"
#	define	PATH_ENV_DELIM		':'
#	define	PATH_ENV_DELIM_STR	":"
#	define	HAVE_DOS_DRIVELETTER
#	define	far
#	define	near
#	define	NEED_O_BINARY
#endif

/*
 * Win32 with Mingw32
 */
#ifdef	__MINGW32__
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'/'
#	define	PATH_DELIM_STR		"/"
#	define	PATH_ENV_DELIM		';'
#	define	PATH_ENV_DELIM_STR	";"
#	define	HAVE_DOS_DRIVELETTER
#	define	far
#	define	near
#	define	NEED_O_BINARY
#endif

/*
 * OS/2 EMX
 */
#ifdef	__EMX__				/* We don't want to call it UNIX */
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'/'
#	define	PATH_DELIM_STR		"/"
#	define	PATH_ENV_DELIM		';'
#	define	PATH_ENV_DELIM_STR	";"
#	define	HAVE_DOS_DRIVELETTER
#	define	far
#	define	near
#	define	NEED_O_BINARY
#endif

#ifdef	__BEOS__			/* We don't want to call it UNIX */
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'/'
#	define	PATH_DELIM_STR		"/"
#	define	PATH_ENV_DELIM		':'
#	define	PATH_ENV_DELIM_STR	":"
#	define	far
#	define	near
#endif

/*
 * DOS with DJGPP
 */
#ifdef	__DJGPP__			/* We don't want to call it UNIX */
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'/'
#	define	PATH_DELIM_STR		"/"
#	define	PATH_ENV_DELIM		';'
#	define	PATH_ENV_DELIM_STR	";"
#	define	HAVE_DOS_DRIVELETTER

#	define	NEED_O_BINARY
#endif

/*
 * Vanilla DOS
 */
#if	defined(IS_MSDOS) && !defined(__DJGPP__)
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'\\'
#	define	PATH_DELIM_STR		"\\"
#	define	PATH_ENV_DELIM		';'
#	define	PATH_ENV_DELIM_STR	";"
#	define	HAVE_DOS_DRIVELETTER

#	define	NEED_O_BINARY
#endif

/*
 * ATARI TOS
 */
#ifdef	IS_TOS
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'\\'
#	define	PATH_DELIM_STR		"\\"
#	define	PATH_ENV_DELIM		','
#	define	PATH_ENV_DELIM_STR	","
#	define	HAVE_DOS_DRIVELETTER
#	define	far
#	define	near
#endif

/*
 * Mac OS 9
 */
#ifdef	IS_MAC
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		':'
#	define	PATH_DELIM_STR		":"
#	define	PATH_ENV_DELIM		';'	/* ??? */
#	define	PATH_ENV_DELIM_STR	";"	/* ??? */
#	define	far
#	define	near
#endif

/*
 * I hope this will make compilation on unknown OS easier.
 */
#ifndef	HAVE_PATH_DELIM			/* Default to POSIX rules */
#	define	HAVE_PATH_DELIM
#	define	PATH_DELIM		'/'
#	define	PATH_DELIM_STR		"/"
#	define	PATH_ENV_DELIM		':'
#	define	PATH_ENV_DELIM_STR	":"
#	define	far
#	define	near
#endif

#ifdef __cplusplus
}
#endif

#endif /* _MCONFIG_H */