get_sys 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #!/bin/sh
  2. rm -f em_path.h
  3. echo "You will now be asked for the root directory of the ACK sources.
  4. This directory will not be changed by the installation process.
  5. "
  6. while :
  7. do
  8. echo $E_FLAG "Please give the root of the ACK source tree,
  9. an absolute path: [$SRC_HOME] $E_SFX"
  10. . $FDIR/get_answer
  11. case $ANS in
  12. '') ANS="$SRC_HOME" ;;
  13. esac
  14. SRC_HOME="$ANS"
  15. case $SRC_HOME in
  16. /*) break;
  17. ;;
  18. *) echo "$SRC_HOME is not an absolute path; try again"
  19. ;;
  20. esac
  21. done
  22. echo "You will now be asked for a configuration directory. This is
  23. the directory in which the compilations will take place. The tree that
  24. resides in it will have the same structure as the ACK source tree, but
  25. the directories will usually only contain Makefiles and .o files.
  26. "
  27. while :
  28. do
  29. echo $E_FLAG "Please give the root of the configuration tree,
  30. an absolute path: [$CONFIG] $E_SFX"
  31. . $FDIR/get_answer
  32. case $ANS in
  33. '') ANS="$CONFIG";;
  34. esac
  35. CONFIG="$ANS"
  36. case $CONFIG in
  37. /*) break;
  38. ;;
  39. *) echo "$CONFIG is not an absolute path; try again"
  40. ;;
  41. esac
  42. done
  43. echo "You will now be asked for the root directory of the ACK binaries. After
  44. installation, this directory will have subdirectories bin, lib, lib.bin,
  45. man, h, config, include, modules, doc.
  46. Four of these directories will contain stuff that depends on the machine
  47. for which the ACK binaries are made: bin, modules, config, and lib.bin. The
  48. other sub-directories (lib, man, h, include and doc) will contain
  49. machine-independent stuff.
  50. This information may be useful if you want to use ACK on different platforms
  51. and you have a shared file system. See the installation manual.
  52. "
  53. while :
  54. do
  55. echo $E_FLAG "Please give the root of the ACK binaries,
  56. an absolute path: [$TARGET_HOME] $E_SFX"
  57. . $FDIR/get_answer
  58. case $ANS in
  59. '') ANS="$TARGET_HOME";;
  60. esac
  61. TARGET_HOME="$ANS"
  62. case $TARGET_HOME in
  63. /*) break;
  64. ;;
  65. *) echo "$TARGET_HOME is not an absolute path; try again"
  66. ;;
  67. esac
  68. done
  69. sed -e "/^#define[ ]*EM_DIR/s@\".*\"@\"$TARGET_HOME\"@" <$FDIR/em_path.h.src >em_path.h
  70. echo "You will now be asked for the type of the system that you want
  71. ACK binaries produced for. This is not neccessarily the system you
  72. run this program on. In this case, if you have not done so already,
  73. you will have to install ACK on the current machine first.
  74. "
  75. echo "Give me the type of the system, the current choice is:
  76. vax_bsd4_1a VAX11 with BSD4.1a
  77. vax_bsd4_2 VAX11 with BSD4.2
  78. vax_sysV_2 VAX11 with System V.2
  79. i386 Intel 80386 system running Xenix System V
  80. sun3 Sun 3 M68020 workstation
  81. sun2 Sun 2 M68000 workstation
  82. m68_sysV_0 Motorola 68000 with Uniplus System V.0 Unix
  83. m68020 Motorola M68020 VME131 running Unix System V/68 R2V2.1
  84. sparc SUN SPARC workstation running SunOs 4
  85. sparc_solaris SUN SPARC workstation running solaris 2
  86. ANY Neither of the above
  87. "
  88. echo $E_FLAG "system type: [$SYSNAME] $E_SFX"
  89. . $FDIR/get_answer
  90. case $ANS in
  91. '') ANS="$SYSNAME";;
  92. esac
  93. SYSNAME="$ANS"
  94. while :
  95. do
  96. echo $E_FLAG "Is this the system you are running on? (y/n) [$CURRENT] $E_SFX"
  97. . $FDIR/get_answer
  98. case $ANS in
  99. '') ANS="$CURRENT";;
  100. esac
  101. case X$ANS in
  102. Xj*|Xy*|X) UTIL_HOME=$TARGET_HOME
  103. CURRENT=y
  104. break
  105. ;;
  106. Xn*) CURRENT=n
  107. echo "You will now be asked for the root directory of ACK on the current machine.
  108. This tree will not be changed by the installation process.
  109. "
  110. while :
  111. do
  112. echo $E_FLAG "Please give the root of a runnable ACK tree,
  113. an absolute path: [$UTIL_HOME] $E_SFX"
  114. . $FDIR/get_answer
  115. case $ANS in
  116. '') ANS="$UTIL_HOME" ;;
  117. esac
  118. UTIL_HOME="$ANS"
  119. case $UTIL_HOME in
  120. /*) break;
  121. ;;
  122. *) echo "$UTIL_HOME is not an absolute path; try again"
  123. ;;
  124. esac
  125. done
  126. break
  127. ;;
  128. *) echo "I do not understand your answer ($ANS). Try again."
  129. ;;
  130. esac
  131. done
  132. while :
  133. do
  134. echo "The system to install ACK for is $SYSNAME,
  135. the root of the ACK source tree is $SRC_HOME,
  136. the root of the configuration tree is $CONFIG,
  137. the root of the ACK binary tree to be created is $TARGET_HOME,
  138. and the root of a runnable ACK binary tree is $UTIL_HOME.
  139. If the machine to compile ACK for is the current machine, the last two names
  140. may be identical."
  141. echo $E_FLAG "Are you satisfied with all this? (y/n) $E_SFX"
  142. . $FDIR/get_answer
  143. case X$ANS in
  144. Xj*|Xy*|X) break
  145. ;;
  146. Xn*) echo Ok, I will give you another chance....
  147. . $0
  148. break
  149. ;;
  150. *) echo "I do not understand your answer ($ANS). Try again."
  151. ;;
  152. esac
  153. done