Building OpenOffice.org under Windows
This document refers to older versions of OpenOffice.org only. If you intend to build the snapshot No. 638 or later, go here!
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:
config_office> winenv.bat
In this example, the script winenv.bat
is executed in the directory config_office
under
a 4NT shell. Unless stated otherwise, all commands appearing in
this document should be entered from a 4NT shell.
$SRC_ROOT
will denote the directory in which
the source code of OpenOffice.org is stored.
Table of contens:
- Overview
- Build Requirements
- Build Instructions
- Building a Full Build
- Building Individual Projects with a Prebuild
- Building a Project with Debug Information
- Instructions to Build an Installation Set
Overview
All those who have done a build of OpenOffice.org before may use this section as a reminder. You 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:
- Get the source code, either from the download webpage at www.openoffice.org/dev_docs/source/get_tarballs.html, or alternatively via a check-out from the cvs tree against a release tag, e.g. OpenOffice614.
-
Run the
configure
script in a cygwin bash shell to check all requirements and to create the scriptwinenv.bat
, or edit the sample filewinenvsample.bat
. -
Run the
winenv.bat
script to set all environment variables. -
Build using the
dmake
tool.
Overview of Building an Individual Project
You can use a prebuild version to build an individual project. Having a prebuild version is neccessary 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:
-
Download the appropriate solver tarballs from the download webpage at
www.openoffice.org/dev_docs/source/get_tarballs.html,
i.e. for 614 the solver tarball
solver614_win32intel.tar.gz.
-
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/get_tarballs.html). However, it is not possible to download individual modules there. -
Check out the module
config_office
. This is always necessary to create the build environment. -
Also check out the module
solenv
. This module provides the build tools. - Unpack the solver tarball.
-
Run the
configure
script in a cygwin bash shell to check all requirements and to create the scriptwinenv.bat
, or edit the sample filewinenvsample.bat
. -
Run the script
winenv.bat
to set all environment variables. - Build each module against the prebuild
solver
using thedmake
tool.
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:
Build Requirements
- Windows NT Version 4 Service Pack 3 or higher.
- Microsoft Visual C++ Version 6 Service Pack 3.
-
4NT Version 2.5 or higher. You can download this from ftp://jpsoft.com/4nt/.
Note: Before you use 4NT, you must ensure that the initialization file
4nt.ini
is present in the 4NT application directory. The following code sample shows the content of the4nt.ini
file:[4NT] CommandSep = ^ EscapeChar = Ctrl-X ParameterChar = & LocalAliases = Yes
- JDK 1.2.2.
- Perl 5 for Win32. You can download this binary from http://www.activestate.com/Products/ActivePerl/Download.html.
-
Cygnus Toolkit. Download the Cygnus Toolkit from
http://sources.redhat.com/cygwin/download.html.
Follow the installation instructions provided. Note: OpenOffice.org was
successfully build using the (old) b20 version of cygwin, but we encountered
problems with the newest version (in particular with the
find
andsed
implementation of cygwin run under the 4NT shell). Cygwin-b20 resides under various mirror sites, for instance at ftp://ftp.ccp14.dl.ac.uk/ccp14/ftp-mirror/programming/cygwin/pub/cygwin/old/cygwin-b20/. Check the mirror site list on the Cygwin page for a mirror site close to you.
-
GNU Bison 1.28: cygwin-b20 only contains Bison 1.25. You can
download this from
http://www.gnu.org/software/bison/bison.html.
In fact, only the bison.simple
file in the
share
subdirectory of the cygnus-b20 installation has to be replaced by the corresponding file from the Bison version 1.28 (at www.gnu.org, this file is called bisonl.s1). This means that if you have installed bison 1.28 atC:\bison-1.28
and cygwin b-20 resides inC:\cygnus\cygwin-b20
, then all you have to do is:
cp C:\bison-1.28\share\bison.s1 C:\cygnus\cygwin-b20\share\bison.simple.
Bison will also need a \tmp directory to function properly (C:\tmp
). -
A Microsoft Assembly compiler. Instructions on where and how to get a free
version can be found at
http://www2.dgsys.com/~raymoon/faq/masm.html#9. You need the files
ml.exe and ml.err. Place them somewhere in a directory
and note the path, i.e.
C:\ml
-
zip.exe
Version 2.2 or higher. You can download this from http://ring.omp.ad.jp/pub/text/CTAN/tools/zip/info-zip -
from 613 on: STLPort Version 4.0, freely available from
http://www.stlport.org.
No installation required, just download the files, i.e. to
C:\STLport-4.0
. -
The header files
adoctint.h
andSqlUcode.h
from the Microsoft Platforms SDK, April 2000 Edition.
Download the Platform SDK Setup,psdk-86.exe
, from the Custom Installation section. Then run it in your Win32 environment. This starts an interactive download program. Follow the instructions on the screen. At the Custom Installation screen, select Build Environment/Data Acces Services/OLE DB and the Build Environment/Data Acces Services/ODBC from the Custom Installation tree. This downloads a number of files to your Win32 environment. You only need to copy the two header files to the$SRC_ROOT/external/download
directory. -
from 627 on: The gpc general polygon clipper library release 2.31, located at, for instance,
http://penguinppc.org/files/pub/openoffice/633b/src/ (file gpc231.tar.Z,
the original site - www.cs.man.ac.uk/~amurta/software - is no longer
online).
Download and unpack the tarball. You should have the files
gpc.c and gpc.h in
$SRC_ROOT/external/gpc
. - Note: the pgp-files listed here earlier as requirements are obsolete now.
-
from 614 to 627: Berkeley DB 3.1.17 from
www.sleepycat.com.
Download the tarball from their download website
and build the data base following
their instructions on the documentation website.
Remember that the java API has to be build as well which is not the
default option. How to include the java API is explained on the same
webpage.
The data base will consist in a directory
structure (
db3.1.17
) including a subdirectoryjava/classes
. Go there and create a java archive (jar
command) calleddb.jar
(db31.jar for older releases) and place this into theexternal/common
directory:db3.1.17> cd java/classes db3.1.17/java/classes> jar cvf db.jar * db3.1.17/java/classes> mv db.jar $SRC_ROOT/external/common/.
From 632 on, all necessary components of the Berkeley DB are included in the OpenOffice.org source.
Hardware Requirements
- Intel Pentium II PC
- 128 MB RAM
- 2 GB free disk space
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 from
www.openoffice.org/dev_docs/source/get_tarballs.html,
e.g.
oo_609_src.tar.gz
in case of the 609 release. There is a second source tarball calledsolenv
containing the build tools.Unpack the tarballs as follows (for the example 609):
> gunzip oo_609_src.tar.gz > tar -xvf oo_609_src.tar > cd oo_609_src
This will be $SRC_ROOT from now on.
For releases 627 or earlier you will also need thesolenv
tarball:$SRC_ROOT> gunzip solenv609_win32intel.tar.gz $SRC_ROOT> tar -xvf solenv609_win32intel.tar
-
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
:> runsocks cvs -d:pserver:anoncvs@anoncvs.openoffice.org:/cvs login > cd $SRC_ROOT $SRC_ROOT> runsocks cvs / -d:pserver:anoncvs@anoncvs.openoffice.org:/cvs / co -r OpenOffice609 openoffice
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> runsocks cvs / -d:pserver:anoncvs@anoncvs.openoffice.org:/cvs / update -r OpenOffice609 openoffice
-
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> runsocks cvs / -d:pserver:anoncvs@anoncvs.openoffice.org:/cvs / co -r OpenOffice609 (module-name)
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, this is not possible at present. You must use a non-open source shell to build on a computer running a Win32 operating system: the 4NT command shell.
In the future, it may be possible to build on a Win32 system using the
Cygnus bash
shell. However, this requires syntax changes to the
makefiles that the build uses. This is a future project for OpenOffice.org.
However, the Cygnus bash
shell 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 you then execute
to set all necessary build environment variables.
Alternatively, you can edit the winenvsample.bat
file.
This configuration file will be moved into the SRC_ROOT
directory. A top-level makefile script makefile.rc
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.rc
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.
In case you adjust the sample file winenvsample.bat
to your
needs rather then running the configure script, you have to copy it by
hand to SRC_ROOT
and name it winenv.bat
.
Copying the file makefile.rc
from $SRC_ROOT/config_office
to
$SRC_ROOT
had to be done by hand as well in this case.
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 file configure.in
. The
configure script itself is created from configure.in
using the autoconf
command. In this case, 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.
To run the configure
script, do the following:
open a cygwin bash shell.
$SRC_ROOT> cd $SRC_ROOT/config_office config_office> bash configure --with-stlport4-home=(path)
path
is the absolute path pointing to your STLPort
installation, given in a cygwin-specific notation.
If, for instance, STLport resides in C:\STLport-4.0
,
path would be
//C/STLport-4.0
. Exit the bash shell afterwards.
configure
will probably also ask you for
the location of the Java Development Kit 1.2.2,
the Microsoft compiler, and the assembly compiler. In case they
reside in C:\jdk1.2.2
,
C:\PROGRA~1/MICROS~3/VC98
, and C:\ml
,
their locations have to be entered as
//C/jdk1.2.2
),
//C/PROGRA~1/MICROS~3/VC98
, and
//C/ml
, respectively.
The configure script
should find everything else by itself. If not, you can always specify
it explicitly, for instance for Perl with the option
--with-perl-home=//C/Perl
if it resides in
C:\Perl
. Note that all paths
given here are for the sake of an example only.
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 --helpCurrently, the configure scripts ends for Windows with an error message /bin/sh: No such file or directory. This is a bug, but doesn't lead to any problems and can be ignored.
The option --with-stlport4-home
is a requirement.
For more information on the options that you can use with the
configure
script, see the Build Environment document at
tools.openoffice.org/build_env.html.
After running configure
, you have to execute the configuration
file which sets all environment variables. An example of how this file
called winenv.bat looks like with the example paths given above is shown
here.
Alternatively to running the configure script, you can make use of the
sample file winenvsample.bat
in $SRC_ROOT/config_office
, adjust it to your setup, and copy it to $SRC_ROOT
as
winenv.bat
. Note that in this case you also have to copy
makefile.rc
by hand.
$SRC_ROOT> winenv.bator
edit $SRC_ROOT/config_office/winenvsample.bat
$SRC_ROOT> cp config_office/winenvsample.bat winenv.bat $SRC_ROOT> cp config_office/makefile.rc makefile.rc $SRC_ROOT> winenv.bat
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> dmakeIf you are interested in the order in which the individual modules are build, type
$SRC_ROOT> dmake -n
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 | ~20 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 in 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
solver609_win32int.tar.gz
from the Download page at
www.openoffice.org/dev_docs/source/get_tarballs.html
and unpack it in the $SRC_ROOT
directory:
$SRC_ROOT> gunzip solver609_win32int.tar.gz $SRC_ROOT> tar -xvf solver609_win32int.tarIn 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 dmake
tool.
$SRC_ROOT/(module-name)> dmakeFiles called
makefile.rc
in each directory with further
subdirectories iterate through all directories of the module and exectues
dmake
in each of them (just like the top-level
makefile.rc
does when building the entire office suite).
The last or second to last directory 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
(wntmsci3.pro
until snapshot 619)
directory. Then run
dmake
with the debug option set to true:
$SRC_ROOT/(module)> rm -rf wntmsci7.pro $SRC_ROOT/(module)> dmake debug=true
Instructions to Build an Installation Set
When you have completed the build, you need to do the following to install and set up the office suite:
-
From the top-level directory, run the
dmake install
command, or rundmake
in the directoryinstsetoo
:$SRC_ROOT> dmake install
or$SRC_ROOT> cd instsetoo instsetoo> dmake
Languages other than english (provided the language option was set in configuring) can be build with the optionLANGEXT
. For instance for french:$SRC_ROOT/instsetoo> dmake LANGEXT=33
The parameter 33 stems from the international phone code for France. -
Change directory to
$SRC_ROOT/instsetoo/wntmsci7.pro/normal
and execute thesetup
binary:$SRC_ROOT> cd instsetoo/wntmsci7.pro/normal normal> ./setup