xref: /dragonfly/bin/csh/csh/host.defs (revision b97fef05)
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(aarch64)				: "arm"
530vendor	: defined(algor)				: "algoritmics"
531vendor	: defined(arm32) || defined(arm)		: "acorn"
532vendor	: defined(alpha)				: "digital"
533vendor	: defined(amiga)				: "commodore"
534vendor	: defined(atari)				: "atari"
535vendor	: defined(hp300)				: "hp"
536vendor	: defined(M_intel)				: "intel"
537vendor	: defined(m68k)					: "motorola"
538vendor	: defined(mac68k)				: "apple"
539vendor	: defined(pc532)				: "national-semi"
540vendor	: defined(pmax)					: "dec"
541vendor	: defined(powerpc)				: "motorola"
542vendor	: defined(mips)					: "mips"
543vendor	: defined(sparc)				: "sun"
544vendor	: defined(sparc64)				: "sun"
545vendor	: defined(sun3)					: "sun"
546vendor	: defined(vax)					: "digital"
547vendor	: defined(M_amd64)				: "amd"
548hosttype:						: "NetBSD"
549ostype	:						: "NetBSD"
550machtype: defined(aarch64)				: "aarch64"
551machtype: defined(alpha)				: "alpha"
552machtype: defined(algor)				: "algor"
553machtype: defined(arm32) || defined(APCS_32)		: "arm32"
554machtype: defined(arm26) || defined(APCS_26)		: "arm26"
555machtype: defined(arm)					: "arm"
556machtype: defined(sparc)				: "sparc"
557machtype: defined(sparc64)				: "sparc64"
558machtype: defined(mc68020)				: "m68k"
559machtype: defined(M_i386)				: "i386"
560machtype: defined(M_mipsel)				: "mipsel"
561machtype: defined(M_mipseb)				: "mipseb"
562machtype: defined(mips)					: "mips"
563machtype: defined(pc532)				: "pc532"
564machtype: defined(powerpc)				: "powerpc"
565machtype: defined(vax)					: "vax"
566machtype: defined(M_amd64)				: "x86_64"
567enddef	:
568
569newdef : defined(OpenBSD)
570comment        : OpenBSD
571vendor	: defined(aarch64)				: "arm"
572vendor : defined(alpha)					: "digital"
573vendor : defined(M_amd64)				: "amd"
574vendor : defined(arm)					: "arm"
575vendor : defined(hppa) || defined(hppa64)		: "hp"
576vendor : defined(M_intel)				: "intel"
577vendor : defined(m68k)					: "motorola"
578vendor : defined(m88k)					: "motorola"
579vendor : defined(mips) && defined(sgi)			: "sgi"
580vendor : defined(powerpc)				: "motorola"
581vendor : defined(sh)					: "io-data"
582vendor : defined(sparc) || defined(sparc64)		: "sun"
583vendor : defined(vax)					: "digital"
584hosttype:						: "OpenBSD"
585ostype :						: "OpenBSD"
586machtype: defined(aarch64)				: "aarch64"
587machtype: defined(alpha)				: "alpha"
588machtype: defined(M_amd64)				: "amd64"
589machtype: defined(arm)					: "arm"
590machtype: defined(hppa)					: "hppa"
591machtype: defined(hppa64)				: "hppa64"
592machtype: defined(M_i386)				: "i386"
593machtype: defined(m68k)					: "m68k"
594machtype: defined(m88k)					: "m88k"
595machtype: defined(mips)					: "mips"
596machtype: defined(sh)					: "sh"
597machtype: defined(sparc64)				: "sparc64"
598machtype: defined(sparc)				: "sparc"
599machtype: defined(powerpc)				: "powerpc"
600machtype: defined(vax)					: "vax"
601enddef :
602
603
604newdef	: defined(FreeBSD)
605comment : FreeBSD
606vendor	: defined(aarch64)				: "arm"
607vendor	: defined(alpha)				: "digital"
608vendor	: defined(arm32) || defined(arm)		: "acorn"
609vendor	: defined(M_intel)				: "intel"
610vendor	: defined(ia64)					: "intel"
611vendor	: defined(mips)					: "mips"
612vendor	: defined(powerpc)				: "motorola"
613vendor	: defined(sparc)				: "sun"
614vendor	: defined(sparc64)				: "sun"
615vendor	: defined(M_amd64)				: "amd"
616hosttype:						: "FreeBSD"
617ostype	:						: "FreeBSD"
618machtype: defined(aarch64)				: "aarch64"
619machtype: defined(alpha)				: "alpha"
620machtype: defined(arm32) || defined(APCS_32)		: "arm32"
621machtype: defined(arm)					: "arm"
622machtype: defined(ia64)					: "ia64"
623machtype: defined(M_i386)				: "i386"
624machtype: defined(mips)					: "mips"
625machtype: defined(powerpc)				: "powerpc"
626machtype: defined(sparc)				: "sparc"
627machtype: defined(sparc64)				: "sparc64"
628machtype: defined(M_amd64)				: "x86_64"
629enddef	:
630
631
632newdef	: defined(__DragonFly__)
633comment : DragonFly
634vendor	: defined(M_intel)				: "intel"
635vendor	: defined(x86_64)				: "amd"
636hosttype:						: "DragonFly"
637ostype	:						: "DragonFly"
638machtype: defined(x86_64)				: "x86_64"
639enddef	:
640
641
642newdef	: defined(MidnightBSD)
643comment : MidnightBSD
644vendor	: defined(M_intel)				: "intel"
645hosttype:						: "MidnightBSD"
646ostype	:						: "MidnightBSD"
647machtype: defined(M_i386)				: "i386"
648enddef	:
649
650
651newdef	: defined(__386BSD__)
652comment : Bill Jolitz's 386BSD
653vendor	: defined(M_intel)				: "intel"
654hosttype:						: "386BSD"
655ostype	:						: "386BSD"
656machtype:						: "i386"
657enddef	:
658
659
660newdef	: defined(bsdi)
661comment : BSDI's unix
662vendor	: defined(M_intel)				: "intel"
663vendor	: defined(sparc)				: "sun"
664vendor	: defined(powerpc)				: "motorola"
665hosttype: defined(M_intel)				: "bsd386"
666hosttype: defined(sparc)				: "bsd-sparc"
667hosttype: defined(powerpc)				: "bsd-powerpc"
668ostype	:						: "bsdi"
669machtype: defined(M_i386)				: "i386"
670machtype: defined(sparc)				: "sparc"
671machtype: defined(powerpc)				: "powerpc"
672enddef	:
673
674
675newdef	: defined(COHERENT)
676comment : COHERENT's unix
677vendor	: defined(_I386)				: "intel"
678hosttype:						: "coh386"
679hosttype:						: "coherent"
680ostype	:						: "coherent"
681machtype: defined(_I386)				: "i386"
682enddef	:
683
684newdef	: defined(concurrent)
685comment : Concurrent PowerHawk
686vendor	:						: "concurrent"
687hosttype:						: "powerhawk"
688ostype	:						: "powermax_os"
689machtype:						: "powerhawk"
690enddef	:
691
692newdef	: defined(SCO)
693comment : SCO UNIX System V/386 Release 3.2
694vendor	:						: "sco"
695hosttype:						: "sco386"
696ostype	:						: "sco_unix"
697machtype:						: "i386"
698enddef	:
699
700newdef	: defined(M_XENIX) && !defined(M_UNIX)
701comment : SCO XENIX
702vendor	:						: "sco"
703hosttype:						: "sco_xenix"
704ostype	:						: "sco_xenix"
705machtype: defined(M_I386)				: "i386"
706machtype: defined(M_I286)				: "i286"
707enddef	:
708
709
710newdef	: defined(ISC) || defined(ISC202)
711comment : Interactive Unix
712vendor	:						: "isc"
713hosttype:						: "isc386"
714ostype	: defined(POSIX)				: "POSIX"
715ostype	:						: "SVR3"
716machtype: defined(M_i386)				: "i386"
717enddef	:
718
719
720newdef	: defined(INTEL)
721comment : Intel Unix
722vendor	:						: "intel"
723hosttype:						: "intel386"
724ostype	:						: "intel_unix"
725machtype: defined(M_i386)				: "i386"
726enddef	:
727
728
729newdef	: defined(MACH)
730comment : cmu's mach
731vendor	:						: "cmu"
732hosttype: defined(M_i386)				: "i386-mach"
733ostype	:						: "mach"
734machtype: defined(M_i386)				: "i386"
735enddef	:
736
737
738newdef	: defined(alliant)
739comment : Alliants FSX
740vendor	:						: "alliant"
741hosttype: defined(mc68000)				: "alliant-fx80"
742hosttype: defined(i860)					: "alliant-fx2800"
743hosttype:						: "alliant"
744ostype	:						: "fsx"
745machtype: defined(mc68000)				: "mc68000"
746machtype: defined(i860)					: "i860"
747enddef	:
748
749
750newdef	: defined(_FTX)
751comment : Stratus Computer, Inc FTX2 (i860 based)
752comment : Stratus Computer, Inc FTX3 (HPPA based)
753vendor	:						: "stratus"
754hosttype: defined(i860) && defined(_FTX)		: "atlantic"
755hosttype: defined(hppa) && defined(_FTX)		: "continuum"
756ostype	: defined(i860) && defined(_FTX)		: "ftx2"
757ostype	: defined(hppa) && defined(_FTX)		: "ftx3"
758machtype: defined(i860)					: "i860"
759machtype: defined(hppa)					: "hppa"
760enddef	:
761
762
763newdef	: defined(sequent) || defined(_SEQUENT_)
764comment : Sequent Balance (32000 based)
765comment : Sequent Symmetry running DYNIX/ptx (386/486 based)
766comment : Sequent Symmetry running DYNIX 3 (386/486 based)
767vendor	:						: "sequent"
768hosttype: defined(M_i386) && defined(sequent)		: "symmetry"
769hosttype: defined(M_i386)				: "ptx"
770hosttype:						: "balance"
771ostype	: defined(M_i386) && !defined(sequent)		: "ptx"
772ostype	:						: "dynix3"
773machtype: defined(M_i386)				: "i386"
774machtype: defined(ns32000)				: "ns32000"
775enddef	:
776
777
778newdef	: defined(ns32000)
779comment : Encore Computer Corp. Multimax (32000 based)
780vendor	:						: "encore"
781hosttype: defined(CMUCS)				: "multimax"
782hosttype:						: isamultimax(0)
783ostype	: defined(CMUCS)				: "mach"
784ostype	:						: isamultimax(1)
785machtype:						: "ns32000"
786enddef	:
787
788
789newdef	: defined(iconuxv)
790comment : Icon 88k running Unix
791vendor	:						: "icon"
792hosttype:						: "icon"
793ostype	:						: "iconuxv"
794machtype: defined(m88k)					: "m88k"
795enddef	:
796
797
798newdef	: defined(_CRAY) && defined(_CRAYCOM)
799comment : Cray Computer Corp. running CSOS
800vendor	:						: "ccc"
801hosttype: defined(_CRAY2)				: "cray"
802hosttype: defined(_CRAY3)				: "cray"
803hosttype: defined(_CRAY4)				: "cray"
804ostype	:						: "CSOS"
805machtype: defined(_CRAY2)				: "cray2"
806machtype: defined(_CRAY3)				: "cray3"
807machtype: defined(_CRAY4)				: "cray4"
808enddef	:
809
810
811newdef	: defined(cray) && !defined(_CRAYMPP)
812comment : Cray Research Inc. PVP running UNICOS
813vendor	:						: "cri"
814hosttype:						: getcray()
815ostype	:						: "unicos"
816machtype:						: getcray()
817enddef	:
818
819
820newdef	: defined(cray) && defined(_CRAYT3D)
821comment : Cray Research Inc. running UNICOS MAX
822vendor	:						: "cri"
823hosttype:						: getcray()
824ostype	:						: "unicosmax"
825machtype:						: getcray()
826enddef	:
827
828
829newdef	: defined(cray) && defined(_CRAYT3E)
830comment : Cray Research Inc. running UNICOS/mk
831vendor	:						: "cri"
832hosttype:						: getcray()
833ostype	:						: "unicosmk"
834machtype:						: getcray()
835enddef	:
836
837
838newdef	: defined(convex)
839comment : Convex
840vendor	:						: "convex"
841hosttype:						: "convex"
842ostype	:						: "convexos"
843machtype:						: getconvex()
844enddef	:
845
846
847newdef	: defined(butterfly)
848comment : BBN Butterfly 1000
849vendor	:						: "bbn"
850hosttype:						: "butterfly"
851machtype: defined(mc68020)				: "m68k"
852enddef	:
853
854
855newdef	: defined(NeXT)
856comment : NeXTStep
857vendor	:						: "next"
858hosttype: defined(mc68020)				: "next"
859hosttype: defined(M_i386) 				: "intel-pc"
860hosttype: defined(hppa)	  				: "hp"
861hosttype: defined(sparc)  				: "sun"
862ostype	:						: "nextstep"
863machtype: defined(mc68020)				: "m68k"
864machtype: defined(M_i386) 				: "i386"
865machtype: defined(hppa)	  				: "hppa"
866machtype: defined(sparc)  				: "sparc"
867enddef	:
868
869
870newdef	: defined(APPLE)
871comment : OS X
872vendor	:						: "apple"
873hosttype: defined(i386)					: "intel-mac"
874hosttype: defined(M_amd64)				: "intel-mac"
875hosttype: defined(ppc)					: "powermac"
876hosttype: defined(aarch64)				: "arm64mac"
877ostype	:						: "darwin"
878machtype: defined(i386)					: "i386"
879machtype: defined(M_amd64)				: "x86_64"
880machtype: defined(ppc)					: "powerpc"
881machtype: defined(aarch64)				: "aarch64"
882enddef	:
883
884
885newdef	: defined(sony_news)
886comment : Sony NEWS 800 or 1700 workstation
887vendor	:						: "sony"
888hosttype: defined(mips)					: "news_mips"
889hosttype: defined(mc68020)				: "news_m68k"
890ostype	:						: "News"
891machtype: defined(mc68020)				: "m68k"
892machtype: defined(M_mipsel)				: "mipsel"
893machtype: defined(M_mipseb)				: "mipseb"
894enddef	:
895
896
897newdef	: defined(sgi)
898comment : Silicon Graphics
899vendor	:						: "sgi"
900hosttype: defined(M_mipsel)				: "iris4d"
901hosttype: defined(M_mipseb)				: "iris4d"
902hosttype: defined(mc68000)				: "iris3d"
903ostype	:						: "irix"
904machtype: defined(M_mipsel)				: "mipsel"
905machtype: defined(M_mipseb)				: "mipseb"
906machtype: defined(mc68000)				: "mc68000"
907enddef	:
908
909
910newdef	: defined(ultrix)
911comment : Digital's Ultrix
912vendor	:						: "dec"
913hosttype: defined(M_mipsel)				: "decstation"
914hosttype: defined(M_mipseb)				: "decmips"
915hosttype: defined(vax)					: "vax"
916ostype	:						: "ultrix"
917machtype: defined(M_mipsel)				: "mipsel"
918machtype: defined(M_mipseb)				: "mipseb"
919machtype: defined(vax)					: "vax"
920enddef	:
921
922
923newdef	: defined(MIPS)
924comment : Mips OS
925vendor	:						: "mips"
926hosttype: defined(M_mipsel)				: "mips"
927hosttype: defined(M_mipseb)				: "mips"
928ostype	:						: "mips"
929machtype: defined(M_mipsel)				: "mipsel"
930machtype: defined(M_mipseb)				: "mipseb"
931enddef	:
932
933
934newdef	: defined(DECOSF1)
935comment : Digital's alpha running osf1
936vendor	:						: "dec"
937ostype	:						: "osf1"
938hosttype: defined(alpha)				: "alpha"
939machtype: defined(alpha)				: "alpha"
940enddef	:
941
942
943newdef	: defined(Lynx)
944comment : Lynx OS 2.1
945vendor	:						: "Lynx"
946hosttype: defined(M_mipsel)				: "lynxos-mips"
947hosttype: defined(M_mipseb)				: "lynxos-mips"
948hosttype: defined(M_i386)				: "lynxos-i386"
949hosttype: defined(i860)					: "lynxos-i860"
950hosttype: defined(m68k)					: "lynxos-m68k"
951hosttype: defined(m88k)					: "lynxos-m88k"
952hosttype: defined(sparc)				: "lynxos-sparc"
953hosttype:						: "lynxos-unknown"
954ostype	:						: "LynxOS"
955machtype: defined(M_mipsel)				: "mipsel"
956machtype: defined(M_mipseb)				: "mipseb"
957machtype: defined(M_i386)				: "i386"
958machtype: defined(i860)					: "i860"
959machtype: defined(m68k)					: "m68k"
960machtype: defined(m88k)					: "m88k"
961machtype: defined(sparc)				: "sparc"
962enddef	:
963
964
965newdef	: defined(masscomp)
966comment : Masscomp
967vendor	:						: "masscomp"
968hosttype:						: "masscomp"
969ostype	:						: "masscomp"
970enddef	:
971
972newdef	: defined(MACHTEN)
973comment : Machintosh
974vendor	:						: "Tenon"
975hosttype:						: "Macintosh"
976ostype	:						: "MachTen"
977machtype:						: "Macintosh"
978enddef	:
979
980
981
982newdef	: defined(GOULD_NP1)
983comment : Gould
984vendor	:						: "gould"
985hosttype:						: "gould_np1"
986machtype:						: "gould"
987enddef	:
988
989
990newdef	: defined(MULTIFLOW)
991comment : Multiflow running 4.3BSD
992vendor	:						: "multiflow"
993hosttype:						: "multiflow"
994machtype:						: "multiflow"
995ostype	:						: "bsd43"
996enddef	:
997
998
999newdef	: defined(SXA)
1000comment : PFU/Fujitsu A-xx computer
1001vendor	:						: "sxa"
1002hosttype:						: "pfa50"
1003ostype	: defined(_BSDX_)				: "e60-bsdx"
1004ostype	:						: "e60"
1005machtype:						: "pfa50"
1006enddef	:
1007
1008
1009newdef	: defined(titan)
1010comment : (St)Ardent Titan
1011vendor	:						: "ardent"
1012hosttype:						: "titan"
1013enddef	:
1014
1015
1016newdef	: defined(stellar)
1017comment : Stellar
1018vendor	:						: "stellar"
1019hosttype:						: "stellar"
1020ostype	:						: "stellix"
1021enddef	:
1022
1023
1024newdef	: defined(atari)
1025comment : Atari TT running SVR4. This machine was never
1026comment : commercially available.
1027vendor	:						: "atari"
1028hosttype:						: "atari"
1029ostype	:						: "asv"
1030enddef	:
1031
1032
1033newdef	: defined(OPUS)
1034comment : ???
1035vendor	:						: "opus"
1036hosttype:						: "opus"
1037enddef	:
1038
1039
1040newdef	: defined(eta10)
1041comment : ETA running SVR3
1042vendor	:						: "eta"
1043hosttype:						: "eta10"
1044enddef	:
1045
1046
1047newdef	: defined(hk68)
1048comment : Heurikon HK68 running Uniplus+ 5.0
1049vendor	:						: "heurikon"
1050hosttype:						: "hk68"
1051ostype	:						: "uniplus"
1052enddef	:
1053
1054
1055newdef	: defined(NDIX)
1056comment : Norsk Data ND 500/5000 running Ndix
1057vendor	:						: "norsk"
1058hosttype:						: "nd500"
1059ostype	:						: "ndix"
1060enddef	:
1061
1062
1063newdef	: defined(AMIGA)
1064comment : Amiga running AmigaOS+GG
1065vendor	:						: "commodore"
1066hosttype:						: "amiga"
1067ostype	:						: "AmigaOS"
1068machtype:						: "m68k"
1069enddef	:
1070
1071
1072newdef	: defined(uts)
1073comment : Amdahl running uts 2.1
1074vendor	:						: "amdahl"
1075hosttype:						: "amdahl"
1076ostype	:						: "uts"
1077machtype:						: "amdahl"
1078enddef	:
1079
1080
1081newdef	: defined(UTek)
1082comment : Tektronix 4300 running UTek (BSD 4.2 / 68020 based)
1083vendor	:						: "tektronix"
1084hosttype:						: "tek4300"
1085enddef	:
1086
1087
1088newdef	: defined(UTekV)
1089comment : Tektronix XD88/10 running UTekV 3.2e (SVR3/88100 based)
1090vendor	:						: "tektronix"
1091hosttype:						: "tekXD88"
1092enddef	:
1093
1094
1095newdef	: defined(DGUX)
1096comment : Data-General AViiON running DGUX
1097hosttype:						: "aviion"
1098ostype	:						: "dgux"
1099vendor	:						: "dg"
1100machtype: defined(m88k)					: "m88k"
1101machtype: defined(i386)					: "pentium"
1102enddef	:
1103
1104
1105newdef	: defined(sysV68)
1106comment : Motorola MPC running System V/68 R32V2 (SVR3/68020 based)
1107vendor	:						: "motorola"
1108hosttype:						: "sysV68"
1109machtype:						: "m68k"
1110enddef	:
1111
1112
1113newdef	: defined(supermax)
1114comment : DDE Supermax running System V/68 R3 (SVR3/68020 based)
1115vendor	:						: "supermax"
1116hosttype:						: "supermax"
1117machtype:						: "m68k"
1118enddef	:
1119
1120
1121newdef	: defined(sysV88)
1122comment : Motorola MPC running System V/88 R32V2 (SVR3/88100 based)
1123vendor	:						: "motorola"
1124hosttype:						: "sysV88"
1125machtype:						: "m88k"
1126enddef	:
1127
1128
1129newdef	: defined(clipper)
1130comment : Clipper Chipset (Intergraph)
1131vendor	:						: "intergraph"
1132hosttype:						: "clipper"
1133machtype:						: "clipper"
1134enddef	:
1135
1136newdef : defined(QNX)
1137ostype :						: "qnx"
1138enddef :
1139
1140newdef	: (defined(SNI) || defined(sinix)) && !defined(_OSD_POSIX)
1141comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): SINIX aka. ReliantUNIX, a SVR4 derivative
1142vendor	:						: "fsc"
1143hosttype: defined(M_intel)				: "wx200i"
1144hosttype: defined(MIPSEB)				: "rm400"
1145ostype	: defined(sinix)				: "sinix"
1146machtype: defined(M_i586)				: "i586"
1147machtype: defined(M_i486)				: "i486"
1148machtype: defined(M_i386)				: "i386"
1149machtype: defined(M_mipsel)				: "mipsel"
1150machtype: defined(M_mipseb)				: "mipseb"
1151machtype:						: "mips"
1152enddef	:
1153
1154newdef	: defined(_OSD_POSIX)
1155comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): BS2000 POSIX (mainframe, EBCDIC)
1156vendor	:						: "fsc"
1157hosttype:						: "bs2000"
1158ostype	:						: "osdposix"
1159machtype: #machine(7500)				: "s390"
1160machtype: #machine(mips)				: "mips"
1161machtype: #machine(sparc)				: "sparc"
1162machtype:						: "bs2000"
1163enddef	:
1164
1165newdef	: defined(MVS)
1166comment : ibm uss s/390 (mainframe, EBCDIC)
1167vendor	:						: "ibm"
1168hosttype:						: "s390"
1169ostype	:						: "os390"
1170machtype:						: "s390"
1171enddef	:
1172
1173newdef	: defined(_SX)
1174comment : NEC Corporation (SX-4)
1175vendor	:						: "nec"
1176ostype	:						: "superux"
1177hosttype:						: "sx4"
1178machtype:						: "sx4"
1179enddef	:
1180
1181newdef	: !defined(SOLARIS2) && (SYSVREL == 4)
1182comment : Unix System V Release 4.0
1183vendor	: defined(DELL)					: "dell"
1184hosttype: defined(M_i386)				: "i386"
1185ostype	:						: "svr4"
1186machtype: defined(M_i386)				: "i386"
1187enddef	:
1188
1189newdef	: defined(uxp) || defined(uxps)
1190comment : FUJITSU DS/90 7000
1191vendor	:						: "fujitsu"
1192hosttype:						: "ds90"
1193ostype	:						: "sysv4"
1194machtype:						: "sparc"
1195enddef	:
1196
1197newdef	: defined(CYGWIN)
1198comment : Cygwin
1199vendor	: defined(M_intel)				: "intel"
1200hosttype:						: gethost()
1201ostype	:						: getostype()
1202machtype:						: getmach()
1203enddef	:
1204
1205newdef	: defined(_UWIN)
1206comment : AT&T Research Unix for Windows
1207vendor	:						: "att"
1208hosttype:						: "win32.i386"
1209machtype:						: "i386"
1210enddef	:
1211
1212
1213newdef	: defined(mc68000) || defined(mc68k32) || defined(m68k) || defined(mc68010) || defined(mc68020)
1214hosttype:						: "m68k"
1215vendor	: defined(m68k)					: "motorola"
1216machtype:						: "m68k"
1217enddef	:
1218
1219
1220newdef	: defined(m88k)
1221hosttype:						: "m88k"
1222machtype:						: "m88k"
1223enddef	:
1224
1225
1226newdef	: defined(M_intel)
1227hosttype: defined(M_i586)				: "i586"
1228hosttype: defined(M_i486)				: "i486"
1229hosttype: defined(M_i386)				: "i386"
1230vendor	:						: "intel"
1231machtype: defined(M_i586)				: "i586"
1232machtype: defined(M_i486)				: "i486"
1233machtype: defined(M_i386)				: "i386"
1234enddef	:
1235
1236
1237newdef	: defined(sparc)
1238hosttype:						: "sparc"
1239machtype:						: "sparc"
1240enddef	:
1241
1242
1243newdef	: defined(i860)
1244hosttype:						: "i860"
1245machtype:						: "i860"
1246enddef	:
1247
1248
1249newdef	: defined(osf1)
1250ostype	:						: "osf1"
1251enddef	:
1252
1253
1254newdef	: SYSVREL == 0
1255ostype	: defined(BSD4_4)				: "bsd44"
1256ostype	: defined(BSD)					: "bsd"
1257ostype	: defined(POSIX)				: "posix"
1258enddef	:
1259
1260
1261newdef	: SYSVREL == 1
1262ostype	:						: "svr1"
1263enddef	:
1264
1265
1266newdef	: SYSVREL == 2
1267ostype	:						: "svr2"
1268enddef	:
1269
1270
1271newdef	: SYSVREL == 3
1272ostype	:						: "svr3"
1273enddef	:
1274
1275
1276newdef	: SYSVREL == 4
1277ostype	:						: "svr4"
1278enddef	:
1279
1280
1281newcode :
1282#ifndef _hosttype_
1283    hosttype = "unknown";
1284#endif
1285#ifndef _ostype_
1286    ostype = "unknown";
1287#endif
1288#ifndef _vendor_
1289    vendor = "unknown";
1290#endif
1291#ifndef _machtype_
1292    machtype = "unknown";
1293#endif
1294    tsetenv(STRHOSTTYPE, str2short(hosttype));
1295    tsetenv(STRVENDOR,	 str2short(vendor));
1296    tsetenv(STROSTYPE,	 str2short(ostype));
1297    tsetenv(STRMACHTYPE, str2short(machtype));
1298} /* end setmachine */
1299endcode :
1300