host.defs revision 302408
160107Sobriennewcode :
216877Ssos/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.55 2012/01/11 20:20:15 christos Exp $ */
316877Ssos/*
416877Ssos * host.defs: Hosttype/Machtype etc.
516877Ssos */
616877Ssos/*-
716877Ssos * Copyright (c) 1980, 1991 The Regents of the University of California.
816877Ssos * All rights reserved.
916877Ssos *
1016877Ssos * Redistribution and use in source and binary forms, with or without
1116877Ssos * modification, are permitted provided that the following conditions
1216877Ssos * are met:
1316877Ssos * 1. Redistributions of source code must retain the above copyright
1416877Ssos *    notice, this list of conditions and the following disclaimer.
1516877Ssos * 2. Redistributions in binary form must reproduce the above copyright
1616877Ssos *    notice, this list of conditions and the following disclaimer in the
1716877Ssos *    documentation and/or other materials provided with the distribution.
1816877Ssos * 3. Neither the name of the University nor the names of its contributors
19117271Sache *    may be used to endorse or promote products derived from this software
2016877Ssos *    without specific prior written permission.
2116877Ssos *
2216877Ssos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2316877Ssos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2416877Ssos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2516877Ssos * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2616877Ssos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2716877Ssos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2816877Ssos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2916877Ssos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3016877Ssos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3116877Ssos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3216877Ssos * SUCH DAMAGE.
3316877Ssos */
3416877Ssos#include "sh.h"
3516877Ssos
3616877SsosRCSID("$tcsh: host.defs,v 1.55 2012/01/11 20:20:15 christos Exp $")
3716877Ssos
3816877Ssosendcode :
3916877Ssos
4016877Ssosmacro	: M_mips64el : (defined(mips64) || defined(__mips64)) && (defined(MIPSEL) || defined(__MIPSEL))
4116877Ssosmacro	: M_mips64eb : (defined(mips64) || defined(__mips64)) && (defined(MIPSEB) || defined(__MIPSEB))
4216877Ssosmacro	: M_mipsel : (!defined(M_mips64el)) && (defined(mips) || defined(__mips)) && (defined(MIPSEL) || defined(__MIPSEL))
4316877Ssosmacro	: M_mipseb : (!defined(M_mips64eb)) && (defined(mips) || defined(__mips)) && (defined(MIPSEB) || defined(__MIPSEB))
4416877Ssosmacro	: M_i386 : (defined(i386) || defined(__i386__))
4516877Ssosmacro	: M_i486 : (defined(i486) || defined(__i486__))
4616877Ssosmacro	: M_i586 : (defined(i586) || defined(__i586__))
4716877Ssosmacro	: M_i686 : (defined(i686) || defined(__i686__))
4816877Ssosmacro	: M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
4916877Ssos
5016877Ssosnewdef	: defined(ns32000)
5116877Ssosnewcode :
5216877Ssosstatic char *
5316877Ssosisamultimax(int flag)
5416877Ssos{
5516877Ssos    if (access("/Umax.image", F_OK) == 0)
5616877Ssos	return "multimax";
5716877Ssos    else 
5816877Ssos	return flag ? "mach" : "ns32000";
5938140Syokota}
6016877Ssosendcode :
6116877Ssosenddef	:
6216877Ssos
6332822Syokota
6416877Ssosnewdef	: defined(cray)
6516877Ssosnewcode :
6616877Ssos/*  
6716877Ssos * On crays, find the current machine type via the target() syscall
6816877Ssos * We need ctype.h to convert the name returned to lower case
6916877Ssos */
7016877Ssos# include <sys/target.h> 
7116877Ssos# include <ctype.h>
7216877Ssos# include <string.h>
7316877Ssos
7416877Ssos/* From: hpa@hook.eecs.nwu.edu (H. Peter Anvin) */
7516877Ssosstatic char *
7616877Ssosgetcray(void)
7716877Ssos{
7816877Ssos# ifdef MC_GET_SYSTEM /* If we have target() */
7916877Ssos    struct target data;
8016877Ssos
8116877Ssos    if (target(MC_GET_SYSTEM, &data) != -1) {
8216877Ssos	static char hosttype_buf[sizeof(data.mc_pmt)+1];
8316877Ssos	unsigned char *p = (unsigned char *) &(data.mc_pmt);
8416877Ssos	char *q = hosttype_buf;
8516877Ssos	int n;
8616877Ssos
8716877Ssos	/* 
8816877Ssos	 * Copy to buffer and convert to lower case 
8916877Ssos	 * String may not be null-terminated, so keep a counter
9016877Ssos	 */
9116877Ssos	for (n = 0; *p && n < sizeof(data.mc_pmt); n++)
9216877Ssos	  *q++ = tolower(p[n]);
9316877Ssos
9416877Ssos	*q = '\0';
9518194Ssos
9616877Ssos	/* replace dashes with underscores if present */
9716877Ssos	while ((q = strchr(hosttype_buf, '-')) != NULL)
9874119Sache	    *q = '_';
9916877Ssos	return hosttype_buf;	/* Return in static buffer */
10016877Ssos    }
10116877Ssos    else
10216877Ssos# endif /* MC_GET_SYSTEM */
10316877Ssos	return "cray";		/* target() failed */
10416877Ssos}
10516877Ssosendcode :
10616877Ssosenddef	:
10716877Ssos
10874119Sache
10916877Ssosnewdef	: defined(convex)
11043334Syokotanewcode :
11143334Syokota/*  
11243334Syokota * On convex, find the current machine type via the getsysinfo() syscall
11343334Syokota */
11443334Syokota#include <sys/sysinfo.h> 
115
116/* From: fox@convex.com (David DeSimone) */
117static char *
118getconvex(void)
119{
120    struct system_information  sysinfo;
121    static char	 result[8];
122
123    if (getsysinfo(SYSINFO_SIZE, &sysinfo) == -1)
124	return "convex";
125
126    switch(sysinfo.cpu_type) {
127#ifdef SI_CPUTYPE_C1
128    case SI_CPUTYPE_C1:
129	return "c1";
130#endif
131
132#ifdef SI_CPUTYPE_C2
133    case SI_CPUTYPE_C2:
134	return "c2";
135#endif
136
137#ifdef SI_CPUTYPE_C2MP
138    case SI_CPUTYPE_C2MP:
139	(void) strcpy(result, "c2X0");
140	result[2] = sysinfo.cpu_count + '0';
141	return result;
142#endif
143
144#ifdef SI_CPUTYPE_C34
145    case SI_CPUTYPE_C34:
146	(void) strcpy(result, "c34X0");
147	result[3] = sysinfo.cpu_count + '0';
148	return result;
149#endif
150
151#ifdef SI_CPUTYPE_C38
152    case SI_CPUTYPE_C38:
153	(void) strcpy(result, "c38X0");
154	result[3] = sysinfo.cpu_count + '0';
155	return result;
156#endif
157
158#ifdef SI_CPUTYPE_C46
159    case SI_CPUTYPE_C46:
160	(void) strcpy(result, "c46X0");
161	result[3] = sysinfo.cpu_count + '0';
162	return result;
163#endif
164
165    default:
166	return "convex";
167    }
168}
169endcode :
170enddef	:
171
172newdef : defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
173newcode :
174# include "tw.h"
175#include <sys/utsname.h>
176static char mach[256];
177static char host[256];
178static char ostype[32];
179static void populate(void)
180{
181	struct utsname uts;
182	int e = uname(&uts);
183	const char *p = short2str(tgetenv(STROSTYPE));
184	if (p == NULL) {
185#if defined(__ANDROID__)
186		p = "android";
187#elif defined(__CYGWIN__)
188		p = "cygwin";
189#else
190		p = "linux";
191#endif
192	}
193	xsnprintf(ostype, sizeof(ostype), "%s", p);
194	xsnprintf(mach, sizeof(mach), "%s", e != -1 ? uts.machine : "unknown");
195	xsnprintf(host, sizeof(host), "%s-%s",
196	    e != -1 ? uts.machine : "unknown", ostype);
197}
198
199static char *
200getmach(void)
201{
202    if (!mach[0])
203	populate();
204    return mach;
205}
206
207static char *
208gethost(void)
209{
210    if (!host[0])
211	populate();
212    return host;
213}
214
215static char *
216getostype(void)
217{
218    if (!ostype[0])
219	populate();
220    return ostype;
221}
222
223endcode :
224enddef :
225
226newcode :
227void
228getmachine(void)
229{
230     const char *hosttype;
231     const char *ostype;
232     const char *vendor;
233     const char *machtype;
234
235endcode :
236
237
238newdef	: defined(HOSTTYPE)
239hosttype:						: HOSTTYPE
240enddef	:
241
242
243newdef	: defined(__PARAGON__)
244comment : Intel Paragon running OSF/1
245vendor	:						: "intel"
246hosttype:						: "paragon"
247ostype	:						: "osf1"
248machtype: defined(M_i386)				: "i386"
249enddef	:
250
251
252newdef	: defined(AMIX)
253comment : Amiga running Amix 2.02
254vendor	:						: "commodore"
255hosttype:						: "amiga"
256ostype	:						: "Amix"
257machtype:						: "m68k"
258enddef	:
259
260
261newdef	: defined(accel)
262comment : celerity Accel
263vendor	:						: "celerity"
264hosttype:						: "celerityACCEL"
265ostype	:						: "unix"
266machtype:						: "accel"
267enddef	:
268
269
270newdef	: defined(_VMS_POSIX)
271comment : digital vax or alpha running vms posix
272vendor	:						: "dec"
273hosttype:						: "VMS-POSIX"
274ostype	:						: "vms"
275machtype: defined(alpha)				: "alpha"
276machtype: defined(vax)					: "vax"
277enddef	:
278
279
280newdef	: defined(__hp_osf)
281comment : Hewlett Packard running OSF/1
282vendor	:						: "hp"
283hosttype: defined(pa_risc)				: "hp9000s700-osf1"
284hosttype:						: "hp-osf1"
285ostype	:						: "osf1"
286machtype: defined(pa_risc)				: "pa_risc"
287enddef	:
288
289
290newdef	: defined(hp9000)
291comment : Hewlett Packard running MORE/bsd 
292vendor	:						: "hp"
293hosttype: defined(hp300)				: "hp300"
294hosttype: defined(hp800)				: "hp800"
295hosttype:						: "hp9000"
296ostype	: defined(BSD4_4)				: "bsd44"
297ostype	:						: "mtXinu"
298machtype: defined(hp300)				: "m68k"
299machtype: defined(hp800)				: "pa_risc"
300enddef	:
301
302
303newdef	: defined(hpux) || defined(__hpux)
304comment : Hewlett Packard running HP/UX
305vendor	:						: "hp"
306hosttype: defined(hp9000s800)				: "hp9000s800"
307hosttype: defined(hp9000s700)				: "hp9000s700"
308hosttype: defined(hp9000s500)				: "hp9000s500"
309hosttype: defined(hp9000s300)				: "hp9000s300"
310hosttype:						: "hp"
311ostype	:						: "hpux"
312machtype: defined(hp9000s800)				: "pa_risc"
313machtype: defined(hp9000s700)				: "pa_risc"
314machtype: defined(hp9000s500)				: "m68k"
315machtype: defined(hp9000s300)				: "m68k"
316enddef	:
317
318
319newdef	: defined(apollo)
320comment : Hewlett Packard apollo running Domain/OS
321vendor	:						: "hp"
322hosttype:						: "apollo"
323ostype	:						: "DomainOS"
324machtype:						: "m68k"
325enddef	:
326
327
328newdef	: defined(sun) || defined(__sun__)
329comment : Sun Microsystems series 2 workstation (68010 based)
330comment : Sun Microsystems series 3 workstation (68020 based)
331comment : Sun Microsystems 386i workstation (386 based)
332comment : Sun Microsystems series 4 workstation (SPARC based)
333vendor	:						: "sun"
334hosttype: defined(M_i386) && !defined(__SVR4)		: "sun386i"
335hosttype: defined(M_i386) && defined(__SVR4)		: "i86pc"
336hosttype: defined(mc68010)				: "sun2"
337hosttype: defined(mc68020)				: "sun3"
338hosttype: defined(sparc)				: "sun4"
339hosttype:						: "sun"
340ostype	: defined(SUNOS3)				: "sunos3"
341ostype	: defined(SUNOS4)				: "sunos4"
342ostype	: defined(SOLARIS2)				: "solaris"
343machtype: defined(mc68010)				: "m68k"
344machtype: defined(mc68020)				: "m68k"
345machtype: defined(sparcv9)				: "sparcv9"
346machtype: defined(sparc)				: "sparc"
347machtype: defined(M_i386)				: "i386"
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(x86_64)				: "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(x86_64)				: "x86_64"
565enddef	:
566
567
568newdef	: defined(__FreeBSD__) 
569comment : FreeBSD
570vendor	: defined(alpha)				: "digital"
571vendor	: defined(arm32) || defined(__arm__)		: "acorn"
572vendor	: defined(M_intel)				: "intel"
573vendor	: defined(ia64)					: "intel"
574vendor	: defined(mips)					: "mips"
575vendor	: defined(powerpc)				: "motorola"
576vendor	: defined(sparc)				: "sun"
577vendor	: defined(sparc64)				: "sun"
578vendor	: defined(x86_64)				: "amd"
579hosttype:						: "FreeBSD"
580ostype	:						: "FreeBSD"
581machtype: defined(alpha)				: "alpha"
582machtype: defined(arm32) || defined(__APCS_32__)	: "arm32"
583machtype: defined(arm)					: "arm"
584machtype: defined(ia64)					: "ia64"
585machtype: defined(M_i386)				: "i386"
586machtype: defined(mips)					: "mips"
587machtype: defined(powerpc)				: "powerpc"
588machtype: defined(sparc)				: "sparc"
589machtype: defined(sparc64)				: "sparc64"
590machtype: defined(x86_64)				: "x86_64"
591enddef	:
592
593
594newdef	: defined(__MidnightBSD__)
595comment : MidnightBSD
596vendor	: defined(M_intel)				: "intel"
597hosttype:						: "MidnightBSD"
598ostype	:						: "MidnightBSD"
599machtype: defined(M_i386)				: "i386"
600enddef	:
601
602
603newdef	: defined(__386BSD__)
604comment : Bill Jolitz's 386BSD
605vendor	: defined(M_intel)				: "intel"
606hosttype:						: "386BSD"
607ostype	:						: "386BSD"
608machtype:						: "i386"
609enddef	:
610
611
612newdef	: defined(bsdi)
613comment : BSDI's unix
614vendor	: defined(M_intel)				: "intel"
615vendor	: defined(sparc)				: "sun"
616vendor	: defined(powerpc)				: "motorola"
617hosttype: defined(M_intel)				: "bsd386"
618hosttype: defined(sparc)				: "bsd-sparc"
619hosttype: defined(powerpc)				: "bsd-powerpc"
620ostype	:						: "bsdi"
621machtype: defined(M_i386)				: "i386"
622machtype: defined(sparc)				: "sparc"
623machtype: defined(powerpc)				: "powerpc"
624enddef	:
625
626
627newdef	: defined(COHERENT)
628comment : COHERENT's unix
629vendor	: defined(_I386)				: "intel"
630hosttype:						: "coh386"
631hosttype:						: "coherent"
632ostype	:						: "coherent"
633machtype: defined(_I386)				: "i386"
634enddef	:
635
636newdef	: defined(concurrent)
637comment : Concurrent PowerHawk
638vendor	:						: "concurrent"
639hosttype:						: "powerhawk"
640ostype	:						: "powermax_os"
641machtype:						: "powerhawk"
642enddef	:
643
644newdef	: defined(SCO)
645comment : SCO UNIX System V/386 Release 3.2
646vendor	:						: "sco"
647hosttype:						: "sco386"
648ostype	:						: "sco_unix"
649machtype:						: "i386"
650enddef	:
651
652newdef	: defined(M_XENIX) && !defined(M_UNIX)
653comment : SCO XENIX
654vendor	:						: "sco"
655hosttype:						: "sco_xenix"
656ostype	:						: "sco_xenix"
657machtype: defined(M_I386)				: "i386"
658machtype: defined(M_I286)				: "i286"
659enddef	:
660
661
662newdef	: defined(ISC) || defined(ISC202)
663comment : Interactive Unix
664vendor	:						: "isc"
665hosttype:						: "isc386"
666ostype	: defined(POSIX)				: "POSIX"
667ostype	:						: "SVR3"
668machtype: defined(M_i386)				: "i386"
669enddef	:
670
671
672newdef	: defined(INTEL)
673comment : Intel Unix
674vendor	:						: "intel"
675hosttype:						: "intel386"
676ostype	:						: "intel_unix"
677machtype: defined(M_i386)				: "i386"
678enddef	:
679
680
681newdef	: defined(MACH)
682comment : cmu's mach
683vendor	:						: "cmu"
684hosttype: defined(M_i386)				: "i386-mach"
685ostype	:						: "mach"
686machtype: defined(M_i386)				: "i386"
687enddef	:
688
689
690newdef	: defined(alliant)
691comment : Alliants FSX
692vendor	:						: "alliant"
693hosttype: defined(mc68000)				: "alliant-fx80"
694hosttype: defined(i860)					: "alliant-fx2800"
695hosttype:						: "alliant"
696ostype	:						: "fsx"
697machtype: defined(mc68000)				: "mc68000"
698machtype: defined(i860)					: "i860"
699enddef	:
700
701
702newdef	: defined(_FTX)
703comment : Stratus Computer, Inc FTX2 (i860 based)
704comment : Stratus Computer, Inc FTX3 (HPPA based)
705vendor	:						: "stratus"
706hosttype: defined(i860) && defined(_FTX)		: "atlantic"
707hosttype: defined(hppa) && defined(_FTX)		: "continuum"
708ostype	: defined(i860) && defined(_FTX)		: "ftx2"
709ostype	: defined(hppa) && defined(_FTX)		: "ftx3"
710machtype: defined(i860)					: "i860"
711machtype: defined(hppa)					: "hppa"
712enddef	:
713
714
715newdef	: defined(sequent) || defined(_SEQUENT_)
716comment : Sequent Balance (32000 based)
717comment : Sequent Symmetry running DYNIX/ptx (386/486 based)
718comment : Sequent Symmetry running DYNIX 3 (386/486 based)
719vendor	:						: "sequent"
720hosttype: defined(M_i386) && defined(sequent)		: "symmetry"
721hosttype: defined(M_i386)				: "ptx"
722hosttype:						: "balance"
723ostype	: defined(M_i386) && !defined(sequent)		: "ptx"
724ostype	:						: "dynix3"
725machtype: defined(M_i386)				: "i386"
726machtype: defined(ns32000)				: "ns32000"
727enddef	:
728
729
730newdef	: defined(ns32000)
731comment : Encore Computer Corp. Multimax (32000 based)
732vendor	:						: "encore"
733hosttype: defined(CMUCS)				: "multimax"
734hosttype:						: isamultimax(0)
735ostype	: defined(CMUCS)				: "mach"
736ostype	:						: isamultimax(1)
737machtype:						: "ns32000"
738enddef	:
739
740
741newdef	: defined(iconuxv)
742comment : Icon 88k running Unix
743vendor	:						: "icon"
744hosttype:						: "icon"
745ostype	:						: "iconuxv"
746machtype: defined(m88k)					: "m88k"
747enddef	:
748
749
750newdef	: defined(_CRAY) && defined(_CRAYCOM)
751comment : Cray Computer Corp. running CSOS
752vendor	:						: "ccc"
753hosttype: defined(_CRAY2)				: "cray"
754hosttype: defined(_CRAY3)				: "cray"
755hosttype: defined(_CRAY4)				: "cray"
756ostype	:						: "CSOS"
757machtype: defined(_CRAY2)				: "cray2"
758machtype: defined(_CRAY3)				: "cray3"
759machtype: defined(_CRAY4)				: "cray4"
760enddef	:
761
762
763newdef	: defined(cray) && !defined(_CRAYMPP)
764comment : Cray Research Inc. PVP running UNICOS
765vendor	:						: "cri"
766hosttype:						: getcray()
767ostype	:						: "unicos"
768machtype:						: getcray()
769enddef	:
770
771
772newdef	: defined(cray) && defined(_CRAYT3D)
773comment : Cray Research Inc. running UNICOS MAX
774vendor	:						: "cri"
775hosttype:						: getcray()
776ostype	:						: "unicosmax"
777machtype:						: getcray()
778enddef	:
779
780
781newdef	: defined(cray) && defined(_CRAYT3E)
782comment : Cray Research Inc. running UNICOS/mk
783vendor	:						: "cri"
784hosttype:						: getcray()
785ostype	:						: "unicosmk"
786machtype:						: getcray()
787enddef	:
788
789
790newdef	: defined(convex)
791comment : Convex
792vendor	:						: "convex"
793hosttype:						: "convex"
794ostype	:						: "convexos"
795machtype:						: getconvex()
796enddef	:
797
798
799newdef	: defined(butterfly)
800comment : BBN Butterfly 1000
801vendor	:						: "bbn"
802hosttype:						: "butterfly"
803machtype: defined(mc68020)				: "m68k"
804enddef	:
805
806
807newdef	: defined(NeXT)
808comment : NeXTStep
809vendor	:						: "next"
810hosttype: defined(mc68020)				: "next"
811hosttype: defined(M_i386) 				: "intel-pc"
812hosttype: defined(hppa)	  				: "hp"
813hosttype: defined(sparc)  				: "sun"
814ostype	:						: "nextstep"
815machtype: defined(mc68020)				: "m68k"
816machtype: defined(M_i386) 				: "i386"
817machtype: defined(hppa)	  				: "hppa"
818machtype: defined(sparc)  				: "sparc"
819enddef	:
820
821
822newdef	: defined(__APPLE__) && defined(__MACH__)
823comment : OS X
824vendor	:						: "apple"
825hosttype: defined(i386)					: "intel-pc"
826hosttype: defined(ppc)					: "powermac"
827ostype	:						: "darwin"
828machtype: defined(i386)					: "i386"
829machtype: defined(ppc)					: "powerpc"
830enddef	:
831
832
833newdef	: defined(sony_news)
834comment : Sony NEWS 800 or 1700 workstation
835vendor	:						: "sony"
836hosttype: defined(mips)					: "news_mips"
837hosttype: defined(mc68020)				: "news_m68k"
838ostype	:						: "News"
839machtype: defined(mc68020)				: "m68k"
840machtype: defined(M_mipsel)				: "mipsel"
841machtype: defined(M_mipseb)				: "mipseb"
842enddef	:
843
844
845newdef	: defined(sgi)
846comment : Silicon Graphics
847vendor	:						: "sgi"
848hosttype: defined(M_mipsel)				: "iris4d"
849hosttype: defined(M_mipseb)				: "iris4d"
850hosttype: defined(mc68000)				: "iris3d"
851ostype	:						: "irix"
852machtype: defined(M_mipsel)				: "mipsel"
853machtype: defined(M_mipseb)				: "mipseb"
854machtype: defined(mc68000)				: "mc68000"
855enddef	:
856
857
858newdef	: defined(ultrix) || defined(__ultrix)
859comment : Digital's Ultrix 
860vendor	:						: "dec"
861hosttype: defined(M_mipsel)				: "decstation"
862hosttype: defined(M_mipseb)				: "decmips"
863hosttype: defined(vax)					: "vax"
864ostype	:						: "ultrix"
865machtype: defined(M_mipsel)				: "mipsel"
866machtype: defined(M_mipseb)				: "mipseb"
867machtype: defined(vax)					: "vax"
868enddef	:
869
870
871newdef	: defined(MIPS)
872comment : Mips OS
873vendor	:						: "mips"
874hosttype: defined(M_mipsel)				: "mips"
875hosttype: defined(M_mipseb)				: "mips"
876ostype	:						: "mips"
877machtype: defined(M_mipsel)				: "mipsel"
878machtype: defined(M_mipseb)				: "mipseb"
879enddef	:
880
881
882newdef	: defined(DECOSF1)
883comment : Digital's alpha running osf1
884vendor	:						: "dec"
885ostype	:						: "osf1"
886hosttype: defined(alpha)				: "alpha"
887machtype: defined(alpha)				: "alpha"
888enddef	:
889
890
891newdef	: defined(Lynx)
892comment : Lynx OS 2.1
893vendor	:						: "Lynx"
894hosttype: defined(M_mipsel)				: "lynxos-mips"
895hosttype: defined(M_mipseb)				: "lynxos-mips"
896hosttype: defined(M_i386)				: "lynxos-i386"
897hosttype: defined(i860)					: "lynxos-i860"
898hosttype: defined(m68k)					: "lynxos-m68k"
899hosttype: defined(m88k)					: "lynxos-m88k"
900hosttype: defined(sparc)				: "lynxos-sparc"
901hosttype:						: "lynxos-unknown"
902ostype	:						: "LynxOS"
903machtype: defined(M_mipsel)				: "mipsel"
904machtype: defined(M_mipseb)				: "mipseb"
905machtype: defined(M_i386)				: "i386"
906machtype: defined(i860)					: "i860"
907machtype: defined(m68k)					: "m68k"
908machtype: defined(m88k)					: "m88k"
909machtype: defined(sparc)				: "sparc"
910enddef	:
911
912
913newdef	: defined(masscomp)
914comment : Masscomp
915vendor	:						: "masscomp"
916hosttype:						: "masscomp"
917ostype	:						: "masscomp"
918enddef	:
919
920newdef	: defined(__MACHTEN__)
921comment : Machintosh
922vendor	:						: "Tenon"
923hosttype:						: "Macintosh"
924ostype	:						: "MachTen"
925machtype:						: "Macintosh"
926enddef	:
927
928
929
930newdef	: defined(GOULD_NP1)
931comment : Gould
932vendor	:						: "gould"
933hosttype:						: "gould_np1"
934machtype:						: "gould"
935enddef	:
936
937
938newdef	: defined(MULTIFLOW)
939comment : Multiflow running 4.3BSD
940vendor	:						: "multiflow"
941hosttype:						: "multiflow"
942machtype:						: "multiflow"
943ostype	:						: "bsd43"
944enddef	:
945
946
947newdef	: defined(SXA)
948comment : PFU/Fujitsu A-xx computer
949vendor	:						: "sxa"
950hosttype:						: "pfa50"
951ostype	: defined(_BSDX_)				: "e60-bsdx"
952ostype	:						: "e60"
953machtype:						: "pfa50"
954enddef	:
955
956
957newdef	: defined(titan)
958comment : (St)Ardent Titan
959vendor	:						: "ardent"
960hosttype:						: "titan"
961enddef	:
962
963
964newdef	: defined(stellar)
965comment : Stellar
966vendor	:						: "stellar"
967hosttype:						: "stellar"
968ostype	:						: "stellix"
969enddef	:
970
971
972newdef	: defined(atari)
973comment : Atari TT running SVR4. This machine was never
974comment : commercially available.
975vendor	:						: "atari"
976hosttype:						: "atari"
977ostype	:						: "asv"
978enddef	:
979
980
981newdef	: defined(OPUS)
982comment : ???
983vendor	:						: "opus"
984hosttype:						: "opus"
985enddef	:
986
987
988newdef	: defined(eta10)
989comment : ETA running SVR3
990vendor	:						: "eta"
991hosttype:						: "eta10"
992enddef	:
993
994
995newdef	: defined(hk68)
996comment : Heurikon HK68 running Uniplus+ 5.0
997vendor	:						: "heurikon"
998hosttype:						: "hk68"
999ostype	:						: "uniplus"
1000enddef	:
1001
1002
1003newdef	: defined(NDIX)
1004comment : Norsk Data ND 500/5000 running Ndix
1005vendor	:						: "norsk"
1006hosttype:						: "nd500"
1007ostype	:						: "ndix"
1008enddef	:
1009
1010
1011newdef	: defined(AMIGA)
1012comment : Amiga running AmigaOS+GG
1013vendor	:						: "commodore"
1014hosttype:						: "amiga"
1015ostype	:						: "AmigaOS"
1016machtype:						: "m68k"
1017enddef	:
1018
1019
1020newdef	: defined(uts)
1021comment : Amdahl running uts 2.1
1022vendor	:						: "amdahl"
1023hosttype:						: "amdahl"
1024ostype	:						: "uts"
1025machtype:						: "amdahl"
1026enddef	:
1027
1028
1029newdef	: defined(UTek)
1030comment : Tektronix 4300 running UTek (BSD 4.2 / 68020 based)
1031vendor	:						: "tektronix"
1032hosttype:						: "tek4300"
1033enddef	:
1034
1035
1036newdef	: defined(UTekV)
1037comment : Tektronix XD88/10 running UTekV 3.2e (SVR3/88100 based)
1038vendor	:						: "tektronix"
1039hosttype:						: "tekXD88"
1040enddef	:
1041
1042
1043newdef	: defined(__DGUX__)
1044comment : Data-General AViiON running DGUX
1045hosttype:						: "aviion"
1046ostype	:						: "dgux"
1047vendor	:						: "dg"
1048machtype: defined(m88k)					: "m88k"
1049machtype: defined(i386)					: "pentium"
1050enddef	:
1051
1052
1053newdef	: defined(sysV68)
1054comment : Motorola MPC running System V/68 R32V2 (SVR3/68020 based)
1055vendor	:						: "motorola"
1056hosttype:						: "sysV68"
1057machtype:						: "m68k"
1058enddef	:
1059
1060
1061newdef	: defined(supermax)
1062comment : DDE Supermax running System V/68 R3 (SVR3/68020 based)
1063vendor	:						: "supermax"
1064hosttype:						: "supermax"
1065machtype:						: "m68k"
1066enddef	:
1067
1068
1069newdef	: defined(sysV88)
1070comment : Motorola MPC running System V/88 R32V2 (SVR3/88100 based)
1071vendor	:						: "motorola"
1072hosttype:						: "sysV88"
1073machtype:						: "m88k"
1074enddef	:
1075
1076
1077newdef	: defined(__clipper__)
1078comment : Clipper Chipset (Intergraph)
1079vendor	:						: "intergraph"
1080hosttype:						: "clipper"
1081machtype:						: "clipper"
1082enddef	:
1083
1084newdef : defined(__QNX__)
1085ostype :						: "qnx"
1086enddef :
1087
1088newdef	: (defined(SNI) || defined(sinix)) && !defined(_OSD_POSIX)
1089comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): SINIX aka. ReliantUNIX, a SVR4 derivative
1090vendor	:						: "fsc"
1091hosttype: defined(M_intel)				: "wx200i"
1092hosttype: defined(MIPSEB)				: "rm400"
1093ostype	: defined(sinix)				: "sinix"
1094machtype: defined(M_i586)				: "i586"
1095machtype: defined(M_i486)				: "i486"
1096machtype: defined(M_i386)				: "i386"
1097machtype: defined(M_mipsel)				: "mipsel"
1098machtype: defined(M_mipseb)				: "mipseb"
1099machtype:						: "mips"
1100enddef	:
1101
1102newdef	: defined(_OSD_POSIX)
1103comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): BS2000 POSIX (mainframe, EBCDIC)
1104vendor	:						: "fsc"
1105hosttype:						: "bs2000"
1106ostype	:						: "osdposix"
1107machtype: #machine(7500)				: "s390"
1108machtype: #machine(mips)				: "mips"
1109machtype: #machine(sparc)				: "sparc"
1110machtype:						: "bs2000"
1111enddef	:
1112
1113newdef	: defined(__MVS__)
1114comment : ibm uss s/390 (mainframe, EBCDIC)
1115vendor	:						: "ibm"
1116hosttype:						: "s390"
1117ostype	:						: "os390"
1118machtype:						: "s390"
1119enddef	:
1120
1121newdef	: defined(_SX)
1122comment : NEC Corporation (SX-4)
1123vendor	:						: "nec"
1124ostype	:						: "superux"
1125hosttype:						: "sx4"
1126machtype:						: "sx4"
1127enddef	:
1128
1129newdef	: !defined(SOLARIS2) && (SYSVREL == 4)
1130comment : Unix System V Release 4.0
1131vendor	: defined(DELL)					: "dell"
1132hosttype: defined(M_i386)				: "i386"
1133ostype	:						: "svr4"
1134machtype: defined(M_i386)				: "i386"
1135enddef	:
1136
1137newdef	: defined(__uxp__) || defined(__uxps__)
1138comment : FUJITSU DS/90 7000
1139vendor	:						: "fujitsu"
1140hosttype:						: "ds90"
1141ostype	:						: "sysv4"
1142machtype:						: "sparc"
1143enddef	:
1144
1145newdef	: defined(__CYGWIN__)
1146comment : Cygwin
1147vendor	:						: "intel"
1148hosttype:						: gethost()
1149ostype	:						: getostype()
1150machtype:						: getmach()
1151enddef	:
1152
1153newdef	: defined(_UWIN)
1154comment : AT&T Research Unix for Windows
1155vendor	:						: "att"
1156hosttype:						: "win32.i386"
1157machtype:						: "i386"
1158enddef	:
1159
1160
1161newdef	: defined(mc68000) || defined(mc68k32) || defined(m68k) || defined(mc68010) || defined(mc68020)
1162hosttype:						: "m68k"
1163vendor	: defined(m68k)					: "motorola"
1164machtype:						: "m68k"
1165enddef	:
1166
1167
1168newdef	: defined(m88k)
1169hosttype:						: "m88k"
1170machtype:						: "m88k"
1171enddef	:
1172
1173
1174newdef	: defined(M_intel)
1175hosttype: defined(M_i586)				: "i586"
1176hosttype: defined(M_i486)				: "i486"
1177hosttype: defined(M_i386)				: "i386"
1178vendor	:						: "intel"
1179machtype: defined(M_i586)				: "i586"
1180machtype: defined(M_i486)				: "i486"
1181machtype: defined(M_i386)				: "i386"
1182enddef	:
1183
1184
1185newdef	: defined(sparc)
1186hosttype:						: "sparc"
1187machtype:						: "sparc"
1188enddef	:
1189
1190
1191newdef	: defined(i860)
1192hosttype:						: "i860"
1193machtype:						: "i860"
1194enddef	:
1195
1196
1197newdef	: defined(osf1)
1198ostype	:						: "osf1"
1199enddef	:
1200
1201
1202newdef	: SYSVREL == 0
1203ostype	: defined(BSD4_4)				: "bsd44"
1204ostype	: defined(BSD)					: "bsd"
1205ostype	: defined(POSIX)				: "posix"
1206enddef	:
1207
1208
1209newdef	: SYSVREL == 1
1210ostype	:						: "svr1"
1211enddef	:
1212
1213
1214newdef	: SYSVREL == 2
1215ostype	:						: "svr2"
1216enddef	:
1217
1218
1219newdef	: SYSVREL == 3
1220ostype	:						: "svr3"
1221enddef	:
1222
1223
1224newdef	: SYSVREL == 4
1225ostype	:						: "svr4"
1226enddef	:
1227
1228
1229newcode :
1230#ifndef _hosttype_
1231    hosttype = "unknown";
1232#endif
1233#ifndef _ostype_
1234    ostype = "unknown";
1235#endif
1236#ifndef _vendor_
1237    vendor = "unknown";
1238#endif
1239#ifndef _machtype_
1240    machtype = "unknown";
1241#endif
1242    tsetenv(STRHOSTTYPE, str2short(hosttype));
1243    tsetenv(STRVENDOR,	 str2short(vendor));
1244    tsetenv(STROSTYPE,	 str2short(ostype));
1245    tsetenv(STRMACHTYPE, str2short(machtype));
1246} /* end setmachine */
1247endcode :
1248