wiki:BuildingFm2

Version 20 (modified by Gregg Young, 13 years ago) ( diff )

--

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

  • OpenWatcom v1.6 or newer can work. However OpenWatcom v1.9 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.
    • High memory builds are currently the default. They require exehdr.exe. The following version is required:
      1-05-04 13:54 82,461 0 exehdr.exe
      (build level info is not available)
    • For release builds we are now using wipfc.exe which is included in OpenWatcom v1.9 or newer.
      • If you prefer not to use this version of WIPFC or not to update to OpenWatcom v1.9, 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 available here.
      • If you need to use RC.EXE instead of WRC.EXE, please use the following version:
        12-18-97 6:01 868,000 0 RC.EXE
        which reports itself as
        IBM RC (Resource Compiler) Version 5.00.002 Dec 18 1997
        It is available from 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 lxlite from Hobbes
  • To build the symbol files included in the debug package of FM/2, Perl v5.8 or newer is required.
  • To build the exceptq xqs files included in the debug package of FM/2, makexqs.exe from the exceptq developers' package is required. exceptq from Hobbes
  • 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: <OpenWatcomPath>\binp
    • LIBPATH or BEGINLIBPATH: <OpenWatcomPath>\binp\dll
    • HELP: <OpenWatcomPath>\binp\help
    • BOOKSHELF: <OpenWatcomPath>\binp\help
  • Ensure that exehdr.exe is on the PATH
  • Ensure that lxlite.exe is on the PATH
  • In order to build symbol and xqs files,
    • add <PerlPath>\bin to the PATH
    • add <PerlPath>\bin and <PerlPath>\lib to the LIBPATH or BEGINLIBPATH
    • set up a proper PERLLIB environment variable
    • ensure makexqs.exe is on the PATH
  • 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 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:

WMAKE <macro-definitions> <build-target>

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 the help file).
dll
This builds just the dlls which is useful when developing since almost all changes only effect the dlls.
dist
This is a complete build of FM/2 from start to finish, including the Warpin installation file. 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.

Note: See TracWiki for help on using the wiki.