first 2.8 KB

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