Pristine Ack-5.5
[Ack-5.5.git] / first / get_sys
1 rm -f em_path.h
2 echo "You will now be asked for the root directory of the ACK sources.
3 This directory will not be changed by the installation process.
4 "
5 while :
6 do
7         echo $E_FLAG "Please give the root of the ACK source tree,
8 an absolute path: [$SRC_HOME] $E_SFX"
9         . $FDIR/get_answer
10         case $ANS in
11         '')     ANS="$SRC_HOME" ;;
12         esac
13         SRC_HOME="$ANS"
14         case $SRC_HOME in
15         /*)     break;
16                 ;;
17         *)      echo "$SRC_HOME is not an absolute path; try again"
18                 ;;
19         esac
20 done
21 echo "You will now be asked for a configuration directory. This is
22 the directory in which the compilations will take place. The tree that
23 resides in it will have the same structure as the ACK source tree, but
24 the directories will usually only contain Makefiles and .o files.
25 "
26 while :
27 do
28         echo $E_FLAG "Please give the root of the configuration tree,
29 an absolute path: [$CONFIG] $E_SFX"
30         . $FDIR/get_answer
31         case $ANS in
32         '')     ANS="$CONFIG";;
33         esac
34         CONFIG="$ANS"
35         case $CONFIG in
36         /*)     break;
37                 ;;
38         *)      echo "$CONFIG is not an absolute path; try again"
39                 ;;
40         esac
41 done
42 echo "You will now be asked for the root directory of the ACK binaries. After
43 installation, this directory will have subdirectories bin, lib, lib.bin,
44 man, h, config, include, modules, doc.
45 Four of these directories will contain stuff that depends on the machine
46 for which the ACK binaries are made: bin, modules, config, and lib.bin. The
47 other sub-directories (lib, man, h, include and doc) will contain
48 machine-independent stuff.
49 This information may be useful if you want to use ACK on different platforms
50 and you have a shared file system. See the installation manual.
51 "
52 while :
53 do
54         echo $E_FLAG "Please give the root of the ACK binaries,
55 an absolute path: [$TARGET_HOME] $E_SFX"
56         . $FDIR/get_answer
57         case $ANS in
58         '')     ANS="$TARGET_HOME";;
59         esac
60         TARGET_HOME="$ANS"
61         case $TARGET_HOME in
62         /*)     break;
63                 ;;
64         *)      echo "$TARGET_HOME is not an absolute path; try again"
65                 ;;
66         esac
67 done
68 sed -e "/^#define[      ]*EM_DIR/s@\".*\"@\"$TARGET_HOME\"@" <$FDIR/em_path.h.src >em_path.h
69
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
95 while :
96 do
97 echo $E_FLAG "Is this the system you are running on? (y/n) [$CURRENT] $E_SFX"
98 . $FDIR/get_answer
99 case $ANS in
100 '')     ANS="$CURRENT";;
101 esac
102 case X$ANS in
103 Xj*|Xy*|X)      UTIL_HOME=$TARGET_HOME
104         CURRENT=y
105         break
106         ;;
107 Xn*)    CURRENT=n
108         echo "You will now be asked for the root directory of ACK on the current machine.
109 This tree will not be changed by the installation process.
110 "
111         while :
112         do
113                 echo $E_FLAG "Please give the root of a runnable ACK tree,
114 an absolute path: [$UTIL_HOME] $E_SFX"
115                 . $FDIR/get_answer
116                 case $ANS in
117                 '')     ANS="$UTIL_HOME" ;;
118                 esac
119                 UTIL_HOME="$ANS"
120                 case $UTIL_HOME in
121                 /*)     break;
122                         ;;
123                 *)      echo "$UTIL_HOME is not an absolute path; try again"
124                         ;;
125                 esac
126         done
127         break
128         ;;
129 *)      echo "I do not understand your answer ($ANS). Try again."
130         ;;
131 esac
132 done
133
134 while :
135 do
136 echo "The system to install ACK for is $SYSNAME,
137 the root of the ACK source tree is $SRC_HOME,
138 the root of the configuration tree is $CONFIG,
139 the root of the ACK binary tree to be created is $TARGET_HOME,
140 and the root of a runnable ACK binary tree is $UTIL_HOME.
141 If the machine to compile ACK for is the current machine, the last two names
142 may be identical."
143 echo $E_FLAG "Are you satisfied with all this? (y/n) $E_SFX"
144 . $FDIR/get_answer
145 case X$ANS in
146 Xj*|Xy*|X)      break
147         ;;
148 Xn*)    echo Ok, I will give you another chance....
149         . $0
150         break
151         ;;
152 *)      echo "I do not understand your answer ($ANS). Try again."
153         ;;
154 esac
155 done