first 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. : check $PATH first
  2. if sh ckpath
  3. then :
  4. else
  5. exit 1
  6. fi
  7. : check write-ability of /tmp and /usr/tmp
  8. if ( >/usr/tmp/aaax.$$ )
  9. then
  10. rm /usr/tmp/aaax.$$
  11. else
  12. echo /usr/tmp must exist and be writable.
  13. exit 2
  14. fi
  15. if ( >/tmp/aaax.$$ )
  16. then
  17. rm /tmp/aaax.$$
  18. else
  19. echo /tmp must exist and be writable.
  20. exit 2
  21. fi
  22. : set ACK HOME Directory in ../h/em_path.h
  23. rm -f em_path.h
  24. sed -e "/^#define[ ]*EM_DIR/s@\".*\"@\"`cd .. ; pwd`\"@" <../h/em_path.h >em_path.h
  25. if cmp ../h/em_path.h em_path.h >/dev/null 2>&1
  26. then
  27. : Don't touch ../h/em_path.h, it's already correct
  28. else
  29. rm -f ../h/em_path.h
  30. if mv em_path.h ../h >/dev/null 2>&1
  31. then : success
  32. else
  33. echo "Sorry, can't replace ../h/em_path.h"
  34. exit 7
  35. fi
  36. fi
  37. : remove non-system as and ld from descr files
  38. if (ack_sys) >/dev/null 2>&1
  39. then
  40. : echo Your system is: `ack_sys`.
  41. else
  42. echo -n "Give me the type of your system, the current choice is:
  43. pdp_v7 PDP11 with sep I/D and version 7
  44. vax_bsd4_1a VAX11 with BSD4.1a
  45. vax_bsd4_1c VAX11 with BSD4.1c
  46. vax_bsd4_2 VAX11 with BSD4.2
  47. pc_ix IBM PC with PC/IX
  48. m68_unisoft Motorola 68000 with Unisoft UNIX
  49. ANY Neither of the above
  50. system type: "
  51. if read SYSNAME
  52. then
  53. echo echo "$SYSNAME" >../bin/ack_sys
  54. chmod +x ../bin/ack_sys
  55. case `ack_sys` in
  56. pdp_v7|vax_bsd4_1[ac]|vax_bsd4_2|pc_ix|m68_unisoft) ;;
  57. *) echo None of the software especially intended for the named systems will work ;;
  58. esac
  59. else
  60. echo Sorry, got EOF when reading system name.
  61. exit 8
  62. fi
  63. fi
  64. echo -n "Your system is `ack_sys`, are you satisfied with that? (y/n) "
  65. if read YESNO
  66. then
  67. case $YESNO in
  68. j*|y*) ;;
  69. n*) echo Ok, I will give you another chance....
  70. rm -f ../bin/ack_sys
  71. exec sh $0
  72. ;;
  73. *) echo "I do not understand your answer ($YESNO). Bye"
  74. exit 9
  75. ;;
  76. esac
  77. else
  78. echo Sorry, got EOF when reading your answer.
  79. exit 9
  80. fi
  81. : "Take action according to the system used"
  82. : 'Prevent the use of the system assembler on for certain systems'
  83. case `ack_sys` in
  84. vax_bsd*) RMD=pdp ;;
  85. pdp_*) RMD="vax2 vax4" ;;
  86. *) RMD="pdp vax2 vax4" ;;
  87. esac
  88. for i in $RMD
  89. do
  90. ( cd ../lib/$i
  91. if grep '^name as$' descr >/dev/null 2>&1
  92. then
  93. cp descr descr.orig
  94. ed - descr <<'ABC'
  95. /^name as$/;/^end$/d
  96. /^name ld$/;/^end$/d
  97. w
  98. q
  99. ABC
  100. fi
  101. )
  102. done
  103. : 'Set the default machine in ../h/local.h'
  104. case `ack_sys` in
  105. pdp_v7) ACM=pdp ;;
  106. vax_bsd4_1[ac]) ACM=vax2 ;;
  107. vax_bsd4_2) ACM=vax2 ;;
  108. pc_ix) ACM=ix ;;
  109. m68_unisoft) ACM=m68k2 ;;
  110. *) ACM=m68k2 ;;
  111. esac
  112. rm -f local.h
  113. sed /ACKM/s/'".*"'/'"'$ACM'"'/ <../h/local.h >local.h
  114. if cmp -s ../h/local.h local.h
  115. then :
  116. else
  117. cp local.h ../h
  118. rm -f local.h
  119. fi
  120. echo "Your default machine to compile for is $ACM"
  121. case `ack_sys` in
  122. vax_bsd4_*)
  123. echo 'Installing the include directory in lib/vax2'
  124. ( cd ../lib/vax2 ; sh fetch_inc )
  125. echo Done
  126. case `ack_sys` in
  127. vax_bsd4_1a) VERS=BSD41a ;;
  128. vax_bsd4_1c) VERS=BSD41c ;;
  129. vax_bsd4_2) VERS=BSD42 ;;
  130. *) echo "Unknown VAX BSD version, look at mach/vax[24]/libem"
  131. break ;;
  132. esac
  133. for i in vax2 vax4
  134. do (
  135. cd ../mach/$i/libem
  136. ed - system.h <<ABC
  137. g/^#/s/.*/\/* & *\//
  138. /$VERS/s/^.*#/#/
  139. /$VERS/s/*\/.*$//
  140. w
  141. q
  142. ABC
  143. ) done
  144. echo 'mach/vax[24]/libem/system.h reflects your BSD version.'
  145. esac