From: herbert Date: Sat, 29 Sep 2001 13:22:08 +0000 (+0000) Subject: Some work on the files in os2/, removed unnecessary X-Git-Tag: Alpha-3_0_0_19~33 X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/commitdiff_plain/3934e170ee5862b7bd458cefe9158e65fb3bf56f Some work on the files in os2/, removed unnecessary configuration stuff. Changed the expect in unsignedcompare test target. --- diff --git a/os2/BUILD.OS2 b/os2/BUILD.OS2 index 6f1f813..c0215bd 100644 --- a/os2/BUILD.OS2 +++ b/os2/BUILD.OS2 @@ -14,24 +14,24 @@ My fixes can be found at: http://www.fh-wedel.de/pub/fh-wedel/staff/di/lclint/index.html -Edit the makefile "Makefile.os2" and the compile batch "makeos2.cmd" -in the "lclint-?.?\os2" directory. During make execution all important -settings will be written to a config file read by any sub makefile. In -any case you will have to set the variable `$BASEDIR' in Makefile.os2 -and `%base%' in makeos2.cmd according to your setup. +You may want to set the correct date and version to be written into the +lclint.exe binary in the Makefile.os2 file, although it is not strictly +necessary. This should be enough to build the program. During make +execution then some information will be written to a config file read +by the sub makefile in the src/ directory. -Then use the batch file makeos2.cmd from inside the os2/ directory -to build lclint. The options to that batch file are: +Use the batch file makeos2.cmd from inside the os2/ directory to build +lclint. The options to that batch file are: makeos2 [--emx|-e|--gcc|-g|--icc|-i|--oldconf|-o|--test|-t|--package|-p] -Like with make, this batch should be called from inside the os2 -directory. The options starting with "e" build LCLint using emx/gcc with -debug code. The letter "g" stands for gcc using the OMF object format -and optimization rather than debug code. For IBMs icc compiler use "i". -Each of the above options will create a new configuration. To continue -a build with an existing configuration use "o". Finally "t" runs the -"quicktest" part of the test suite (other tests are not yet supported). +This batch should be called from inside the os2 directory. The options +starting with "e" build LCLint using emx/gcc with debug code. The letter +"g" stands for gcc using the OMF object format and optimization rather +than debug code. For IBMs icc compiler use "i". Each of the above +options will create a new configuration. To continue a build with an +existing configuration use "o". Finally "t" runs the "quicktest" part +of the test suite (other tests are not yet supported). If you experience problems with the automatic configuration file creation from within Makefile.os2 you may alternatively call makeos2.cmd with the @@ -40,6 +40,11 @@ IBMC, else edit it by hand). In that case you may also want to edit the local_constants.h and herald.h files from this directory to have it match your setup. +After building the program you may want to testrun it, using the batch +file `run_lclint.cmd' or go through the test suite using `makeos2 -t'. +Before that you will need to set the environment variables in the +`setenv.cmd' file that is called from the other two batches. + Please, be aware that you need the flex library in order to build lclint. As far as I remember the OS/2 version of flex comes with this library for the emx/gcc compiler. If not, you will easily be able to compile it @@ -51,13 +56,14 @@ emx/gcc. However you can compile the lib with IBM's compiler, too. To do this, you will have to get the flex sources from one of the usual ftp sites and compile at least the library. -To compile the flex library using IBM's VisualAge C++ compiler, you only -need to perform the following steps: +To compile the flex library using IBM's VisualAge C++ compiler, you +only need to perform the following steps: - enter the flex source directory. - enter "icc -c -Q -O libmain.c" and "icc -c -Q -O libyywrap.c" -- enter "ilib fl.lib" from the command line (the library must not exist) - and "y", "+libmain.obj+libyywrap.obj" and "" from the ilib prompt. +- enter "ilib fl.lib" from the command line (the library must not + exist) and "y", "+libmain.obj+libyywrap.obj" and "" from the + ilib prompt. - copy fl.lib somewhere where it gets found, I suggest "ibmcpp\lib". When using emx/gcc you can either produce code using the OMF object format diff --git a/os2/Makefile.os2 b/os2/Makefile.os2 index 9cd2710..6b18885 100644 --- a/os2/Makefile.os2 +++ b/os2/Makefile.os2 @@ -36,14 +36,14 @@ ### LCL_VERSION=3.0.0.16 -LCL_DATE=25 Sep 2001 +LCL_DATE=28 Sep 2001 # this gets written into the binary, add your name, your compiler settings # etc. if you like. -TODAY=Monday 25 Sep 19:40 MEST 2001 +TODAY=Monday 28 Sep 23:43 MEST 2001 ME=herbert MACHINE=i586 -COMPILE_MSG=\# define LCL_COMPILE \"Compiled using $(CC)\\n on OS/2 $(TODAY) $(MACHINE) by $(ME),\\n OS/2 specific subversion is 4\" +COMPILE_MSG=\# define LCL_COMPILE \"Compiled using $(CC)\\n on OS/2 $(TODAY) $(MACHINE) by $(ME),\\n OS/2 specific subversion is 5\" ### Directory containing system include files: @@ -81,7 +81,7 @@ INSTALLDIR = \\usr\\bin ### this should be the complete path for the directory where this ### Makefile is, with no trailing / or spaces. -BASEDIR = e:\\usr\\src\\lclint-$(LCL_VERSION) +# BASEDIR = e:\\usr\\src\\lclint-$(LCL_VERSION) ### ### Then, run: @@ -183,27 +183,6 @@ FLEX = flex YFLAGS = -v -t -d LFLAGS = -### -### is the test suite available? (must be full path here) -### - -TESTDIR = $(BASEDIR)/test - -### -### if this Makefile is used with one of the -### standard installation packages, no changes should be -### necessary below this line. -### - -.PHONY: install dobinaries dolibraries doimports test - -### -### set this to a different directory -### to install binaries elsewhere -### - -RELEASEDIR = $(BASEDIR)/bin - all: @$(ECHO) @$(ECHO) "Creating configuration file. Syntax error message can be ignored..." @@ -212,15 +191,16 @@ all: @$(ECHO) @$(ECHO) "Creating local constants header file. Syntax error messages can be ignored..." @$(ECHO) - $(MAKE) ARGV=$(ARGV) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables localconstants + $(MAKE) ARGV=$(ARGV) -f Makefile.os2 --directory=..\\src --warn-undefined-variables localconstants @$(ECHO) @$(ECHO) "Now building lclint executable file..." @$(ECHO) - $(MAKE) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables + $(MAKE) -f Makefile.os2 --directory=..\\src --warn-undefined-variables @$(ECHO) @$(ECHO) "Now moving lclint executable file to bin directory..." @$(ECHO) - $(MV) $(BASEDIR)\src\lclint$E $(RELEASEDIR)\lclint$E + @if not exist ..\\bin mkdir ..\\bin + $(MV) ..\src\lclint$E ..\\bin\\lclint$E configinc: $(ECHO) "CC=$(CC)" >config.inc @@ -242,44 +222,12 @@ configinc: $(ECHO) "MV=$(MV)" >>config.inc $(ECHO) "CP=$(CP)" >>config.inc $(ECHO) "ECHO=\"$(ECHO)\"" >>config.inc - $(CP) $(BASEDIR)\src\Headers\herald.h $(BASEDIR)\src\Headers\herald.last - $(ECHO) "/* herald.h - created automatically from herald.os2 and Makefile.os2 */" >$(BASEDIR)\src\Headers\herald.h - $(ECHO) "/*@constant observer char *LCL_VERSION;@*/" >>$(BASEDIR)\src\Headers\herald.h - $(ECHO) "# define LCL_VERSION \"LCLint $(LCL_VERSION) --- $(LCL_DATE)\"" >>$(BASEDIR)\src\Headers\herald.h - $(ECHO) "/*@constant observer char *LCL_PARSE_VERSION;@*/" >>$(BASEDIR)\src\Headers\herald.h - $(ECHO) "# define LCL_PARSE_VERSION \"LCLint $(LCL_VERSION)\"" >>$(BASEDIR)\src\Headers\herald.h - $(ECHO) "/*@constant observer char *LCL_COMPILE;@*/" >>$(BASEDIR)\src\Headers\herald.h - $(ECHO) "$(COMPILE_MSG)" >>$(BASEDIR)\src\Headers\herald.h - -### -### locations of standard LCLint files -### -### this should NOT have to be edited if you use the standard -### installation package - -LCLINTBINDIR = $(BASEDIR)/bin - -LCLINTLIB = $(BASEDIR)/lib -LCLINTIMPORTS = $(BASEDIR)/imports - -### -### uses recursive make calls directly, so installation -### will continue even if there are errors! -### - -install: - $(MAKE) dobinaries -f Makefile.os2 - $(MAKE) dolibraries -f Makefile.os2 - $(MAKE) doimports -f Makefile.os2 - -dobinaries: - $(INSTALL) $(INSTALLFLAGS) $(LCLINTBINDIR)\lclint$E $(INSTALLDIR) - -dolibraries: - -mkdir$E $(LIBDIR) - $(CP) $(LCLINTLIB)\\* $(LIBDIR) - -doimports: - -mkdir$E $(IMPORTSDIR) - $(CP) $(LCLINTIMPORTS)\\* $(IMPORTSDIR) + $(CP) ..\src\Headers\herald.h ..\src\Headers\herald.last + $(ECHO) "/* herald.h - created automatically from herald.os2 and Makefile.os2 */" >..\src\Headers\herald.h + $(ECHO) "/*@constant observer char *LCL_VERSION;@*/" >>..\src\Headers\herald.h + $(ECHO) "# define LCL_VERSION \"LCLint $(LCL_VERSION) --- $(LCL_DATE)\"" >>..\src\Headers\herald.h + $(ECHO) "/*@constant observer char *LCL_PARSE_VERSION;@*/" >>..\src\Headers\herald.h + $(ECHO) "# define LCL_PARSE_VERSION \"LCLint $(LCL_VERSION)\"" >>..\src\Headers\herald.h + $(ECHO) "/*@constant observer char *LCL_COMPILE;@*/" >>..\src\Headers\herald.h + $(ECHO) "$(COMPILE_MSG)" >>..\src\Headers\herald.h diff --git a/os2/README.OS2 b/os2/README.OS2 index e61528c..a7c3e48 100644 --- a/os2/README.OS2 +++ b/os2/README.OS2 @@ -95,6 +95,7 @@ The following things specific to the OS/2 version of lclint have changed / fixed since the first official release: version 3.0.0.16: +- Finally fully united the OS/2 port with the main source tree. - Bugfixes. version 3.0.0.14: diff --git a/os2/config.inc b/os2/config.inc index 6bc67ed..97ba474 100644 --- a/os2/config.inc +++ b/os2/config.inc @@ -1,7 +1,7 @@ CC=icc -q -W2 -Dunlink=unlink -O+ -G5 -Gf+ -Gi+ -Gs+ CFLAGS= CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 -BISON= +BISON=bison FLEX=flex YFLAGS=-v -t -d LFLAGS= diff --git a/os2/makeos2.cmd b/os2/makeos2.cmd index 6a8708c..821954a 100755 --- a/os2/makeos2.cmd +++ b/os2/makeos2.cmd @@ -1,7 +1,6 @@ @echo off setlocal -set version=3.0.0.16 -set base=e:\usr\src\lclint-%version% +call setenv.cmd if "%1"=="" goto icc if "%1"=="--icc" goto icc if "%1"=="-i" goto icc @@ -35,29 +34,28 @@ sh -c "export TODAY=`date.exe`; export LCL_DATE=`date.exe | cut -d ' ' -f 2,3,6` goto end :oldconf -if not exist %base%\src\Headers\local_constants.h copy local_constants.h %base%\src\Headers\local_constants.h -if not exist %base%\src\Headers\heral.h copy local_constants.h %base%\src\Headers\herald.h +if not exist ..\src\Headers\local_constants.h copy local_constants.h ..\src\Headers\local_constants.h +if not exist ..\src\Headers\heral.h copy local_constants.h ..\src\Headers\herald.h make -f Makefile.os2 --directory=../src --warn-undefined-variables %2 %3 %4 %5 %6 %7 %8 %9 +if not exist ..\bin mv ..\src\lclint.exe ..\bin if errorlevel 0 mv ..\src\lclint.exe ..\bin goto end :test -set LARCH_PATH=%base%\lib -set LCLIMPORTDIR=%base%\imports cd ..\test echo it's %LARCH_PATH% and %LCLIMPORTDIR% -make LCLINT=%base%\bin\lclint %2 -e -f Makefile-test.os2 +make LCLINT=%basedir%\bin\lclint %2 %3 %4 %4 %5 %6 %7 %8 %9 -e -f Makefile-test.os2 cd ..\os2 goto end :package -cd %base%\.. +cd %basedir%\.. rm -f lclint-%version%-os2-*.tar* tar cvf lclint-%version%-os2-bin.tar lclint-%version%\bin lclint-%version%\imports lclint-%version%\lib lclint-%version%\os2 lclint-%version%\test lclint-%version%\BUFFERCHECKING lclint-%version%\LICENSE lclint-%version%\README tar cvf lclint-%version%-os2-all.tar lclint-%version% cd \export\lclint -tar cvf %base%\..\lclint-%version%-os2-add.tar lclint-%version% -gzip %base%\..\lclint-%version%-os2-*.tar +tar cvf %basedir%\..\lclint-%version%-os2-add.tar lclint-%version% +gzip %basedir%\..\lclint-%version%-os2-*.tar goto end :end diff --git a/os2/run_lclint.cmd b/os2/run_lclint.cmd index 35fc3d9..6e8c958 100755 --- a/os2/run_lclint.cmd +++ b/os2/run_lclint.cmd @@ -3,10 +3,7 @@ rem ***************************************************************** rem run LCLint from the source\os2 directory with proper environment rem ***************************************************************** setlocal -set base=e:\usr\src\lclint-3.0.0.16 -set LARCH_PATH=%base%\lib -set LCLIMPORTDIR=%base%\imports -set LCLBINARY=%base%\bin\lclint.exe +call setenv.cmd echo it's %LCLBINARY%, %LARCH_PATH% and %LCLIMPORTDIR% %LCLBINARY% %1 %2 %3 %4 %5 %6 %7 %8 %9 endlocal diff --git a/os2/setenv.cmd b/os2/setenv.cmd new file mode 100755 index 0000000..e6a767e --- /dev/null +++ b/os2/setenv.cmd @@ -0,0 +1,10 @@ +rem ********************************************************************** +rem Configure me: This is needed because the test targets are made in +rem different directories, so absolute paths in the +rem environment variables are needed. +rem ********************************************************************** +set version=3.0.0.16 +set basedir=e:\usr\src\lclint-%version% +set LARCH_PATH=%basedir%\lib +set LCLIMPORTDIR=%basedir%\imports +set LCLBINARY=%basedir%\bin\lclint.exe diff --git a/test/Makefile-test.os2 b/test/Makefile-test.os2 index 4451498..ad3b06f 100644 --- a/test/Makefile-test.os2 +++ b/test/Makefile-test.os2 @@ -530,7 +530,7 @@ unreachable: $(LCLINTR) switch.c -expect 4 unsignedcompare: - ${LCLINT} +posixlib unsignedcompare.c -expect 2 + ${LCLINT} +posixlib unsignedcompare.c -expect 4 ###