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