Building OpenOffice.org with the MinGW compiler
Disclaimer! The build of OpenOffice.org with the MinGW compiler is not supported and fully experimental at this moment!
The following page is a short summary of the required actions to build OpenOffice.org with this compiler.
The only branch with applied MinGW patches is cws_srx645_mingw. You have to checkout the source with cvs, no source archiv is available as this document is written.
Requirements
The build has the same requirements as the W32-tcsh build, but you don't need any Microsoft compiler. (Only the compiler, you need all the rest, e.g. MASM and PSDK.)
A lot of memory
Experiments show that with only 256MB real memory ld is using virtual memory to link the libraries, this takes very long. 512MB real memory and 1.5GB virtual memory are suficient.
A patched MinGW compiler
You can either use the MinGW compiler that comes with Cygwin (gcc -mno-cygwin, alias cygming) or install a MinGW system in addition to you already needed cygwin installation. Choose one of the following two possibilities: cygming-
cygming ( Either this ... )
In addition to the cygwin packages mentioned here for W32-tcsh you need to install:
Only binary
gcc-mingw
gcc-mingw-core
gcc-mingw-g++
With source
binutils
mingw-runtime
w32api
Get and install reimp.exe
You need reeimp.exe in your path. reimp.exe is used to generate def files from Microsoft import libraries, you can find it in a MinGW installation in thebin
directory, or inmingw-utils-0.3.tar.gz from http://www.mingw.org/download.shtml
.
Only put reimp.exe in the path you are using when building OOo, not all files from that archive.
Patch and rebuild binutils, w32api and mingw-runtime
The setup program unpacks the source packages to /usr/src. Get the needed resres.c.patch and pseudo-reloc.diff. patches and save them to /usr/src. Now apply the patches:
/usr/src:$ cd /usr/src/binutils-20040312-1
/usr/src/binutils-20040312-1:$ patch -p1 < ../resres.c.patch
/usr/src/binutils-20040312-1:$ patch -p0 < ../pseudo-reloc.diff
Rebuild binutils:
/usr/src/binutils-20040312-1:$ ./configure --prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/sbin \
--localstatedir=/var \
--datadir=/usr/share \
--mandir=/usr/share/man \
--infodir=/usr/share/info
/usr/src/binutils-20040312-1:$ make && make install
Rebuild mingw-runtime:
/usr/src/binutils-20040312-1:$ cd ../w32api-2.5-1
/usr/src/w32api-2.5-1:$ ./configure --prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/sbin \
--localstatedir=/var \
--datadir=/usr/share \
--mandir=/usr/share/man \
--infodir=/usr/share/info
/usr/src/w32api-2.5-1:$ make && make install
Rebuild w32api:
/usr/src/w32api-2.5-1:$ cd ..
/usr/src:$ ln -s w32api-2.5-1 w32api
/usr/src:$ cd w32api-2.5-1
/usr/src/w32api-2.5-1:$ cd ../mingw-runtime-3.2-1
/usr/src/mingw-runtime-3.2-1:$ ./configure --prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/sbin \
--localstatedir=/var \
--datadir=/usr/share \
--mandir=/usr/share/man \
--infodir=/usr/share/info
/usr/src/mingw-runtime-3.2-1:$ make && make install
That's it. Proceed with the build section.
-
MinGW ( ... or this! )
You need to install MinGW first, you need:
MinGW-3.1.0-1.exe,
gcc-core-3.3.1-20030804-1.tar.gz,
gcc-g++-3.3.1-20030804-1.tar.gz and
w32api-2.5.tar.gzYou have to patch and rebuild binutils and you have to rebuild libmsvcrt.a with the patched binutils. For this you need:
MSYS-1.0.9.exe,
msysDTK-1.0.1.exe,
binutils-2.13.90-20030111-1-src.tar.gz,
mingw-runtime-3.2-src.tar.gz,
w32api-2.5-src.tar.gz,
bison,
flex.Patch the binutils sources with resres.c.patch and pseudo-reloc.diff.
Hint 1: First rebuild w32api-2.5 and then mingw-runtime-3.2 (This containes libmsvcrt.a)
Hint 2: To build binutils with MinGW you need bison and flex, but you have to remove them from the path before you start the OOo build.
Build
It is recommended to use an as short as possible path, but the path must include the Platform SDK Bin directory, e.g.:
$ export
PATH=/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/psdk02_2003/Bin
Now configure, e.g.:
For cygming:
$ ./configure --with-mingwin=yes
--with-jdk-home=/cygdrive/c/j2sdk1.4.1_02
\
--with-ant-home=/cygdrive/c/ant-1.5.3-1
--with-psdk-home=/cygdrive/d/psdk02_2003
or for MinGW:
$ ./configure --with-mingwin=/cygdrive/c/MinGW
--with-jdk-home=/cygdrive/c/j2sdk1.4.1_02 \
--with-ant-home=/cygdrive/c/ant-1.5.3-1
--with-psdk-home=/cygdrive/d/psdk02_2003
Start a tcsh
$ tcsh
Set your environment variables:
$ source winmingw.set
Build dmake
$ ./bootstrap
Rehash your path
$ rehash
Build OOo
$ dmake
And now wait. ...
Comments and updates
This document is a work in progress, any comments to Volker Quetschke.