1/* @(#)mconfig.h	1.24 98/12/14 Copyright 1995 J. Schilling */
2/*
3 *	definitions for machine configuration
4 *
5 *	Copyright (c) 1995 J. Schilling
6 *
7 *	This file must be included before any other file.
8 *	Use only cpp instructions.
9 *
10 *	NOTE: SING: (Schily Is Not Gnu)
11 */
12/*
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; see the file COPYING.  If not, write to
25 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef _MCONFIG_H
29#define _MCONFIG_H
30
31/*
32 * This hack that is needed as long as VMS has no POSIX shell.
33 */
34#ifdef	VMS
35#	define	USE_STATIC_CONF
36#endif
37
38#ifdef  VANILLA_AUTOCONF
39#include <config.h>
40#else
41#ifdef	USE_STATIC_CONF
42#include <xmconfig.h>	/* This is the current static autoconf stuff */
43#else
44#include <xconfig.h>	/* This is the current dynamic autoconf stuff */
45#endif
46#endif
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52#if defined(unix) || defined(__unix) || defined(__unix__)
53#	define	IS_UNIX
54#endif
55
56#ifdef	__MSDOS__
57#	define	IS_MSDOS
58#endif
59
60#if defined(tos) || defined(__tos)
61#	define	IS_TOS
62#endif
63
64#ifdef	THINK_C
65#	define	IS_MAC
66#endif
67
68#if defined(sun) || defined(__sun) || defined(__sun__)
69#	define	IS_SUN
70#endif
71
72#if defined(__CYGWIN32__)
73#       define IS_GCC_WIN32
74#endif
75
76/*--------------------------------------------------------------------------*/
77/*
78 * Some magic that cannot (yet) be figured out with autoconf.
79 */
80
81#ifdef sparc
82#	ifndef	HAVE_LDSTUB
83#	define	HAVE_LDSTUB
84#	endif
85#	ifndef	HAVE_SCANSTACK
86#	define	HAVE_SCANSTACK
87#	endif
88#endif
89#if	defined(__i386_) || defined(i386)
90#	ifndef	HAVE_XCHG
91#	define	HAVE_XCHG
92#	endif
93#	ifndef	HAVE_SCANSTACK
94#	define	HAVE_SCANSTACK
95#	endif
96#endif
97
98#if	defined(SOL2) || defined(SOL2) || defined(S5R4) || defined(__S5R4) \
99							|| defined(SVR4)
100#	ifndef	__SVR4
101#		define	__SVR4
102#	endif
103#endif
104
105#ifdef	__SVR4
106#	ifndef	SVR4
107#		define	SVR4
108#	endif
109#endif
110
111/*
112 * SunOS 4.x / SunOS 5.x
113 */
114#if defined(IS_SUN)
115#	define	HAVE_GETAV0
116#endif
117
118/*
119 * AIX
120 */
121#if	defined(_IBMR2) || defined(_AIX)
122#	define	IS_UNIX		/* ??? really ??? */
123#endif
124
125/*
126 * Silicon Graphics	(must be before SVR4)
127 */
128#if defined(sgi) || defined(__sgi)
129#	define	__NOT_SVR4__	/* Not a real SVR4 implementation */
130#endif
131
132/*
133 * Data General
134 */
135#if defined(__DGUX__)
136#ifdef	XXXXXXX
137#	undef	HAVE_MTGET_DSREG
138#	undef	HAVE_MTGET_RESID
139#	undef	HAVE_MTGET_FILENO
140#	undef	HAVE_MTGET_BLKNO
141#endif
142#	define	mt_type		mt_model
143#	define	mt_dsreg	mt_status1
144#	define	mt_erreg	mt_status2
145	/*
146	 * DGUX hides its flock as dg_flock.
147	 */
148#	define	HAVE_FLOCK
149#	define	flock	dg_flock
150	/*
151	 * Use the BSD style wait on DGUX to get the resource usages of child
152	 * processes.
153	 */
154#	define	_BSD_WAIT_FLAVOR
155#endif
156
157/*
158 * Apple Rhapsody
159 */
160#if defined(__NeXT__) && defined(__TARGET_OSNAME) && __TARGET_OSNAME == rhapsody
161#	define HAVE_OSDEF /* prevent later definitions to overwrite current */
162#endif
163
164/*
165 * NextStep
166 */
167#if defined(__NeXT__) && !defined(HAVE_OSDEF)
168#define	NO_PRINT_OVR
169#undef	HAVE_USG_STDIO		/*
170				 *  NeXT Step 3.x uses __flsbuf(unsigned char , FILE *)
171				 * instead of __flsbuf(int, FILE *)
172				 */
173#endif
174
175/*
176 * NextStep 3.x has a broken linker that does not allow us to override
177 * these functions.
178 */
179#ifndef	__OPRINTF__
180
181#ifdef	NO_PRINT_OVR
182#	define	printf	Xprintf
183#	define	fprintf	Xfprintf
184#	define	sprintf	Xsprintf
185#endif
186
187#endif	/* __OPRINTF__ */
188
189/*--------------------------------------------------------------------------*/
190/*
191 * If there is no flock defined by the system, use emulation
192 * through fcntl record locking.
193 */
194#ifndef HAVE_FLOCK
195#define LOCK_SH         1       /* shared lock */
196#define LOCK_EX         2       /* exclusive lock */
197#define LOCK_NB         4       /* don't block when locking */
198#define LOCK_UN         8       /* unlock */
199#endif
200
201#include <prototyp.h>
202
203/*
204 * gcc 2.x generally implements the long long type.
205 */
206#ifdef	__GNUC__
207#	if	__GNUC__ > 1
208#		ifndef	HAVE_LONGLONG
209#			define	HAVE_LONGLONG
210#		endif
211#	endif
212#endif
213
214/*
215 * Convert to GNU name
216 */
217#ifdef	HAVE_STDC_HEADERS
218#	ifndef	STDC_HEADERS
219#		define	STDC_HEADERS
220#	endif
221#endif
222/*
223 * Convert to SCHILY name
224 */
225#ifdef	STDC_HEADERS
226#	ifndef	HAVE_STDC_HEADERS
227#		define	HAVE_STDC_HEADERS
228#	endif
229#endif
230
231#ifdef	IS_UNIX
232#	define	PATH_DELIM	'/'
233#	define	PATH_DELIM_STR	"/"
234#	define	far
235#	define	near
236#endif
237
238#ifdef	IS_GCC_WIN32
239#	define	PATH_DELIM	'/'
240#	define	PATH_DELIM_STR	"/"
241#	define	far
242#	define	near
243#endif
244
245#ifdef	IS_MSDOS
246#	define	PATH_DELIM	'\\'
247#	define	PATH_DELIM_STR	"\\"
248#endif
249
250#ifdef	IS_TOS
251#	define	PATH_DELIM	'\\'
252#	define	PATH_DELIM_STR	"\\"
253#	define	far
254#	define	near
255#endif
256
257#ifdef	IS_MAC
258#	define	PATH_DELIM	':'
259#	define	PATH_DELIM_STR	":"
260#	define	far
261#	define	near
262#endif
263
264#ifdef __cplusplus
265}
266#endif
267
268#endif /* _MCONFIG_H */
269