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