From The Document Foundation Wiki
Jump to: navigation, search

Cross Compiling LibreOffice for Windows on a Linux machine

Obtain dbghelp.dll and gdiplus.dll from a Windows installation

There are multiple websites offering you to download those DLLs. Unfortunately, I don't know if it is allowed to redistribute those DLLs. Thus, I'm not putting a direct link here on this wiki.

First, we add the OpenSuse repository with all the Windows libraries.


sudo zypper ar -r

We install all the Windows libraries. This is completely crazy but it ensures that the build will not break because something is missing. Help to narrow down the number of packages to install is welcome.


sudo zypper in mingw32-\* && rpm -e `rpm -qa | grep mingw32| grep debug|xargs`

We need Java.


sudo zypper in java-1_6_0-openjdk-devel

We need to install the build dependancies


sudo zypper si -d libreoffice


sudo apt-get build-dep libreoffice

Clone LO repository
git clone git://

Open the autogen.lastrun file (or create it at the root of the repository) and replace its content by:

(on Fedora, replace i686-w64-mingw32 by i686-pc-mingw32)

On Fedora, I remove libwpd, libwps and libwpg which are not useful anyway (wordperfect filters)

CC=ccache i686-w64-mingw32-gcc
CXX=ccache i686-w64-mingw32-g++
CC_FOR_BUILD=ccache gcc
CXX_FOR_BUILD=ccache g++

Generate config files
Copy the dll files
cp dbghelp.dll external/dbghelp
chmod +x external/dbghelp/dbghelp.dll
cp gdiplus.dll external/gdiplus.dll
chmod +x external/gdiplus/gdiplus.dll
Build it!

Take a nap. When you wake up, you should have a Windows build on your Linux computer.

Building the installer

This is still work in progress. Lanedo is working on it.