= Building !FileManager/2 (FM/2) = This document explains how to build FM/2 from source. == Getting the Toolchain == The following tools are currently used to build the FM/2 binaries * [http://www.openwatcom.org/index.php/Download OpenWatcom] v1.6 or newer can work. However !OpenWatcom v1.9 release candidate 3 or newer is recommended because it includes the versions of WIPFC.EXE and WRC.EXE currently used to build release-level versions of FM/2. * For release builds we are now using wipfc.exe which is included in !OpenWatcom v1.9 release candidate 3 or newer. Until !OpenWatcom v1.9 is released, you may download with version of WIPFC [http://home.earthlink.net/~steve53/OpenWatcom/wipfc-20100324.zip here.] * If you prefer not to use this version of WIPFC, you may use IPFC.EXE from the OS/2 Toolkit. However you will have to define and set an environment variable, SET USER_IPFC=1, to force the build to use ipfc.exe. * For release builds we are now using WRC.EXE as the resource compiler. It is included with !OpenWatcom 1.8 or newer. If you have an earlier version of !OpenWatcom, you may download the newer WRC [http://svn.netlabs.org/fm2/attachment/ticket/131/wrc.zip?format=raw available here]. * If you need to use RC.EXE instead of WRC.EXE, please use the following version:[[BR]] 12-18-97 6:01 868,000 0 RC.EXE[[BR]] which reports itself as[[BR]] IBM RC (Resource Compiler) Version 5.00.002 Dec 18 1997[[BR]] It is available from [ftp://ftp.software.ibm.com/ps/products/warpzilla/os2tk40rc.zip Toolkit update for Mozilla] * We have converted to using the !OpenWatcom OS/2 Toolkit. '''Ensure that your build environment has paths to the !OpenWatcom Toolkit ahead of those for IBM's Toolkit.''' If you allow the !OpenWatcom installation to modify your CONFIG.SYS, you may have to edit the changes to move the !OpenWatcom paths in front. * The IBM Toolkit is on eComStation CD!#2 and you may want a copy of the IBM Toolkit installed for the documentation included in it. * lxlite LX compressor. You can get [http://hobbes.nmsu.edu/h-search.php?key=lxlite&pushbutton=Search lxlite from Hobbes] * To build the symbol files included in the optional debug package of FM/2, Perl v5.8 or newer is required. * To build a Warpin installation file for FM/2, Warpin 0.9.20 or newer must be installed. == Setting up the Toolchain == After installing the tools listed above: * Ensure that in your build environment the following !OpenWatcom paths precede those of other tools like the OS/2 Toolkit, !VisualAge C++, GCC, etc. * PATH: \binp * LIBPATH or BEGINLIBPATH: \binp\dll * HELP: \binp\help * BOOKSHELF: \binp\help * Ensure that lxlite.exe is on the PATH * In order to build symbol files, * add \bin to the PATH * add \bin and \lib to the LIBPATH or BEGINLIBPATH * set up a proper PERLLIB environment variable * If you use IPFC instead of WIPFC: SET USE_IPFC=1 or use USE_IPFC=1 on the WMAKE command line * If you use RC instead of WRC: SET USE_RC=1 or use USE_RC=1 on the WMAKE command line == Building the Executables == Use Subversion to pull a copy of the source code distribution into your client workspace. See [wiki:WikiStart#Gettingthesources Getting the sources] for instructions. FM/2 is built using WMAKE from !OpenWatcom. Build commands must be run from top directory of your Subversion workspace. The directory will contain the top level makefile. To build FM/2, the WMAKE command will be of the form:[[BR]] WMAKE The macro definitions are optional. If used, they override any corresponding environment variable ''during the execution of that build''. The most commonly used macros are: * FM2_VER=-3-18-0 (Sets the version for FM/2. Use the format as seen here (with three hyphens).) * DEBUG=1 (for debug builds.) * FORTIFY=1 (for debug builds. This includes extra code for debugging memory management problems.) * WARNALL=1 (This cause the compiler to display all levels of warnings during the build. This is usually not needed and results in ''many'' warnings.) * USE_RC=1 (Forces the build to use RC.EXE instead of WRC.EXE. This should not be used for release builds.) * USE_IPFC=1 (Forces the build to use IPFC.EXE instead of WIPFC.EXE. This should not be used for release builds.) '''The build targets.''' For a complete list, see the makefiles. The build targets most often used are: all:: This is the default target. It builds a fully functioning FM/2 (including help files and resources. dist:: This is a complete, releaseable build of FM/2 from start to finish. It is a "shortcut" for all of following other targets: * all * lxlite * syms * wpi lxlite:: This uses Lxlite to compress the executables. The "all" target should be built before building this target. syms:: This builds the symbol files for the debug package included in the Warpin installation file. Again, the "all" target should be built before building this target. wpi:: This builds the Warpin installation file. Again, the "all" target should be built before building this target. clean:: This deletes files so that a subsequent "WMAKE all" or "WMAKE dist" will completely rebuild FM/2. The current makefiles can not detect a change in the value of the DEBUG variable and will not regenerate files that depend on the DEBUG setting without some assistance. So when switching between debug and release builds, use the "wmake clean" to force a subsequent build to build all files. Build options such as DEBUG and FORTIFY may be specified either in the environment or on the command line. Choose one method and use it consistently or you may get unexpected results. The outputs for "WMAKE all" are: * av2.exe * databar.exe * dirsize.exe * eas.exe * fm3.exe * fm4.exe * global.exe * ini.exe * killproc.exe * sysinfo.exe * undel.exe * vcollect.exe * vdir.exe * viewinfs.exe * vtree.exe * dll\fm3dll.dll * dll\fm3res.dll * dll\ipf\fm3.hlp == Summary of Build options == === DEBUG === If not defined, a release build will be built. If defined a debug build with be built. Debug builds include support for symbolic debugging. === WARNALL === If not defined, do default compile-time error checking. If defined, do more compile-time error checking. Errors reported by WARNALL are rarely a problem, but it is recommend that WARNALL be used before releasing a production binary. === FORTIFY === If not defined FORTIFY support is omitted. If defined FORTIFY support is enabled. FORTIFY added runtime heap corruption and leak checking. Be sure to use "wmake clean" when changing this option. === USE_RC === If not defined, build with wrc.exe. If defined, build with rc.exe. wrc.exe is the preferred resource compiler. === USE_IPFC === If not defined, build with wipfc.exe. If defined, build with ipfc.exe. wipfc.exe is the preferred help compiler.