home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / splint3s.zip / splint-3.0.1.6 / os2 / BUILD.OS2 next >
Text File  |  2002-02-16  |  5KB  |  106 lines

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