xref: /freebsd/contrib/tcsh/host.defs (revision 732a02b4e77866604a120a275c082bb6221bd2ff)
1newcode :
2/*
3 * host.defs: Hosttype/Machtype etc.
4 */
5/*-
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 *    notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 *    notice, this list of conditions and the following disclaimer in the
16 *    documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 *    may be used to endorse or promote products derived from this software
19 *    without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33#include "sh.h"
34
35endcode :
36
37macro	: M_mips64el : (defined(mips64) && defined(MIPSEL))
38macro	: M_mips64eb : (defined(mips64) && defined(MIPSEB))
39macro	: M_mipsel : (!defined(M_mips64el) && defined(mips) && defined(MIPSEL))
40macro	: M_mipseb : (!defined(M_mips64eb) && defined(mips) && defined(MIPSEB))
41macro	: M_amd64: (defined(amd64) || defined(x86_64))
42macro	: M_i386 : defined(i386)
43macro	: M_i486 : defined(i486)
44macro	: M_i586 : defined(i586)
45macro	: M_i686 : defined(i686)
46macro	: M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
47
48newdef	: defined(ns32000)
49newcode :
50static char *
51isamultimax(int flag)
52{
53    if (access("/Umax.image", F_OK) == 0)
54	return "multimax";
55    else
56	return flag ? "mach" : "ns32000";
57}
58endcode :
59enddef	:
60
61
62newdef	: defined(cray)
63newcode :
64/*
65 * On crays, find the current machine type via the target() syscall
66 * We need ctype.h to convert the name returned to lower case
67 */
68# include <sys/target.h>
69# include <ctype.h>
70# include <string.h>
71
72/* From: hpa@hook.eecs.nwu.edu (H. Peter Anvin) */
73static char *
74getcray(void)
75{
76# ifdef MC_GET_SYSTEM /* If we have target() */
77    struct target data;
78
79    if (target(MC_GET_SYSTEM, &data) != -1) {
80	static char hosttype_buf[sizeof(data.mc_pmt)+1];
81	unsigned char *p = (unsigned char *) &(data.mc_pmt);
82	char *q = hosttype_buf;
83	int n;
84
85	/*
86	 * Copy to buffer and convert to lower case
87	 * String may not be null-terminated, so keep a counter
88	 */
89	for (n = 0; *p && n < sizeof(data.mc_pmt); n++)
90	  *q++ = tolower(p[n]);
91
92	*q = '\0';
93
94	/* replace dashes with underscores if present */
95	while ((q = strchr(hosttype_buf, '-')) != NULL)
96	    *q = '_';
97	return hosttype_buf;	/* Return in static buffer */
98    }
99    else
100# endif /* MC_GET_SYSTEM */
101	return "cray";		/* target() failed */
102}
103endcode :
104enddef	:
105
106
107newdef	: defined(convex)
108newcode :
109/*
110 * On convex, find the current machine type via the getsysinfo() syscall
111 */
112#include <sys/sysinfo.h>
113
114/* From: fox@convex.com (David DeSimone) */
115static char *
116getconvex(void)
117{
118    struct system_information  sysinfo;
119    static char	 result[8];
120
121    if (getsysinfo(SYSINFO_SIZE, &sysinfo) == -1)
122	return "convex";
123
124    switch(sysinfo.cpu_type) {
125#ifdef SI_CPUTYPE_C1
126    case SI_CPUTYPE_C1:
127	return "c1";
128#endif
129
130#ifdef SI_CPUTYPE_C2
131    case SI_CPUTYPE_C2:
132	return "c2";
133#endif
134
135#ifdef SI_CPUTYPE_C2MP
136    case SI_CPUTYPE_C2MP:
137	(void) strcpy(result, "c2X0");
138	result[2] = sysinfo.cpu_count + '0';
139	return result;
140#endif
141
142#ifdef SI_CPUTYPE_C34
143    case SI_CPUTYPE_C34:
144	(void) strcpy(result, "c34X0");
145	result[3] = sysinfo.cpu_count + '0';
146	return result;
147#endif
148
149#ifdef SI_CPUTYPE_C38
150    case SI_CPUTYPE_C38:
151	(void) strcpy(result, "c38X0");
152	result[3] = sysinfo.cpu_count + '0';
153	return result;
154#endif
155
156#ifdef SI_CPUTYPE_C46
157    case SI_CPUTYPE_C46:
158	(void) strcpy(result, "c46X0");
159	result[3] = sysinfo.cpu_count + '0';
160	return result;
161#endif
162
163    default:
164	return "convex";
165    }
166}
167endcode :
168enddef	:
169
170newdef : defined(linux) || defined(CYGWIN) || defined(GNU) || defined(GLIBC)
171newcode :
172# include "tw.h"
173#include <sys/utsname.h>
174static char mach[256];
175static char host[256];
176static char ostype[32];
177static void populate(void)
178{
179	struct utsname uts;
180	int e = uname(&uts);
181	const char *p = short2str(tgetenv(STROSTYPE));
182	if (p == NULL) {
183#if defined(__ANDROID__)
184		p = "android";
185#elif defined(__CYGWIN__)
186		p = "cygwin";
187#else
188		p = "linux";
189#endif
190	}
191	xsnprintf(ostype, sizeof(ostype), "%s", p);
192	xsnprintf(mach, sizeof(mach), "%s", e != -1 ? uts.machine : "unknown");
193	xsnprintf(host, sizeof(host), "%s-%s",
194	    e != -1 ? uts.machine : "unknown", ostype);
195}
196
197static char *
198getmach(void)
199{
200    if (!mach[0])
201	populate();
202    return mach;
203}
204
205static char *
206gethost(void)
207{
208    if (!host[0])
209	populate();
210    return host;
211}
212
213static char *
214getostype(void)
215{
216    if (!ostype[0])
217	populate();
218    return ostype;
219}
220
221endcode :
222enddef :
223
224newcode :
225void
226getmachine(void)
227{
228     const char *hosttype;
229     const char *ostype;
230     const char *vendor;
231     const char *machtype;
232
233endcode :
234
235
236newdef	: defined(HOSTTYPE)
237hosttype:						: HOSTTYPE
238enddef	:
239
240
241newdef	: defined(PARAGON)
242comment : Intel Paragon running OSF/1
243vendor	:						: "intel"
244hosttype:						: "paragon"
245ostype	:						: "osf1"
246machtype: defined(M_i386)				: "i386"
247enddef	:
248
249
250newdef	: defined(AMIX)
251comment : Amiga running Amix 2.02
252vendor	:						: "commodore"
253hosttype:						: "amiga"
254ostype	:						: "Amix"
255machtype:						: "m68k"
256enddef	:
257
258
259newdef	: defined(accel)
260comment : celerity Accel
261vendor	:						: "celerity"
262hosttype:						: "celerityACCEL"
263ostype	:						: "unix"
264machtype:						: "accel"
265enddef	:
266
267
268newdef	: defined(_VMS_POSIX)
269comment : digital vax or alpha running vms posix
270vendor	:						: "dec"
271hosttype:						: "VMS-POSIX"
272ostype	:						: "vms"
273machtype: defined(alpha)				: "alpha"
274machtype: defined(vax)					: "vax"
275enddef	:
276
277
278newdef	: defined(hp_osf)
279comment : Hewlett Packard running OSF/1
280vendor	:						: "hp"
281hosttype: defined(pa_risc)				: "hp9000s700-osf1"
282hosttype:						: "hp-osf1"
283ostype	:						: "osf1"
284machtype: defined(pa_risc)				: "pa_risc"
285enddef	:
286
287
288newdef	: defined(hp9000)
289comment : Hewlett Packard running MORE/bsd
290vendor	:						: "hp"
291hosttype: defined(hp300)				: "hp300"
292hosttype: defined(hp800)				: "hp800"
293hosttype:						: "hp9000"
294ostype	: defined(BSD4_4)				: "bsd44"
295ostype	:						: "mtXinu"
296machtype: defined(hp300)				: "m68k"
297machtype: defined(hp800)				: "pa_risc"
298enddef	:
299
300
301newdef	: defined(hpux)
302comment : Hewlett Packard running HP/UX
303vendor	:						: "hp"
304hosttype: defined(hp9000s800)				: "hp9000s800"
305hosttype: defined(hp9000s700)				: "hp9000s700"
306hosttype: defined(hp9000s500)				: "hp9000s500"
307hosttype: defined(hp9000s300)				: "hp9000s300"
308hosttype:						: "hp"
309ostype	:						: "hpux"
310machtype: defined(hp9000s800)				: "pa_risc"
311machtype: defined(hp9000s700)				: "pa_risc"
312machtype: defined(hp9000s500)				: "m68k"
313machtype: defined(hp9000s300)				: "m68k"
314enddef	:
315
316
317newdef	: defined(apollo)
318comment : Hewlett Packard apollo running Domain/OS
319vendor	:						: "hp"
320hosttype:						: "apollo"
321ostype	:						: "DomainOS"
322machtype:						: "m68k"
323enddef	:
324
325
326newdef	: defined(sun)
327comment : Sun Microsystems series 2 workstation (68010 based)
328comment : Sun Microsystems series 3 workstation (68020 based)
329comment : Sun Microsystems 386i workstation (386 based)
330comment : Sun Microsystems series 4 workstation (SPARC based)
331vendor	:						: "sun"
332hosttype: defined(M_i386) && !defined(SVR4)		: "sun386i"
333hosttype: defined(M_i386) && defined(SVR4)		: "i86pc"
334hosttype: defined(M_amd64)				: "i86pc"
335hosttype: defined(mc68010)				: "sun2"
336hosttype: defined(mc68020)				: "sun3"
337hosttype: defined(sparc)				: "sun4"
338hosttype:						: "sun"
339ostype	: defined(SUNOS3)				: "sunos3"
340ostype	: defined(SUNOS4)				: "sunos4"
341ostype	: defined(SOLARIS2)				: "solaris"
342machtype: defined(mc68010)				: "m68k"
343machtype: defined(mc68020)				: "m68k"
344machtype: defined(sparcv9)				: "sparcv9"
345machtype: defined(sparc)				: "sparc"
346machtype: defined(M_i386)				: "i386"
347machtype: defined(M_amd64)				: "amd64"
348enddef	:
349
350
351newdef	: defined(pyr)
352comment : Pyramid Technology
353vendor	:						: "pyramid"
354hosttype:						: "pyramid"
355machtype:						: "pyramid"
356enddef	:
357
358
359newdef	: defined(hcx) || defined(_CX_UX)
360comment : Harris Tahoe running CX/UX
361vendor	:						: "harris"
362hosttype:						: "hcx"
363ostype	:						: "hcx"
364machtype:						: "tahoe"
365enddef	:
366
367
368newdef	: defined(tahoe)
369comment : Harris Tahoe
370vendor	:						: "harris"
371hosttype:						: "tahoe"
372machtype:						: "tahoe"
373enddef	:
374
375
376newdef	: defined(ibm032)
377comment : RT running IBM AOS4.3 or MACH
378vendor	:						: "ibm"
379hosttype:						: "rt"
380ostype	: defined(MACH)					: "mach"
381ostype	:						: "aos"
382machtype:						: "ibm032"
383enddef	:
384
385
386newdef	: defined(aiws)
387comment : RT running IBM aix2.x
388vendor	:						: "ibm"
389hosttype:						: "rtpc"
390ostype	:						: "aix"
391machtype:						: "ibm032"
392enddef	:
393
394
395newdef	: defined(_AIX370)
396comment : IBM/370 running aix
397vendor	:						: "ibm"
398hosttype:						: "aix370"
399ostype	:						: "aix"
400machtype:						: "ibm370"
401enddef	:
402
403
404newdef	: defined(_IBMESA)
405comment : IBM/ESA running aix
406vendor	:						: "ibm"
407hosttype:						: "aixESA"
408ostype	:						: "aix"
409machtype:						: "esa"
410enddef	:
411
412
413newdef	: defined(_IBMR2)
414comment : IBM/RS6000 running aix
415vendor	:						: "ibm"
416hosttype:						: "rs6000"
417ostype	:						: "aix"
418machtype:						: "rs6000"
419enddef	:
420
421
422newdef	: defined(_AIXPS2)
423comment : IBM/PS2 running aix
424vendor	:						: "ibm"
425hosttype:						: "ps2"
426ostype	:						: "aix"
427machtype:						: "i386"
428enddef	:
429
430
431newdef	: defined(OREO)
432comment : Macintosh running AU/X
433vendor	:						: "apple"
434hosttype:						: "mac2"
435ostype	:						: "aux"
436machtype: defined(mc68020)				: "m68k"
437enddef	:
438
439
440newdef	: defined(u3b20d)
441comment : AT&T 3B/20 series running SVR2/3
442vendor	:						: "att"
443hosttype:						: "att3b20"
444machtype:						: "u3b20"
445enddef	:
446
447
448newdef	: defined(u3b15)
449comment : AT&T 3B/15 series running SVR2/3
450vendor	:						: "att"
451hosttype:						: "att3b15"
452machtype:						: "u3b15"
453enddef	:
454
455
456newdef	: defined(u3b5)
457comment : AT&T 3B/5 series running SVR2/3
458vendor	:						: "att"
459hosttype:						: "att3b5"
460machtype:						: "u3b5"
461enddef	:
462
463
464newdef	: defined(u3b2)
465comment : AT&T 3B/2 series running SVR2/3
466vendor	:						: "att"
467hosttype:						: "att3b2"
468machtype:						: "u3b2"
469enddef	:
470
471
472newdef	: defined(UNIXPC)
473comment : AT&T UnixPC att3b1/att7300
474vendor	:						: "att"
475hosttype:						: "unixpc"
476machtype: defined(u3b1)					: "u3b1"
477machtype: defined(att7300)				: "att7300"
478enddef	:
479
480
481newdef	: defined(_MINIX)
482comment : Andy Tanenbaum's minix
483vendor	: defined(M_i386)				: "intel"
484hosttype: defined(M_i386)				: "minix386"
485hosttype:						: "minix"
486ostype	:						: "minix"
487machtype: defined(M_i386)				: "i386"
488enddef	:
489
490
491newdef	: defined(gnu_hurd)
492comment : GNU/HURD
493vendor	: defined(M_intel)				: "intel"
494hosttype: defined(M_i686)				: "i686"
495hosttype: defined(M_i586)				: "i586"
496hosttype: defined(M_i486)				: "i486"
497hosttype: defined(M_i386)				: "i386"
498ostype	:						: "gnu"
499machtype: defined(M_i686)				: "i686-pc-gnu"
500machtype: defined(M_i586)				: "i586-pc-gnu"
501machtype: defined(M_i486)				: "i486-pc-gnu"
502machtype: defined(M_i386)				: "i386-pc-gnu"
503enddef	:
504
505
506newdef	: defined(linux) || defined(GNU) || defined(GLIBC)
507comment : Linus Torvalds's linux
508vendor	: defined(M_intel)				: "intel"
509hosttype:						: gethost()
510ostype	:						: getostype()
511machtype:						: getmach()
512vendor	: defined(ANDROID)				: "linux"
513vendor	: defined(alpha)				: "dec"
514vendor	: defined(PPC)					: "apple"
515enddef	:
516
517
518newdef	: defined(EMX)
519comment : OS/2 EMX [unix emulation under OS/2]
520vendor	: defined(M_intel)				: "intel"
521hosttype: defined(M_i386)				: "i386-emx"
522ostype	:						: "os2"
523machtype: defined(M_i386)				: "i386"
524enddef	:
525
526
527newdef	: defined(NetBSD)
528comment : NetBSD
529vendor	: defined(algor)				: "algoritmics"
530vendor	: defined(arm32) || defined(arm)		: "acorn"
531vendor	: defined(alpha)				: "digital"
532vendor	: defined(amiga)				: "commodore"
533vendor	: defined(atari)				: "atari"
534vendor	: defined(hp300)				: "hp"
535vendor	: defined(M_intel)				: "intel"
536vendor	: defined(m68k)					: "motorola"
537vendor	: defined(mac68k)				: "apple"
538vendor	: defined(pc532)				: "national-semi"
539vendor	: defined(pmax)					: "dec"
540vendor	: defined(powerpc)				: "motorola"
541vendor	: defined(mips)					: "mips"
542vendor	: defined(sparc)				: "sun"
543vendor	: defined(sparc64)				: "sun"
544vendor	: defined(sun3)					: "sun"
545vendor	: defined(vax)					: "digital"
546vendor	: defined(M_amd64)				: "amd"
547hosttype:						: "NetBSD"
548ostype	:						: "NetBSD"
549machtype: defined(alpha)				: "alpha"
550machtype: defined(algor)				: "algor"
551machtype: defined(arm32) || defined(APCS_32)		: "arm32"
552machtype: defined(arm26) || defined(APCS_26)		: "arm26"
553machtype: defined(arm)					: "arm"
554machtype: defined(sparc)				: "sparc"
555machtype: defined(sparc64)				: "sparc64"
556machtype: defined(mc68020)				: "m68k"
557machtype: defined(M_i386)				: "i386"
558machtype: defined(M_mipsel)				: "mipsel"
559machtype: defined(M_mipseb)				: "mipseb"
560machtype: defined(mips)					: "mips"
561machtype: defined(pc532)				: "pc532"
562machtype: defined(powerpc)				: "powerpc"
563machtype: defined(vax)					: "vax"
564machtype: defined(M_amd64)				: "x86_64"
565enddef	:
566
567newdef : defined(OpenBSD)
568comment        : OpenBSD
569vendor : defined(alpha)					: "digital"
570vendor : defined(M_amd64)				: "amd"
571vendor : defined(arm)					: "arm"
572vendor : defined(hppa) || defined(hppa64)		: "hp"
573vendor : defined(M_intel)				: "intel"
574vendor : defined(m68k)					: "motorola"
575vendor : defined(m88k)					: "motorola"
576vendor : defined(mips) && defined(sgi)			: "sgi"
577vendor : defined(powerpc)				: "motorola"
578vendor : defined(sh)					: "io-data"
579vendor : defined(sparc) || defined(sparc64)		: "sun"
580vendor : defined(vax)					: "digital"
581hosttype:						: "OpenBSD"
582ostype :						: "OpenBSD"
583machtype: defined(alpha)				: "alpha"
584machtype: defined(M_amd64)				: "amd64"
585machtype: defined(arm)					: "arm"
586machtype: defined(hppa)					: "hppa"
587machtype: defined(hppa64)				: "hppa64"
588machtype: defined(M_i386)				: "i386"
589machtype: defined(m68k)					: "m68k"
590machtype: defined(m88k)					: "m88k"
591machtype: defined(mips)					: "mips"
592machtype: defined(sh)					: "sh"
593machtype: defined(sparc64)				: "sparc64"
594machtype: defined(sparc)				: "sparc"
595machtype: defined(powerpc)				: "powerpc"
596machtype: defined(vax)					: "vax"
597enddef :
598
599
600newdef	: defined(FreeBSD)
601comment : FreeBSD
602vendor	: defined(alpha)				: "digital"
603vendor	: defined(arm32) || defined(arm)		: "acorn"
604vendor	: defined(M_intel)				: "intel"
605vendor	: defined(ia64)					: "intel"
606vendor	: defined(mips)					: "mips"
607vendor	: defined(powerpc)				: "motorola"
608vendor	: defined(sparc)				: "sun"
609vendor	: defined(sparc64)				: "sun"
610vendor	: defined(M_amd64)				: "amd"
611hosttype:						: "FreeBSD"
612ostype	:						: "FreeBSD"
613machtype: defined(alpha)				: "alpha"
614machtype: defined(arm32) || defined(APCS_32)		: "arm32"
615machtype: defined(arm)					: "arm"
616machtype: defined(ia64)					: "ia64"
617machtype: defined(M_i386)				: "i386"
618machtype: defined(mips)					: "mips"
619machtype: defined(powerpc)				: "powerpc"
620machtype: defined(sparc)				: "sparc"
621machtype: defined(sparc64)				: "sparc64"
622machtype: defined(M_amd64)				: "x86_64"
623enddef	:
624
625
626newdef	: defined(MidnightBSD)
627comment : MidnightBSD
628vendor	: defined(M_intel)				: "intel"
629hosttype:						: "MidnightBSD"
630ostype	:						: "MidnightBSD"
631machtype: defined(M_i386)				: "i386"
632enddef	:
633
634
635newdef	: defined(__386BSD__)
636comment : Bill Jolitz's 386BSD
637vendor	: defined(M_intel)				: "intel"
638hosttype:						: "386BSD"
639ostype	:						: "386BSD"
640machtype:						: "i386"
641enddef	:
642
643
644newdef	: defined(bsdi)
645comment : BSDI's unix
646vendor	: defined(M_intel)				: "intel"
647vendor	: defined(sparc)				: "sun"
648vendor	: defined(powerpc)				: "motorola"
649hosttype: defined(M_intel)				: "bsd386"
650hosttype: defined(sparc)				: "bsd-sparc"
651hosttype: defined(powerpc)				: "bsd-powerpc"
652ostype	:						: "bsdi"
653machtype: defined(M_i386)				: "i386"
654machtype: defined(sparc)				: "sparc"
655machtype: defined(powerpc)				: "powerpc"
656enddef	:
657
658
659newdef	: defined(COHERENT)
660comment : COHERENT's unix
661vendor	: defined(_I386)				: "intel"
662hosttype:						: "coh386"
663hosttype:						: "coherent"
664ostype	:						: "coherent"
665machtype: defined(_I386)				: "i386"
666enddef	:
667
668newdef	: defined(concurrent)
669comment : Concurrent PowerHawk
670vendor	:						: "concurrent"
671hosttype:						: "powerhawk"
672ostype	:						: "powermax_os"
673machtype:						: "powerhawk"
674enddef	:
675
676newdef	: defined(SCO)
677comment : SCO UNIX System V/386 Release 3.2
678vendor	:						: "sco"
679hosttype:						: "sco386"
680ostype	:						: "sco_unix"
681machtype:						: "i386"
682enddef	:
683
684newdef	: defined(M_XENIX) && !defined(M_UNIX)
685comment : SCO XENIX
686vendor	:						: "sco"
687hosttype:						: "sco_xenix"
688ostype	:						: "sco_xenix"
689machtype: defined(M_I386)				: "i386"
690machtype: defined(M_I286)				: "i286"
691enddef	:
692
693
694newdef	: defined(ISC) || defined(ISC202)
695comment : Interactive Unix
696vendor	:						: "isc"
697hosttype:						: "isc386"
698ostype	: defined(POSIX)				: "POSIX"
699ostype	:						: "SVR3"
700machtype: defined(M_i386)				: "i386"
701enddef	:
702
703
704newdef	: defined(INTEL)
705comment : Intel Unix
706vendor	:						: "intel"
707hosttype:						: "intel386"
708ostype	:						: "intel_unix"
709machtype: defined(M_i386)				: "i386"
710enddef	:
711
712
713newdef	: defined(MACH)
714comment : cmu's mach
715vendor	:						: "cmu"
716hosttype: defined(M_i386)				: "i386-mach"
717ostype	:						: "mach"
718machtype: defined(M_i386)				: "i386"
719enddef	:
720
721
722newdef	: defined(alliant)
723comment : Alliants FSX
724vendor	:						: "alliant"
725hosttype: defined(mc68000)				: "alliant-fx80"
726hosttype: defined(i860)					: "alliant-fx2800"
727hosttype:						: "alliant"
728ostype	:						: "fsx"
729machtype: defined(mc68000)				: "mc68000"
730machtype: defined(i860)					: "i860"
731enddef	:
732
733
734newdef	: defined(_FTX)
735comment : Stratus Computer, Inc FTX2 (i860 based)
736comment : Stratus Computer, Inc FTX3 (HPPA based)
737vendor	:						: "stratus"
738hosttype: defined(i860) && defined(_FTX)		: "atlantic"
739hosttype: defined(hppa) && defined(_FTX)		: "continuum"
740ostype	: defined(i860) && defined(_FTX)		: "ftx2"
741ostype	: defined(hppa) && defined(_FTX)		: "ftx3"
742machtype: defined(i860)					: "i860"
743machtype: defined(hppa)					: "hppa"
744enddef	:
745
746
747newdef	: defined(sequent) || defined(_SEQUENT_)
748comment : Sequent Balance (32000 based)
749comment : Sequent Symmetry running DYNIX/ptx (386/486 based)
750comment : Sequent Symmetry running DYNIX 3 (386/486 based)
751vendor	:						: "sequent"
752hosttype: defined(M_i386) && defined(sequent)		: "symmetry"
753hosttype: defined(M_i386)				: "ptx"
754hosttype:						: "balance"
755ostype	: defined(M_i386) && !defined(sequent)		: "ptx"
756ostype	:						: "dynix3"
757machtype: defined(M_i386)				: "i386"
758machtype: defined(ns32000)				: "ns32000"
759enddef	:
760
761
762newdef	: defined(ns32000)
763comment : Encore Computer Corp. Multimax (32000 based)
764vendor	:						: "encore"
765hosttype: defined(CMUCS)				: "multimax"
766hosttype:						: isamultimax(0)
767ostype	: defined(CMUCS)				: "mach"
768ostype	:						: isamultimax(1)
769machtype:						: "ns32000"
770enddef	:
771
772
773newdef	: defined(iconuxv)
774comment : Icon 88k running Unix
775vendor	:						: "icon"
776hosttype:						: "icon"
777ostype	:						: "iconuxv"
778machtype: defined(m88k)					: "m88k"
779enddef	:
780
781
782newdef	: defined(_CRAY) && defined(_CRAYCOM)
783comment : Cray Computer Corp. running CSOS
784vendor	:						: "ccc"
785hosttype: defined(_CRAY2)				: "cray"
786hosttype: defined(_CRAY3)				: "cray"
787hosttype: defined(_CRAY4)				: "cray"
788ostype	:						: "CSOS"
789machtype: defined(_CRAY2)				: "cray2"
790machtype: defined(_CRAY3)				: "cray3"
791machtype: defined(_CRAY4)				: "cray4"
792enddef	:
793
794
795newdef	: defined(cray) && !defined(_CRAYMPP)
796comment : Cray Research Inc. PVP running UNICOS
797vendor	:						: "cri"
798hosttype:						: getcray()
799ostype	:						: "unicos"
800machtype:						: getcray()
801enddef	:
802
803
804newdef	: defined(cray) && defined(_CRAYT3D)
805comment : Cray Research Inc. running UNICOS MAX
806vendor	:						: "cri"
807hosttype:						: getcray()
808ostype	:						: "unicosmax"
809machtype:						: getcray()
810enddef	:
811
812
813newdef	: defined(cray) && defined(_CRAYT3E)
814comment : Cray Research Inc. running UNICOS/mk
815vendor	:						: "cri"
816hosttype:						: getcray()
817ostype	:						: "unicosmk"
818machtype:						: getcray()
819enddef	:
820
821
822newdef	: defined(convex)
823comment : Convex
824vendor	:						: "convex"
825hosttype:						: "convex"
826ostype	:						: "convexos"
827machtype:						: getconvex()
828enddef	:
829
830
831newdef	: defined(butterfly)
832comment : BBN Butterfly 1000
833vendor	:						: "bbn"
834hosttype:						: "butterfly"
835machtype: defined(mc68020)				: "m68k"
836enddef	:
837
838
839newdef	: defined(NeXT)
840comment : NeXTStep
841vendor	:						: "next"
842hosttype: defined(mc68020)				: "next"
843hosttype: defined(M_i386) 				: "intel-pc"
844hosttype: defined(hppa)	  				: "hp"
845hosttype: defined(sparc)  				: "sun"
846ostype	:						: "nextstep"
847machtype: defined(mc68020)				: "m68k"
848machtype: defined(M_i386) 				: "i386"
849machtype: defined(hppa)	  				: "hppa"
850machtype: defined(sparc)  				: "sparc"
851enddef	:
852
853
854newdef	: defined(APPLE) && defined(MACH)
855comment : OS X
856vendor	:						: "apple"
857hosttype: defined(i386)					: "intel-mac"
858hosttype: defined(ppc)					: "powermac"
859hosttype: defined(M_amd64)				: "intel-mac"
860ostype	:						: "darwin"
861machtype: defined(i386)					: "i386"
862machtype: defined(M_amd64)				: "x86_64"
863machtype: defined(ppc)					: "powerpc"
864enddef	:
865
866
867newdef	: defined(sony_news)
868comment : Sony NEWS 800 or 1700 workstation
869vendor	:						: "sony"
870hosttype: defined(mips)					: "news_mips"
871hosttype: defined(mc68020)				: "news_m68k"
872ostype	:						: "News"
873machtype: defined(mc68020)				: "m68k"
874machtype: defined(M_mipsel)				: "mipsel"
875machtype: defined(M_mipseb)				: "mipseb"
876enddef	:
877
878
879newdef	: defined(sgi)
880comment : Silicon Graphics
881vendor	:						: "sgi"
882hosttype: defined(M_mipsel)				: "iris4d"
883hosttype: defined(M_mipseb)				: "iris4d"
884hosttype: defined(mc68000)				: "iris3d"
885ostype	:						: "irix"
886machtype: defined(M_mipsel)				: "mipsel"
887machtype: defined(M_mipseb)				: "mipseb"
888machtype: defined(mc68000)				: "mc68000"
889enddef	:
890
891
892newdef	: defined(ultrix)
893comment : Digital's Ultrix
894vendor	:						: "dec"
895hosttype: defined(M_mipsel)				: "decstation"
896hosttype: defined(M_mipseb)				: "decmips"
897hosttype: defined(vax)					: "vax"
898ostype	:						: "ultrix"
899machtype: defined(M_mipsel)				: "mipsel"
900machtype: defined(M_mipseb)				: "mipseb"
901machtype: defined(vax)					: "vax"
902enddef	:
903
904
905newdef	: defined(MIPS)
906comment : Mips OS
907vendor	:						: "mips"
908hosttype: defined(M_mipsel)				: "mips"
909hosttype: defined(M_mipseb)				: "mips"
910ostype	:						: "mips"
911machtype: defined(M_mipsel)				: "mipsel"
912machtype: defined(M_mipseb)				: "mipseb"
913enddef	:
914
915
916newdef	: defined(DECOSF1)
917comment : Digital's alpha running osf1
918vendor	:						: "dec"
919ostype	:						: "osf1"
920hosttype: defined(alpha)				: "alpha"
921machtype: defined(alpha)				: "alpha"
922enddef	:
923
924
925newdef	: defined(Lynx)
926comment : Lynx OS 2.1
927vendor	:						: "Lynx"
928hosttype: defined(M_mipsel)				: "lynxos-mips"
929hosttype: defined(M_mipseb)				: "lynxos-mips"
930hosttype: defined(M_i386)				: "lynxos-i386"
931hosttype: defined(i860)					: "lynxos-i860"
932hosttype: defined(m68k)					: "lynxos-m68k"
933hosttype: defined(m88k)					: "lynxos-m88k"
934hosttype: defined(sparc)				: "lynxos-sparc"
935hosttype:						: "lynxos-unknown"
936ostype	:						: "LynxOS"
937machtype: defined(M_mipsel)				: "mipsel"
938machtype: defined(M_mipseb)				: "mipseb"
939machtype: defined(M_i386)				: "i386"
940machtype: defined(i860)					: "i860"
941machtype: defined(m68k)					: "m68k"
942machtype: defined(m88k)					: "m88k"
943machtype: defined(sparc)				: "sparc"
944enddef	:
945
946
947newdef	: defined(masscomp)
948comment : Masscomp
949vendor	:						: "masscomp"
950hosttype:						: "masscomp"
951ostype	:						: "masscomp"
952enddef	:
953
954newdef	: defined(MACHTEN)
955comment : Machintosh
956vendor	:						: "Tenon"
957hosttype:						: "Macintosh"
958ostype	:						: "MachTen"
959machtype:						: "Macintosh"
960enddef	:
961
962
963
964newdef	: defined(GOULD_NP1)
965comment : Gould
966vendor	:						: "gould"
967hosttype:						: "gould_np1"
968machtype:						: "gould"
969enddef	:
970
971
972newdef	: defined(MULTIFLOW)
973comment : Multiflow running 4.3BSD
974vendor	:						: "multiflow"
975hosttype:						: "multiflow"
976machtype:						: "multiflow"
977ostype	:						: "bsd43"
978enddef	:
979
980
981newdef	: defined(SXA)
982comment : PFU/Fujitsu A-xx computer
983vendor	:						: "sxa"
984hosttype:						: "pfa50"
985ostype	: defined(_BSDX_)				: "e60-bsdx"
986ostype	:						: "e60"
987machtype:						: "pfa50"
988enddef	:
989
990
991newdef	: defined(titan)
992comment : (St)Ardent Titan
993vendor	:						: "ardent"
994hosttype:						: "titan"
995enddef	:
996
997
998newdef	: defined(stellar)
999comment : Stellar
1000vendor	:						: "stellar"
1001hosttype:						: "stellar"
1002ostype	:						: "stellix"
1003enddef	:
1004
1005
1006newdef	: defined(atari)
1007comment : Atari TT running SVR4. This machine was never
1008comment : commercially available.
1009vendor	:						: "atari"
1010hosttype:						: "atari"
1011ostype	:						: "asv"
1012enddef	:
1013
1014
1015newdef	: defined(OPUS)
1016comment : ???
1017vendor	:						: "opus"
1018hosttype:						: "opus"
1019enddef	:
1020
1021
1022newdef	: defined(eta10)
1023comment : ETA running SVR3
1024vendor	:						: "eta"
1025hosttype:						: "eta10"
1026enddef	:
1027
1028
1029newdef	: defined(hk68)
1030comment : Heurikon HK68 running Uniplus+ 5.0
1031vendor	:						: "heurikon"
1032hosttype:						: "hk68"
1033ostype	:						: "uniplus"
1034enddef	:
1035
1036
1037newdef	: defined(NDIX)
1038comment : Norsk Data ND 500/5000 running Ndix
1039vendor	:						: "norsk"
1040hosttype:						: "nd500"
1041ostype	:						: "ndix"
1042enddef	:
1043
1044
1045newdef	: defined(AMIGA)
1046comment : Amiga running AmigaOS+GG
1047vendor	:						: "commodore"
1048hosttype:						: "amiga"
1049ostype	:						: "AmigaOS"
1050machtype:						: "m68k"
1051enddef	:
1052
1053
1054newdef	: defined(uts)
1055comment : Amdahl running uts 2.1
1056vendor	:						: "amdahl"
1057hosttype:						: "amdahl"
1058ostype	:						: "uts"
1059machtype:						: "amdahl"
1060enddef	:
1061
1062
1063newdef	: defined(UTek)
1064comment : Tektronix 4300 running UTek (BSD 4.2 / 68020 based)
1065vendor	:						: "tektronix"
1066hosttype:						: "tek4300"
1067enddef	:
1068
1069
1070newdef	: defined(UTekV)
1071comment : Tektronix XD88/10 running UTekV 3.2e (SVR3/88100 based)
1072vendor	:						: "tektronix"
1073hosttype:						: "tekXD88"
1074enddef	:
1075
1076
1077newdef	: defined(DGUX)
1078comment : Data-General AViiON running DGUX
1079hosttype:						: "aviion"
1080ostype	:						: "dgux"
1081vendor	:						: "dg"
1082machtype: defined(m88k)					: "m88k"
1083machtype: defined(i386)					: "pentium"
1084enddef	:
1085
1086
1087newdef	: defined(sysV68)
1088comment : Motorola MPC running System V/68 R32V2 (SVR3/68020 based)
1089vendor	:						: "motorola"
1090hosttype:						: "sysV68"
1091machtype:						: "m68k"
1092enddef	:
1093
1094
1095newdef	: defined(supermax)
1096comment : DDE Supermax running System V/68 R3 (SVR3/68020 based)
1097vendor	:						: "supermax"
1098hosttype:						: "supermax"
1099machtype:						: "m68k"
1100enddef	:
1101
1102
1103newdef	: defined(sysV88)
1104comment : Motorola MPC running System V/88 R32V2 (SVR3/88100 based)
1105vendor	:						: "motorola"
1106hosttype:						: "sysV88"
1107machtype:						: "m88k"
1108enddef	:
1109
1110
1111newdef	: defined(clipper)
1112comment : Clipper Chipset (Intergraph)
1113vendor	:						: "intergraph"
1114hosttype:						: "clipper"
1115machtype:						: "clipper"
1116enddef	:
1117
1118newdef : defined(QNX)
1119ostype :						: "qnx"
1120enddef :
1121
1122newdef	: (defined(SNI) || defined(sinix)) && !defined(_OSD_POSIX)
1123comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): SINIX aka. ReliantUNIX, a SVR4 derivative
1124vendor	:						: "fsc"
1125hosttype: defined(M_intel)				: "wx200i"
1126hosttype: defined(MIPSEB)				: "rm400"
1127ostype	: defined(sinix)				: "sinix"
1128machtype: defined(M_i586)				: "i586"
1129machtype: defined(M_i486)				: "i486"
1130machtype: defined(M_i386)				: "i386"
1131machtype: defined(M_mipsel)				: "mipsel"
1132machtype: defined(M_mipseb)				: "mipseb"
1133machtype:						: "mips"
1134enddef	:
1135
1136newdef	: defined(_OSD_POSIX)
1137comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): BS2000 POSIX (mainframe, EBCDIC)
1138vendor	:						: "fsc"
1139hosttype:						: "bs2000"
1140ostype	:						: "osdposix"
1141machtype: #machine(7500)				: "s390"
1142machtype: #machine(mips)				: "mips"
1143machtype: #machine(sparc)				: "sparc"
1144machtype:						: "bs2000"
1145enddef	:
1146
1147newdef	: defined(MVS)
1148comment : ibm uss s/390 (mainframe, EBCDIC)
1149vendor	:						: "ibm"
1150hosttype:						: "s390"
1151ostype	:						: "os390"
1152machtype:						: "s390"
1153enddef	:
1154
1155newdef	: defined(_SX)
1156comment : NEC Corporation (SX-4)
1157vendor	:						: "nec"
1158ostype	:						: "superux"
1159hosttype:						: "sx4"
1160machtype:						: "sx4"
1161enddef	:
1162
1163newdef	: !defined(SOLARIS2) && (SYSVREL == 4)
1164comment : Unix System V Release 4.0
1165vendor	: defined(DELL)					: "dell"
1166hosttype: defined(M_i386)				: "i386"
1167ostype	:						: "svr4"
1168machtype: defined(M_i386)				: "i386"
1169enddef	:
1170
1171newdef	: defined(uxp) || defined(uxps)
1172comment : FUJITSU DS/90 7000
1173vendor	:						: "fujitsu"
1174hosttype:						: "ds90"
1175ostype	:						: "sysv4"
1176machtype:						: "sparc"
1177enddef	:
1178
1179newdef	: defined(CYGWIN)
1180comment : Cygwin
1181vendor	: defined(M_intel)				: "intel"
1182hosttype:						: gethost()
1183ostype	:						: getostype()
1184machtype:						: getmach()
1185enddef	:
1186
1187newdef	: defined(_UWIN)
1188comment : AT&T Research Unix for Windows
1189vendor	:						: "att"
1190hosttype:						: "win32.i386"
1191machtype:						: "i386"
1192enddef	:
1193
1194
1195newdef	: defined(mc68000) || defined(mc68k32) || defined(m68k) || defined(mc68010) || defined(mc68020)
1196hosttype:						: "m68k"
1197vendor	: defined(m68k)					: "motorola"
1198machtype:						: "m68k"
1199enddef	:
1200
1201
1202newdef	: defined(m88k)
1203hosttype:						: "m88k"
1204machtype:						: "m88k"
1205enddef	:
1206
1207
1208newdef	: defined(M_intel)
1209hosttype: defined(M_i586)				: "i586"
1210hosttype: defined(M_i486)				: "i486"
1211hosttype: defined(M_i386)				: "i386"
1212vendor	:						: "intel"
1213machtype: defined(M_i586)				: "i586"
1214machtype: defined(M_i486)				: "i486"
1215machtype: defined(M_i386)				: "i386"
1216enddef	:
1217
1218
1219newdef	: defined(sparc)
1220hosttype:						: "sparc"
1221machtype:						: "sparc"
1222enddef	:
1223
1224
1225newdef	: defined(i860)
1226hosttype:						: "i860"
1227machtype:						: "i860"
1228enddef	:
1229
1230
1231newdef	: defined(osf1)
1232ostype	:						: "osf1"
1233enddef	:
1234
1235
1236newdef	: SYSVREL == 0
1237ostype	: defined(BSD4_4)				: "bsd44"
1238ostype	: defined(BSD)					: "bsd"
1239ostype	: defined(POSIX)				: "posix"
1240enddef	:
1241
1242
1243newdef	: SYSVREL == 1
1244ostype	:						: "svr1"
1245enddef	:
1246
1247
1248newdef	: SYSVREL == 2
1249ostype	:						: "svr2"
1250enddef	:
1251
1252
1253newdef	: SYSVREL == 3
1254ostype	:						: "svr3"
1255enddef	:
1256
1257
1258newdef	: SYSVREL == 4
1259ostype	:						: "svr4"
1260enddef	:
1261
1262
1263newcode :
1264#ifndef _hosttype_
1265    hosttype = "unknown";
1266#endif
1267#ifndef _ostype_
1268    ostype = "unknown";
1269#endif
1270#ifndef _vendor_
1271    vendor = "unknown";
1272#endif
1273#ifndef _machtype_
1274    machtype = "unknown";
1275#endif
1276    tsetenv(STRHOSTTYPE, str2short(hosttype));
1277    tsetenv(STRVENDOR,	 str2short(vendor));
1278    tsetenv(STROSTYPE,	 str2short(ostype));
1279    tsetenv(STRMACHTYPE, str2short(machtype));
1280} /* end setmachine */
1281endcode :
1282