1 ----------------------------------
\r
2 EiC BUILD INSTRUCTIONS
\r
8 ---------TABLE-of-CONTENTS---------
\r
11 2. INSTALLING EIC FROM THE SOURCE DISTRIBUTION:
\r
18 3 BUILDING A TOY VERSION OF EiC
\r
19 4. EXPLANATION OF NON-PORTABLE MACROS USED:
\r
20 $(addprefix PREFIX,NAMES...) (from GNU info Make)
\r
21 5. TROUBLE SHOOTING:
\r
22 6. PORTING EiC TO OTHER PLATFORMS
\r
24 --END-of-TABLE-of-CONTENTS---------
\r
26 ------------------------------------
\r
29 EiC's distribution plus binaries require approximately 4
\r
30 Mbytes of disk space. To build EiC, you will need GNU make and
\r
31 gcc 2.6.3 or later. However, if you don't have GNU make then
\r
32 the section on 'explanation of non-portable macros' may help
\r
33 you over come this limitation.
\r
36 -------------------------------------------
\r
37 - INSTALLING EiC FORM THE SOURCE DISTRIBUTION:
\r
39 There are just six easy steps to installing EiC. Please read
\r
40 all six steps before starting at step 1.
\r
44 Untar the distribution. It will automatically unpack itself
\r
45 into a subdirectory off the current directory. This
\r
46 subdirectory will be named EiC and will be referred to as the
\r
47 top EiC directory or the HOMEofEiC.
\r
49 If you use GNU tar, then:
\r
50 % tar -xvzf EiC.tar.gz
\r
52 % gunzip EiC.tar.gz
\r
53 % tar -xvf EiC.tar.gz
\r
57 If you haven't already done so, then:
\r
62 This step looks worse than it really is. You shouldn't have to
\r
63 do anything, other than setting the directory where EiC will
\r
66 In the project parameter file:
\r
70 you will need to set EiC's installation directory; this is
\r
71 where the EiC binary will be placed, via:
\r
73 INSTALL_DIR = $(HOME)/bin
\r
75 By default, it points to 'bin', which is assumed to be just
\r
76 off your home directory and within your search path. If you
\r
77 don't have a bin directory, make it or just change the
\r
78 assignment to point to any other directory that is in your
\r
79 search PATH, and that you have write access to.
\r
81 The rest of this step can now be skipped over and only if things
\r
82 fail, after step 4, will you need to refer to the rest of step
\r
85 Now, you will need to:
\r
87 a) set the EiC project parameters, and
\r
88 b) check the appropriate platform parameters are
\r
89 set according to your site.
\r
91 Hopefully, the default settings will do. However, if you are
\r
92 uncertain about what to do, with respect to what the various
\r
93 parameters mean or platform types, then consult the DATA
\r
94 DICTIONARY section in the file:
\r
96 EiC/config/GuideLines.make.
\r
98 Now check the parameter settings in the file:
\r
100 EiC/config/$(PLATFORM)/make.params
\r
102 where $(PLATFORM) is the platform type that you are going
\r
103 to compile EiC for. Check the directory EiC/config
\r
104 for the platforms supported. They are indicated by
\r
105 directories with names starting with '_'; for example,
\r
106 _LINUX, _SOLARIS, _SUNOS, etc.
\r
108 If you find any parameter setting in the platform make.params
\r
109 file that are not to your liking, then you have can override
\r
110 these settings by placing a corresponding parameter in
\r
113 EiC/override.params
\r
115 The main purpose of the override.params file is to
\r
116 allow for any peculiarities that are unique
\r
117 to any particular site. More information on this
\r
118 file can be found in the file itself.
\r
123 From EiC's top directory type the following command:
\r
125 % config/makeconfig
\r
127 makeconfig will use its default procedures to determine your
\r
128 operating system, and other configuration settings. It will
\r
129 attempt to produce the file:
\r
133 that will contain the correct configuration setup for the EiC
\r
134 project Makefiles within your environment. To get more
\r
135 infomation about makeconfig type:
\r
137 % config/makeconfig -h
\r
141 If makeconfig was successful, then from the EiC top directory,
\r
148 % test.sh // run EiC's test procedures
\r
151 You will have to also set the environmental variable
\r
152 HOMEofEiC to point to directory where EiC is
\r
153 installed. See README.BIN for further information on
\r
156 Hopefully everythings goes to plan -- if not, see the section
\r
157 on trouble shooting below.
\r
161 To make the documentation then
\r
167 - BUILDING A TOY VERSION OF EiC
\r
169 To build a version of the EiC interpreter
\r
170 that does not include EiC's runtime library
\r
171 then change to EiC's src directory
\r
174 % make -f makefile.seic
\r
177 This will produce the binary `seic'. It
\r
178 is the starting point for experimenting
\r
181 - EXPLANATION OF NON-PORTABLE MACROS USED:
\r
183 -- $(addprefix PREFIX,NAMES...) (from GNU info Make)
\r
185 The argument NAMES is regarded as a series of names, separated
\r
186 by whitespace; PREFIX is used as a unit. The value of PREFIX
\r
187 is prepended to the front of each individual name and the
\r
188 resulting larger names are concatenated with single spaces
\r
189 between them. For example,
\r
191 $(addprefix src/,foo bar)
\r
193 produces the result `src/foo src/bar'.
\r
195 - TROUBLE SHOOTING:
\r
197 If the compiler complains about duplicate definitions
\r
198 of standard C funtions, then make sure you are using
\r
199 gcc 2.6.3 or later, via:
\r
203 If the installation procedure completely fails, then
\r
204 check that make is being initiated correctly in each
\r
205 subdirectly. You may need to set the SHELL variable in the
\r
206 top level make file (../EiC/Makefile):
\r
211 If you don't have a ksh shell, then you may have to
\r
212 do most things by hand:
\r
215 % config/makeconfig
\r
216 % make install // let it fail
\r
217 % cd module/stdClib/src
\r
221 % cd ../module/stdClib/src
\r
228 Check that you aren't installing EiC for a platform it
\r
229 doesn't know about (see porting EiC to other platforms below).
\r
231 If everything compiles, without errors, and your system reports
\r
235 eic: Command not found
\r
237 Then check your search path and the directory where EiC
\r
238 was installed. Or maybe just enter
\r
243 Read all of step 3.
\r
246 -------------------------------------------------
\r
247 - PORTING EiC TO OTHER PLATFORMS
\r
249 This part of the documentation explains how to port EiC to a new
\r
250 platform. It is also assumed that the following steps will be
\r
251 performed on the new platform. The following outlines the steps I
\r
252 took to port EiC to a Dec Alpha.
\r
254 -- Porting the EiC interpreter
\r
256 First get the platform name
\r
259 At the system prompt:
\r
264 Therefore, the DEC alpha platform name is:
\r
268 Now change to the directory EiC/config and
\r
269 create the appropriate platform directory.
\r
274 Note the leading underscore. Now pick one of the existing
\r
275 platforms that you feel is compatible with the new
\r
276 platform and copy over its `make.params' file.
\r
279 % cp _LINUX/make.params _OSF1
\r
281 Now edit the copy of make.params, to reflect to the new OS, in
\r
282 particular change the PLATFORM designation.
\r
284 Next, check for data alignment, pointer size and
\r
285 byte ordering, by compiling and running
\r
286 `alignment' in EiC/config:
\r
290 #define EIC_LITTLE_ENDIAN 1
\r
292 {2, 2}, /* short */
\r
295 {4, 4}, /* float */
\r
296 {8, 8}, /* double */
\r
297 {8, 8}, /* pointer */
\r
298 {0, 1}, /* struct*/
\r
302 Now you need to inform EiC about this by
\r
303 adding the following structure to the
\r
304 EiC source file `EiC/src/metric.h':
\r
308 #define EIC_LITTLE_ENDIAN 1
\r
309 short metric[8][2] = { /* size, alignment pairs */
\r
311 {2, 2}, /* short */
\r
314 {4, 4}, /* float */
\r
315 {8, 8}, /* double */
\r
316 {8, 8}, /* pointer */
\r
317 {0, 1}, /* struct*/
\r
321 Now inform the makefile system of the new platform.
\r
322 In the directory EiC type:
\r
324 <EiC> % config/makeconfig
\r
325 TOP_DIR = /home/edb/compilers/EiC
\r
326 CONFIG_DIR = /home/edb/compilers/EiC/config
\r
329 This completes the porting of the EiC
\r
330 interpeter and the Makefile system to the new
\r
331 platform. Now the fun begins -- we have to
\r
332 port EiC's runtime library.
\r
334 -- Porting the runtime library.
\r
336 Change to the directory EiC/module/stdClib/src and
\r
337 add the appropriate patform directory:
\r
339 <EiC/.../src> mkdir _OSF1
\r
341 Copy the contents of an already established
\r
342 platform to this directory:
\r
344 <EiC/.../src> cp -r _LINUX/* _OSF1
\r
346 Now each header file in this directory must be
\r
347 made compatible with the platform header files in
\r
348 `/usr/include'. Also the file "fcntl.h" needs to be
\r
349 addressed. However, you don't have to worry about
\r
360 As these files get automaticly constructed by EiC's build
\r
361 process during installation, by the EiC/config/genstdio.c
\r
362 program. As this document is usually as not as up todate as
\r
363 the gentstdio.c file you should also check it for any other .h
\r
364 files it may now be generating. To do this, just look at the
\r
365 contents of the main() function.
\r
367 To help with this process of generating header files, I used
\r
368 gcc and grep; for example, when inspecting termios.h:
\r
370 </usr/include> gcc -D_POSIX_SOURCE -E termios.h | less
\r