Windows Build Dependencies
- 1 Install Cygwin Requirements
- 2 Install Windows Build Requirements
- 3 Notes
Install Cygwin Requirements
On Windows, you must first install cygwin from www.cygwin.com.
The easiest thing to do is to download the cygwin SETUP.EXE. Then run cmd and navigate to the download dir and copy and paste the below to run setup.exe preselected with the list of required packages
setup.exe -P autoconf,automake,bison,cabextract,doxygen,flex,gcc-g++,git,gnupg,gperf,libxml2-devel,libpng12-devel,make,mintty,openssh,openssl,patch,perl,pkg-config,readline,rsync,unzip,vim,wget,zip
This launch the GUI and requires you to manually choose installation paths etc, but the packages passed via command line are pre-selected meaning you just need to accept the selection.
Alternatively, Run the setup.exe utility, switch the package view mode to 'Full' by pressing 'View' until 'Full' is displayed beside it, then select the following packages for installation:
As a safety measure, and because I always had to do it :
Once cygwin installed, close all cygwin consoles, run
c:\cygwin\bin\dash.exe, and in the terminal, launch
Install Windows Build Requirements
Where to put the source code/Git checkout
On Windows you have to be careful where you put your LibreOffice source code.
You should pay attention to the length of the full path to the directory where you put the LibreOffice source code, as Windows places a severe limit on the maximum path length that is easy to run into. Experience indicates that a path like
C:/git/libo is short enough.
You will use Cygwin Bash Shell for the whole build process. You must installed all the build dependencies above before starting the shell to run autogen because autogen need some environment variables to find the tools.
Native Windows programs cannot use Cygwin symlinks. However, Cygwin's awk is a symlink to gawk. So gawk.exe must be copied to awk.exe by executing:
cd /bin rm awk cp gawk.exe awk
If you use Windows SDK 7+ with VS2008 Express, you should register it after install. You should do it with Start>Programs>Microsoft Windows SDK v7.1>Visual Studio Registration>Windows SDK Configuration Tool. If this does not work, open the SDK console (one step up), and execute:
WindowsSdkVer.exe -version:v7.1 -legacy (Thanks to Chromium build instructions).
Pre-built Mozilla libraries
For the pre-built Mozilla libraries, you need MSVC 2005 runtime files Microsoft.VC80.CRT.manifest, msvcp80.dll, and msvcr80.dll in external/msvcp80. Those files should be in c:/windows/winsxs/ , under a folder beginning with x86_Microsoft.VC80.CRT. I put an asterisk in path because I did not have the same string as what is set in configure. If you don't have those files, you can get them by installing the redistributable package. and copying the aforementioned .dll files from:
and the manifest from
You should rename the manifest to Microsoft.VC80.CRT.manifest
Something like the following in the autogen.lastrun is known to produce a working build:
--with-max-jobs=5 --with-num-cpus=2 --disable-binfilter --disable-build-mozilla --disable-odk --without-junit --with-ant-home=/home/xyz/apache-ant-1.8.2 --with-mozilla-build=/home/xyz/mozilla-build
Of course, change the information behind ='s to fit your needs; eg. decrease the --with-max-jobs when you have smaller amount of cores( cf Development/How to build for more information), or set the paths to what you have used when installing various prerequisites.
Other than setting --with-num-cpus and --with-max-jobs, you also need --without-junit. You also need to specify the path for ant with --with-ant-home=<cygwin path of ant>. If your build fails because of Mozilla you may add --disable-mozilla but that also disable some features. If you use the free Visual Studio 2008 Express, then --disable-activex and --disable-atl, because only the full version of Visual Studio 2008 contains the required headers. Remember to restart the shell after you install Microsoft tools, before you run autogen.
Visual Studio 2010 compiler
We cannot yet build using the Visual Studio 2010 compiler. The build will fail in cli_ure (UNO bridge for C# binding). Stick with the Visual Studio 2008 compiler for now.
System PATH causing weird build breakage
The build imports the system PATH for DLL lookups. If you experience weird build breakage that no one else seems to experience, check your PATH value and try cleaning it. Note that you need to re-run configure in order for the new system PATH value to take effect in your build. For example, the author has experienced a build failture in the shell module due to his system PATH including a path to an older OOo installation which had a DLL of the same name as the one that the build uses.
Buildability of 'master'
If you are building the Windows build for the first time, it is recommended that you check the current state of http://tinderbox.libreoffice.org/MASTER/status.html . If you see recent "green" builds, it is a good time to try - otherwise it might happen to you that you'll have to fix the build yourself. The buildability on Windows has improved recently with the introduction of the MinGW and more stable native Windows tinderboxes, but still there might be a day or two when 'master' is not buildable on Windows.
The usual recommendation is to just pull and try again, and once you have a build, don't pull in the tree any more, but do your hacking in it. Clone a different tree and iterate pulling and building in that until it again works, then switch. Repeat.