host.defs revision 131962
1228753Smmnewcode	:
2228753Smm/* $Header: /src/pub/tcsh/host.defs,v 1.36 2003/02/08 20:03:25 christos Exp $ */
3228753Smm/*
4228753Smm * host.defs: Hosttype/Machtype etc.
5228753Smm */
6228753Smm/*-
7228753Smm * Copyright (c) 1980, 1991 The Regents of the University of California.
8228753Smm * All rights reserved.
9228753Smm *
10228753Smm * Redistribution and use in source and binary forms, with or without
11228753Smm * modification, are permitted provided that the following conditions
12228753Smm * are met:
13228753Smm * 1. Redistributions of source code must retain the above copyright
14228753Smm *    notice, this list of conditions and the following disclaimer.
15228753Smm * 2. Redistributions in binary form must reproduce the above copyright
16228753Smm *    notice, this list of conditions and the following disclaimer in the
17228753Smm *    documentation and/or other materials provided with the distribution.
18228753Smm * 3. Neither the name of the University nor the names of its contributors
19228753Smm *    may be used to endorse or promote products derived from this software
20228753Smm *    without specific prior written permission.
21228753Smm *
22228753Smm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23228753Smm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24228753Smm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25229592Smm * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26228753Smm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27228753Smm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28228753Smm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29228753Smm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30228753Smm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31228753Smm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32228753Smm * SUCH DAMAGE.
33228753Smm */
34228753Smm#include "sh.h"
35228753Smm
36228753SmmRCSID("$Id: host.defs,v 1.36 2003/02/08 20:03:25 christos Exp $")
37228753Smm
38228753Smmendcode	:
39228753Smm
40228753Smmmacro	: M_mips64el : (defined(mips64) || defined(__mips64)) && (defined(MIPSEL) || defined(__MIPSEL))
41228753Smmmacro	: M_mips64eb : (defined(mips64) || defined(__mips64)) && (defined(MIPSEB) || defined(__MIPSEB))
42228753Smmmacro	: M_mipsel : (!defined(M_mips64el)) && (defined(mips) || defined(__mips)) && (defined(MIPSEL) || defined(__MIPSEL))
43228753Smmmacro	: M_mipseb : (!defined(M_mips64eb)) && (defined(mips) || defined(__mips)) && (defined(MIPSEB) || defined(__MIPSEB))
44228753Smmmacro	: M_i386 : (defined(i386) || defined(__i386__))
45228753Smmmacro	: M_i486 : (defined(i486) || defined(__i486__))
46228753Smmmacro	: M_i586 : (defined(i586) || defined(__i586__))
47228753Smmmacro	: M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
48228753Smm
49228753Smmnewdef	: defined(ns32000)
50228753Smmnewcode	:
51228753Smmstatic char *
52228753Smmisamultimax(flag)
53228753Smm    int flag;
54228753Smm{
55228753Smm    if (access("/Umax.image", F_OK) == 0)
56228753Smm	return "multimax";
57228753Smm    else 
58228753Smm	return flag ? "mach" : "ns32000";
59228753Smm}
60228753Smmendcode	:
61228753Smmenddef	:
62228753Smm
63228753Smm
64228753Smmnewdef	: defined(cray)
65228753Smmnewcode	:
66228753Smm/*  
67228753Smm * On crays, find the current machine type via the target() syscall
68228753Smm * We need ctype.h to convert the name returned to lower case
69228753Smm */
70228753Smm# include <sys/target.h> 
71228753Smm# include <ctype.h>
72228753Smm# include <string.h>
73228753Smm
74228753Smm/* From: hpa@hook.eecs.nwu.edu (H. Peter Anvin) */
75228753Smmstatic char *
76228753Smmgetcray()
77228753Smm{
78228753Smm# ifdef MC_GET_SYSTEM /* If we have target() */
79228753Smm    struct target data;
80228753Smm
81228753Smm    if (target(MC_GET_SYSTEM, &data) != -1) {
82228753Smm	static char hosttype_buf[sizeof(data.mc_pmt)+1];
83228753Smm	char *p = (char *) &(data.mc_pmt);
84228753Smm	char *q = hosttype_buf;
85228753Smm	int n;
86228753Smm
87228753Smm	/* 
88228753Smm	 * Copy to buffer and convert to lower case 
89228753Smm	 * String may not be null-terminated, so keep a counter
90228753Smm	 */
91228753Smm	for (n = 0; *p && n < sizeof(data.mc_pmt); n++)
92228753Smm	  *q++ = tolower(p[n]);
93228753Smm
94228753Smm	*q = '\0';
95228753Smm
96228753Smm	/* replace dashes with underscores if present */
97228753Smm	while ((q = strchr(hosttype_buf, '-')) != NULL)
98228753Smm	    *q = '_';
99228753Smm	return hosttype_buf; 	/* Return in static buffer */
100228753Smm    }
101228753Smm    else
102228753Smm# endif /* MC_GET_SYSTEM */
103228753Smm	return "cray";		/* target() failed */
104228753Smm}
105228753Smmendcode	:
106228753Smmenddef	:
107228753Smm
108228753Smm
109228753Smmnewdef	: defined(convex)
110228753Smmnewcode	:
111228753Smm/*  
112228753Smm * On convex, find the current machine type via the getsysinfo() syscall
113228753Smm */
114228753Smm#include <sys/sysinfo.h> 
115228753Smm
116228753Smm/* From: fox@convex.com (David DeSimone) */
117228753Smmstatic char *
118228753Smmgetconvex()
119228753Smm{
120228753Smm    struct system_information  sysinfo;
121228753Smm    static char  result[8];
122228753Smm
123228753Smm    if (getsysinfo(SYSINFO_SIZE, &sysinfo) == -1)
124228753Smm	return "convex";
125228753Smm
126228753Smm    switch(sysinfo.cpu_type) {
127228753Smm#ifdef SI_CPUTYPE_C1
128228753Smm    case SI_CPUTYPE_C1:
129228753Smm	return "c1";
130228753Smm#endif
131228753Smm
132228753Smm#ifdef SI_CPUTYPE_C2
133228753Smm    case SI_CPUTYPE_C2:
134228753Smm	return "c2";
135228753Smm#endif
136228753Smm
137228753Smm#ifdef SI_CPUTYPE_C2MP
138228753Smm    case SI_CPUTYPE_C2MP:
139228753Smm	(void) strcpy(result, "c2X0");
140228753Smm	result[2] = sysinfo.cpu_count + '0';
141228753Smm	return result;
142228753Smm#endif
143228753Smm
144228753Smm#ifdef SI_CPUTYPE_C34
145228753Smm    case SI_CPUTYPE_C34:
146228753Smm	(void) strcpy(result, "c34X0");
147228753Smm	result[3] = sysinfo.cpu_count + '0';
148228753Smm	return result;
149228753Smm#endif
150228753Smm
151228753Smm#ifdef SI_CPUTYPE_C38
152228753Smm    case SI_CPUTYPE_C38:
153228753Smm	(void) strcpy(result, "c38X0");
154228753Smm	result[3] = sysinfo.cpu_count + '0';
155228753Smm	return result;
156228753Smm#endif
157228753Smm
158228753Smm#ifdef SI_CPUTYPE_C46
159228753Smm    case SI_CPUTYPE_C46:
160228753Smm	(void) strcpy(result, "c46X0");
161228753Smm	result[3] = sysinfo.cpu_count + '0';
162228753Smm	return result;
163228753Smm#endif
164228753Smm
165228753Smm    default:
166228753Smm	return "convex";
167228753Smm    }
168228753Smm}
169228753Smmendcode	:
170228753Smmenddef	:
171228753Smm
172228753Smm
173228753Smmnewcode	:
174228753Smmvoid
175228753Smmgetmachine()
176228753Smm{
177228753Smm     char *hosttype;
178228753Smm     char *ostype;
179228753Smm     char *vendor;
180228753Smm     char *machtype;
181228753Smm
182228753Smmendcode	:
183228753Smm
184228753Smm
185228753Smmnewdef	: defined(HOSTTYPE)
186228753Smmhosttype:						: HOSTTYPE
187228753Smmenddef	:
188228753Smm
189228753Smm
190228753Smmnewdef	: defined(__PARAGON__)
191228753Smmcomment	: Intel Paragon running OSF/1
192228753Smmvendor	:						: "intel"
193228753Smmhosttype:						: "paragon"
194228753Smmostype	:						: "osf1"
195228753Smmmachtype: defined(M_i386) 				: "i386"
196228753Smmenddef	:
197228753Smm
198228753Smm
199228753Smmnewdef	: defined(AMIX)
200comment	: Amiga running Amix 2.02
201vendor	:						: "commodore"
202hosttype:						: "amiga"
203ostype	:						: "Amix"
204machtype:						: "m68k"
205enddef	:
206
207
208newdef	: defined(accel)
209comment	: celerity Accel
210vendor	: 						: "celerity"
211hosttype: 						: "celerityACCEL"
212ostype	:						: "unix"
213machtype:						: "accel"
214enddef	:
215
216
217newdef	: defined(_VMS_POSIX)
218comment	: digital vax or alpha running vms posix
219vendor	:						: "dec"
220hosttype:						: "VMS-POSIX"
221ostype	:						: "vms"
222machtype: defined(__alpha)				: "alpha"
223machtype: defined(__vax) || defined(vax)		: "vax"
224machtype: defined(__vax__) 				: "vax"
225enddef	:
226
227
228newdef	: defined(__hp_osf)
229comment	: Hewlett Packard running OSF/1
230vendor	:						: "hp"
231hosttype: defined(__pa_risc)				: "hp9000s700-osf1"
232hosttype: 						: "hp-osf1"
233ostype	: 						: "osf1"
234machtype: defined(__pa_risc)				: "pa_risc"
235enddef	:
236
237
238newdef	: defined(hp9000)
239comment	: Hewlett Packard running MORE/bsd 
240vendor	: 						: "hp"
241hosttype: defined(hp300)				: "hp300"
242hosttype: defined(hp800)				: "hp800"
243hosttype: 						: "hp9000"
244ostype	: defined(BSD4_4)				: "bsd44"
245ostype	:						: "mtXinu"
246machtype: defined(hp300)				: "m68k"
247machtype: defined(hp800)				: "pa_risc"
248enddef	:
249
250
251newdef	: defined(hpux) || defined(__hpux)
252comment	: Hewlett Packard running HP/UX
253vendor	:						: "hp"
254hosttype: defined(__hp9000s700)				: "hp9000s700"
255hosttype: defined(__hp9000s800) || defined(hp9000s800)  : "hp9000s800"
256hosttype: defined(hp9000s500)				: "hp9000s500"
257hosttype: defined(__hp9000s300) || defined(hp9000s300)  : "hp9000s300"
258hosttype: 						: "hp"
259ostype	:						: "hpux"
260machtype: defined(__hp9000s700)				: "pa_risc"
261machtype: defined(__hp9000s800) || defined(hp9000s800)  : "pa_risc"
262machtype: defined(hp9000s500)				: "m68k"
263machtype: defined(__hp9000s300) || defined(hp9000s300)  : "m68k"
264enddef	:
265
266
267newdef	: defined(apollo)
268comment	: Hewlett Packard apollo running Domain/OS
269vendor	:						: "hp"
270hosttype: 						: "apollo"
271ostype	:						: "DomainOS"
272machtype: 						: "m68k"
273enddef	:
274
275
276newdef	: defined(sun) || defined(__sun__)
277comment	: Sun Microsystems series 2 workstation (68010 based)
278comment	: Sun Microsystems series 3 workstation (68020 based)
279comment	: Sun Microsystems 386i workstation (386 based)
280comment	: Sun Microsystems series 4 workstation (SPARC based)
281vendor	:						: "sun"
282hosttype: defined(M_i386) && !defined(__SVR4)		: "sun386i"
283hosttype: defined(M_i386) && defined(__SVR4)		: "i86pc"
284hosttype: defined(mc68010) || defined(__mc68010__)	: "sun2"
285hosttype: defined(mc68020) || defined(__mc68020__)	: "sun3"
286hosttype: defined(sparc) || defined(__sparc__)		: "sun4"
287hosttype: 						: "sun"
288ostype	: defined(SUNOS3)				: "sunos3"
289ostype	: defined(SUNOS4)				: "sunos4"
290ostype	: defined(SOLARIS2)				: "solaris"
291machtype: defined(mc68010) || defined(__mc68010__)	: "m68k"
292machtype: defined(mc68020) || defined(__mc68020__)	: "m68k"
293machtype: defined(sparc) || defined(__sparc__)		: "sparc"
294machtype: defined(M_i386)				: "i386"
295enddef	:
296
297
298newdef	: defined(pyr)
299comment	: Pyramid Technology
300vendor	:						: "pyramid"
301hosttype:						: "pyramid"
302machtype:						: "pyramid"
303enddef	:
304
305
306newdef	: defined(hcx) || defined(_CX_UX)
307comment	: Harris Tahoe running CX/UX
308vendor	:						: "harris"
309hosttype:						: "hcx"
310ostype	:						: "hcx"
311machtype:						: "tahoe"
312enddef	:
313
314
315newdef	: defined(tahoe)
316comment	: Harris Tahoe
317vendor	:						: "harris"
318hosttype:						: "tahoe"
319machtype:						: "tahoe"
320enddef	:
321
322
323newdef	: defined(ibm032)
324comment	: RT running IBM AOS4.3 or MACH
325vendor	:						: "ibm"
326hosttype:						: "rt"
327ostype	: defined(MACH)					: "mach"
328ostype	: 						: "aos"
329machtype:						: "ibm032"
330enddef	:
331
332
333newdef	: defined(aiws)
334comment	: RT running IBM aix2.x
335vendor	:						: "ibm"
336hosttype:						: "rtpc"
337ostype	:						: "aix"
338machtype:						: "ibm032"
339enddef	:
340
341
342newdef	: defined(_AIX370)
343comment	: IBM/370 running aix
344vendor	:						: "ibm"
345hosttype:						: "aix370"
346ostype	:						: "aix"
347machtype:						: "ibm370"
348enddef	:
349
350
351newdef	: defined(_IBMESA)
352comment	: IBM/ESA running aix
353vendor	:						: "ibm"
354hosttype:						: "aixESA"
355ostype	:						: "aix"
356machtype:						: "esa"
357enddef	:
358
359
360newdef	: defined(_IBMR2)
361comment	: IBM/RS6000 running aix
362vendor	:						: "ibm"
363hosttype:						: "rs6000"
364ostype	:						: "aix"
365machtype:						: "rs6000"
366enddef	:
367
368
369newdef	: defined(_AIXPS2)
370comment	: IBM/PS2 running aix
371vendor	:						: "ibm"
372hosttype:						: "ps2"
373ostype	:						: "aix"
374machtype:						: "i386"
375enddef	:
376
377
378newdef	: defined(OREO)
379comment	: Macintosh running AU/X
380vendor	:						: "apple"
381hosttype:						: "mac2"
382ostype	:						: "aux"
383machtype: defined(mc68020)				: "m68k"
384enddef	:
385
386
387newdef	: defined(u3b20d)
388comment	: AT&T 3B/20 series running SVR2/3 
389vendor	:						: "att"
390hosttype:						: "att3b20"
391machtype:						: "u3b20"
392enddef	:
393
394
395newdef	: defined(u3b15)
396comment	: AT&T 3B/15 series running SVR2/3 
397vendor	:						: "att"
398hosttype:						: "att3b15"
399machtype:						: "u3b15"
400enddef	:
401
402
403newdef	: defined(u3b5)
404comment	: AT&T 3B/5 series running SVR2/3 
405vendor	:						: "att"
406hosttype:						: "att3b5"
407machtype:						: "u3b5"
408enddef	:
409
410
411newdef	: defined(u3b2)
412comment	: AT&T 3B/2 series running SVR2/3 
413vendor	:						: "att"
414hosttype:						: "att3b2"
415machtype:						: "u3b2"
416enddef	:
417
418
419newdef	: defined(UNIXPC)
420comment	: AT&T UnixPC att3b1/att7300
421vendor	:						: "att"
422hosttype:						: "unixpc"
423machtype: defined(u3b1)					: "u3b1"
424machtype: defined(att7300)				: "att7300"
425enddef	:
426
427
428newdef	: defined(_MINIX)
429comment	: Andy Tanenbaum's minix
430vendor	: defined(M_i386)				: "intel"
431hosttype: defined(M_i386)				: "minix386"
432hosttype:						: "minix"
433ostype	:						: "minix"
434machtype: defined(M_i386)				: "i386"
435enddef	:
436
437
438newdef	: defined(linux)
439comment	: Linus Torvalds's linux
440vendor	: defined(M_intel)				: "intel"
441hosttype: defined(M_i586) 				: "i586-linux"
442hosttype: defined(M_i486) 				: "i486-linux"
443hosttype: defined(M_i386)				: "i386-linux"
444ostype	: !defined(PPC) 				: "linux"
445ostype	: defined(PPC)					: "mklinux"
446machtype: defined(M_i586) 				: "i586"
447machtype: defined(M_i486) 				: "i486"
448machtype: defined(M_i386)				: "i386"
449vendor	: defined(__alpha)				: "dec"
450vendor	: defined(PPC)					: "apple"
451hosttype: defined(__alpha)				: "alpha"
452hosttype: defined(PPC)					: "powerpc"
453machtype: defined(__alpha)				: "alpha"
454machtype: defined(PPC)					: "powerpc"
455machtype: defined(M_mipsel)				: "mipsel"
456machtype: defined(M_mipseb)				: "mipseb"
457machtype: defined(M_mips64el)				: "mips64el"
458machtype: defined(M_mips64eb)				: "mips64eb"
459enddef	:
460
461
462newdef	: defined(__EMX__)
463comment	: OS/2 EMX [unix emulation under OS/2]
464vendor	: defined(M_intel)				: "intel"
465hosttype: defined(M_i386)				: "i386-emx"
466ostype	:						: "os2"
467machtype: defined(M_i386)				: "i386"
468enddef	:
469
470
471newdef	: defined(__NetBSD__) 
472comment	: NetBSD
473vendor	: defined(arm32) || defined(__arm__)		: "acorn"
474vendor	: defined(alpha)				: "digital"
475vendor	: defined(amiga)				: "commodore"
476vendor	: defined(atari)				: "atari"
477vendor	: defined(hp300)				: "hp"
478vendor	: defined(M_intel)				: "intel"
479vendor	: defined(m68k)					: "motorola"
480vendor	: defined(mac68k)				: "apple"
481vendor	: defined(pc532)				: "national-semi"
482vendor	: defined(pmax)					: "dec"
483vendor	: defined(mips)					: "mips"
484vendor	: defined(sparc)				: "sun"
485vendor	: defined(sun3)					: "sun"
486vendor	: defined(vax)					: "digital"
487hosttype: 						: "NetBSD"
488ostype	: 						: "NetBSD"
489machtype: defined(arm32) || defined(__APCS_32__)	: "arm32"
490machtype: defined(arm26) || defined(__APCS_26__)	: "arm26"
491machtype: defined(arm) || defined(__arm__)		: "arm"
492machtype: defined(sparc)				: "sparc"
493machtype: defined(mc68020)				: "m68k"
494machtype: defined(M_i386)				: "i386"
495machtype: defined(M_mipsel)				: "mipsel"
496machtype: defined(M_mipseb)				: "mipseb"
497machtype: defined(mips)					: "mips"
498machtype: defined(pc532)				: "pc532"
499machtype: defined(vax)					: "vax"
500machtype: defined(alpha)				: "alpha"
501enddef	:
502
503
504newdef	: defined(__FreeBSD__) 
505comment	: FreeBSD
506vendor	: defined(__alpha)				: "digital"
507vendor	: defined(M_intel)				: "intel"
508hosttype:						: "FreeBSD"
509ostype	:						: "FreeBSD"
510machtype: defined(__alpha)				: "alpha"
511machtype: defined(M_i386)				: "i386"
512enddef	:
513
514
515newdef	: defined(__386BSD__)
516comment	: Bill Jolitz's 386BSD
517vendor	: defined(M_intel)				: "intel"
518hosttype:						: "386BSD"
519ostype	:						: "386BSD"
520machtype:						: "i386"
521enddef	:
522
523
524newdef	: defined(bsdi)
525comment	: BSDI's unix
526vendor	: defined(M_intel)				: "intel"
527vendor	: defined(sparc)				: "sun"
528vendor	: defined(__powerpc__)				: "motorola"
529hosttype: defined(M_intel)				: "bsd386"
530hosttype: defined(sparc)				: "bsd-sparc"
531hosttype: defined(__powerpc__)				: "bsd-powerpc"
532ostype	:						: "bsdi"
533machtype: defined(M_i386)				: "i386"
534machtype: defined(sparc)				: "sparc"
535machtype: defined(__powerpc__)				: "powerpc"
536enddef	:
537
538
539newdef	: defined(COHERENT)
540comment	: COHERENT's unix
541vendor	: defined(_I386)				: "intel"
542hosttype:						: "coh386"
543hosttype:						: "coherent"
544ostype	:						: "coherent"
545machtype: defined(_I386)				: "i386"
546enddef	:
547
548newdef	: defined(concurrent)
549comment	: Concurrent PowerHawk
550vendor	:						: "concurrent"
551hosttype:						: "powerhawk"
552ostype	:						: "powermax_os"
553machtype:						: "powerhawk"
554enddef	:
555
556newdef	: defined(SCO)
557comment	: SCO UNIX System V/386 Release 3.2
558vendor	:						: "sco"
559hosttype:						: "sco386"
560ostype	:						: "sco_unix"
561machtype:						: "i386"
562enddef	:
563
564newdef	: defined(M_XENIX) && !defined(M_UNIX)
565comment	: SCO XENIX
566vendor	:						: "sco"
567hosttype:						: "sco_xenix"
568ostype	:						: "sco_xenix"
569machtype: defined(M_I386)				: "i386"
570machtype: defined(M_I286)				: "i286"
571enddef	:
572
573
574newdef	: defined(ISC) || defined(ISC202)
575comment	: Interactive Unix
576vendor	:						: "isc"
577hosttype:						: "isc386"
578ostype	: defined(POSIX)				: "POSIX"
579ostype	: 						: "SVR3"
580machtype: defined(M_i386)				: "i386"
581enddef	:
582
583
584newdef	: defined(INTEL)
585comment	: Intel Unix
586vendor	:						: "intel"
587hosttype:						: "intel386"
588ostype	:						: "intel_unix"
589machtype: defined(M_i386)				: "i386"
590enddef	:
591
592
593newdef	: defined(MACH)
594comment	: cmu's mach
595vendor	:						: "cmu"
596hosttype: defined(M_i386)				: "i386-mach"
597ostype	:						: "mach"
598machtype: defined(M_i386)				: "i386"
599enddef	:
600
601
602newdef	: defined(alliant)
603comment	: Alliants FSX
604vendor	:						: "alliant"
605hosttype: defined(mc68000)				: "alliant-fx80"
606hosttype: defined(i860)					: "alliant-fx2800"
607hosttype:						: "alliant"
608ostype	:						: "fsx"
609machtype: defined(mc68000)				: "mc68000"
610machtype: defined(i860)					: "i860"
611enddef	:
612
613
614newdef	: defined(_FTX)
615comment	: Stratus Computer, Inc FTX2 (i860 based)
616comment	: Stratus Computer, Inc FTX3 (HPPA based)
617vendor	:						: "stratus"
618hosttype: defined(i860) && defined(_FTX)		: "atlantic"
619hosttype: defined(__hppa) && defined(_FTX)		: "continuum"
620ostype	: defined(i860) && defined(_FTX)		: "ftx2"
621ostype	: defined(__hppa) && defined(_FTX)		: "ftx3"
622machtype: defined(i860)					: "i860"
623machtype: defined(__hppa)				: "hppa"
624enddef	:
625
626
627newdef	: defined(sequent) || defined(_SEQUENT_)
628comment	: Sequent Balance (32000 based)
629comment	: Sequent Symmetry running DYNIX/ptx (386/486 based)
630comment	: Sequent Symmetry running DYNIX 3 (386/486 based)
631vendor	:						: "sequent"
632hosttype: defined(M_i386) && defined(sequent)		: "symmetry"
633hosttype: defined(M_i386)				: "ptx"
634hosttype: 						: "balance"
635ostype	: defined(M_i386) && !defined(sequent)		: "ptx"
636ostype	: 						: "dynix3"
637machtype: defined(M_i386)				: "i386"
638machtype: defined(ns32000)				: "ns32000"
639enddef	:
640
641
642newdef	: defined(ns32000)
643comment	: Encore Computer Corp. Multimax (32000 based)
644vendor	:						: "encore"
645hosttype: defined(CMUCS)				: "multimax"
646hosttype: 						: isamultimax(0)
647ostype	: defined(CMUCS)				: "mach"
648ostype	:						: isamultimax(1)
649machtype:						: "ns32000"
650enddef	:
651
652
653newdef	: defined(iconuxv)
654comment	: Icon 88k running Unix
655vendor	:						: "icon"
656hosttype:						: "icon"
657ostype	:						: "iconuxv"
658machtype: defined(m88k) || defined(__m88k__)		: "m88k"
659enddef	:
660
661
662newdef	: defined(_CRAY) && defined(_CRAYCOM)
663comment	: Cray Computer Corp. running CSOS
664vendor	:						: "ccc"
665hosttype: defined(_CRAY2)				: "cray"
666hosttype: defined(_CRAY3)				: "cray"
667hosttype: defined(_CRAY4)				: "cray"
668ostype	:						: "CSOS"
669machtype: defined(_CRAY2)				: "cray2"
670machtype: defined(_CRAY3)				: "cray3"
671machtype: defined(_CRAY4)				: "cray4"
672enddef	:
673
674
675newdef	: defined(cray) && !defined(_CRAYMPP)
676comment	: Cray Research Inc. PVP running UNICOS
677vendor	:						: "cri"
678hosttype:						: getcray()
679ostype	:						: "unicos"
680machtype:						: getcray()
681enddef	:
682
683
684newdef  : defined(cray) && defined(_CRAYT3D)
685comment : Cray Research Inc. running UNICOS MAX
686vendor  :                                               : "cri"
687hosttype:                                               : getcray()
688ostype  :                                               : "unicosmax"
689machtype:                                               : getcray()
690enddef  :
691
692
693newdef	: defined(cray) && defined(_CRAYT3E)
694comment	: Cray Research Inc. running UNICOS/mk
695vendor	:						: "cri"
696hosttype:						: getcray()
697ostype	:						: "unicosmk"
698machtype:						: getcray()
699enddef	:
700
701
702newdef	: defined(convex)
703comment	: Convex
704vendor	: 						: "convex"
705hosttype:						: "convex"
706ostype	:						: "convexos"
707machtype:						: getconvex()
708enddef	:
709
710
711newdef	: defined(butterfly)
712comment	: BBN Butterfly 1000
713vendor	:						: "bbn"
714hosttype:						: "butterfly"
715machtype: defined(mc68020) || defined(__mc68020__)	: "m68k"
716enddef	:
717
718
719newdef	: defined(NeXT)
720comment	: NeXTStep
721vendor	:						: "next"
722hosttype: defined(mc68020) || defined(__mc68020__)	: "next"
723hosttype: defined(M_i386)  || defined(__i386__)		: "intel-pc"
724hosttype: defined(hppa)    || defined(__hppa__)		: "hp"
725hosttype: defined(sparc)   || defined(__sparc__)	: "sun"
726ostype	:						: "nextstep"
727machtype: defined(mc68020) || defined(__mc68020__)	: "m68k"
728machtype: defined(M_i386)  || defined(__i386__)		: "i386"
729machtype: defined(hppa)    || defined(__hppa__)		: "hppa"
730machtype: defined(sparc)   || defined(__sparc__)	: "sparc"
731enddef	:
732
733
734newdef	: defined(__APPLE__) && defined(__MACH__)
735comment	: OS X
736vendor	:						: "apple"
737hosttype: defined(__i386__)				: "intel-pc"
738hosttype: defined(__ppc__)				: "powermac"
739ostype	:						: "darwin"
740machtype: defined(__i386__)				: "i386"
741machtype: defined(__ppc__)				: "powerpc"
742enddef	:
743
744
745newdef	: defined(sony_news)
746comment	: Sony NEWS 800 or 1700 workstation
747vendor	:						: "sony"
748hosttype: defined(mips)					: "news_mips"
749hosttype: defined(mc68020) || defined(__mc68020__)	: "news_m68k"
750ostype	:						: "News"
751machtype: defined(mc68020) || defined(__mc68020__)	: "m68k"
752machtype: defined(M_mipsel)				: "mipsel"
753machtype: defined(M_mipseb)				: "mipseb"
754enddef	:
755
756
757newdef	: defined(sgi)
758comment	: Silicon Graphics
759vendor	:						: "sgi"
760hosttype: defined(M_mipsel)				: "iris4d"
761hosttype: defined(M_mipseb)				: "iris4d"
762hosttype: defined(mc68000) 				: "iris3d"
763ostype	:						: "irix"
764machtype: defined(M_mipsel)				: "mipsel"
765machtype: defined(M_mipseb)				: "mipseb"
766machtype: defined(mc68000) 				: "mc68000"
767enddef	:
768
769
770newdef	: defined(ultrix) || defined(__ultrix)
771comment	: Digital's Ultrix 
772vendor	:						: "dec"
773hosttype: defined(M_mipsel)				: "decstation"
774hosttype: defined(M_mipseb)				: "decmips"
775hosttype: defined(vax) || defined(__vax)		: "vax"
776hosttype: defined(__vax__) 				: "vax"
777ostype	:						: "ultrix"
778machtype: defined(M_mipsel)				: "mipsel"
779machtype: defined(M_mipseb)				: "mipseb"
780machtype: defined(vax) || defined (__vax)		: "vax"
781hosttype: defined(__vax__) 				: "vax"
782enddef	:
783
784
785newdef	: defined(MIPS)
786comment	: Mips OS
787vendor	:						: "mips"
788hosttype: defined(M_mipsel) 				: "mips"
789hosttype: defined(M_mipseb)				: "mips"
790ostype	:						: "mips"
791machtype: defined(M_mipsel)				: "mipsel"
792machtype: defined(M_mipseb)				: "mipseb"
793enddef	:
794
795
796newdef	: defined(DECOSF1)
797comment	: Digital's alpha running osf1
798vendor	:						: "dec"
799ostype	:						: "osf1"
800hosttype: defined(__alpha)				: "alpha"
801machtype: defined(__alpha)				: "alpha"
802enddef	:
803
804
805newdef	: defined(Lynx)
806comment	: Lynx OS 2.1
807vendor	:						: "Lynx"
808hosttype: defined(M_mipsel)				: "lynxos-mips"
809hosttype: defined(M_mipseb)				: "lynxos-mips"
810hosttype: defined(M_i386)				: "lynxos-i386"
811hosttype: defined(i860) || defined(__i860__)		: "lynxos-i860"
812hosttype: defined(m68k)					: "lynxos-m68k"
813hosttype: defined(m88k)					: "lynxos-m88k"
814hosttype: defined(sparc)				: "lynxos-sparc"
815hosttype: 						: "lynxos-unknown"
816ostype	:						: "LynxOS"
817machtype: defined(M_mipsel)				: "mipsel"
818machtype: defined(M_mipseb)				: "mipseb"
819machtype: defined(M_i386)				: "i386"
820machtype: defined(i860) || defined(__i860__)		: "i860"
821machtype: defined(m68k)					: "m68k"
822machtype: defined(m88k)					: "m88k"
823machtype: defined(sparc)				: "sparc"
824enddef	:
825
826
827newdef	: defined(masscomp)
828comment	: Masscomp
829vendor	:						: "masscomp"
830hosttype:						: "masscomp"
831ostype	:						: "masscomp"
832enddef	:
833
834newdef	: defined(__MACHTEN__)
835comment	: Machintosh
836vendor	:						: "Tenon"
837hosttype:						: "Macintosh"
838ostype	: 						: "MachTen"
839machtype:						: "Macintosh"
840enddef	:
841
842
843
844newdef	: defined(GOULD_NP1)
845comment	: Gould
846vendor	:						: "gould"
847hosttype:						: "gould_np1"
848machtype:						: "gould"
849enddef	:
850
851
852newdef	: defined(MULTIFLOW)
853comment	: Multiflow running 4.3BSD
854vendor	:						: "multiflow"
855hosttype:						: "multiflow"
856machtype:						: "multiflow"
857ostype	:						: "bsd43"
858enddef	:
859
860
861newdef	: defined(SXA)
862comment	: PFU/Fujitsu A-xx computer
863vendor	:						: "sxa"
864hosttype:						: "pfa50"
865ostype	: defined(_BSDX_)				: "e60-bsdx"
866ostype	: 						: "e60"
867machtype:						: "pfa50"
868enddef	:
869
870
871newdef	: defined(titan)
872comment	: (St)Ardent Titan
873vendor	:						: "ardent"
874hosttype:						: "titan"
875enddef	:
876
877
878newdef	: defined(stellar)
879comment	: Stellar
880vendor	:						: "stellar"
881hosttype:						: "stellar"
882ostype	:						: "stellix"
883enddef	:
884
885
886newdef	: defined(atari)
887comment	: Atari TT running SVR4. This machine was never
888comment	: commercially available.
889vendor	:						: "atari"
890hosttype:						: "atari"
891ostype	:						: "asv"
892enddef	:
893
894
895newdef	: defined(OPUS)
896comment	: ???
897vendor	:						: "opus"
898hosttype:						: "opus"
899enddef	:
900
901
902newdef	: defined(eta10)
903comment	: ETA running SVR3
904vendor	:						: "eta"
905hosttype:						: "eta10"
906enddef	:
907
908
909newdef	: defined(hk68)
910comment	: Heurikon HK68 running Uniplus+ 5.0
911vendor	:						: "heurikon"
912hosttype:						: "hk68"
913ostype	:						: "uniplus"
914enddef	:
915
916
917newdef	: defined(NDIX)
918comment	: Norsk Data ND 500/5000 running Ndix
919vendor	:						: "norsk"
920hosttype:						: "nd500"
921ostype	:						: "ndix"
922enddef	:
923
924
925newdef	: defined(AMIGA)
926comment	: Amiga running AmigaOS+GG
927vendor	:						: "commodore"
928hosttype:						: "amiga"
929ostype	:						: "AmigaOS"
930machtype:						: "m68k"
931enddef	:
932
933
934newdef	: defined(uts)
935comment	: Amdahl running uts 2.1
936vendor	: 						: "amdahl"
937hosttype:						: "amdahl"
938ostype	:						: "uts"
939machtype:						: "amdahl"
940enddef	:
941
942
943newdef	: defined(UTek)
944comment	: Tektronix 4300 running UTek (BSD 4.2 / 68020 based)
945vendor	:						: "tektronix"
946hosttype: 						: "tek4300"
947enddef	:
948
949
950newdef	: defined(UTekV)
951comment	: Tektronix XD88/10 running UTekV 3.2e (SVR3/88100 based)
952vendor	:						: "tektronix"
953hosttype: 						: "tekXD88"
954enddef	:
955
956
957newdef	: defined(__DGUX__)
958comment	: Data-General AViiON running DGUX
959hosttype:						: "aviion"
960ostype	:						: "dgux"
961vendor	:						: "dg"
962machtype: defined(__m88k__)				: "m88k"
963machtype: defined(__i386__)				: "pentium"
964enddef	:
965
966
967newdef	: defined(sysV68)
968comment	: Motorola MPC running System V/68 R32V2 (SVR3/68020 based)
969vendor	:						: "motorola"
970hosttype: 						: "sysV68"
971machtype:						: "m68k"
972enddef	:
973
974
975newdef	: defined(supermax)
976comment	: DDE Supermax running System V/68 R3 (SVR3/68020 based)
977vendor	:						: "supermax"
978hosttype: 						: "supermax"
979machtype:						: "m68k"
980enddef	:
981
982
983newdef	: defined(sysV88)
984comment	: Motorola MPC running System V/88 R32V2 (SVR3/88100 based)
985vendor	:						: "motorola"
986hosttype: 						: "sysV88"
987machtype:						: "m88k"
988enddef	:
989
990
991newdef	: defined(__clipper__)
992comment	: Clipper Chipset (Intergraph)
993vendor	:						: "intergraph"
994hosttype:						: "clipper"
995machtype:						: "clipper"
996enddef	:
997
998
999newdef	: defined(SNI) || defined(sinix)
1000comment	: Siemens Nixdorf Informationssysteme SINIX
1001vendor	:						: "sni"
1002hosttype: defined(M_intel)				: "wx200i"
1003hosttype: defined(MIPSEB)				: "rm400"
1004ostype	: defined(sinix)				: "sinix"
1005machtype: defined(M_i586)				: "i586"
1006machtype: defined(M_i486)				: "i486"
1007machtype: defined(M_i386)				: "i386"
1008machtype: defined(M_mipsel)				: "mipsel"
1009machtype: defined(M_mipseb)				: "mipseb"
1010machtype:						: "mips"
1011enddef	:
1012
1013newdef	: defined(_OSD_POSIX)
1014comment	: Siemens Nixdorf Informationssysteme BS2000 POSIX (mainframe, EBCDIC)
1015vendor	:						: "sni"
1016hosttype: defined(M_intel)				: "bs2000"
1017ostype	: 						: "posix"
1018machtype:						: "bs2000"
1019enddef	:
1020
1021newdef	: defined(__MVS__)
1022comment	: ibm uss s/390 (mainframe, EBCDIC)
1023vendor	:						: "ibm"
1024hosttype:					 	: "s390"
1025ostype	: 						: "os390"
1026machtype:						: "s390"
1027enddef	:
1028
1029newdef	: defined(_SX)
1030comment : NEC Corporation (SX-4)
1031vendor	: 						: "nec"
1032ostype	:						: "superux"
1033hosttype:						: "sx4"
1034machtype:						: "sx4"
1035enddef	:
1036
1037newdef  : !defined(SOLARIS2) && (SYSVREL == 4)
1038comment : Unix System V Release 4.0
1039vendor  : defined(DELL)					: "dell"
1040hosttype: defined(M_i386)				: "i386"
1041ostype  :						: "svr4"
1042machtype: defined(M_i386)				: "i386"
1043enddef	:
1044
1045newdef	: defined(__uxp__) || defined(__uxps__)
1046comment	: FUJITSU DS/90 7000
1047vendor	:						: "fujitsu"
1048hosttype:						: "ds90"
1049ostype	:						: "sysv4"
1050machtype:						: "sparc"
1051enddef	:
1052
1053newdef  : defined(_UWIN)
1054comment : AT&T Research Unix for Windows
1055vendor  :               				: "att"
1056hosttype:                       			: "win32.i386"
1057machtype:                       			: "i386"
1058enddef	:
1059
1060
1061newdef	: defined(mc68000) || defined(__mc68000__) || defined(mc68k32) || defined(m68k) || defined(mc68010) || defined(mc68020)
1062hosttype:						: "m68k"
1063vendor	: defined(m68k)					: "motorola"
1064machtype:						: "m68k"
1065enddef	:
1066
1067
1068newdef	: defined(m88k) || defined(__m88k__)
1069hosttype:						: "m88k"
1070machtype:						: "m88k"
1071enddef	:
1072
1073
1074newdef	: defined(M_intel)
1075hosttype: defined(M_i586)				: "i586"
1076hosttype: defined(M_i486)				: "i486"
1077hosttype: defined(M_i386)				: "i386"
1078vendor	: 						: "intel"
1079machtype: defined(M_i586)				: "i586"
1080machtype: defined(M_i486)				: "i486"
1081machtype: defined(M_i386)				: "i386"
1082enddef	:
1083
1084
1085newdef	: defined(sparc) || defined(__sparc__)
1086hosttype:						: "sparc"
1087machtype:						: "sparc"
1088enddef	:
1089
1090
1091newdef	: defined(i860) || defined(__i860__)
1092hosttype:						: "i860"
1093machtype:						: "i860"
1094enddef	:
1095
1096
1097newdef	: defined(osf1)
1098ostype	:						: "osf1"
1099enddef	:
1100
1101
1102newdef	: SYSVREL == 0
1103ostype	: defined(BSD4_4)				: "bsd44"
1104ostype	: defined(BSD)					: "bsd"
1105ostype	: defined(POSIX)				: "posix"
1106enddef	:
1107
1108
1109newdef	: SYSVREL == 1
1110ostype	: 						: "svr1"
1111enddef	:
1112
1113
1114newdef	: SYSVREL == 2
1115ostype	: 						: "svr2"
1116enddef	:
1117
1118
1119newdef	: SYSVREL == 3
1120ostype	: 						: "svr3"
1121enddef	:
1122
1123
1124newdef	: SYSVREL == 4
1125ostype	: 						: "svr4"
1126enddef	:
1127
1128
1129newcode	:
1130#ifndef _hosttype_
1131    hosttype = "unknown";
1132#endif
1133#ifndef _ostype_
1134    ostype = "unknown";
1135#endif
1136#ifndef _vendor_
1137    vendor = "unknown";
1138#endif
1139#ifndef _machtype_
1140    machtype = "unknown";
1141#endif
1142    tsetenv(STRHOSTTYPE, str2short(hosttype));
1143    tsetenv(STRVENDOR,   str2short(vendor));
1144    tsetenv(STROSTYPE,   str2short(ostype));
1145    tsetenv(STRMACHTYPE, str2short(machtype));
1146} /* end setmachine */
1147endcode	:
1148