]>
Commit | Line | Data |
---|---|---|
e5a87a6c | 1 | Building lclint:\r |
2 | ----------------\r | |
3 | \r | |
4 | This file is originally part of the binary distribution of lclint for OS/2.\r | |
5 | \r | |
6 | For building lclint for OS/2 you need the complete "original" source\r | |
7 | package (available e.g. via Dave Evans' lclint homepage) and maybe \r | |
8 | some more recent patches for the OS/2 version. The LCLint home page\r | |
9 | is at:\r | |
10 | \r | |
11 | http://lclint.cs.virginia.edu/\r | |
12 | \r | |
13 | My fixes can be found at:\r | |
14 | \r | |
15 | http://www.fh-wedel.de/pub/fh-wedel/staff/di/lclint/index.html\r | |
16 | \r | |
3934e170 | 17 | You may want to set the correct date and version to be written into the \r |
18 | lclint.exe binary in the Makefile.os2 file, although it is not strictly \r | |
19 | necessary. This should be enough to build the program. During make \r | |
20 | execution then some information will be written to a config file read \r | |
21 | by the sub makefile in the src/ directory.\r | |
e5a87a6c | 22 | \r |
3934e170 | 23 | Use the batch file makeos2.cmd from inside the os2/ directory to build \r |
24 | lclint. The options to that batch file are:\r | |
e5a87a6c | 25 | \r |
26 | makeos2 [--emx|-e|--gcc|-g|--icc|-i|--oldconf|-o|--test|-t|--package|-p]\r | |
27 | \r | |
3934e170 | 28 | This batch should be called from inside the os2 directory. The options \r |
29 | starting with "e" build LCLint using emx/gcc with debug code. The letter \r | |
30 | "g" stands for gcc using the OMF object format and optimization rather \r | |
31 | than debug code. For IBMs icc compiler use "i". Each of the above \r | |
32 | options will create a new configuration. To continue a build with an \r | |
33 | existing configuration use "o". Finally "t" runs the "quicktest" part \r | |
34 | of the test suite (other tests are not yet supported).\r | |
e5a87a6c | 35 | \r |
e5d2a658 | 36 | If you experience problems with the automatic configuration file creation\r |
37 | from within Makefile.os2 you may alternatively call makeos2.cmd with the\r | |
38 | `-o' option and use the existing config.inc file (assuming that you use\r | |
39 | IBMC, else edit it by hand). In that case you may also want to edit the\r | |
40 | local_constants.h and herald.h files from this directory to have it match \r | |
41 | your setup.\r | |
42 | \r | |
3934e170 | 43 | After building the program you may want to testrun it, using the batch\r |
44 | file `run_lclint.cmd' or go through the test suite using `makeos2 -t'. \r | |
45 | Before that you will need to set the environment variables in the \r | |
46 | `setenv.cmd' file that is called from the other two batches.\r | |
47 | \r | |
e5a87a6c | 48 | Please, be aware that you need the flex library in order to build lclint.\r |
49 | As far as I remember the OS/2 version of flex comes with this library for\r | |
50 | the emx/gcc compiler. If not, you will easily be able to compile it \r | |
51 | following the instructions from flex'es README.OS2 file.\r | |
52 | \r | |
53 | If you want to use IBM's compiler, you will probably not find the lib\r | |
54 | as easily as the whole flex package has so far only been ported for \r | |
55 | emx/gcc. However you can compile the lib with IBM's compiler, too. To\r | |
56 | do this, you will have to get the flex sources from one of the usual \r | |
57 | ftp sites and compile at least the library. \r | |
58 | \r | |
3934e170 | 59 | To compile the flex library using IBM's VisualAge C++ compiler, you \r |
60 | only need to perform the following steps:\r | |
e5a87a6c | 61 | \r |
62 | - enter the flex source directory.\r | |
63 | - enter "icc -c -Q -O libmain.c" and "icc -c -Q -O libyywrap.c"\r | |
3934e170 | 64 | - enter "ilib fl.lib" from the command line (the library must not \r |
65 | exist) and "y", "+libmain.obj+libyywrap.obj" and "<enter>" from the \r | |
66 | ilib prompt.\r | |
e5a87a6c | 67 | - copy fl.lib somewhere where it gets found, I suggest "ibmcpp\lib".\r |
68 | \r | |
69 | When using emx/gcc you can either produce code using the OMF object format\r | |
70 | or use a.out. The latter has the consequence of needing emx.dll to run the \r | |
71 | binary and under certain circumstances being able to run it under DOS using \r | |
72 | emx.exe or rsx.exe as DOS extender (you may want to replace the "-g" switch\r | |
73 | by "-O3" in the compiler settings for optimization rather than debug code)\r | |
74 | in such a case. \r | |
75 | \r | |
76 | To create such a binary override the default settings in the makefile by \r | |
77 | invoking the following little batch (the default settings for using the \r | |
78 | a.out format defined in Makefile.os2 do *not* produce an executable that \r | |
79 | runs under DOS):\r | |
80 | \r | |
81 | @echo off\r | |
82 | if exist bin\lclint del bin\lclint\r | |
83 | make all -f makefile.os2 "COMPILER=gcc-emx" "CC=gcc -O3" "E="\r | |
84 | if errorlevel 1 goto end\r | |
85 | cd bin\r | |
86 | echo on\r | |
87 | emxbind lclint -p\r | |
88 | @echo off\r | |
89 | cd ..\r | |
90 | :end\r | |
91 | \r | |
92 | Please be aware that for debugging purposes the a.out format is the best \r | |
93 | choice. I did not succeed in debugging any single step of lclint using \r | |
94 | ipmd as it crashed each time I tried to load the lclint executable.\r | |
95 | \r | |
96 | The Makefile.os2 is currently configured to use flex and bison to generate \r | |
97 | some source files. If you do not have these tools on your system you should \r | |
98 | change the corresponding section to use the .der files shipping with the \r | |
99 | lclint sources.\r | |
100 | \r | |
101 | Herbert in September 2001\r | |
102 | \r |