Building OpenOffice.org under Windows

This document describes the requirements and actions that you need to build OpenOffice.org on Windows.

Commands you have to type on the keyboard follow this syntax throughout this document:

D:\my\source> winenv.bat

In this example, the script winenv.bat is executed in the directory D:\my\source under a 4NT shell. Depending on if you want to use the 4NT or the Cygwin tcsh environment, unless stated otherwise, all commands appearing in this document should be entered from a 4NT shell or a tcsh shell, respectively. (The exception is the configure script which has to be run from a cygwin bash shell.)

(The Cygwin tcsh environment is experimental, and can be used starting with cws_srx644_ooo20030412.)

$SRC_ROOT will denote the directory in which the source code of OpenOffice.org is stored.

Basically, there is the choice to build OpenOffice.org from two different branches: a stable branch, which results in the 1.0.x releases, or a less stable developer branch (latest release 643B). Links to the different sources are given in the document.




Table of Contents




Overview

This section is meant as a reminder or checklist for those who have some experience in building OpenOffice.org. Everybody else should jump to the Build Requirements section.

Even experienced builders are well advised to check the release notes at www.openoffice.org/dev_docs/source/download.html and the section Build Requirements in this document to inform yourself about changes since the previous releases.

Detailed step-by-step build descriptions are given from the next section on.

You can perform a full build, or you can build an individual project using a prebuild version.

Overview of Performing a Full Build

To perform a full build, you need to follow these steps:

  1. Get the source code, either from the download webpage (www.openoffice.org/dev_docs/source/download.html) or alternatively via a check-out from the cvs tree against a release tag, e.g. OpenOffice643.
  2. Run the configure script in a cygwin bash shell to check all requirements and to create the script winenv.bat.
  3. Run the winenv.bat (under 4NT) or winenv.set (under tcsh) script to set all environment variables.
  4. The following point is only used for the tcsh environment, and not needed when using 4NT:
  5. Create the build tools using bootstrap.
  6. Build typing dmake in $SRC_ROOT, or build -all in the instsetoo module, or build followed by deliver in the individual modules.
For detailed build instructions, see the section Building a Full Build of the Office Suite in this document. The installation procedure is described at the end of this document.

Overview of Building an Individual Project

You can use a prebuild version to build an individual project. Having a prebuild version is necessary because the individual project you want to build could depend on other projects. A project builds a particular component of OpenOffice.org. For example, the Word Processing project builds the Word Processing application. To build an individual project, you must follow these steps:

  1. Download the appropriate solver tarballs from the download webpage (www.openoffice.org/dev_docs/source/download.html) i.e., for 643B the solver tarball solver643B_win32intel.tar.gz.
  2. Check out the modules for the project that you want to build from the OpenOffice.org cvs tree. If your project uses the resources module, res, check out this module also. You can, of course, also download the entire source from the download webpage (www.openoffice.org/dev_docs/source/download.html). However, it is not possible to download individual modules there.
  3. Check out the module config_office. This is always necessary to create the build environment.
  4. Also check out the module solenv.
  5. Unpack the solver tarball in the $SRC_ROOT directory.
  6. Run the configure script in a cygwin bash shell to check all requirements and to create the script winenv.bat.
  7. Run the script winenv.bat to set all environment variables.
  8. Build each module against the prebuild solver using the build tool, followed by deliver.
For detailed build instructions, see Building Individual Projects with a Prebuild.



Build Requirements

Before you start building, you must ensure that your system satisfies the recommended software and hardware requirements for the type of system you are working on. For Windows, these are as follows:

Starting with cws_srx644_ooo20030412 there are two possible ways of building OpenOffice.org for Windows. The standard way using the proprietary 4NT shell and the new unixy way using the cygwin tcsh. Each of both methods has its own Build Requirements section.

Build Requirements - 4NT

Build Requirements - tcsh


Hardware Requirements



External Components

The code contains some further external components which are already provided. If you are interested in details about these, look at the External Components webpage at http://tools.openoffice.org/ext_comp.html.



Get the source code

You have two options to get the source code:




Generating the Build Environment and Build Tools

As mentioned above there are now two build systems for Windows, the standard way using the proprietary 4NT shell and the new unixy way using the cygwin tcsh. Each of both methods has its own Build Requirements section.

Even if you want to use a non-open source shell to build on a computer running a Win32 operating system, the 4NT command shell, the Cygwin bash shell is needed to run the configure script which generates the build environment.

To use the new tcsh environment you have to use --with-use-shell=tcsh as command line switch to the configure script.

You use the configure script to generate the build environment. The configure script checks that all software, hardware, and system requirements for the build are satisfied, and it creates a configuration file called winenv.bat (4NT environement) or winenv.set (tcsh environement). In the 4NT case you have to start winenv.bat in your 4NT-shell to set the environment variables, in the tcsh case you have to run the source command on winenv.set

This configuration file will be moved into the SRC_ROOT directory. A top-level makefile script makefile.mk and the script bootstrap in the config-office directory will be moved into SRC_ROOT as well. This is due to technical reasons: The SRC_ROOT directory in the cvs tree can only hold directories. On the other hand, the top-level makefile.mk should logically be placed in the top-level directory SRC_ROOT. The cvs tree holds these files in config_office and configure copies them up.

The following should demonstrate in detail what steps have to be done to set up the environment. First for the 4NT case and in a second example for the tcsh case.

For both examples we assume that

There are a number of options that you can use with the configure script. To display these options, type the following command:

config_office> ./configure --help

After running configure you have to execute the configuration file which sets all environment variables. An example of how this file called winenv.bat (in the 4NT case) looks like with the example paths given above is shown here. In the 4NT-case you have to start winenv.bat in your 4NT-Shell, in the tcsh-case you have to start a tcsh and source the configuration file to set all environment variables:

$SRC_ROOT> tcsh



$SRC_ROOT> source winenv.set

If you experiment with newest sources from the cvs-tree, mind that updates to the configure process do not happen via updates of configure (the script file) but via the files configure.in and set_soenv.in. The configure script itself is created from configure.in and set_soenv.in using the autoconf command. In this case, you would run commands like the following:
(This has to be done in a Cygwin bash shell)

$SRC_ROOT> CD config_office
config_office> cvs update configure.in
config_office> autoconf
to update the configure script. If you only use code from the snapshot releases on the web, you don't need to be concerned about this.

In the 4NT case you don't need to generate additional build tools, all will be prepared when you call winenv.bat. But in the tcsh case you have to create some build tools. (Remember, you have a tcsh running at this moment.)

To create the build tools, type the following command:

$SRC_ROOT> ./bootstrap

The bootstrap utility creates the tools required for building. This involves already building some modules and will take a few minutes.



Build Instructions

Building a Full Build of the Office Suite

Now you are ready to build OpenOffice.org. To build the entire suite, all you have to do (after having created the environment as described above) is to run dmake from the top-level directory. This will take several hours.
$SRC_ROOT> dmake

If you decide to rebuild a module or build each module individually (mind dependencies!), you will have to use the build tool. A subsequent deliver will copy all created binaries, libraries etc. into the solver tree:

$SRC_ROOT/(module)> build
$SRC_ROOT/(module)> deliver

The following table shows the time required to build on a system with a particular specification. You can use these details to estimate the time required to build on your system.

Architecture Intel
Processor Pentium III
Processor speed 600 MHz
RAM 256 MB
Hard Disk 6 GB SCSI
Time ~10 h

Building Individual Projects with a Prebuild

OpenOffice.org is organised in several projects. For example, the Word Processing Project. These in turn consist of several modules, organised in separate directories. The source contains approximately 90 modules.

You can build any project or module individually. Building modules individually should not be misunderstood as reducing OpenOffice.org to a special application, say, for instance, the spreadsheet application. The program will always consist of the entire office suite: text processor, spreadsheet, drawing application, etc. Building individual modules comes in handy if you want to develop on a certain module. Most modules will depend on other modules to be already built. In other words, all modules must build in a particular order. To avoid building all modules which are prerequisites of the module of your interest, you can make use of a pre-build solver tree against which you can build any module.

For more information on modules and on the sequence that they build in, and on the dependencies, see tools.openoffice.org/modules.html.

You have to download the solver tree as a tarball solver643B_win32int.tar.gz from the Download page at http://www.openoffice.org/dev_docs/source/download.html and unpack it in the $SRC_ROOT directory, e.g.:




$SRC_ROOT> gunzip solver643B_win32int.tar.gz
$SRC_ROOT> tar -xvf solver643B_win32int.tar

In order to create the build environment and build tools, you also have to check out the config_office module and solenv.

To build a project, you build each of its modules individually in their directory with the build tool, followed by deliver to copy the created libraries, binaries etc. into the solver tree:

$SRC_ROOT/(module-name)> build
$SRC_ROOT/(module-name)> deliver
Files called build.lst in the directories (module-name)/prj contain all information about the subdirectories to be build (each of them containing makefiles makefile.mk), about internal dependencies, and also about modules the current module depends on. The files (module-name)/prj/d.lst control the actions done by deliver. The last or second to last directory to be build is usually module-name/util which is responsible for linking one or more shared libraries.



Building a Project with Debug Information

To rebuild a complete project with debug information, remove all object files by removing the wntmsci7.pro directory. Then run build with the debug option set to true:

$SRC_ROOT/(module)> rm -rf wntmsci7.pro
$SRC_ROOT/(module)> build debug=true



Instructions to Build an Installation Set

The build process (started with a top-level dmake or build -all in $SRC_ROOT/instsetoo) will create installation sets in english and german. A simple build in $SRC_ROOT/instsetoo will also create the installation sets, provided all other modules are already built.

If you have build an installation set earlier and want to re-build it, please delete the local outpath first:

$SRC_ROOT/instsetoo> rm -rf wntmsci7.pro

The English installation set will be located at $SRC_ROOT/instsetoo/wntmsci7.pro/01/normal. Execute the setup binary to install:

$SRC_ROOT> CD instsetoo/wntmsci7.pro/01/normal
normal> setup.exe
The 01 in the path names indicates that the localisation is american english. This number corresponds to the international phone code for the USA. The German installation set will be located in a subdirectory 49. This scheme holds true for all localisations you may have chosen explicitely (see next section Building Localised Versions of OpenOffice.org).

For a network installation, use the -net option to setup. Details on the network installation process can be found at http://installation.openoffice.org/proposals/netinstall.html in the installation project webpage.




Building Localised Versions of OpenOffice.org

Running the configure script with the --with-lang option will introduce the build of additional language resources. This option will introduce a command in the environment settings file which in turn after execution sets a variable like, for instance, RES_FREN to TRUE in the case of french (You can also set this variable by hand in order to introduce another language). It is also possible to build more than one language at once. One language resource, however, will not be introduced that way: the help content! Clicking on 'help' would still open english help documents.

There is no automatic procedure yet to implement non-english help, but the additional manual effort is rather minimal: After building the source as described above, but before building the installation set, a zip-file with all helpcontent for the language of choice has to be unzipped into the directory

$SRC_ROOT/solver/641/wntmsci7.pro/pck.
The filenames of these files contain a number code for the language, corresponding to the international phone code of a country in which that language is mainly spoken. For instance, the file helpcontent_34_wnt.zip contains all helpcontent for the spanish localisation. The zipfiles themselves are available at ftp.services.openoffice.org/pub/OpenOffice.org/contrib/helpcontent/.

Having unzipped the helpcontent files in there, building of installation sets can be resumed or repeated (in case you already have build some), as described in the previous chapter. English installation sets will be located in

$SRC_ROOT/instsetoo/wntmsci7.pro/01/normal, 
where 01 corresponds to the international phone code of the USA. If you have chosen, for instance, French (by configuring with the --with-lang=FREN option) you will find an additional directory called 33:
$SRC_ROOT/instsetoo/wntmsci7.pro/33/normal.
Similarily, you will find 49 for German, 34 for Spanish, etc.

Localised help content is not yet available for all languages. In such cases, the english helpcontent will appear in the installations. For instance, when Danish is set with configure, you will find installation sets under the directory 45, but the help files will appear in english.