Complete upgrade of tcsh 6.18.01 => 6.19.00
[dragonfly.git] / bin / csh / host.defs
1 newcode :
2 /* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.60 2013/03/13 15:53:38 corinna Exp $ */
3 /*
4  * host.defs: Hosttype/Machtype etc.
5  */
6 /*-
7  * Copyright (c) 1980, 1991 The Regents of the University of California.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. Neither the name of the University nor the names of its contributors
19  *    may be used to endorse or promote products derived from this software
20  *    without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  */
34 #include "sh.h"
35
36 RCSID("$tcsh: host.defs,v 1.60 2013/03/13 15:53:38 corinna 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)                              : "x86_64"
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(__DragonFly__)
630 comment : DragonFly
631 vendor  : defined(M_intel)                              : "intel"
632 vendor  : defined(x86_64)                               : "amd"
633 hosttype:                                               : "DragonFly"
634 ostype  :                                               : "DragonFly"
635 machtype: defined(x86_64)                               : "x86_64"
636 enddef  :
637
638
639 newdef  : defined(MidnightBSD)
640 comment : MidnightBSD
641 vendor  : defined(M_intel)                              : "intel"
642 hosttype:                                               : "MidnightBSD"
643 ostype  :                                               : "MidnightBSD"
644 machtype: defined(M_i386)                               : "i386"
645 enddef  :
646
647
648 newdef  : defined(__386BSD__)
649 comment : Bill Jolitz's 386BSD
650 vendor  : defined(M_intel)                              : "intel"
651 hosttype:                                               : "386BSD"
652 ostype  :                                               : "386BSD"
653 machtype:                                               : "i386"
654 enddef  :
655
656
657 newdef  : defined(bsdi)
658 comment : BSDI's unix
659 vendor  : defined(M_intel)                              : "intel"
660 vendor  : defined(sparc)                                : "sun"
661 vendor  : defined(powerpc)                              : "motorola"
662 hosttype: defined(M_intel)                              : "bsd386"
663 hosttype: defined(sparc)                                : "bsd-sparc"
664 hosttype: defined(powerpc)                              : "bsd-powerpc"
665 ostype  :                                               : "bsdi"
666 machtype: defined(M_i386)                               : "i386"
667 machtype: defined(sparc)                                : "sparc"
668 machtype: defined(powerpc)                              : "powerpc"
669 enddef  :
670
671
672 newdef  : defined(COHERENT)
673 comment : COHERENT's unix
674 vendor  : defined(_I386)                                : "intel"
675 hosttype:                                               : "coh386"
676 hosttype:                                               : "coherent"
677 ostype  :                                               : "coherent"
678 machtype: defined(_I386)                                : "i386"
679 enddef  :
680
681 newdef  : defined(concurrent)
682 comment : Concurrent PowerHawk
683 vendor  :                                               : "concurrent"
684 hosttype:                                               : "powerhawk"
685 ostype  :                                               : "powermax_os"
686 machtype:                                               : "powerhawk"
687 enddef  :
688
689 newdef  : defined(SCO)
690 comment : SCO UNIX System V/386 Release 3.2
691 vendor  :                                               : "sco"
692 hosttype:                                               : "sco386"
693 ostype  :                                               : "sco_unix"
694 machtype:                                               : "i386"
695 enddef  :
696
697 newdef  : defined(M_XENIX) && !defined(M_UNIX)
698 comment : SCO XENIX
699 vendor  :                                               : "sco"
700 hosttype:                                               : "sco_xenix"
701 ostype  :                                               : "sco_xenix"
702 machtype: defined(M_I386)                               : "i386"
703 machtype: defined(M_I286)                               : "i286"
704 enddef  :
705
706
707 newdef  : defined(ISC) || defined(ISC202)
708 comment : Interactive Unix
709 vendor  :                                               : "isc"
710 hosttype:                                               : "isc386"
711 ostype  : defined(POSIX)                                : "POSIX"
712 ostype  :                                               : "SVR3"
713 machtype: defined(M_i386)                               : "i386"
714 enddef  :
715
716
717 newdef  : defined(INTEL)
718 comment : Intel Unix
719 vendor  :                                               : "intel"
720 hosttype:                                               : "intel386"
721 ostype  :                                               : "intel_unix"
722 machtype: defined(M_i386)                               : "i386"
723 enddef  :
724
725
726 newdef  : defined(MACH)
727 comment : cmu's mach
728 vendor  :                                               : "cmu"
729 hosttype: defined(M_i386)                               : "i386-mach"
730 ostype  :                                               : "mach"
731 machtype: defined(M_i386)                               : "i386"
732 enddef  :
733
734
735 newdef  : defined(alliant)
736 comment : Alliants FSX
737 vendor  :                                               : "alliant"
738 hosttype: defined(mc68000)                              : "alliant-fx80"
739 hosttype: defined(i860)                                 : "alliant-fx2800"
740 hosttype:                                               : "alliant"
741 ostype  :                                               : "fsx"
742 machtype: defined(mc68000)                              : "mc68000"
743 machtype: defined(i860)                                 : "i860"
744 enddef  :
745
746
747 newdef  : defined(_FTX)
748 comment : Stratus Computer, Inc FTX2 (i860 based)
749 comment : Stratus Computer, Inc FTX3 (HPPA based)
750 vendor  :                                               : "stratus"
751 hosttype: defined(i860) && defined(_FTX)                : "atlantic"
752 hosttype: defined(hppa) && defined(_FTX)                : "continuum"
753 ostype  : defined(i860) && defined(_FTX)                : "ftx2"
754 ostype  : defined(hppa) && defined(_FTX)                : "ftx3"
755 machtype: defined(i860)                                 : "i860"
756 machtype: defined(hppa)                                 : "hppa"
757 enddef  :
758
759
760 newdef  : defined(sequent) || defined(_SEQUENT_)
761 comment : Sequent Balance (32000 based)
762 comment : Sequent Symmetry running DYNIX/ptx (386/486 based)
763 comment : Sequent Symmetry running DYNIX 3 (386/486 based)
764 vendor  :                                               : "sequent"
765 hosttype: defined(M_i386) && defined(sequent)           : "symmetry"
766 hosttype: defined(M_i386)                               : "ptx"
767 hosttype:                                               : "balance"
768 ostype  : defined(M_i386) && !defined(sequent)          : "ptx"
769 ostype  :                                               : "dynix3"
770 machtype: defined(M_i386)                               : "i386"
771 machtype: defined(ns32000)                              : "ns32000"
772 enddef  :
773
774
775 newdef  : defined(ns32000)
776 comment : Encore Computer Corp. Multimax (32000 based)
777 vendor  :                                               : "encore"
778 hosttype: defined(CMUCS)                                : "multimax"
779 hosttype:                                               : isamultimax(0)
780 ostype  : defined(CMUCS)                                : "mach"
781 ostype  :                                               : isamultimax(1)
782 machtype:                                               : "ns32000"
783 enddef  :
784
785
786 newdef  : defined(iconuxv)
787 comment : Icon 88k running Unix
788 vendor  :                                               : "icon"
789 hosttype:                                               : "icon"
790 ostype  :                                               : "iconuxv"
791 machtype: defined(m88k)                                 : "m88k"
792 enddef  :
793
794
795 newdef  : defined(_CRAY) && defined(_CRAYCOM)
796 comment : Cray Computer Corp. running CSOS
797 vendor  :                                               : "ccc"
798 hosttype: defined(_CRAY2)                               : "cray"
799 hosttype: defined(_CRAY3)                               : "cray"
800 hosttype: defined(_CRAY4)                               : "cray"
801 ostype  :                                               : "CSOS"
802 machtype: defined(_CRAY2)                               : "cray2"
803 machtype: defined(_CRAY3)                               : "cray3"
804 machtype: defined(_CRAY4)                               : "cray4"
805 enddef  :
806
807
808 newdef  : defined(cray) && !defined(_CRAYMPP)
809 comment : Cray Research Inc. PVP running UNICOS
810 vendor  :                                               : "cri"
811 hosttype:                                               : getcray()
812 ostype  :                                               : "unicos"
813 machtype:                                               : getcray()
814 enddef  :
815
816
817 newdef  : defined(cray) && defined(_CRAYT3D)
818 comment : Cray Research Inc. running UNICOS MAX
819 vendor  :                                               : "cri"
820 hosttype:                                               : getcray()
821 ostype  :                                               : "unicosmax"
822 machtype:                                               : getcray()
823 enddef  :
824
825
826 newdef  : defined(cray) && defined(_CRAYT3E)
827 comment : Cray Research Inc. running UNICOS/mk
828 vendor  :                                               : "cri"
829 hosttype:                                               : getcray()
830 ostype  :                                               : "unicosmk"
831 machtype:                                               : getcray()
832 enddef  :
833
834
835 newdef  : defined(convex)
836 comment : Convex
837 vendor  :                                               : "convex"
838 hosttype:                                               : "convex"
839 ostype  :                                               : "convexos"
840 machtype:                                               : getconvex()
841 enddef  :
842
843
844 newdef  : defined(butterfly)
845 comment : BBN Butterfly 1000
846 vendor  :                                               : "bbn"
847 hosttype:                                               : "butterfly"
848 machtype: defined(mc68020)                              : "m68k"
849 enddef  :
850
851
852 newdef  : defined(NeXT)
853 comment : NeXTStep
854 vendor  :                                               : "next"
855 hosttype: defined(mc68020)                              : "next"
856 hosttype: defined(M_i386)                               : "intel-pc"
857 hosttype: defined(hppa)                                 : "hp"
858 hosttype: defined(sparc)                                : "sun"
859 ostype  :                                               : "nextstep"
860 machtype: defined(mc68020)                              : "m68k"
861 machtype: defined(M_i386)                               : "i386"
862 machtype: defined(hppa)                                 : "hppa"
863 machtype: defined(sparc)                                : "sparc"
864 enddef  :
865
866
867 newdef  : defined(APPLE) && defined(MACH)
868 comment : OS X
869 vendor  :                                               : "apple"
870 hosttype: defined(i386)                                 : "intel-pc"
871 hosttype: defined(ppc)                                  : "powermac"
872 hosttype: defined(M_amd64)                              : "amd"
873 ostype  :                                               : "darwin"
874 machtype: defined(i386)                                 : "i386"
875 machtype: defined(M_amd64)                              : "x86_64"
876 machtype: defined(ppc)                                  : "powerpc"
877 enddef  :
878
879
880 newdef  : defined(sony_news)
881 comment : Sony NEWS 800 or 1700 workstation
882 vendor  :                                               : "sony"
883 hosttype: defined(mips)                                 : "news_mips"
884 hosttype: defined(mc68020)                              : "news_m68k"
885 ostype  :                                               : "News"
886 machtype: defined(mc68020)                              : "m68k"
887 machtype: defined(M_mipsel)                             : "mipsel"
888 machtype: defined(M_mipseb)                             : "mipseb"
889 enddef  :
890
891
892 newdef  : defined(sgi)
893 comment : Silicon Graphics
894 vendor  :                                               : "sgi"
895 hosttype: defined(M_mipsel)                             : "iris4d"
896 hosttype: defined(M_mipseb)                             : "iris4d"
897 hosttype: defined(mc68000)                              : "iris3d"
898 ostype  :                                               : "irix"
899 machtype: defined(M_mipsel)                             : "mipsel"
900 machtype: defined(M_mipseb)                             : "mipseb"
901 machtype: defined(mc68000)                              : "mc68000"
902 enddef  :
903
904
905 newdef  : defined(ultrix)
906 comment : Digital's Ultrix
907 vendor  :                                               : "dec"
908 hosttype: defined(M_mipsel)                             : "decstation"
909 hosttype: defined(M_mipseb)                             : "decmips"
910 hosttype: defined(vax)                                  : "vax"
911 ostype  :                                               : "ultrix"
912 machtype: defined(M_mipsel)                             : "mipsel"
913 machtype: defined(M_mipseb)                             : "mipseb"
914 machtype: defined(vax)                                  : "vax"
915 enddef  :
916
917
918 newdef  : defined(MIPS)
919 comment : Mips OS
920 vendor  :                                               : "mips"
921 hosttype: defined(M_mipsel)                             : "mips"
922 hosttype: defined(M_mipseb)                             : "mips"
923 ostype  :                                               : "mips"
924 machtype: defined(M_mipsel)                             : "mipsel"
925 machtype: defined(M_mipseb)                             : "mipseb"
926 enddef  :
927
928
929 newdef  : defined(DECOSF1)
930 comment : Digital's alpha running osf1
931 vendor  :                                               : "dec"
932 ostype  :                                               : "osf1"
933 hosttype: defined(alpha)                                : "alpha"
934 machtype: defined(alpha)                                : "alpha"
935 enddef  :
936
937
938 newdef  : defined(Lynx)
939 comment : Lynx OS 2.1
940 vendor  :                                               : "Lynx"
941 hosttype: defined(M_mipsel)                             : "lynxos-mips"
942 hosttype: defined(M_mipseb)                             : "lynxos-mips"
943 hosttype: defined(M_i386)                               : "lynxos-i386"
944 hosttype: defined(i860)                                 : "lynxos-i860"
945 hosttype: defined(m68k)                                 : "lynxos-m68k"
946 hosttype: defined(m88k)                                 : "lynxos-m88k"
947 hosttype: defined(sparc)                                : "lynxos-sparc"
948 hosttype:                                               : "lynxos-unknown"
949 ostype  :                                               : "LynxOS"
950 machtype: defined(M_mipsel)                             : "mipsel"
951 machtype: defined(M_mipseb)                             : "mipseb"
952 machtype: defined(M_i386)                               : "i386"
953 machtype: defined(i860)                                 : "i860"
954 machtype: defined(m68k)                                 : "m68k"
955 machtype: defined(m88k)                                 : "m88k"
956 machtype: defined(sparc)                                : "sparc"
957 enddef  :
958
959
960 newdef  : defined(masscomp)
961 comment : Masscomp
962 vendor  :                                               : "masscomp"
963 hosttype:                                               : "masscomp"
964 ostype  :                                               : "masscomp"
965 enddef  :
966
967 newdef  : defined(MACHTEN)
968 comment : Machintosh
969 vendor  :                                               : "Tenon"
970 hosttype:                                               : "Macintosh"
971 ostype  :                                               : "MachTen"
972 machtype:                                               : "Macintosh"
973 enddef  :
974
975
976
977 newdef  : defined(GOULD_NP1)
978 comment : Gould
979 vendor  :                                               : "gould"
980 hosttype:                                               : "gould_np1"
981 machtype:                                               : "gould"
982 enddef  :
983
984
985 newdef  : defined(MULTIFLOW)
986 comment : Multiflow running 4.3BSD
987 vendor  :                                               : "multiflow"
988 hosttype:                                               : "multiflow"
989 machtype:                                               : "multiflow"
990 ostype  :                                               : "bsd43"
991 enddef  :
992
993
994 newdef  : defined(SXA)
995 comment : PFU/Fujitsu A-xx computer
996 vendor  :                                               : "sxa"
997 hosttype:                                               : "pfa50"
998 ostype  : defined(_BSDX_)                               : "e60-bsdx"
999 ostype  :                                               : "e60"
1000 machtype:                                               : "pfa50"
1001 enddef  :
1002
1003
1004 newdef  : defined(titan)
1005 comment : (St)Ardent Titan
1006 vendor  :                                               : "ardent"
1007 hosttype:                                               : "titan"
1008 enddef  :
1009
1010
1011 newdef  : defined(stellar)
1012 comment : Stellar
1013 vendor  :                                               : "stellar"
1014 hosttype:                                               : "stellar"
1015 ostype  :                                               : "stellix"
1016 enddef  :
1017
1018
1019 newdef  : defined(atari)
1020 comment : Atari TT running SVR4. This machine was never
1021 comment : commercially available.
1022 vendor  :                                               : "atari"
1023 hosttype:                                               : "atari"
1024 ostype  :                                               : "asv"
1025 enddef  :
1026
1027
1028 newdef  : defined(OPUS)
1029 comment : ???
1030 vendor  :                                               : "opus"
1031 hosttype:                                               : "opus"
1032 enddef  :
1033
1034
1035 newdef  : defined(eta10)
1036 comment : ETA running SVR3
1037 vendor  :                                               : "eta"
1038 hosttype:                                               : "eta10"
1039 enddef  :
1040
1041
1042 newdef  : defined(hk68)
1043 comment : Heurikon HK68 running Uniplus+ 5.0
1044 vendor  :                                               : "heurikon"
1045 hosttype:                                               : "hk68"
1046 ostype  :                                               : "uniplus"
1047 enddef  :
1048
1049
1050 newdef  : defined(NDIX)
1051 comment : Norsk Data ND 500/5000 running Ndix
1052 vendor  :                                               : "norsk"
1053 hosttype:                                               : "nd500"
1054 ostype  :                                               : "ndix"
1055 enddef  :
1056
1057
1058 newdef  : defined(AMIGA)
1059 comment : Amiga running AmigaOS+GG
1060 vendor  :                                               : "commodore"
1061 hosttype:                                               : "amiga"
1062 ostype  :                                               : "AmigaOS"
1063 machtype:                                               : "m68k"
1064 enddef  :
1065
1066
1067 newdef  : defined(uts)
1068 comment : Amdahl running uts 2.1
1069 vendor  :                                               : "amdahl"
1070 hosttype:                                               : "amdahl"
1071 ostype  :                                               : "uts"
1072 machtype:                                               : "amdahl"
1073 enddef  :
1074
1075
1076 newdef  : defined(UTek)
1077 comment : Tektronix 4300 running UTek (BSD 4.2 / 68020 based)
1078 vendor  :                                               : "tektronix"
1079 hosttype:                                               : "tek4300"
1080 enddef  :
1081
1082
1083 newdef  : defined(UTekV)
1084 comment : Tektronix XD88/10 running UTekV 3.2e (SVR3/88100 based)
1085 vendor  :                                               : "tektronix"
1086 hosttype:                                               : "tekXD88"
1087 enddef  :
1088
1089
1090 newdef  : defined(DGUX)
1091 comment : Data-General AViiON running DGUX
1092 hosttype:                                               : "aviion"
1093 ostype  :                                               : "dgux"
1094 vendor  :                                               : "dg"
1095 machtype: defined(m88k)                                 : "m88k"
1096 machtype: defined(i386)                                 : "pentium"
1097 enddef  :
1098
1099
1100 newdef  : defined(sysV68)
1101 comment : Motorola MPC running System V/68 R32V2 (SVR3/68020 based)
1102 vendor  :                                               : "motorola"
1103 hosttype:                                               : "sysV68"
1104 machtype:                                               : "m68k"
1105 enddef  :
1106
1107
1108 newdef  : defined(supermax)
1109 comment : DDE Supermax running System V/68 R3 (SVR3/68020 based)
1110 vendor  :                                               : "supermax"
1111 hosttype:                                               : "supermax"
1112 machtype:                                               : "m68k"
1113 enddef  :
1114
1115
1116 newdef  : defined(sysV88)
1117 comment : Motorola MPC running System V/88 R32V2 (SVR3/88100 based)
1118 vendor  :                                               : "motorola"
1119 hosttype:                                               : "sysV88"
1120 machtype:                                               : "m88k"
1121 enddef  :
1122
1123
1124 newdef  : defined(clipper)
1125 comment : Clipper Chipset (Intergraph)
1126 vendor  :                                               : "intergraph"
1127 hosttype:                                               : "clipper"
1128 machtype:                                               : "clipper"
1129 enddef  :
1130
1131 newdef : defined(QNX)
1132 ostype :                                                : "qnx"
1133 enddef :
1134
1135 newdef  : (defined(SNI) || defined(sinix)) && !defined(_OSD_POSIX)
1136 comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): SINIX aka. ReliantUNIX, a SVR4 derivative
1137 vendor  :                                               : "fsc"
1138 hosttype: defined(M_intel)                              : "wx200i"
1139 hosttype: defined(MIPSEB)                               : "rm400"
1140 ostype  : defined(sinix)                                : "sinix"
1141 machtype: defined(M_i586)                               : "i586"
1142 machtype: defined(M_i486)                               : "i486"
1143 machtype: defined(M_i386)                               : "i386"
1144 machtype: defined(M_mipsel)                             : "mipsel"
1145 machtype: defined(M_mipseb)                             : "mipseb"
1146 machtype:                                               : "mips"
1147 enddef  :
1148
1149 newdef  : defined(_OSD_POSIX)
1150 comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): BS2000 POSIX (mainframe, EBCDIC)
1151 vendor  :                                               : "fsc"
1152 hosttype:                                               : "bs2000"
1153 ostype  :                                               : "osdposix"
1154 machtype: #machine(7500)                                : "s390"
1155 machtype: #machine(mips)                                : "mips"
1156 machtype: #machine(sparc)                               : "sparc"
1157 machtype:                                               : "bs2000"
1158 enddef  :
1159
1160 newdef  : defined(MVS)
1161 comment : ibm uss s/390 (mainframe, EBCDIC)
1162 vendor  :                                               : "ibm"
1163 hosttype:                                               : "s390"
1164 ostype  :                                               : "os390"
1165 machtype:                                               : "s390"
1166 enddef  :
1167
1168 newdef  : defined(_SX)
1169 comment : NEC Corporation (SX-4)
1170 vendor  :                                               : "nec"
1171 ostype  :                                               : "superux"
1172 hosttype:                                               : "sx4"
1173 machtype:                                               : "sx4"
1174 enddef  :
1175
1176 newdef  : !defined(SOLARIS2) && (SYSVREL == 4)
1177 comment : Unix System V Release 4.0
1178 vendor  : defined(DELL)                                 : "dell"
1179 hosttype: defined(M_i386)                               : "i386"
1180 ostype  :                                               : "svr4"
1181 machtype: defined(M_i386)                               : "i386"
1182 enddef  :
1183
1184 newdef  : defined(uxp) || defined(uxps)
1185 comment : FUJITSU DS/90 7000
1186 vendor  :                                               : "fujitsu"
1187 hosttype:                                               : "ds90"
1188 ostype  :                                               : "sysv4"
1189 machtype:                                               : "sparc"
1190 enddef  :
1191
1192 newdef  : defined(CYGWIN)
1193 comment : Cygwin
1194 vendor  : defined(M_intel)                              : "intel"
1195 hosttype:                                               : gethost()
1196 ostype  :                                               : getostype()
1197 machtype:                                               : getmach()
1198 enddef  :
1199
1200 newdef  : defined(_UWIN)
1201 comment : AT&T Research Unix for Windows
1202 vendor  :                                               : "att"
1203 hosttype:                                               : "win32.i386"
1204 machtype:                                               : "i386"
1205 enddef  :
1206
1207
1208 newdef  : defined(mc68000) || defined(mc68k32) || defined(m68k) || defined(mc68010) || defined(mc68020)
1209 hosttype:                                               : "m68k"
1210 vendor  : defined(m68k)                                 : "motorola"
1211 machtype:                                               : "m68k"
1212 enddef  :
1213
1214
1215 newdef  : defined(m88k)
1216 hosttype:                                               : "m88k"
1217 machtype:                                               : "m88k"
1218 enddef  :
1219
1220
1221 newdef  : defined(M_intel)
1222 hosttype: defined(M_i586)                               : "i586"
1223 hosttype: defined(M_i486)                               : "i486"
1224 hosttype: defined(M_i386)                               : "i386"
1225 vendor  :                                               : "intel"
1226 machtype: defined(M_i586)                               : "i586"
1227 machtype: defined(M_i486)                               : "i486"
1228 machtype: defined(M_i386)                               : "i386"
1229 enddef  :
1230
1231
1232 newdef  : defined(sparc)
1233 hosttype:                                               : "sparc"
1234 machtype:                                               : "sparc"
1235 enddef  :
1236
1237
1238 newdef  : defined(i860)
1239 hosttype:                                               : "i860"
1240 machtype:                                               : "i860"
1241 enddef  :
1242
1243
1244 newdef  : defined(osf1)
1245 ostype  :                                               : "osf1"
1246 enddef  :
1247
1248
1249 newdef  : SYSVREL == 0
1250 ostype  : defined(BSD4_4)                               : "bsd44"
1251 ostype  : defined(BSD)                                  : "bsd"
1252 ostype  : defined(POSIX)                                : "posix"
1253 enddef  :
1254
1255
1256 newdef  : SYSVREL == 1
1257 ostype  :                                               : "svr1"
1258 enddef  :
1259
1260
1261 newdef  : SYSVREL == 2
1262 ostype  :                                               : "svr2"
1263 enddef  :
1264
1265
1266 newdef  : SYSVREL == 3
1267 ostype  :                                               : "svr3"
1268 enddef  :
1269
1270
1271 newdef  : SYSVREL == 4
1272 ostype  :                                               : "svr4"
1273 enddef  :
1274
1275
1276 newcode :
1277 #ifndef _hosttype_
1278     hosttype = "unknown";
1279 #endif
1280 #ifndef _ostype_
1281     ostype = "unknown";
1282 #endif
1283 #ifndef _vendor_
1284     vendor = "unknown";
1285 #endif
1286 #ifndef _machtype_
1287     machtype = "unknown";
1288 #endif
1289     tsetenv(STRHOSTTYPE, str2short(hosttype));
1290     tsetenv(STRVENDOR,   str2short(vendor));
1291     tsetenv(STROSTYPE,   str2short(ostype));
1292     tsetenv(STRMACHTYPE, str2short(machtype));
1293 } /* end setmachine */
1294 endcode :