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