Skip to content

start:

Building OpenOffice.org 2.x (680er series) under Windows with 4NT

Beware! The build instructions for OpenOffice.org 1.1.x (and older) are different!

Last changes made: $Date: 2008/03/07 14:06:09 $

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. Unless stated otherwise, all commands appearing in this document should be entered from a 4NT shell (the exception is the configure script which has to be run from a cygwin bash shell). $SRC_ROOT will denote the directory in which the source code of OpenOffice.org is stored.


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 http://development.openoffice.org/releases/2.0.0rc2.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.

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 (http://download.openoffice.org/680/index.html) or alternatively via a check-out from the cvs tree against a release tag, e.g. OpenOffice_2_0_0.
  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) script to set all environment variables.

    Please see the last screen from the configure script for more specific information on setting up for your platform.

  4. Build typing dmake in $SRC_ROOT, or build --all in the instetoo_native 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.



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:

Software Requirements

  • Windows NT Version 4 Service Pack 3 or higher, Windows 2000 SP 2 or higher or Windows XP.
     
  • A Microsoft Visual C++ .NET Compiler . MS Visual C++ .net 2003 (not for free available) is currently used for the official builds but Microsoft Visual C++ 2005 Express Edition (free download, as in free beer) is also expected (but not guaranteed) to work. See additional build instructions at: MS Visual C++ 2005 Express
     
  • A Microsoft Platform SDK. The Sun provided builds use the following parts of the February 2003 version of the Microsoft Platform SDK (including the 64-bit build environment if possible): The MDAC SDK, the Core SDK, the Internet Development SDK and the Windows Installer SDK.
    Unfortunately that SDK is no longer available for download from Microsoft. The current version of the Platform SDK (Microsoft Windows Server 2003 SP1 Platform SDK - April 2005 Edition) can be downloaded from here. The following parts have to be installed:
    • Microsoft Windows Core SDK
      (The 64-bit Build Environment / 64-bit Tools are not needed)
    • Microsoft Web Workshop (IE) SDK
    • Microsoft Internet Information Server (IIS) SDK
    • Microsoft Data Access Services (MDAC) SDK
    • Microsoft DirectShow SDK
    • Platform SDK Redistributable: GDI+
  • A DirectX 9.0 SDK. The Sun provided builds use DirectX 9.0 SDK Update - (Summer 2004) but that is no longer available for download from Microsoft. The current version of the DirectX SDK
    • DirectX SDK - (February 2006)
    can be downloaded here.
     
  • 4NT Version 4.0 or higher. You can download this from ftp://jpsoft.com/4nt/.

    Important Note: Please ensure that the path to the 4NT application directory doesn't contain one or more spaces. No, not even c:\Program Files\4NT\. In this case uninstall and re-install to a directory without spaces.

    Important Note: Before you use 4NT, you must ensure that the initialisation file 4nt.ini is present in the 4NT application directory (This means you propably have to create it.). The following code sample shows the content of the 4nt.ini file:

    [4NT]
    CommandSep = ^
    EscapeChar = Ctrl-X
    ParameterChar = &
    LocalAliases = Yes
    

     
  • A Java 2 SDK is required. JDK 1.4.2
    Note: Java 5.0 (JDK 1.5.0) is supported starting from m158 (OOo 2.0.3), see issue 59368.
     
  • Cygwin Toolkit from http://www.cygwin.com. Use at least Cygwin DLL version 1.5.10. The official information about using setup.exe and installing Cygwin are available at: http://cygwin.com/cygwin-ug-net/setup-net.html. More help and information on the Cygwin tools can be found at http://website.openoffice.org/support/en/howtos/1.html.

    When installing Cygwin make sure you set the "Default Text File Type" to "Unix". This is the default setting.

    Not all Cygwin packages are needed to build OpenOffice.org, but make sure that at least all the packages from the base category and the following packages are installed.

    bison
    flex
    make
    patch
    perl
    Important Note: Within the Cygwin Toolkit, three executables might be realised as symlinks, namely awk.exe, gunzip.exe and tar.exe. This might lead to a break of the build later, and the symlinks should be replaced with copies of the command they link to. Check, in a cygwin shell, with ls -l /bin/awk.exe whether awk.exe is a symlink. For instance, awk.exe could be a link to gawk.exe, in which case you should copy gawk.exe to awk.exe: cd /bin; cp gawk.exe awk.exe. Take similar action for unzip.exe and tar.exe.

    Important Note: If you are using cygwin-1.5.18, you may have to download a development snapshot of the cygwin1.dll from http://cygwin.com/snapshots/, please see issue i#51560# for more details. If you do not do this, your build will hang while building 'instsetoo_native'.  

  • zip.exe Version 2.2 or higher, and unzip.exe. If you do not have these already, you can download them from www.info-zip.org. Note: The cygwin zip.exe is not working for the build under the 4NT shell. You have to use the native w32 version. Make sure that the first zip.exe in your path is the native w32 version, e.g. rename or delete the zip.exe in your cygwin /bin directory and copy the InfoZip version to this place.
     
  • The gpc general polygon clipper library release 2.31, located at http://www.cs.man.ac.uk/aig/staff/alan/software/. Download and unpack the tarball. You should have the files gpc.c and gpc.h in $SRC_ROOT/external/gpc.
     
  • The Microsoft Layer for Unicode (unicows.dll). Get it from the Microsoft site and put it into $SRC_ROOT/external/unicows. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen here.
     
  • The dbghelp.dll from Microsoft. Get it from the Microsoft site and put it into $SRC_ROOT/external/dbghelp. (Note: You may have to search Microsoft's website.) Last time it was seen here.
     
  • Ant Is required. This is a Java make utility.
     
  • Nullsoft Scriptable Install System (NSIS)
    This is optional, if available a self contained Windows installer is created in addition to the MSI installer files.
     
  • Mozilla libraries
    Some Mozilla libraries are needed. Choose one of the following three options.
    • Build the libraries
      Get the source from here, copy it into $SRC_ROOT/moz/download and configure will detect the source archive.
    • Use prebuild libraries
      Place WNTMSCI{inc,lib,runtile}.zip into $SRC_ROOT/moz/zipped. You have to configure with --disable-build-mozilla to enable the use of the prebuild libraries. The files can be found here or can be reused if the packages were build following the instructions of the previous point. In the latter case they can be found in $SRC_ROOT/moz/wntmsci10.pro of a successfull build.
    • Don't use the libraries
      By using the --disable-mozilla switch for configure you waive the extra functionality.

Perl Module requirements

This is a list of the perl modules that have to be installed.

Important Note: No, these modules are not automatically included in the Cygwin perl installation. Use the link above to learn how to install them.
Please note that CPAN is not able to deal with usernames containing spaces. To work around this fact, when CPAN asks you to specify the CPAN build and cache directory, change the default suggestion to /cpan.

Module: Used for:
Archive::Zip packing image lists, evtl. for further zipping needs
XML::Parser expat based parser for the new XML based build lists

Perl - Additional CWS tooling requirements

For committers who want to use the CWS tooling

Module: Used for:
Crypt::SSLeay for SSL encrypted SOAP connections. Note: It needs the openssl-devel cygwin package to be installed.
LWP::UserAgent a requirement for SOAP::Lite that is not automatically installed. Install it or the install of SOAP::Lite will fail.
SOAP::Lite access the SOAP based CWS webservice.

Hardware Requirements

  • Intel Pentium II PC
  • 128 MB RAM (More recommended)
  • 4 GB free disk space (8 GB for crashdump)


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:

  • Download the source code tarball (http://download.openoffice.org/2.0.0/source.html), e.g. OOo_2.0.0_src.tar.gz in case of the 2.0 stable release.

    Unpack the tarballs as follows:

    > tar -xvzf OOo_2.0.0_src.tar.gz
    > cd OOo_2.0.0rc3_src 
    

    This will be $SRC_ROOT from now on.

  • Another possibility is to check out the code from the cvs tree. If you don't have a username and password, you can still do a checkout as anoncvs:
    > cvs -d:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs login
    
    Just press enter when prompted for the password.
    > cd $SRC_ROOT
    $SRC_ROOT> cvs /
        -d:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs /
        co -r OpenOffice_2_0_0 OpenOffice2
    
    The non-bold slash means that the command should be in one line. It is possible to update an already existing older copy to a newer release:
    $SRC_ROOT> cvs /
        -d:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs /
        update -r OpenOffice_2_0_0 OpenOffice2
    
  • If you're only interested in building individual modules, you won't need the entire source code. You can check out individual modules from the cvs tree:
    $SRC_ROOT> cvs /
        -d:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs /
        co -r OpenOffice_2_0_0 (module-name)
    
  • A note on the tags (i.e. the argument to the -r option in the cvs commands listed above): If HEAD is used as a tag, you will get the newest latest source code. This, however, will most likely not build since development is going on there. See http://tools.openoffice.org#CWS for a description of the development process with child workspaces and Environment Information System for the current child workspaces and milestones.




Generating the Build Environment and Build Tools

Ideally, in keeping with the principles of open source, you would use an open source shell to build on a computer running a Win32 operating system. However, you decided to use a non-open source shell to build on a computer running a Win32 operating system: the 4NT command shell.

On the other hand, the bash shell from the cygwin tools is needed to run the configure script which generates 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 that sets all necessary build environment variables and builds the dmake.exe. See the example below.

This configuration file is created in the SRC_ROOT directory. A top-level makefile script makefile.mk are 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:

As 4nt is not the only possible shell, you have to enable the use of 4NT with --with-use-shell=4nt
  • Run the configure script according to the following example. We assume here that

    • the source code is in C:\OOo_2.0.0rc3_src
    • JDK 1.4.1_02 is installed in C:\j2sdk1.4.1_02
    • the Microsoft Compiler is located in c:\Programme\Microsoft Visual Studio .NET 2003\Vc7.
    • and your zip.exe and unzip.exe are in C:\unzip

    Running the configure script could then look like the following (bold typed text is what you enter):

    (open a cygwin bash shell)
    cd /cygdrive/c/OOo_2.0.0rc3_src/config_office
    ./configure --with-cl-home="/cygdrive/c/Programme/Microsoft Visual Studio .NET 2003/Vc7" --with-jdk-home=/cygdrive/c/j2sdk1.4.1_02 --with-unzip-home=/cygdrive/c/unzip --with-use-shell=4nt
    .
    .
    .
    (some screen output here)
    .
    .
    .
    (more screen output here)
    bash-2.02$ exit

You should exit the bash shell. Now you can run the environment settings file winenv.bat from your 4NT shell.

Note the change in pathname notation. Since the cygwin bash shell won't accept backslashes, paths have to be typed in a cygwin bash notation which is /cygdrive/c/path/to/file, instead of C:\path\to\file. This may appear confusing at the moment, but sticking to this notation will work.

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

config_office> bash configure --help

After running configure you have to execute the configuration file which sets all environment variables. The generated file is called winenv.bat.

If you experiment with the newest sources from the cvs-tree, mind that updates to the configure process may 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 using the autoreconf command. The perl script set_soenv is created when you run configure from set_soenv.in.

If you need to modify or create a correct configure you would run commands like the following:

$SRC_ROOT> cd config_office
config_office> cvs update configure.in
get a bash shell
config_office>bash autoconf
exit the bash shell
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.


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 may take several hours.
$SRC_ROOT> dmake

If you wish to control the build more you can perform a build with local install sets or tarballs.

  • instsetoo_native will create rpm's or the actual delivery package for your platform.
  • instsetoo will create a single tar file containing the build however it is deprecated.
	cd $SRC_ROOT
	cd instetoo_native
	build --all

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 Athlon XP1700
Processor speed 1466 MHz
RAM 512 MB
Hard Disk 160 GB 7200 RPM IDE
Time (for SRC680_m86) ~17 h






Building a Project with Debug Information

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

$SRC_ROOT/(module)> rm -rf wntmsci10.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_native) will create an installation sets in English. A simple build in $SRC_ROOT/instsetoo_native will also create the installation sets, provided all other modules are already built.

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

$SRC_ROOT/instsetoo_native> rm -rf wntmsci10.pro

The English installation set will be located at $SRC_ROOT/instsetoo_native/wntmsci10.pro/OpenOffice/install/en-US. Execute the setup binary to install:

$SRC_ROOT> cd instsetoo_native/wntmsci10.pro/OpenOffice/install/en-US
en-US> setup.exe
The en-US in the path names indicates that the localization is American English. This value corresponds to the language tags defined by RFC 1766 (Tags for the Identification of Languages). The German installation set will be located in a de subdirectory. This scheme holds true for all localizations you may have chosen explicitly (see next section Building Localized 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.

For information on creating an automated installation script and create a response file.




Building Localized Versions of OpenOffice.org

Running the configure script with the --with-lang option will introduce the build of additional language resources. This switch accepts one or more RFC 1766 language tags as arguments, unfortunately not all languages are supported. Check the value of the completelangiso macro in $SRC_ROOT/solenv/inc/postset.mk for all the currently supported language tags.

Example: --with-lang="de fr" enables the build of the localized german and french version.

The environment variable WITH_LANG will then contain the language tags of the additional (en-US will always be build) languages.




Building Localized Language Packs

If you build additional localized languages it is possible to generate Language Packs that contain only the changes needed to add the additional language to an OpenOffice.org of a different language.

The following commands will generate language packs languages that were specified with the --with-lang switch during the configure phase. Note that you can only build the language packs after you have build the complete office with all selected languages.

$SRC_ROOT> cd instsetoo_native/util; dmake ooolanguagepack