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