]>
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 | |
17 | Edit the makefile "Makefile.os2" and the compile batch "makeos2.cmd" \r | |
18 | in the "lclint-?.?\os2" directory. During make execution all important \r | |
19 | settings will be written to a config file read by any sub makefile. In\r | |
20 | any case you will have to set the variable `$BASEDIR' in Makefile.os2 \r | |
21 | and `%base%' in makeos2.cmd according to your setup.\r | |
22 | \r | |
23 | Then use the batch file makeos2.cmd from inside the os2/ directory\r | |
24 | to build lclint. The options to that batch file are:\r | |
25 | \r | |
26 | makeos2 [--emx|-e|--gcc|-g|--icc|-i|--oldconf|-o|--test|-t|--package|-p]\r | |
27 | \r | |
28 | Like with make, this batch should be called from inside the os2\r | |
29 | directory. The options starting with "e" build LCLint using emx/gcc with \r | |
30 | debug code. The letter "g" stands for gcc using the OMF object format \r | |
31 | and optimization rather than debug code. For IBMs icc compiler use "i".\r | |
32 | Each of the above options will create a new configuration. To continue\r | |
33 | a build with an existing configuration use "o". Finally "t" runs the\r | |
34 | "quicktest" part of the test suite (other tests are not yet supported).\r | |
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 | |
e5a87a6c | 43 | Please, be aware that you need the flex library in order to build lclint.\r |
44 | As far as I remember the OS/2 version of flex comes with this library for\r | |
45 | the emx/gcc compiler. If not, you will easily be able to compile it \r | |
46 | following the instructions from flex'es README.OS2 file.\r | |
47 | \r | |
48 | If you want to use IBM's compiler, you will probably not find the lib\r | |
49 | as easily as the whole flex package has so far only been ported for \r | |
50 | emx/gcc. However you can compile the lib with IBM's compiler, too. To\r | |
51 | do this, you will have to get the flex sources from one of the usual \r | |
52 | ftp sites and compile at least the library. \r | |
53 | \r | |
54 | To compile the flex library using IBM's VisualAge C++ compiler, you only\r | |
55 | need to perform the following steps:\r | |
56 | \r | |
57 | - enter the flex source directory.\r | |
58 | - enter "icc -c -Q -O libmain.c" and "icc -c -Q -O libyywrap.c"\r | |
59 | - enter "ilib fl.lib" from the command line (the library must not exist)\r | |
60 | and "y", "+libmain.obj+libyywrap.obj" and "<enter>" from the ilib prompt.\r | |
61 | - copy fl.lib somewhere where it gets found, I suggest "ibmcpp\lib".\r | |
62 | \r | |
63 | When using emx/gcc you can either produce code using the OMF object format\r | |
64 | or use a.out. The latter has the consequence of needing emx.dll to run the \r | |
65 | binary and under certain circumstances being able to run it under DOS using \r | |
66 | emx.exe or rsx.exe as DOS extender (you may want to replace the "-g" switch\r | |
67 | by "-O3" in the compiler settings for optimization rather than debug code)\r | |
68 | in such a case. \r | |
69 | \r | |
70 | To create such a binary override the default settings in the makefile by \r | |
71 | invoking the following little batch (the default settings for using the \r | |
72 | a.out format defined in Makefile.os2 do *not* produce an executable that \r | |
73 | runs under DOS):\r | |
74 | \r | |
75 | @echo off\r | |
76 | if exist bin\lclint del bin\lclint\r | |
77 | make all -f makefile.os2 "COMPILER=gcc-emx" "CC=gcc -O3" "E="\r | |
78 | if errorlevel 1 goto end\r | |
79 | cd bin\r | |
80 | echo on\r | |
81 | emxbind lclint -p\r | |
82 | @echo off\r | |
83 | cd ..\r | |
84 | :end\r | |
85 | \r | |
86 | Please be aware that for debugging purposes the a.out format is the best \r | |
87 | choice. I did not succeed in debugging any single step of lclint using \r | |
88 | ipmd as it crashed each time I tried to load the lclint executable.\r | |
89 | \r | |
90 | The Makefile.os2 is currently configured to use flex and bison to generate \r | |
91 | some source files. If you do not have these tools on your system you should \r | |
92 | change the corresponding section to use the .der files shipping with the \r | |
93 | lclint sources.\r | |
94 | \r | |
95 | Herbert in September 2001\r | |
96 | \r |