host.defs revision 145479
1newcode	:
2/* $Header: /src/pub/tcsh/host.defs,v 1.40 2005/03/03 16:49:15 kim Exp $ */
3/*
4 * host.defs: Hosttype/Machtype etc.
5 */
6/*-
7 * Copyright (c) 1980, 1991 The Regents of the University of California.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the University nor the names of its contributors
19 *    may be used to endorse or promote products derived from this software
20 *    without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34#include "sh.h"
35
36RCSID("$Id: host.defs,v 1.40 2005/03/03 16:49:15 kim Exp $")
37
38endcode	:
39
40macro	: M_mips64el : (defined(mips64) || defined(__mips64)) && (defined(MIPSEL) || defined(__MIPSEL))
41macro	: M_mips64eb : (defined(mips64) || defined(__mips64)) && (defined(MIPSEB) || defined(__MIPSEB))
42macro	: M_mipsel : (!defined(M_mips64el)) && (defined(mips) || defined(__mips)) && (defined(MIPSEL) || defined(__MIPSEL))
43macro	: M_mipseb : (!defined(M_mips64eb)) && (defined(mips) || defined(__mips)) && (defined(MIPSEB) || defined(__MIPSEB))
44macro	: M_i386 : (defined(i386) || defined(__i386__))
45macro	: M_i486 : (defined(i486) || defined(__i486__))
46macro	: M_i586 : (defined(i586) || defined(__i586__))
47macro	: M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
48
49newdef	: defined(ns32000)
50newcode	:
51static char *
52isamultimax(flag)
53    int flag;
54{
55    if (access("/Umax.image", F_OK) == 0)
56	return "multimax";
57    else 
58	return flag ? "mach" : "ns32000";
59}
60endcode	:
61enddef	:
62
63
64newdef	: defined(cray)
65newcode	:
66/*  
67 * On crays, find the current machine type via the target() syscall
68 * We need ctype.h to convert the name returned to lower case
69 */
70# include <sys/target.h> 
71# include <ctype.h>
72# include <string.h>
73
74/* From: hpa@hook.eecs.nwu.edu (H. Peter Anvin) */
75static char *
76getcray()
77{
78# ifdef MC_GET_SYSTEM /* If we have target() */
79    struct target data;
80
81    if (target(MC_GET_SYSTEM, &data) != -1) {
82	static char hosttype_buf[sizeof(data.mc_pmt)+1];
83	char *p = (char *) &(data.mc_pmt);
84	char *q = hosttype_buf;
85	int n;
86
87	/* 
88	 * Copy to buffer and convert to lower case 
89	 * String may not be null-terminated, so keep a counter
90	 */
91	for (n = 0; *p && n < sizeof(data.mc_pmt); n++)
92	  *q++ = tolower(p[n]);
93
94	*q = '\0';
95
96	/* replace dashes with underscores if present */
97	while ((q = strchr(hosttype_buf, '-')) != NULL)
98	    *q = '_';
99	return hosttype_buf; 	/* Return in static buffer */
100    }
101    else
102# endif /* MC_GET_SYSTEM */
103	return "cray";		/* target() failed */
104}
105endcode	:
106enddef	:
107
108
109newdef	: defined(convex)
110newcode	:
111/*  
112 * On convex, find the current machine type via the getsysinfo() syscall
113 */
114#include <sys/sysinfo.h> 
115
116/* From: fox@convex.com (David DeSimone) */
117static char *
118getconvex()
119{
120    struct system_information  sysinfo;
121    static char  result[8];
122
123    if (getsysinfo(SYSINFO_SIZE, &sysinfo) == -1)
124	return "convex";
125
126    switch(sysinfo.cpu_type) {
127#ifdef SI_CPUTYPE_C1
128    case SI_CPUTYPE_C1:
129	return "c1";
130#endif
131
132#ifdef SI_CPUTYPE_C2
133    case SI_CPUTYPE_C2:
134	return "c2";
135#endif
136
137#ifdef SI_CPUTYPE_C2MP
138    case SI_CPUTYPE_C2MP:
139	(void) strcpy(result, "c2X0");
140	result[2] = sysinfo.cpu_count + '0';
141	return result;
142#endif
143
144#ifdef SI_CPUTYPE_C34
145    case SI_CPUTYPE_C34:
146	(void) strcpy(result, "c34X0");
147	result[3] = sysinfo.cpu_count + '0';
148	return result;
149#endif
150
151#ifdef SI_CPUTYPE_C38
152    case SI_CPUTYPE_C38:
153	(void) strcpy(result, "c38X0");
154	result[3] = sysinfo.cpu_count + '0';
155	return result;
156#endif
157
158#ifdef SI_CPUTYPE_C46
159    case SI_CPUTYPE_C46:
160	(void) strcpy(result, "c46X0");
161	result[3] = sysinfo.cpu_count + '0';
162	return result;
163#endif
164
165    default:
166	return "convex";
167    }
168}
169endcode	:
170enddef	:
171
172
173newcode	:
174void
175getmachine()
176{
177     const char *hosttype;
178     const char *ostype;
179     const char *vendor;
180     const char *machtype;
181
182endcode	:
183
184
185newdef	: defined(HOSTTYPE)
186hosttype:						: HOSTTYPE
187enddef	:
188
189
190newdef	: defined(__PARAGON__)
191comment	: Intel Paragon running OSF/1
192vendor	:						: "intel"
193hosttype:						: "paragon"
194ostype	:						: "osf1"
195machtype: defined(M_i386) 				: "i386"
196enddef	:
197
198
199newdef	: 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) || defined(__GNU__) || defined(__GLIBC__)
439comment	: Linus Torvalds's linux
440vendor	: defined(M_intel)				: "intel"
441hosttype: defined(__ia64__)				: "ia64-linux"
442hosttype: defined(__powerpc64__)			: "powerpc64-linux"
443hosttype: defined(__s390x__)				: "s390x-linux"
444hosttype: defined(__s390__)				: "s390-linux"
445hosttype: defined(__x86_64__)				: "x86_64-linux"
446hosttype: defined(M_i586) 				: "i586-linux"
447hosttype: defined(M_i486) 				: "i486-linux"
448hosttype: defined(M_i386)				: "i386-linux"
449ostype	: !defined(PPC) 				: "linux"
450ostype	: defined(PPC)					: "mklinux"
451machtype: defined(__ia64__)				: "ia64"
452machtype: defined(__powerpc64__)			: "powerpc64"
453machtype: defined(__s390x__)				: "s390x"
454machtype: defined(__s390__)				: "s390"
455machtype: defined(__x86_64__)				: "x86_64"
456machtype: defined(M_i586) 				: "i586"
457machtype: defined(M_i486) 				: "i486"
458machtype: defined(M_i386)				: "i386"
459vendor	: defined(__alpha)				: "dec"
460vendor	: defined(PPC)					: "apple"
461hosttype: defined(__alpha)				: "alpha"
462hosttype: defined(PPC)					: "powerpc"
463machtype: defined(__alpha)				: "alpha"
464machtype: defined(PPC)					: "powerpc"
465machtype: defined(M_mipsel)				: "mipsel"
466machtype: defined(M_mipseb)				: "mipseb"
467machtype: defined(M_mips64el)				: "mips64el"
468machtype: defined(M_mips64eb)				: "mips64eb"
469enddef	:
470
471
472newdef	: defined(__EMX__)
473comment	: OS/2 EMX [unix emulation under OS/2]
474vendor	: defined(M_intel)				: "intel"
475hosttype: defined(M_i386)				: "i386-emx"
476ostype	:						: "os2"
477machtype: defined(M_i386)				: "i386"
478enddef	:
479
480
481newdef	: defined(__NetBSD__) 
482comment	: NetBSD
483vendor	: defined(arm32) || defined(__arm__)		: "acorn"
484vendor	: defined(alpha)				: "digital"
485vendor	: defined(amiga)				: "commodore"
486vendor	: defined(atari)				: "atari"
487vendor	: defined(hp300)				: "hp"
488vendor	: defined(M_intel)				: "intel"
489vendor	: defined(m68k)					: "motorola"
490vendor	: defined(mac68k)				: "apple"
491vendor	: defined(pc532)				: "national-semi"
492vendor	: defined(pmax)					: "dec"
493vendor	: defined(mips)					: "mips"
494vendor	: defined(sparc)				: "sun"
495vendor	: defined(sun3)					: "sun"
496vendor	: defined(vax)					: "digital"
497hosttype: 						: "NetBSD"
498ostype	: 						: "NetBSD"
499machtype: defined(arm32) || defined(__APCS_32__)	: "arm32"
500machtype: defined(arm26) || defined(__APCS_26__)	: "arm26"
501machtype: defined(arm) || defined(__arm__)		: "arm"
502machtype: defined(sparc)				: "sparc"
503machtype: defined(mc68020)				: "m68k"
504machtype: defined(M_i386)				: "i386"
505machtype: defined(M_mipsel)				: "mipsel"
506machtype: defined(M_mipseb)				: "mipseb"
507machtype: defined(mips)					: "mips"
508machtype: defined(pc532)				: "pc532"
509machtype: defined(vax)					: "vax"
510machtype: defined(alpha)				: "alpha"
511enddef	:
512
513
514newdef	: defined(__FreeBSD__) 
515comment	: FreeBSD
516vendor	: defined(__alpha)				: "digital"
517vendor	: defined(M_intel)				: "intel"
518hosttype:						: "FreeBSD"
519ostype	:						: "FreeBSD"
520machtype: defined(__alpha)				: "alpha"
521machtype: defined(M_i386)				: "i386"
522enddef	:
523
524
525newdef	: defined(__386BSD__)
526comment	: Bill Jolitz's 386BSD
527vendor	: defined(M_intel)				: "intel"
528hosttype:						: "386BSD"
529ostype	:						: "386BSD"
530machtype:						: "i386"
531enddef	:
532
533
534newdef	: defined(bsdi)
535comment	: BSDI's unix
536vendor	: defined(M_intel)				: "intel"
537vendor	: defined(sparc)				: "sun"
538vendor	: defined(__powerpc__)				: "motorola"
539hosttype: defined(M_intel)				: "bsd386"
540hosttype: defined(sparc)				: "bsd-sparc"
541hosttype: defined(__powerpc__)				: "bsd-powerpc"
542ostype	:						: "bsdi"
543machtype: defined(M_i386)				: "i386"
544machtype: defined(sparc)				: "sparc"
545machtype: defined(__powerpc__)				: "powerpc"
546enddef	:
547
548
549newdef	: defined(COHERENT)
550comment	: COHERENT's unix
551vendor	: defined(_I386)				: "intel"
552hosttype:						: "coh386"
553hosttype:						: "coherent"
554ostype	:						: "coherent"
555machtype: defined(_I386)				: "i386"
556enddef	:
557
558newdef	: defined(concurrent)
559comment	: Concurrent PowerHawk
560vendor	:						: "concurrent"
561hosttype:						: "powerhawk"
562ostype	:						: "powermax_os"
563machtype:						: "powerhawk"
564enddef	:
565
566newdef	: defined(SCO)
567comment	: SCO UNIX System V/386 Release 3.2
568vendor	:						: "sco"
569hosttype:						: "sco386"
570ostype	:						: "sco_unix"
571machtype:						: "i386"
572enddef	:
573
574newdef	: defined(M_XENIX) && !defined(M_UNIX)
575comment	: SCO XENIX
576vendor	:						: "sco"
577hosttype:						: "sco_xenix"
578ostype	:						: "sco_xenix"
579machtype: defined(M_I386)				: "i386"
580machtype: defined(M_I286)				: "i286"
581enddef	:
582
583
584newdef	: defined(ISC) || defined(ISC202)
585comment	: Interactive Unix
586vendor	:						: "isc"
587hosttype:						: "isc386"
588ostype	: defined(POSIX)				: "POSIX"
589ostype	: 						: "SVR3"
590machtype: defined(M_i386)				: "i386"
591enddef	:
592
593
594newdef	: defined(INTEL)
595comment	: Intel Unix
596vendor	:						: "intel"
597hosttype:						: "intel386"
598ostype	:						: "intel_unix"
599machtype: defined(M_i386)				: "i386"
600enddef	:
601
602
603newdef	: defined(MACH)
604comment	: cmu's mach
605vendor	:						: "cmu"
606hosttype: defined(M_i386)				: "i386-mach"
607ostype	:						: "mach"
608machtype: defined(M_i386)				: "i386"
609enddef	:
610
611
612newdef	: defined(alliant)
613comment	: Alliants FSX
614vendor	:						: "alliant"
615hosttype: defined(mc68000)				: "alliant-fx80"
616hosttype: defined(i860)					: "alliant-fx2800"
617hosttype:						: "alliant"
618ostype	:						: "fsx"
619machtype: defined(mc68000)				: "mc68000"
620machtype: defined(i860)					: "i860"
621enddef	:
622
623
624newdef	: defined(_FTX)
625comment	: Stratus Computer, Inc FTX2 (i860 based)
626comment	: Stratus Computer, Inc FTX3 (HPPA based)
627vendor	:						: "stratus"
628hosttype: defined(i860) && defined(_FTX)		: "atlantic"
629hosttype: defined(__hppa) && defined(_FTX)		: "continuum"
630ostype	: defined(i860) && defined(_FTX)		: "ftx2"
631ostype	: defined(__hppa) && defined(_FTX)		: "ftx3"
632machtype: defined(i860)					: "i860"
633machtype: defined(__hppa)				: "hppa"
634enddef	:
635
636
637newdef	: defined(sequent) || defined(_SEQUENT_)
638comment	: Sequent Balance (32000 based)
639comment	: Sequent Symmetry running DYNIX/ptx (386/486 based)
640comment	: Sequent Symmetry running DYNIX 3 (386/486 based)
641vendor	:						: "sequent"
642hosttype: defined(M_i386) && defined(sequent)		: "symmetry"
643hosttype: defined(M_i386)				: "ptx"
644hosttype: 						: "balance"
645ostype	: defined(M_i386) && !defined(sequent)		: "ptx"
646ostype	: 						: "dynix3"
647machtype: defined(M_i386)				: "i386"
648machtype: defined(ns32000)				: "ns32000"
649enddef	:
650
651
652newdef	: defined(ns32000)
653comment	: Encore Computer Corp. Multimax (32000 based)
654vendor	:						: "encore"
655hosttype: defined(CMUCS)				: "multimax"
656hosttype: 						: isamultimax(0)
657ostype	: defined(CMUCS)				: "mach"
658ostype	:						: isamultimax(1)
659machtype:						: "ns32000"
660enddef	:
661
662
663newdef	: defined(iconuxv)
664comment	: Icon 88k running Unix
665vendor	:						: "icon"
666hosttype:						: "icon"
667ostype	:						: "iconuxv"
668machtype: defined(m88k) || defined(__m88k__)		: "m88k"
669enddef	:
670
671
672newdef	: defined(_CRAY) && defined(_CRAYCOM)
673comment	: Cray Computer Corp. running CSOS
674vendor	:						: "ccc"
675hosttype: defined(_CRAY2)				: "cray"
676hosttype: defined(_CRAY3)				: "cray"
677hosttype: defined(_CRAY4)				: "cray"
678ostype	:						: "CSOS"
679machtype: defined(_CRAY2)				: "cray2"
680machtype: defined(_CRAY3)				: "cray3"
681machtype: defined(_CRAY4)				: "cray4"
682enddef	:
683
684
685newdef	: defined(cray) && !defined(_CRAYMPP)
686comment	: Cray Research Inc. PVP running UNICOS
687vendor	:						: "cri"
688hosttype:						: getcray()
689ostype	:						: "unicos"
690machtype:						: getcray()
691enddef	:
692
693
694newdef  : defined(cray) && defined(_CRAYT3D)
695comment : Cray Research Inc. running UNICOS MAX
696vendor  :                                               : "cri"
697hosttype:                                               : getcray()
698ostype  :                                               : "unicosmax"
699machtype:                                               : getcray()
700enddef  :
701
702
703newdef	: defined(cray) && defined(_CRAYT3E)
704comment	: Cray Research Inc. running UNICOS/mk
705vendor	:						: "cri"
706hosttype:						: getcray()
707ostype	:						: "unicosmk"
708machtype:						: getcray()
709enddef	:
710
711
712newdef	: defined(convex)
713comment	: Convex
714vendor	: 						: "convex"
715hosttype:						: "convex"
716ostype	:						: "convexos"
717machtype:						: getconvex()
718enddef	:
719
720
721newdef	: defined(butterfly)
722comment	: BBN Butterfly 1000
723vendor	:						: "bbn"
724hosttype:						: "butterfly"
725machtype: defined(mc68020) || defined(__mc68020__)	: "m68k"
726enddef	:
727
728
729newdef	: defined(NeXT)
730comment	: NeXTStep
731vendor	:						: "next"
732hosttype: defined(mc68020) || defined(__mc68020__)	: "next"
733hosttype: defined(M_i386)  || defined(__i386__)		: "intel-pc"
734hosttype: defined(hppa)    || defined(__hppa__)		: "hp"
735hosttype: defined(sparc)   || defined(__sparc__)	: "sun"
736ostype	:						: "nextstep"
737machtype: defined(mc68020) || defined(__mc68020__)	: "m68k"
738machtype: defined(M_i386)  || defined(__i386__)		: "i386"
739machtype: defined(hppa)    || defined(__hppa__)		: "hppa"
740machtype: defined(sparc)   || defined(__sparc__)	: "sparc"
741enddef	:
742
743
744newdef	: defined(__APPLE__) && defined(__MACH__)
745comment	: OS X
746vendor	:						: "apple"
747hosttype: defined(__i386__)				: "intel-pc"
748hosttype: defined(__ppc__)				: "powermac"
749ostype	:						: "darwin"
750machtype: defined(__i386__)				: "i386"
751machtype: defined(__ppc__)				: "powerpc"
752enddef	:
753
754
755newdef	: defined(sony_news)
756comment	: Sony NEWS 800 or 1700 workstation
757vendor	:						: "sony"
758hosttype: defined(mips)					: "news_mips"
759hosttype: defined(mc68020) || defined(__mc68020__)	: "news_m68k"
760ostype	:						: "News"
761machtype: defined(mc68020) || defined(__mc68020__)	: "m68k"
762machtype: defined(M_mipsel)				: "mipsel"
763machtype: defined(M_mipseb)				: "mipseb"
764enddef	:
765
766
767newdef	: defined(sgi)
768comment	: Silicon Graphics
769vendor	:						: "sgi"
770hosttype: defined(M_mipsel)				: "iris4d"
771hosttype: defined(M_mipseb)				: "iris4d"
772hosttype: defined(mc68000) 				: "iris3d"
773ostype	:						: "irix"
774machtype: defined(M_mipsel)				: "mipsel"
775machtype: defined(M_mipseb)				: "mipseb"
776machtype: defined(mc68000) 				: "mc68000"
777enddef	:
778
779
780newdef	: defined(ultrix) || defined(__ultrix)
781comment	: Digital's Ultrix 
782vendor	:						: "dec"
783hosttype: defined(M_mipsel)				: "decstation"
784hosttype: defined(M_mipseb)				: "decmips"
785hosttype: defined(vax) || defined(__vax)		: "vax"
786hosttype: defined(__vax__) 				: "vax"
787ostype	:						: "ultrix"
788machtype: defined(M_mipsel)				: "mipsel"
789machtype: defined(M_mipseb)				: "mipseb"
790machtype: defined(vax) || defined (__vax)		: "vax"
791hosttype: defined(__vax__) 				: "vax"
792enddef	:
793
794
795newdef	: defined(MIPS)
796comment	: Mips OS
797vendor	:						: "mips"
798hosttype: defined(M_mipsel) 				: "mips"
799hosttype: defined(M_mipseb)				: "mips"
800ostype	:						: "mips"
801machtype: defined(M_mipsel)				: "mipsel"
802machtype: defined(M_mipseb)				: "mipseb"
803enddef	:
804
805
806newdef	: defined(DECOSF1)
807comment	: Digital's alpha running osf1
808vendor	:						: "dec"
809ostype	:						: "osf1"
810hosttype: defined(__alpha)				: "alpha"
811machtype: defined(__alpha)				: "alpha"
812enddef	:
813
814
815newdef	: defined(Lynx)
816comment	: Lynx OS 2.1
817vendor	:						: "Lynx"
818hosttype: defined(M_mipsel)				: "lynxos-mips"
819hosttype: defined(M_mipseb)				: "lynxos-mips"
820hosttype: defined(M_i386)				: "lynxos-i386"
821hosttype: defined(i860) || defined(__i860__)		: "lynxos-i860"
822hosttype: defined(m68k)					: "lynxos-m68k"
823hosttype: defined(m88k)					: "lynxos-m88k"
824hosttype: defined(sparc)				: "lynxos-sparc"
825hosttype: 						: "lynxos-unknown"
826ostype	:						: "LynxOS"
827machtype: defined(M_mipsel)				: "mipsel"
828machtype: defined(M_mipseb)				: "mipseb"
829machtype: defined(M_i386)				: "i386"
830machtype: defined(i860) || defined(__i860__)		: "i860"
831machtype: defined(m68k)					: "m68k"
832machtype: defined(m88k)					: "m88k"
833machtype: defined(sparc)				: "sparc"
834enddef	:
835
836
837newdef	: defined(masscomp)
838comment	: Masscomp
839vendor	:						: "masscomp"
840hosttype:						: "masscomp"
841ostype	:						: "masscomp"
842enddef	:
843
844newdef	: defined(__MACHTEN__)
845comment	: Machintosh
846vendor	:						: "Tenon"
847hosttype:						: "Macintosh"
848ostype	: 						: "MachTen"
849machtype:						: "Macintosh"
850enddef	:
851
852
853
854newdef	: defined(GOULD_NP1)
855comment	: Gould
856vendor	:						: "gould"
857hosttype:						: "gould_np1"
858machtype:						: "gould"
859enddef	:
860
861
862newdef	: defined(MULTIFLOW)
863comment	: Multiflow running 4.3BSD
864vendor	:						: "multiflow"
865hosttype:						: "multiflow"
866machtype:						: "multiflow"
867ostype	:						: "bsd43"
868enddef	:
869
870
871newdef	: defined(SXA)
872comment	: PFU/Fujitsu A-xx computer
873vendor	:						: "sxa"
874hosttype:						: "pfa50"
875ostype	: defined(_BSDX_)				: "e60-bsdx"
876ostype	: 						: "e60"
877machtype:						: "pfa50"
878enddef	:
879
880
881newdef	: defined(titan)
882comment	: (St)Ardent Titan
883vendor	:						: "ardent"
884hosttype:						: "titan"
885enddef	:
886
887
888newdef	: defined(stellar)
889comment	: Stellar
890vendor	:						: "stellar"
891hosttype:						: "stellar"
892ostype	:						: "stellix"
893enddef	:
894
895
896newdef	: defined(atari)
897comment	: Atari TT running SVR4. This machine was never
898comment	: commercially available.
899vendor	:						: "atari"
900hosttype:						: "atari"
901ostype	:						: "asv"
902enddef	:
903
904
905newdef	: defined(OPUS)
906comment	: ???
907vendor	:						: "opus"
908hosttype:						: "opus"
909enddef	:
910
911
912newdef	: defined(eta10)
913comment	: ETA running SVR3
914vendor	:						: "eta"
915hosttype:						: "eta10"
916enddef	:
917
918
919newdef	: defined(hk68)
920comment	: Heurikon HK68 running Uniplus+ 5.0
921vendor	:						: "heurikon"
922hosttype:						: "hk68"
923ostype	:						: "uniplus"
924enddef	:
925
926
927newdef	: defined(NDIX)
928comment	: Norsk Data ND 500/5000 running Ndix
929vendor	:						: "norsk"
930hosttype:						: "nd500"
931ostype	:						: "ndix"
932enddef	:
933
934
935newdef	: defined(AMIGA)
936comment	: Amiga running AmigaOS+GG
937vendor	:						: "commodore"
938hosttype:						: "amiga"
939ostype	:						: "AmigaOS"
940machtype:						: "m68k"
941enddef	:
942
943
944newdef	: defined(uts)
945comment	: Amdahl running uts 2.1
946vendor	: 						: "amdahl"
947hosttype:						: "amdahl"
948ostype	:						: "uts"
949machtype:						: "amdahl"
950enddef	:
951
952
953newdef	: defined(UTek)
954comment	: Tektronix 4300 running UTek (BSD 4.2 / 68020 based)
955vendor	:						: "tektronix"
956hosttype: 						: "tek4300"
957enddef	:
958
959
960newdef	: defined(UTekV)
961comment	: Tektronix XD88/10 running UTekV 3.2e (SVR3/88100 based)
962vendor	:						: "tektronix"
963hosttype: 						: "tekXD88"
964enddef	:
965
966
967newdef	: defined(__DGUX__)
968comment	: Data-General AViiON running DGUX
969hosttype:						: "aviion"
970ostype	:						: "dgux"
971vendor	:						: "dg"
972machtype: defined(__m88k__)				: "m88k"
973machtype: defined(__i386__)				: "pentium"
974enddef	:
975
976
977newdef	: defined(sysV68)
978comment	: Motorola MPC running System V/68 R32V2 (SVR3/68020 based)
979vendor	:						: "motorola"
980hosttype: 						: "sysV68"
981machtype:						: "m68k"
982enddef	:
983
984
985newdef	: defined(supermax)
986comment	: DDE Supermax running System V/68 R3 (SVR3/68020 based)
987vendor	:						: "supermax"
988hosttype: 						: "supermax"
989machtype:						: "m68k"
990enddef	:
991
992
993newdef	: defined(sysV88)
994comment	: Motorola MPC running System V/88 R32V2 (SVR3/88100 based)
995vendor	:						: "motorola"
996hosttype: 						: "sysV88"
997machtype:						: "m88k"
998enddef	:
999
1000
1001newdef	: defined(__clipper__)
1002comment	: Clipper Chipset (Intergraph)
1003vendor	:						: "intergraph"
1004hosttype:						: "clipper"
1005machtype:						: "clipper"
1006enddef	:
1007
1008
1009newdef	: (defined(SNI) || defined(sinix)) && !defined(_OSD_POSIX)
1010comment	: Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): SINIX aka. ReliantUNIX, a SVR4 derivative
1011vendor	:						: "fsc"
1012hosttype: defined(M_intel)				: "wx200i"
1013hosttype: defined(MIPSEB)				: "rm400"
1014ostype	: defined(sinix)				: "sinix"
1015machtype: defined(M_i586)				: "i586"
1016machtype: defined(M_i486)				: "i486"
1017machtype: defined(M_i386)				: "i386"
1018machtype: defined(M_mipsel)				: "mipsel"
1019machtype: defined(M_mipseb)				: "mipseb"
1020machtype:						: "mips"
1021enddef	:
1022
1023newdef	: defined(_OSD_POSIX)
1024comment	: Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): BS2000 POSIX (mainframe, EBCDIC)
1025vendor	:						: "fsc"
1026hosttype:						: "bs2000"
1027ostype	:						: "osdposix"
1028machtype: #machine(7500)				: "s390"
1029machtype: #machine(mips)				: "mips"
1030machtype: #machine(sparc)				: "sparc"
1031machtype:						: "bs2000"
1032enddef	:
1033
1034newdef	: defined(__MVS__)
1035comment	: ibm uss s/390 (mainframe, EBCDIC)
1036vendor	:						: "ibm"
1037hosttype:					 	: "s390"
1038ostype	: 						: "os390"
1039machtype:						: "s390"
1040enddef	:
1041
1042newdef	: defined(_SX)
1043comment : NEC Corporation (SX-4)
1044vendor	: 						: "nec"
1045ostype	:						: "superux"
1046hosttype:						: "sx4"
1047machtype:						: "sx4"
1048enddef	:
1049
1050newdef  : !defined(SOLARIS2) && (SYSVREL == 4)
1051comment : Unix System V Release 4.0
1052vendor  : defined(DELL)					: "dell"
1053hosttype: defined(M_i386)				: "i386"
1054ostype  :						: "svr4"
1055machtype: defined(M_i386)				: "i386"
1056enddef	:
1057
1058newdef	: defined(__uxp__) || defined(__uxps__)
1059comment	: FUJITSU DS/90 7000
1060vendor	:						: "fujitsu"
1061hosttype:						: "ds90"
1062ostype	:						: "sysv4"
1063machtype:						: "sparc"
1064enddef	:
1065
1066newdef  : defined(_UWIN)
1067comment : AT&T Research Unix for Windows
1068vendor  :               				: "att"
1069hosttype:                       			: "win32.i386"
1070machtype:                       			: "i386"
1071enddef	:
1072
1073
1074newdef	: defined(mc68000) || defined(__mc68000__) || defined(mc68k32) || defined(m68k) || defined(mc68010) || defined(mc68020)
1075hosttype:						: "m68k"
1076vendor	: defined(m68k)					: "motorola"
1077machtype:						: "m68k"
1078enddef	:
1079
1080
1081newdef	: defined(m88k) || defined(__m88k__)
1082hosttype:						: "m88k"
1083machtype:						: "m88k"
1084enddef	:
1085
1086
1087newdef	: defined(M_intel)
1088hosttype: defined(M_i586)				: "i586"
1089hosttype: defined(M_i486)				: "i486"
1090hosttype: defined(M_i386)				: "i386"
1091vendor	: 						: "intel"
1092machtype: defined(M_i586)				: "i586"
1093machtype: defined(M_i486)				: "i486"
1094machtype: defined(M_i386)				: "i386"
1095enddef	:
1096
1097
1098newdef	: defined(sparc) || defined(__sparc__)
1099hosttype:						: "sparc"
1100machtype:						: "sparc"
1101enddef	:
1102
1103
1104newdef	: defined(i860) || defined(__i860__)
1105hosttype:						: "i860"
1106machtype:						: "i860"
1107enddef	:
1108
1109
1110newdef	: defined(osf1)
1111ostype	:						: "osf1"
1112enddef	:
1113
1114
1115newdef	: SYSVREL == 0
1116ostype	: defined(BSD4_4)				: "bsd44"
1117ostype	: defined(BSD)					: "bsd"
1118ostype	: defined(POSIX)				: "posix"
1119enddef	:
1120
1121
1122newdef	: SYSVREL == 1
1123ostype	: 						: "svr1"
1124enddef	:
1125
1126
1127newdef	: SYSVREL == 2
1128ostype	: 						: "svr2"
1129enddef	:
1130
1131
1132newdef	: SYSVREL == 3
1133ostype	: 						: "svr3"
1134enddef	:
1135
1136
1137newdef	: SYSVREL == 4
1138ostype	: 						: "svr4"
1139enddef	:
1140
1141
1142newcode	:
1143#ifndef _hosttype_
1144    hosttype = "unknown";
1145#endif
1146#ifndef _ostype_
1147    ostype = "unknown";
1148#endif
1149#ifndef _vendor_
1150    vendor = "unknown";
1151#endif
1152#ifndef _machtype_
1153    machtype = "unknown";
1154#endif
1155    tsetenv(STRHOSTTYPE, str2short(hosttype));
1156    tsetenv(STRVENDOR,   str2short(vendor));
1157    tsetenv(STROSTYPE,   str2short(ostype));
1158    tsetenv(STRMACHTYPE, str2short(machtype));
1159} /* end setmachine */
1160endcode	:
1161