machine.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef lint
  2. static char rcsid[]="$Header: machine.c,v 1.2 85/02/14 15:49:22 daveb Exp $";
  3. #endif
  4. # include <stdio.h>
  5. # include <fcntl.h>
  6. /*
  7. ** machine.c
  8. **
  9. ** What machine are we on?
  10. **
  11. ** Usage: machine [-v]
  12. **
  13. ** by default prints one of:
  14. **
  15. ** amdahl Amdahl UTS
  16. ** u370 IBM 370
  17. ** u3b ATT 3b/20
  18. ** u3b2 3b/2
  19. ** u3b5 3b/5
  20. ** mc68k some 68000's
  21. ** mc68000 other 68000's
  22. ** vax DEC VAX
  23. ** pdp11 pdp 11
  24. ** pyr Pyramid 90x
  25. ** sun Sun workstation.
  26. ** tahoe CCI Power 6
  27. ** sel Gould/SEL
  28. **
  29. ** -v 'verbose' output is for managers.
  30. **
  31. ** If nothing is printed, we don't know what we're on.
  32. */
  33. static int vflag;
  34. static char * myname;
  35. static char * indent = "";
  36. main(argc, argv)
  37. int argc;
  38. char **argv;
  39. {
  40. int strcmp();
  41. int i = 0;
  42. myname = argv[0];
  43. while(--argc)
  44. {
  45. if(!strcmp(*++argv, "-v"))
  46. vflag = 1;
  47. else
  48. {
  49. fprintf(stderr, "bad argument `%s'\n", *argv);
  50. fprintf(stderr, "Usage: %s [-v]\n", myname);
  51. exit(1);
  52. }
  53. }
  54. if(vflag)
  55. {
  56. indent = "\t";
  57. printf("%s:\n", myname);
  58. }
  59. #ifdef amdahl
  60. printf("%samdahl\n", indent); /* could fold to u370 */
  61. if(vflag)
  62. printf("%sAmdahl 370 clone\n", indent);
  63. exit(0);
  64. #endif
  65. #ifdef u370
  66. printf("%su370\n", indent);
  67. if(vflag)
  68. printf("%sIBM 370 or clone\n", indent);
  69. exit(0);
  70. #endif
  71. #ifdef u3b
  72. printf("%su3b\n", indent);
  73. if(vflag)
  74. printf("%sATTIS 3b20\n", indent);
  75. exit(0);
  76. #endif
  77. #ifdef u3b2
  78. printf("%su3b2\n", indent);
  79. if(vflag)
  80. printf("%sATTIS 3b2\n", indent);
  81. exit(0);
  82. #endif
  83. #ifdef u3b5
  84. printf("%su3b5\n", indent);
  85. if(vflag)
  86. printf("%sATTIS 3b5\n", indent);
  87. exit(0);
  88. #endif
  89. #ifdef sun
  90. /* MUST BE BEFORE 68000 checks! */
  91. printf("%ssun\n", indent);
  92. if(vflag)
  93. printf("%sSUN Microsystems Workstation\n", indent);
  94. exit(0);
  95. #endif
  96. #ifdef mc68k
  97. printf("%smc68k\n", indent); /* could fold to mc68000 */
  98. if(vflag)
  99. printf("%sSome (System V?) 68000\n", indent);
  100. exit(0);
  101. #endif
  102. #ifdef mc68000
  103. printf("%smc68000\n", indent);
  104. if(vflag)
  105. printf("%sSome (BSD?) 68000\n", indent);
  106. exit(0);
  107. #endif
  108. #ifdef vax
  109. printf("%svax\n", indent);
  110. if(vflag)
  111. printf("%sDEC VAX\n", indent);
  112. exit(0);
  113. #endif
  114. #ifdef pdp11
  115. printf("%spdp11\n", indent);
  116. if(vflag)
  117. printf("%sDEC PDP-11\n", indent);
  118. exit(0);
  119. #endif
  120. #ifdef pyr
  121. printf("%spyr\n", indent);
  122. if(vflag)
  123. printf("%sPyramid 90x\n", indent);
  124. exit(0);
  125. #endif
  126. #ifdef tahoe
  127. printf("%stahoe\n", indent); /* CCI power 6 */
  128. if(vflag)
  129. printf("%sCCI Power 6\n", indent);
  130. exit(0);
  131. #endif
  132. #ifdef sel
  133. printf("%ssel\n", indent); /* Gould/SEL */
  134. if(vflag)
  135. printf("%sGould/SEL\n", indent);
  136. exit(0);
  137. #endif
  138. }