$Id: README.w32,v 1.2 2001/01/18 03:27:06 darren Exp $ Release notes for the Win32 platform Contents I. Installation A. Environment B. Configuration II. Building EiffelFox with Microsoft Visual C++ 6.0 A. Building the Fox library B. Building the EiffelFox C-library C. Building an EiffelFox application 1. Using ISE EiffelBench 2. Using Halstenbach iss-base 3. Using SmallEiffel III. Building EiffelFox with Borland C++ 5.x A. Building the Fox library B. Building the EiffelFox C-library C. Building an EiffelFox application 1. Using ISE EiffelBench 2. Using Halstenbach iss-base 3. Using SmallEiffel I. Installation A. Environment The workspace and make files have been written to use two environment variables in order to locate where the Fox and EiffelFox libraries have been installed. These variables are: FOX Set this to the top-level directory to which the Fox distribution was extracted to (e.g. c:\fox-0.99.131) EIFFELFOX Set this to the top-level directory to where the EiffelFox distribution was extracted (e.g. c:\EiffelFox-0.7.6) B. Configuration After you extract the distribution archive, change to the top level directory and run either "install bc5" or "install vc6" to configure the makefiles for either Borland C++ 5.5 or Microsoft Visual C++ 6.0. II. Building EiffelFox with Microsoft Visual C++ 6.0 The Microsoft Visual C++ 6.0 compiler will be abbreviated in this note as MSVC. Note that it is VERY IMPORTANT to ensure that the Fox library, the EiffelFox C library, and the EiffelFox application all be compiled to use the same type of MSVC C run-time library. Because there are three choices for the run-time library, you will run into much grief if different selections are used across the three compiled components (I know, because I learned this the hard way!). This single issue is responsible for much of the steps in these build instructions. A. Building the Fox library You should build the Fox library using the instructions in the INSTALL file in the top-level directory of the distribution, first applying the modification described below. The default build procedure for Fox using MSVC compiles the code to use the multithreaded-DLL C run-time library. However, neither the ISE EiffleBench or Halstenbach iss-base Eiffel compilers are provided with a run-time library which is compatible with code compiled by MSVC for a multithreaded-DLL C run-time (e.g. using the /MD compiler option). Therefore, if you are using these compilers, you will need to change the C run-time library for which the code will be compiled. This can be done using the following instructions. 1. Open workspace file Open the Fox workspace file (found at $(FOX)\windows\vcpp\win32.dsw) in Visual Studio. 2. Select active configuration From the Build menu, select "Set Active Configuration...". When the "Set Active Project Configuration" dialog appears, select "fox - Win32 Release" (you can also select "fox - Win32 Debug", but you will then have to change the ACE files for the EiffelFox example applications so they point to the "foxd.lib" library, instead). 3. Select C run-time library From the "Project" menu, select "Settings...". When the "Project Settings" dialog appears, select "fox" in the left-hand panel. Select the "C/C++" tab in the right-hand panel. In the "Category" pull-down, select "Code Generation" and in the "Use run-time library" pull-down, select one of the non-DLL options and press OK. Note that these choices are associated with the following C compiler options, which you should note for later configuration. Single-Threaded /ML Multithreaded /MM Debug Single-Threaded /MLd Debug Multithreaded /MMd If you are using Halstenbach iss-base, you must specify a single-threaded C run-time. In any case, I recommend that you use "Single-Threaded" here to get you going unless or until you know what you are doing here and can easily resolve linking problems. 4. Compile the library From the "Build" menu, select "Build fox.lib" (or "foxd.lib", depending upon the configuration you selected in step #2). This will compile the library. B. Building the EiffelFox C-library 1. Open workspace file Open the EiffelFox workspace file (found at %EIFFELFOX%/Clib/EiffelFox.dsw) in Visual Studio. 2. Select active configuration Select the appropriate configuration, as in Fox step #2, above (II-A-2). There are release and debug versions for each of the supported Eiffel compilers: ISE for the ISE EiffelBench compiler, ISS for the Halstenbach iss-base compiler, and SE for the SmallEiffel compiler. All six of these configurations may be built and coexist with each other. 3. Select C run-time library Make the same run-time library choice you made in the Fox step #3, above (II-A-3). The run-time library is already Single-Threaded by default, so you need not change this is you selected this setting above. 4. Adjust location of SmallEiffel If you are building the EiffelFox C-library for use with the SmallEiffel compiler, you will need to verify and possibly adjust the location where this compiler is installed. Because the "SmallEiffel" environment variable used by SmallEiffel does not point to a directory, it cannot be used to point to where its run-time includes files are found. Therefore, the explicit location of SmallEiffel's include files must be set. From the "C/C++" tab of the "Project Settings" dialog, select the "Preprocessor" category. In the "Preprocessor definitions" field, adjust the location of the SmallEiffel runtime directory as appropriate. 5. Compile the library From the "Build" menu, select "Build efox_ise.lib" (or the name appropriate to the configuration you selected in step #2). This will compile the library. If you chose the "ISE EiffelBench (Release)" configuration, you will see warnings about a redefinition of NDEBUG, which you can ignore. This is due to an include file ordering problem in EiffelBench. C. Building an EiffelFox application There are makefiles in each of the example application directories which may be used to compile the examples from the command line. The name of this makefile is "vc6.mak". If you followed the instructions to run "install" from the installation directory, this file will have also been copied into the file "Makefile". These makefiles include a system-dependent makefile, vc6.mak, in the distribution directory, which contains system-specific options should you wish to customize them. The ACE and make files for each compiler are configured to link to the non-debug configurations of the Fox and EiffelFox libraries. If you wish to use, and compiled, the debug versions instead, you will have to change these. In general, to build the application, you simply issue the "nmake" command specifying one of the targets, "ise", "iss", or "se", to build it using the ISE EiffeBench, Halstenbach iss-base, or SmallEiffel compiler, respectively. However, please note the following important instructions for each of the compilers. 1. Using ISE EiffelBench There are ACE files named ise_vc6.ace in each of the example and precompilation directories for use with ISE EiffelBench and MSVC, should you wish to build the application using the graphical development environment. Note that the LACE "multithreaded" option in these ACE files should be set according to the C run-time selections made above for the Fox library and EiffelFox C-library. If you set "multithreaded (no)", the generated C code will be compiled with the /ML option; if you set "multithreaded (yes)", it will be compiled with the /MM option. If you compiled either of the above C libraries with the debug version of these options, they will still link successfully, but with a minor warning about the mixing of the debug and non-debug libraries. If you wish to make a finalized mode application, you can issue the command "nmake ise-finalized". If you wish to precompile the EiffelFox library, run "nmake ise-precompile" in the "precomp" directory before building the example applications. Then uncomment the appropriate precompile line in the ise_vc6.ace files. If you wish to use the EiffelBase precompiled library instead, just uncomment the appropriate precompile line in the ise_vc6.ace files. 2. Using Halstenbach iss-base There are ACE files named iss_vc.ace in each of the example directories for use with Halstenbach iss-base and MSVC. However, as noted in the README.iss file, the C++ external code generation bug in iss-base prevents compilation of the applications from the graphical development environment, because of the need to postprocess the generated code before passing it to the C++ compiler. Therefore, compiling an EiffelFox application using iss-base will require compiling it from the command line. The makefile will automatically postprocess the generated code to correct it provided that you have a real "grep" program (not the lame one that comes with the Borland compiler) available through your path. You must have grep to postprocess the code. You can get one from the GNUish project archive at: http://www.simtel.net/pub/simtelnet/gnu/gnuish/grep15.zip Assuming that you have installed the grep and included it in the path, then from one of the example application directories, issue the command "nmake iss" to create a workbench mode application. If you wish to make a finalized mode application, you can issue the command "nmake iss-finalized". 3. Using SmallEiffel Because of code generation errors for C++ externals, and other minor problems, I have had to patch the SmallEiffel distribution identified as "Release -0.76Beta#4 (Thu 7th september 2000)". This patch, and a complete patched compiler distribution are available from the EiffelFox web site, at: http://darren.hiebert.com/EiffelFox You must use this patched version of the compiler to compile the C and C++ generated code it produces. Compiling the example EiffelFox applications with SmallEiffel must be done from the command line using the supplied makefiles. Make sure that you have set the appropriate C run-time library option in the %EIFFELFOX%/vc6.mak makefile, which can be found in the RUNTIME macro. Once verified, simply issue the command "nmake se". III. Building EiffelFox with Borland C++ 5.x Read the descriptions under III-C, "Building an EiffelFox application", before deciding to try to build the libraries for use with this compiler. A. Building the Fox library Change into the directory %FOX%\windows\borland and run "make". This will build the library %FOX\src\fox.lib. B. Building the EiffelFox C-library Run "make" in the appropriate subdirectory of %EIFFELFOX%\Clib, ise, iss, or se, to create a library for use with ISE EiffelBench, Halstenbach iss-base, or SmallEiffel, respectively. C. Building an EiffelFox application Your choices here are pretty limited. 1. Using ISE EiffelBench Unfortunately, the ISE include files eif_equal.h, eif_globals.h, eif_misc.h, and eif_portable.h included with the 4.5 compiler have problems which causes the C compilation phase to fail. These need to be corrected. If you need these, please email me and I will send them to you. I do not distribute them publicly because they are based upon copyrighted files. I would normally just distribute a patch file, but few Windows folks would be able to handle a patch file. If you wish to precompile the EiffelFox library, run "make ise-precompile" in the "precomp" directory before building the example applications. Then uncomment the appropriate precompile line in the ise_vc6.ace files. If you wish to use the EiffelBase precompiled library instead, just uncomment the appropriate precompile line in the ise_bc5.ace files. 2. Using Halstenbach iss-base I do not know if iss-base supports a C++ compiler other than MSVC. Therefore, EiffelFox and iss-base is not currently supported for the Borland compiler. You might know how to do this, but I have not really tried hard yet to make iss-base use the Borland compiler. 3. Using SmallEiffel Unfortunately, I have found that the Borland C++ compiler crashes on the C++ files generated by SmallEiffel. Therefore, SmallEiffel cannot be used with this C++ compiler. You might have better luck. The makefiles support doing it. Just run "make se". vim:set et: