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