Build Environment

by Z98 | November 12, 2011

The Project provides a package of customized compilers and tools to help quickly set up everything needed to build ReactOS called the ReactOS Build Environment (RosBE) for both Windows and Unix. The BE includes:

  • CMake 2.8.12.1
  • MinGW GCC 4.7.2
  • ninja
  • Command-line SVN Client 1.8.5

Note that if one wishes to use Microsoft's toolchain either from the command line or Visual Studio, simply make sure the bin directory of RosBE is in the path.

Build Procedure

When building using the MinGW toolchain, one must have started the command prompt using the shortcut created by the build environment. This shortcut helps set up the necessary paths and environment variables to make sure all of the necessary compilers and tools are found. It is highly recommended that compilation be done in a separate directory from the source checkout. This keeps the checkout clean and makes it easier to blow away the compiled objects for a truly clean build. The following instructions all assume a separate build directory has been created and is the build environment terminal's current working directory. For the command line build, execute:

pathtocheckout/configure

NOTE: By default, ninja is used for generating the build files. If you want to use makefiles instead, just use the following command:

pathtocheckout/configure Makefiles

This creates several directories and files in the build directory, the two most important being the host-tools and reactos directories. Before ReactOS can be compiled, some helper tools need to be compiled first. To do this, enter the following commands to move into the host-tools directory and build.

cd host-tools && ninja

Once the host tools have been compiled, move into the reactos directory next to the host-tools directory to build ReactOS.

cd ../reactos && ninja

The final step is to build an image for installation or testing. The following are the different types of images currently available.

  • bootcd: An image that can be used to install ReactOS onto a computer, real or virtual.
  • bootcdregtest: An unattended installation image that automatically runs through a series of regression tests.
  • livecd: An image that can be run on a computer from the CD-ROM.

For example, to build a bootcd, use the following command.

ninja bootcd

Note that this command can be issued even before ReactOS has been built. If the object files have not been generated yet, the build system will simply start a build from scratch before building the image.

NOTE: When using makefiles, use make (or makex) instead of ninja.

 

On Windows systems, it is also possible to build ReactOS using Microsoft's toolchain. ReactOS currently supports using Visual Studio 2010 and 2012. One however needs to execute the configure script from the Visual Studio command prompt instead of the build environment tool prompt. The cmake version bundled with the ReactOS Build Environment must however be in the path somewhere. Generating the command line build is effectively the same as the above instructions. Generating a Visual Studio solution file requires a different argument to be passed to configure like so:

pathtocheckout/configure VSSolution

Two separate solutions are created, one for the host tools and the other for ReactOS proper. Once again, the host tools must be built first before attempting to build ReactOS. Please note however that while the Visual Studio build boots, it is not entirely working yet.