Difference between revisions of "Documentation/Building Guide AOO/Step by step"

From Apache OpenOffice Wiki
Jump to: navigation, search
(CentOS 7 for AOO 4.2.x and later)
m (Windows 7, Windows 8.1, Windows 10: Apache Ant was updated)
(29 intermediate revisions by 4 users not shown)
Line 8: Line 8:
 
  {{DraftPage|EN}}
 
  {{DraftPage|EN}}
 
The process to build {{AOo|EN}} is currently undergoing experimentation. As steps are firmed up they will be added here.
 
The process to build {{AOo|EN}} is currently undergoing experimentation. As steps are firmed up they will be added here.
 +
 +
* Updated Install requirements. OpenJDK 6 or 7 is not available for Ubuntu 16.04:
 +
 +
  sudo apt-get install openjdk-8-jdk fakeroot
 +
 +
Draft: With Version 4.2 we start to update the build enviroment to Ubuntu 18.04 and Debian 9. You can follow [https://wiki.openoffice.org/wiki/User:Mechtilde/AOOBauen AOOBauen]
  
 
=Ubuntu 14.04=
 
=Ubuntu 14.04=
  
 +
Ubuntu 14.04 is our secondary build platform for our complimentary community Linux 32 and 64 bit platforms, CentOS7 being our primary.
 
The basic building steps under Ubuntu 12.04 (see below) are to be followed in Ubuntu 14.04 as well; however, there are some minor build issues that any developer, using this OS, needs to be aware of, if he gets stuck while building. The following is the list of issues, with their fixes, that a developer may face with:
 
The basic building steps under Ubuntu 12.04 (see below) are to be followed in Ubuntu 14.04 as well; however, there are some minor build issues that any developer, using this OS, needs to be aware of, if he gets stuck while building. The following is the list of issues, with their fixes, that a developer may face with:
 
* Issue 124712 (build broken in svl); see the link https://issues.apache.org/ooo/show_bug.cgi?id=124712 for detailed information.
 
If you are building trunk, the patch is already applied; if you are building from a release tag or tarball, the patch needs to be applied for all releases <= 4.1.1.
 
  
 
* Issue 125475; see the link https://issues.apache.org/ooo/show_bug.cgi?id=125475 for detailed information. This happens if you explicitly upgraded your GCC and related tools to version 4.9; it will not appear if you use GCC 4.8.x.
 
* Issue 125475; see the link https://issues.apache.org/ooo/show_bug.cgi?id=125475 for detailed information. This happens if you explicitly upgraded your GCC and related tools to version 4.9; it will not appear if you use GCC 4.8.x.
Line 45: Line 49:
  
 
if you get an error like this, then that means connectivity is not built properly. Build connectivity using build --all:connectivity and this error will go away.
 
if you get an error like this, then that means connectivity is not built properly. Build connectivity using build --all:connectivity and this error will go away.
 +
 +
==Build and Packaging tools==
 +
 +
Download, configure, build and install dmake and epm
 +
$ wget https://github.com/jimjag/dmake/archive/dmake-4.12.3.tar.gz
 +
$ tar -xzf dmake-4.12.3.tar.gz
 +
$ cd dmake-dmake-4.12.3
 +
$ ./configure --prefix=/usr/local
 +
$ sudo make install
 +
 +
 +
$ wget https://github.com/jimjag/epm/archive/epm-4.4.2.tar.gz
 +
$ tar -xzf epm-4.4.2.tar.gz
 +
$ cd epm-epm-4.4.2
 +
$ ./configure --prefix=/usr/local --enable-aoo
 +
$ sudo make install
  
 
=Ubuntu 12.04=
 
=Ubuntu 12.04=
Line 95: Line 115:
 
   svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo-trunk
 
   svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo-trunk
 
   cd aoo-trunk/main
 
   cd aoo-trunk/main
 +
 +
* Install git and checkout the source (since 2019-08-03:
 +
 +
  sudo apt install git
 +
  git clone https://gitbox.apache.org/repos/asf/openoffice.git aoo
 +
  cd aoo/main
  
 
|}
 
|}
Line 251: Line 277:
 
=CentOS 7 for AOO 4.2.x and later=
 
=CentOS 7 for AOO 4.2.x and later=
  
Although CentOS 5 was our reference environment for build through the 4.1.x series, as it is a very old environment, it is not a viable system to use for building AOO 4.2.x and later. Not to say that you can't do so, but we have switched to CentOS 7 for our reference build. Other than that, the actual setups and builds for both OSs are strikingly similar.
+
Although CentOS 5 was our reference environment for build through the 4.1.x series, as it is a very old environment, it is not a viable system to use for building AOO 4.2.x and later, mainly due to some dependencies no longer being available for CentOS5 (such as ''gstreamer-1.x''). Not to say that you can't do so, but we have switched to CentOS 7 for our reference build. Other than that, the actual setups and builds for both OSs are strikingly similar.
  
 
==Setup a VM==
 
==Setup a VM==
Line 332: Line 358:
  
 
   $ sudo cpan File::Path
 
   $ sudo cpan File::Path
 +
 +
==Build and Packaging tools==
 +
 +
Download, configure, build and install dmake and epm
 +
$ wget https://github.com/jimjag/dmake/archive/dmake-4.12.3.tar.gz
 +
$ cd dmake-dmake-4,12,3
 +
$ ./configure --prefix=/usr/local; make install
 +
 +
 +
$ wget https://github.com/jimjag/epm/archive/epm-4.4.2.tar.gz
 +
$ cd epm-epm-4.4.2
 +
$ ./configure --prefix=/usr/local --enable-aoo; make install
  
 
==32 bit hints==
 
==32 bit hints==
Line 337: Line 375:
 
There is not a EPEL release for CentOS 7 32bit, so you'll need to download, build and install dpkg and GNUtar directly:
 
There is not a EPEL release for CentOS 7 32bit, so you'll need to download, build and install dpkg and GNUtar directly:
  
  $ wget http://ftp.de.debian.org/debian/pool/main/d/dpkg_1.19.2.tar.xz
+
  $ wget ftp://ftp.de.debian.org//debian/pool/main/d/dpkg/dpkg_1.19.3.tar.xz
 
  $ wget http://ftp.gnu.org/gnu/tar/tar-1.30.tar.gz
 
  $ wget http://ftp.gnu.org/gnu/tar/tar-1.30.tar.gz
  
 
==Configure==
 
==Configure==
  
See http://svn.apache.org/viewvc/openoffice/devtools/build-scripts/ for the configure options for a release build.
+
See https://svn.apache.org/viewvc/openoffice/devtools/build-scripts/ for the configure options for a release build.
  
 
= Fedora 21 =
 
= Fedora 21 =
Line 684: Line 722:
  
 
*Install Cygwin, '''32-bit version'''
 
*Install Cygwin, '''32-bit version'''
**Browse to [https://www.cygwin.com https://www.cygwin.com] and click on the setup-x86.exe link to download the most recent 32-bit version (the most recent Cygwin DLL at the moment is 2.11.2) or use [https://www.cygwin.com/setup-x86.exe this direct link]
+
**Browse to [https://www.cygwin.com https://www.cygwin.com] and click on the setup-x86.exe link to download the most recent 32-bit version (the most recent Cygwin DLL at the moment is 3.0.7) or use [https://www.cygwin.com/setup-x86.exe this direct link]
 
**Run the installer and click through the questions
 
**Run the installer and click through the questions
 
**On the "Choose A Download Site" select a nearby download server
 
**On the "Choose A Download Site" select a nearby download server
 
**Expect a "Setup Alert" dialog box on the first cygwin install on the computer: click OK to close it
 
**Expect a "Setup Alert" dialog box on the first cygwin install on the computer: click OK to close it
**On the page that allows you to select additional packages select: <br /><br /> From the '''Archive''' category: <pre>zip, unzip</pre> From the '''Devel''' category: <pre>autoconf, gperf, gcc-g++, bison, flex, patch, subversion, make</pre> From the '''Net''' category: <pre>rsync</pre>From the '''Perl''' category: <pre>perl, perl-XML-SAX-Expat, perl-Archive-Zip, perl-LWP-Protocol-https, perl-XML-parser, perl-libwww-perl, perl-Digest-SHA, perl-Net-SSLeay</pre>As a shortcut you can install everything needed with one command:<pre>setup-x86.exe -P zip -P unzip -P autoconf -P gperf -P gcc-g++ -P bison -P flex -P patch -P subversion -P make -P rsync -P perl -P perl-XML-SAX-Expat -P perl-Archive-Zip -P perl-LWP-Protocol-https -P perl-XML-parser -P perl-libwww-perl -P perl-Digest-SHA -P perl-Net-SSLeay</pre>If you will use git, you need in addition from the '''Devel''' category the packages:<pre>git, git-svn</pre><i>(If you prefer to install packages with a Linux kind of touch, you can skip selecting the packages and instead select just the package <b>lynx</b> (enter lynx in the Search box and select the lynx entry in the Web/Default section). You would then install the other packages from the cygwin command line using lynx as explained ahead. However, selecting the packages from the Cygwin interface is recommended.)</i>
+
**On the page that allows you to select additional packages select: <br /><br /> From the '''Archive''' category: <pre>zip, unzip</pre> From the '''Devel''' category: <pre>autoconf, gperf, gcc-g++, bison, flex, patch, git, make</pre> From the '''Net''' category: <pre>rsync</pre>From the '''Perl''' category: <pre>perl, perl-XML-SAX-Expat, perl-Archive-Zip, perl-LWP-Protocol-https, perl-XML-parser, perl-libwww-perl, perl-Digest-SHA, perl-Net-SSLeay</pre>As a shortcut you can install everything needed with one command:<pre>setup-x86.exe -P zip -P unzip -P autoconf -P gperf -P gcc-g++ -P bison -P flex -P patch -P git -P make -P rsync -P perl -P perl-XML-SAX-Expat -P perl-Archive-Zip -P perl-LWP-Protocol-https -P perl-XML-parser -P perl-libwww-perl -P perl-Digest-SHA -P perl-Net-SSLeay</pre><i>(If you prefer to install packages with a Linux kind of touch, you can skip selecting the packages and instead select just the package <b>lynx</b> (enter lynx in the Search box and select the lynx entry in the Web/Default section). You would then install the other packages from the cygwin command line using lynx as explained ahead. However, selecting the packages from the Cygwin interface is recommended.)</i>
 
**Click Next to finish package selection.
 
**Click Next to finish package selection.
 
**Click Next to resolve dependencies.
 
**Click Next to resolve dependencies.
Line 710: Line 748:
 
**Browse to https://ant.apache.org/bindownload.cgi
 
**Browse to https://ant.apache.org/bindownload.cgi
 
**Chose a mirror near you.
 
**Chose a mirror near you.
**Download the zip archive (currently that is apache-ant-1.9.13-bin.zip or apache-ant-1.10.5-bin.zip).<br /> Note that Apache Ant 1.10.x will only work with Java 8.
+
**Download the zip archive (currently that is apache-ant-1.9.14-bin.zip or apache-ant-1.10.7-bin.zip).<br /> Note that Apache Ant 1.10.x will only work with Java 8.
 
**Open downloaded archive in file explorer and unzip it to a location of your choice, eg <code>c:\</code>.  Note that <code>C:\Program Files (x86)</code> will not work due to problems of quoting the spaces and parentheses.
 
**Open downloaded archive in file explorer and unzip it to a location of your choice, eg <code>c:\</code>.  Note that <code>C:\Program Files (x86)</code> will not work due to problems of quoting the spaces and parentheses.
 
      
 
      
Line 749: Line 787:
 
::*Start with creating a parent directory for the source code: <pre>mkdir /cygdrive/c/source&#10;cd /cygdrive/c/source</pre>
 
::*Start with creating a parent directory for the source code: <pre>mkdir /cygdrive/c/source&#10;cd /cygdrive/c/source</pre>
 
::*Check out source from Apache SVN repository<pre>svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo-trunk&#10;cd aoo-trunk/main</pre>
 
::*Check out source from Apache SVN repository<pre>svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo-trunk&#10;cd aoo-trunk/main</pre>
 +
 +
::; Checkout from Gitbox using git (Since 2019-08-03):
 +
::*<i>(If you haven't installed the git package from the cygwin interface, please do so now by re-running the cygwin installer, or if you used lynx and apt-cyg then:)<pre>apt-cyg install git</pre></i>
 +
::*Start with creating a parent directory for the source code: <pre>mkdir /cygdrive/c/source&#10;cd /cygdrive/c/source</pre>
 +
::*Check out source from Apache Git repository<pre>git clone https://gitbox.apache.org/repos/asf/openoffice.git aoo&#10;cd aoo/main</pre>
 +
  
 
::; Checkout from SVN using git-svn :
 
::; Checkout from SVN using git-svn :
Line 782: Line 826:
  
 
* Call configure
 
* Call configure
** For those paths that do have spaces, use the cygpath tool to get a shortened version without any spaces, which you can then use in the configuration directives without any trouble (adapt paths as necessary):<pre>$ cygpath -m -s "C:\Program Files (x86)\Java\jdk1.8.0_73" &#10;C:/PROGRA~2/Java/JDK18~1.0_7 &#10;$ cygpath -m -s "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC" &#10;C:/PROGRA~2/MI1DCA~1.0/VC</pre>Run configure (again adapt paths as necessary)<pre>SDK_PATH="/cygdrive/c/Microsoft_SDKs/Windows/v7.0"&#10;./configure \&#10;    --with-frame-home="$SDK_PATH" \&#10;    --with-psdk-home="$SDK_PATH" \&#10;    --with-midl-path="$SDK_PATH/bin" \&#10;    --with-ant-home="/cygdrive/c/apache-ant-1.9.13" \&#10;    --with-jdk-home="C:/PROGRA~2/Java/JDK18~1.0_7" \&#10;    --with-csc-path="C:/Windows/Microsoft.NET/Framework/v3.5" \&#10;    --with-cl-home="C:/PROGRA~2/MI1DCA~1.0/VC" \&#10;    --with-asm-home="C:/PROGRA~2/MI1DCA~1.0/VC/bin" \&#10;    --with-dmake-url="https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2" \&#10;    --disable-pch \&#10;    --disable-atl \&#10;    --disable-activex \&#10;    --disable-nss-module \&#10;    --without-junit</pre>If you have installed the optional DirectX SDK then you can add the switch:<pre>    --with-directx-home="C:/Microsoft_DirectX_SDK_June_2010"</pre>If you have installed Windows Driver Kit 7.1.0 and would like to build with ATL and ActiveX functionality then remove the <code>--disable-activex</code> and the <code>--disable-atl</code> directives, and add the atl home directives: <pre>    --with-atl-include-dir=/cygdrive/c/WinDDK/7600.16385.1/inc/atl71 \&#10;    --with-atl-lib-dir=/cygdrive/c/WinDDK/7600.16385.1/lib/ATL/i386 \&#10;    --with-mfc-include-dir=/cygdrive/c/WinDDK/7600.16385.1/inc/mfc42 \&#10;    --with-mfc-lib-dir=/cygdrive/c/WinDDK/7600.16385.1/lib/Mfc/i386</pre>If you have installed NSIS you can use the relative directive <pre>    --with-nsis-path="C:/NSIS"</pre>If you have installed MozillaBuild tools you can use the relative switch:<pre>    --with-mozilla-build="/cygdrive/d/mozilla-build"</pre>You may also enable a few more switches (used for official releases: --enable-win-x64-shellext):<pre>    --enable-win-x64-shellext \&#10;    --enable-wiki-publisher \&#10;    --enable-category-b \&#10;    --enable-bundled-dictionaries</pre>and if you would like to build for different locales you can use the lang switch (in this example, for English United States and for Italian):<pre>    --with-lang="en-US it"</pre>If you have copied over the dbghelp.dll and would like these extra features you can enable the debug switch:<pre>    --enable-dbgutil</pre>
+
** For those paths that do have spaces, use the cygpath tool to get a shortened version without any spaces, which you can then use in the configuration directives without any trouble (adapt paths as necessary):<pre>$ cygpath -m -s "C:\Program Files (x86)\Java\jdk1.8.0_73" &#10;C:/PROGRA~2/Java/JDK18~1.0_7 &#10;$ cygpath -m -s "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC" &#10;C:/PROGRA~2/MI1DCA~1.0/VC</pre>Run configure (again adapt paths as necessary)<pre>SDK_PATH="/cygdrive/c/Microsoft_SDKs/Windows/v7.0"&#10;./configure \&#10;    --with-frame-home="$SDK_PATH" \&#10;    --with-psdk-home="$SDK_PATH" \&#10;    --with-midl-path="$SDK_PATH/bin" \&#10;    --with-ant-home="/cygdrive/c/apache-ant-1.9.14" \&#10;    --with-jdk-home="C:/PROGRA~2/Java/JDK18~1.0_7" \&#10;    --with-csc-path="C:/Windows/Microsoft.NET/Framework/v3.5" \&#10;    --with-cl-home="C:/PROGRA~2/MI1DCA~1.0/VC" \&#10;    --with-asm-home="C:/PROGRA~2/MI1DCA~1.0/VC/bin" \&#10;    --with-dmake-url="https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2" \&#10;    --disable-pch \&#10;    --disable-atl \&#10;    --disable-activex \&#10;    --disable-nss-module \&#10;    --without-junit</pre>If you have installed the optional DirectX SDK then you can add the switch:<pre>    --with-directx-home="C:/Microsoft_DirectX_SDK_June_2010"</pre>If you have installed Windows Driver Kit 7.1.0 and would like to build with ATL and ActiveX functionality then remove the <code>--disable-activex</code> and the <code>--disable-atl</code> directives, and add the atl home directives: <pre>    --with-atl-include-dir=/cygdrive/c/WinDDK/7600.16385.1/inc/atl71 \&#10;    --with-atl-lib-dir=/cygdrive/c/WinDDK/7600.16385.1/lib/ATL/i386 \&#10;    --with-mfc-include-dir=/cygdrive/c/WinDDK/7600.16385.1/inc/mfc42 \&#10;    --with-mfc-lib-dir=/cygdrive/c/WinDDK/7600.16385.1/lib/Mfc/i386</pre>If you have installed NSIS you can use the relative directive <pre>    --with-nsis-path="C:/NSIS"</pre>If you have installed MozillaBuild tools you can use the relative switch:<pre>    --with-mozilla-build="/cygdrive/d/mozilla-build"</pre>You may also enable a few more switches (used for official releases: --enable-win-x64-shellext):<pre>    --enable-win-x64-shellext \&#10;    --enable-wiki-publisher \&#10;    --enable-category-b \&#10;    --enable-bundled-dictionaries</pre>and if you would like to build for different locales you can use the lang switch (in this example, for English United States and for Italian):<pre>    --with-lang="en-US it"</pre>If you have copied over the dbghelp.dll and would like these extra features you can enable the debug switch:<pre>    --enable-dbgutil</pre>
 
*Finish configuration and download missing external source tarballs and extensions<pre>./bootstrap</pre>
 
*Finish configuration and download missing external source tarballs and extensions<pre>./bootstrap</pre>
 
* Include the configured environment<pre>source winenv.set.sh</pre>
 
* Include the configured environment<pre>source winenv.set.sh</pre>
Line 807: Line 851:
  
 
* Install Cygwin, '''64-bit version'''
 
* Install Cygwin, '''64-bit version'''
** Browse to [https://www.cygwin.com https://www.cygwin.com] and click on the setup-x86_64.exe link to download the most recent 64-bit version (the most recent Cygwin DLL at the moment is 2.11.2) or use [https://www.cygwin.com/setup-x86_64.exe this direct link]
+
** Browse to [https://www.cygwin.com https://www.cygwin.com] and click on the setup-x86_64.exe link to download the most recent 64-bit version (the most recent Cygwin DLL at the moment is 3.0.7) or use [https://www.cygwin.com/setup-x86_64.exe this direct link]
 
** Run the installer and click through the questions
 
** Run the installer and click through the questions
 
** On the "Choose A Download Site" select a nearby download server
 
** On the "Choose A Download Site" select a nearby download server
 
** Expect a "Setup Alert" dialog box on the first cygwin install on the computer: click OK to close it
 
** Expect a "Setup Alert" dialog box on the first cygwin install on the computer: click OK to close it
** On the page that allows you to select additional packages select: <br /><br /> From the '''Archive''' category: <pre>zip, unzip</pre> From the '''Devel''' category: <pre>autoconf, gperf, gcc-g++, bison, flex, patch, subversion, make</pre> From the '''Net''' category: <pre>rsync</pre>From the '''Perl''' category: <pre>perl, perl-XML-SAX-Expat, perl-Archive-Zip, perl-LWP-Protocol-https, perl-XML-parser, perl-libwww-perl, perl-Digest-SHA, perl-Net-SSLeay</pre>As a shortcut you can install everything needed with one command:<pre>setup-x86_64.exe -P zip -P unzip -P autoconf -P gperf -P gcc-g++ -P bison -P flex -P patch -P subversion -P make -P rsync -P perl -P perl-XML-SAX-Expat -P perl-Archive-Zip -P perl-LWP-Protocol-https -P perl-XML-parser -P perl-libwww-perl -P perl-Digest-SHA -P perl-Net-SSLeay</pre>If you will use git, you need in addition from the '''Devel''' category the packages:<pre>git, git-svn</pre>
+
** On the page that allows you to select additional packages select: <br /><br /> From the '''Archive''' category: <pre>zip, unzip</pre> From the '''Devel''' category: <pre>autoconf, gperf, gcc-g++, bison, flex, patch, git, make</pre> From the '''Net''' category: <pre>rsync</pre>From the '''Perl''' category: <pre>perl, perl-XML-SAX-Expat, perl-Archive-Zip, perl-LWP-Protocol-https, perl-XML-parser, perl-libwww-perl, perl-Digest-SHA, perl-Net-SSLeay</pre>As a shortcut you can install everything needed with one command:<pre>setup-x86_64.exe -P zip -P unzip -P autoconf -P gperf -P gcc-g++ -P bison -P flex -P patch -P git -P make -P rsync -P perl -P perl-XML-SAX-Expat -P perl-Archive-Zip -P perl-LWP-Protocol-https -P perl-XML-parser -P perl-libwww-perl -P perl-Digest-SHA -P perl-Net-SSLeay</pre>
 
** Click Next to finish package selection.
 
** Click Next to finish package selection.
 
** Click Next to resolve dependencies.
 
** Click Next to resolve dependencies.
Line 827: Line 871:
 
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Porting]]
 
[[Category:Porting]]
 +
[[Category:Build_System]]

Revision as of 17:24, 6 September 2019


This page is intended as a collection of simple step-by-step recipes to build Apache OpenOffice from source code. A more thorough explanation of what the individual steps do and why they are necessary can be found in the building guide.

Ubuntu 16.04

Editing.png This page is in a DRAFT stage.

The process to build Apache OpenOffice is currently undergoing experimentation. As steps are firmed up they will be added here.

  • Updated Install requirements. OpenJDK 6 or 7 is not available for Ubuntu 16.04:
 sudo apt-get install openjdk-8-jdk fakeroot

Draft: With Version 4.2 we start to update the build enviroment to Ubuntu 18.04 and Debian 9. You can follow AOOBauen

Ubuntu 14.04

Ubuntu 14.04 is our secondary build platform for our complimentary community Linux 32 and 64 bit platforms, CentOS7 being our primary. The basic building steps under Ubuntu 12.04 (see below) are to be followed in Ubuntu 14.04 as well; however, there are some minor build issues that any developer, using this OS, needs to be aware of, if he gets stuck while building. The following is the list of issues, with their fixes, that a developer may face with:

As the BZ says, it is because of buggy toolchain g++4.9. So for now in Ubuntu Linux 14.04, build the source using g++4.8.2, gcc4.8.2; these are the default compilers in Ubuntu Linux 14.04 anyway; please check it using the following commands:

 g++ -v
 gcc -v

if not, you've to download them.

 sudo apt-get install g++-4.8
 cd /usr/bin
 rm gcc
 rm g++
 ln -s gcc-4.8 gcc
 ln -s g++-4.8 g++
  • Updated Install requirements. In addition to those listed for Ubuntu 12.04:
 sudo apt-get install openjdk-7-jdk fakeroot
  • Failed to find ./solver/420/unxlngx6.pro/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 error.
 cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 ./solver/420/unxlngx6.pro/lib/
 rm ./solver/420/unxlngx6.pro/lib/libstdc++.so.6
 ln -s ./solver/420/unxlngx6.pro/lib/libstdc++.so.6.0.20 ./solver/420/unxlngx6.pro/lib/libstdc++.so.6
  • No such file or directory - connectivity/virtualdbtools.hxx while building svx.

if you get an error like this, then that means connectivity is not built properly. Build connectivity using build --all:connectivity and this error will go away.

Build and Packaging tools

Download, configure, build and install dmake and epm

$ wget https://github.com/jimjag/dmake/archive/dmake-4.12.3.tar.gz
$ tar -xzf dmake-4.12.3.tar.gz
$ cd dmake-dmake-4.12.3
$ ./configure --prefix=/usr/local
$ sudo make install


$ wget https://github.com/jimjag/epm/archive/epm-4.4.2.tar.gz
$ tar -xzf epm-4.4.2.tar.gz
$ cd epm-epm-4.4.2
$ ./configure --prefix=/usr/local --enable-aoo
$ sudo make install

Ubuntu 12.04

  • Setup VirtualBox with Ubuntu 12.04 64 bit on Windows7 64bit host. A native installation is of course fine, too.
  • Let updater update ca. 380 packages. Restart.
  • Get the source. You can start with the source release or by checking out from SVN:
Source release SVN
Build from source release if you want to build OpenOffice once but don't want to do any development. Build from SVN if you want to development work with OpenOffice.
  • Download AOO 4.1.3 source tarball from

https://www.apache.org/dyn/closer.lua/openoffice/4.1.3/source/apache-openoffice-4.1.3-r1761381-src.tar.bz2

  • Optional: Download signature from

https://archive.apache.org/dist/openoffice/4.1.3/source/apache-openoffice-4.1.3-r1761381-src.tar.bz2.asc

and verify the source tarball with

gpg --verify apache-openoffice-4.1.3-r1761381-src.tar.bz2.asc \
             apache-openoffice-4.1.3-r1761381-src.tar.bz2

Note that you have to have the keys already imported to your key chain. The keys can be found on the download page:

https://www.apache.org/dist/openoffice/KEYS

  • Unpack source:
 cd /tmp
 tar -xjf ~/Downloads/apache-openoffice-4.1.3-r1761381-src.tar.bz2
 cd aoo-4.1.3/main
  • Start with creating a parent directory for the source code. Don't use /tmp because that is deleted on every boot:
 sudo mkdir /source
 sudo chown <your-user-name> /source
 cd /source
  • Install subversion and checkout the source:
 sudo apt-get install subversion
 svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo-trunk
 cd aoo-trunk/main
  • Install git and checkout the source (since 2019-08-03:
 sudo apt install git
 git clone https://gitbox.apache.org/repos/asf/openoffice.git aoo
 cd aoo/main
  • Install requirements (this will also install packages that are not listed):
 sudo apt-get install g++ gcc bison flex libarchive-zip-perl libcups2-dev \
      libpam0g-dev gperf libfreetype6-dev libxaw7-dev libfontconfig1-dev \
      libxrandr-dev patch libgconf2-dev libgnomevfs2-dev ant libgtk2.0-dev \
      junit junit4 libidl-dev liborbit2-dev openjdk-6-jdk libwww-perl \
      libxml-parser-perl autoconf libssl-dev libpam-dev libgstreamer\*


  • Run autoconf to generate configure script:
 autoconf
  • Configure (see the building guide section on configuration for further options):
 ./configure \
     --with-dmake-url=https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2 \
     --with-epm-url=https://sourceforge.net/projects/oooextras.mirror/files/epm-3.7.tar.gz \
     --disable-odk \
     --disable-binfilter
  • Finish configuration and download missing tarballs and extensions:
 ./bootstrap
  • Include the configured environment:
 source LinuxX86-64Env.Set.sh
  • Build:
 cd instsetoo_native/
 build --all

This may take a while to complete. Several hours are not uncommon. To speed things up you may want to run 'build' like this

 build --all -P<n> -- -P<n>

to start a parallel build. Replace <n> with the number of CPU cores.

  • Install:
 sudo dpkg -i unxlngx6.pro/Apache_OpenOffice/deb/install/en-US/DEBS/*.deb
 sudo dpkg -i unxlngx6.pro/Apache_OpenOffice/deb/install/en-US/DEBS/desktop-integration/openoffice4.2-debian-menus_4.2-9800_all.deb
  • Start Apache OpenOffice:
 /opt/openoffice4/program/soffice

CentOS 5 for AOO 4.1.x

CentOS 5 is our reference environment for build through the 4.1.x series. As it is a very old environment, it is not recommended to use it for your first build. But is important to document how to build on CentOS 5 since this is where the release through 4.1.x are built.

Setup a VM

KVM given here as example.

 $ wget -O /tmp/CentOS-5.iso http://mi.mirror.garr.it/mirrors/CentOS/5.11/isos/x86_64/CentOS-5.11-x86_64-netinstall.iso
 $ fallocate -l 61440M /vms/centos5_64.img
 $ sudo virt-install --boot cdrom --name centos5_64 --memory 8192 -f /vms/centos5_64.img --cdrom /tmp/CentOS-5.iso
  • Install the system; installation will start with the above command and use the following values when asked:
    • Installation method: HTTP with website mirror.centos.org and CentOS directory /centos/5/os/x86_64
    • Partitioning: 60000M for /, rest swap (you will need ~55 GBytes for a full build with all languages and langpacks)
    • Setup Base system only
  • Reboot the VM and configure it
    • You'll probably want a non-root user with sudo access and you may want to disable some services.
    • $ sudo yum update -y
    • $ sudo reboot

Our community builds are actually done on a VMware Fusion VM. Build times are mostly sensitive to the number of CPUs and allocated RAM; our setup is a 6 core VM with 16GB of memory.

Setup repositories and packages

EPEL is needed for dpkg (to build DEBs):

 $ wget http://archives.fedoraproject.org/pub/archive/epel/5/i386/epel-release-5-4.noarch.rpm
 $ sudo rpm -ivh epel-release-5-4.noarch.rpm
 $ sudo yum update -y

Now you can install all dependencies:

 $ sudo yum install \
       gcc \
       expat-devel \
       openssl-devel \
       autoconf \
       gcc-c++ \
       cups-devel \
       pam-devel \
       java-1.6.0-openjdk-devel \
       rpm-build \
       dpkg \
       gperf \
       freetype-devel \
       libX11-devel \
       libXt-devel \
       fontconfig-devel \
       libXrandr-devel \
       bison \
       flex \
       GConf2-devel \
       gnome-vfs2-devel \
       gtk2-devel \
       gstreamer-devel \
       gstreamer-plugins-base-devel \
       mesa-libGLU-devel \
       subversion \
       ccache

Configure ccache:

 $ ccache -M 2G

This leaves out Ant and Perl.

Download Ant

Ant 1.7.1 is now available in the CentOS repositories:

 $ sudo yum install ant17 ant17-apache-regexp

However, this will still cause configure to fail, so a manual download is needed. Ant will live in ~/ant and we need to download it manually.

$ cd
$ wget http://mirrors.nxnethosting.com/apache//ant/binaries/apache-ant-1.9.7-bin.tar.bz2
$ tar xvf apache-ant-1.9.7-bin.tar.bz2
$ ln -s apache-ant-1.9.7 ant

Install Perl modules

We can no longer use the system Perl and standard packages on CentOS 5, which are too old, so we will need to build newer versions.

 $ cd /usr/local/src
 $ wget https://www.cpan.org/src/5.0/perl-5.14.4.tar.gz
 $ tar xvf perl-5.14.4.tar.gz
 $ cd perl-5.14.4
 $ ./configure.gnu ; make
 $ sudo make install
 $ sudo /usr/local/bin/perl -MCPAN -e shell
  cpan[1]> install Archive::Zip XML::Parser LWP::UserAgent Digest::SHA Digest::MD5 LWP::Protocol::https
  cpan[1]> exit
 $

Make sure that /usr/local/bin/perl is in your $PATH and is used before any other versions.

Configure

See http://svn.apache.org/viewvc/openoffice/devtools/build-scripts/ for the configure options for a release build.

CentOS 7 for AOO 4.2.x and later

Although CentOS 5 was our reference environment for build through the 4.1.x series, as it is a very old environment, it is not a viable system to use for building AOO 4.2.x and later, mainly due to some dependencies no longer being available for CentOS5 (such as gstreamer-1.x). Not to say that you can't do so, but we have switched to CentOS 7 for our reference build. Other than that, the actual setups and builds for both OSs are strikingly similar.

Setup a VM

We have had good results installing CentOS 7 under both VirtualBox and VMware. Our community builds are actually done on a VMware Fusion VM. Build times are mostly sensitive to the number of CPUs and allocated RAM; our setup is a 6 core VM with 16GB of memory. We recommend CentOS 7.5

Setup repositories and packages

EPEL is needed for dpkg (to build DEBs) and for ccache (to speed up repeated builds, optional but recommended):

 $ sudo yum install epel-release
 $ sudo yum update -y

Now you can install all dependencies:

 $ sudo yum install \
       gcc \
       expat-devel \
       openssl-devel \
       autoconf \
       gcc-c++ \
       cups-devel \
       pam-devel \
       java-1.7.0-openjdk-devel \
       rpm-build \
       dpkg \
       fakeroot \
       gperf \
       freetype-devel \
       libX11-devel \
       libXt-devel \
       fontconfig-devel \
       libXrandr-devel \
       bison \
       flex \
       GConf2-devel \
       gnome-vfs2-devel \
       gtk2-devel \
       gstreamer-devel \
       gstreamer-plugins-base-devel \
       gstreamer1-devel \
       gstreamer1-plugins-base-devel \
       mesa-libGLU-devel \
       wget \
       subversion \
       ccache \
       glib2-devel \
       dbus-glib-devel \
       perl \
       ORBit2-devel

Configure ccache to use at least 2 GBytes:

 $ ccache -M 2G

This leaves out Ant and Perl.

Download Ant

The version of Ant installed via yum can cause configure to fail, so a manual download is needed. Ant will live in ~/ant and we need to download it manually.

$ cd
$ wget http://mirrors.nxnethosting.com/apache//ant/binaries/apache-ant-1.9.13-bin.tar.bz2
$ tar xvf apache-ant-1.9.13-bin.tar.bz2
$ ln -s apache-ant-1.9.13 ant

Install Perl modules

We can use the system Perl and standard packages on CentOS 6, see https://bz.apache.org/ooo/show_bug.cgi?id=127120

 $ sudo yum install \
       cpan \
       perl-libwww-perl \
       perl-Archive-Zip \
       perl-Digest-SHA \
       perl-XML-Parser \
       perl-Crypt-SSLeay \
       perl-Env \
       perl-LWP-Protocol-https
 $ sudo cpan File::Path

Build and Packaging tools

Download, configure, build and install dmake and epm

$ wget https://github.com/jimjag/dmake/archive/dmake-4.12.3.tar.gz
$ cd dmake-dmake-4,12,3
$ ./configure --prefix=/usr/local; make install


$ wget https://github.com/jimjag/epm/archive/epm-4.4.2.tar.gz
$ cd epm-epm-4.4.2
$ ./configure --prefix=/usr/local --enable-aoo; make install

32 bit hints

There is not a EPEL release for CentOS 7 32bit, so you'll need to download, build and install dpkg and GNUtar directly:

$ wget ftp://ftp.de.debian.org//debian/pool/main/d/dpkg/dpkg_1.19.3.tar.xz
$ wget http://ftp.gnu.org/gnu/tar/tar-1.30.tar.gz

Configure

See https://svn.apache.org/viewvc/openoffice/devtools/build-scripts/ for the configure options for a release build.

Fedora 21

Autoconf

Work directory

/share/linux2/aoo/trunk/main/

You need to create the "configure" command in order to start:

$ autoconf

Configure the build options

You need to configure the build options to tell the build command what to use or to ignore:

$ ./configure \
--with-dmake-url=https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2 \
--with-epm-url=https://sourceforge.net/projects/oooextras.mirror/files/epm-3.7.tar.gz \
--disable-odk \
--disable-gconf \
--disable-gnome-vfs \
--with-package-format="installed"

Bootstrap the build

You need to prepare the build environment. This will download missing source code tar balls of external libraries, download missing external dictionary extensions and pre-build needed tools:

$ ./bootstrap

Source the environment

You need to setup environment variableas and other things in the terminal window where the build should run.

$ source LinuxX86-64Env.Set.sh

Important
It depends on the respective terminal window/tab. The build will not or unpredictable run in a different one.

Start building

Work directory /share/linux2/aoo/trunk/main/instsetoo_native

The following command will use all available CPU cores to build most as possible in parallel:

$ build --all -P8 -- -P8

The following command build and redirect all output to stdout and stderr into a single log file. Perfect for forwarding to someone else in case of build problems:

$ build <options> > build_error_log_yyyy.mm.dd_hh.mm.txt 2>&1

The following can be used when you want to know how many hours the build took to complete:

$ time build <options>

The following is to clear things up when a project didn't build successfully before starting again:

$ build --prepare --from <prj_name>

When the same error occurs exactly again, then maybe the "--prepare" option doesn't work for projects that were changed to gbuild. Then the respective solver directory needs to be deleted manually. Either from the following directory or in another sub-dir. Example:

$ rm -rf main/solver/420/*.pro/workdir/CxxObject/<prj_name>

Cleanup the build tree

Work directory /share/linux2/aoo/trunk/main/

The following command needs to be executed to cleanup all build artefacts to be able to start again a clean build:

$ dmake clean

Important
This will delete the "dmake" command itself. Therefore it's needed to run configure, bootstrap and source again (see above).

Build breaker

1. Module "svx"
2. Module "dbaccess"

The file main/svx/source/fmcomp/fmgridif.cxx and main/dbaccess/source/ui/uno/ColumnControl.cxx should be compiled with enabled compiler optimization. However, this doesn't work on the Intel x86-64 platform due to this GCC 4.9.3 bug (should be fixed with 5.0): https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65009

The workaround is to disable the optimization for both files in the respective makefiles main/svx/Library_svxcore.mk and main/dbaccess/source/ui/uno/makefile.mk. The following short patch should work:

1. Makefile "main/svx/Library_svxcore.mk"

<patch start>

--- Library_svxcore.mk.orig 2016-09-04 15:32:07.305410023 +0200
+++ Library_svxcore.mk.new 2016-09-05 20:16:33.411649496 +0200
@@ -121,7 +121,6 @@
svx/source/engine3d/viewpt3d2 \
svx/source/fmcomp/dbaexchange \
svx/source/fmcomp/fmgridcl \
- svx/source/fmcomp/fmgridif \
svx/source/fmcomp/gridcell \
svx/source/fmcomp/gridcols \
svx/source/fmcomp/gridctrl \
@@ -452,6 +451,23 @@
))
endif

+# the following source file can't be compiled with "-Os" by gcc 4.9 as it
+# because of a bug in devirtualization optimization (#i125475#):
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678>
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65009>
+# Compiling with "-O2" or
+# "-Os -fno-devirtualize -fno-devirtualize-speculatively" is sufficient to fix.
+ifeq ($(COM),GCC)
+$(eval $(call gb_Library_add_cxxobjects,svxcore,\
+ svx/source/fmcomp/fmgridif \
+ , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+))
+else
+$(eval $(call gb_Library_add_exception_objects,svxcore,\
+ svx/source/fmcomp/fmgridif \
+))
+endif
+
$(eval $(call gb_SdiTarget_SdiTarget,svx/sdi/svxslots,svx/sdi/svx))

$(eval $(call gb_SdiTarget_set_include,svx/sdi/svxslots,\

</patch end>

2. Makefile "main/dbaccess/Library_dbui.mk"


<patch start>

--- Library_dbui.mk.orig 2016-09-04 15:28:55.200594932 +0200
+++ Library_dbui.mk.new 2016-09-06 00:34:05.241638508 +0200
@@ -260,7 +260,6 @@
dbaccess/source/ui/tabledesign/TableRowExchange \
dbaccess/source/ui/tabledesign/TableUndo \
dbaccess/source/ui/uno/AdvancedSettingsDlg \
- dbaccess/source/ui/uno/ColumnControl \
dbaccess/source/ui/uno/ColumnModel \
dbaccess/source/ui/uno/ColumnPeer \
dbaccess/source/ui/uno/DBTypeWizDlg \
@@ -313,4 +312,21 @@
))
endif

+# the following source file can't be compiled with "-Os" by gcc 4.9 as it
+# because of a bug in devirtualization optimization (#i125475#):
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678>
+# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65009>
+# Compiling with "-O2" or
+# "-Os -fno-devirtualize -fno-devirtualize-speculatively" is sufficient to fix.
+ifeq ($(COM),GCC)
+$(eval $(call gb_Library_add_cxxobjects,dbui,\
+ dbaccess/source/ui/uno/ColumnControl \
+ , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+))
+else
+$(eval $(call gb_Library_add_exception_objects,dbui,\
+ dbaccess/source/ui/uno/ColumnControl \
+))
+endif
+
# vim: set noet sw=4 ts=4:

</patch end>

Needed packages

The following packages (incl. their dependencies) that need to be available or installed additionally:

  • ant
  • autoconf
  • bison
  • cups-devel
  • flex
  • gcc
  • gcc++
  • gperf
  • gtk2
  • gtk2-devel
  • hamcreast
  • java-1.8.0-openjdk
  • java-1.8.0-openjdk-devel
  • junit
  • libtiff
  • libXt-devel
  • make
  • ORBit
  • pam-devel
  • patch
  • perl-CPAN
  • perl-Env
  • rpm
  • rpm-build

Important
Java 1.8 JDK has to be installed due to dependencies for ant, hamcreast and junit.

Building a release version

Additional things that need to done when building a release version out of a SVN branch (e.g., AOO 4.1.3 from "AOO413").

Packages

The following packages (incl. their dependencies) that need to be available or installed additionally:

  • dpkg
  • dbus-glib-devel
  • GConf2-devel
  • gnome-vfs2
  • gnome-vfs2-devel
  • gstreamer-devel
  • gstreamer-plugins-base-devel
  • mesa-libGLU-devel
  • ORBit2
  • ORBit2-devel
  • perl-Archive-Zip
  • perl-Crypt-SSLeay
  • perl-Digest-MD5
  • perl-Digest-SHA
  • perl-libwww-perl
  • perl-LWP-Protocol-https
  • perl-XML-Parser

Configure

The configure options for a release build can be found here:

http://svn.apache.org/viewvc/openoffice/devtools/build-scripts/4.1.3/unxlngix6/build_aoo64bit_on_centos5.sh

Performance results

  • Intel Core i7-4710HQ 2.5 GHz (8 cores)
  • 16 GB RAM, 256 GB SSD
  • Fedora 21 x86-64 (Kernel 4.1.13-100.fc21.x86_64, glibc 2.20-8)

Trunk

  • Build command:
 $ build --all -P8 -- -P8
  • Time for a full build: 01h 05m 41s (as of 2016-10-09

AOO413 branch

  • Build command (with P8 and only "de en-US fr ja pt" as languages):
 $ build_aoo64bit_on_centos5.sh
  • Time for a full build: 00h 50m 32s (as of 2016-10-09)

Fedora 19 and 20

Build Instructions

The build procedure is the same as for other Linux systems.

Required packages:

$ yum install tcsh perl-Archive-Zip gcc gcc-c++ cups-devel \
              pam-devel java-1.7.0-openjdk-devel gperf freetype-devel \
              gtk2-devel libIDL-devel libXaw-devel bison patch GConf2-devel \
              gnome-vfs2-devel ant make tar rpm-build flex junit4 \
              perl-LWP-UserAgent-Determined perl-XML-Parser \
              perl-Digest-SHA ORBit2-devel perl-LWP-Protocol-https

Build notes:

  • The perl-Digest-SHA dependency is not caught until bootstrap
  • The ORBit2-devel dependency is not caught until building the "shell" module
  • Build breaks in "hsqldb": to build with Java7, you need to apply the patch at https://issues.apache.org/ooo/attachment.cgi?id=80961&action=diff
  • Build breaks in "moz": configure with --disable-mozilla to work around it.

Fedora 10 and 14

Build Instructions

The build procedure is the same as for other Linux systems.

Required packages:

$ yum install tcsh perl-Archive-Zip gcc gcc-c++ cups-devel \
              pam-devel java-1.6.0-openjdk-devel gperf freetype-devel \
              gtk2-devel libIDL-devel libXaw-devel bison patch GConf2-devel \
              gnome-vfs2-devel ant make

Quick start guide

Still valid?

$ yum -y install mono-devel perl-Archive-Zip ant bison \

        flex pam-devel cups-devel gperf libxslt-devel openldap-devel \
        firefox-devel xorg-x11-devel gstreamer-devel \
        gstreamer-plugins-base-devel db4-devel unixODBC-devel \
        xml-commons-jaxp-1.3-apis xalan-j2 boost-devel \
        unixODBC-devel qt-devel subversion autoconf automake \
        gtk2-devel gcc-c++  gnome-vfs2-devel rpm-build \
        expat-devel python-devel curl-devel

$ ./autogen.sh -with-distro=SUSE \

        --with-jdk-home=/usr/lib/jvm/java-1.5.0-gcj \
        --with-ant-home=/usr/share/ant \
        --with-system-mozilla=firefox \
        --disable-Xaw \
        --disable-kde \
        --disable-mono \
        --enable-opengl --enable-ogltrans \
        --disable-neon \
        --enable-debug

Another list:

Blog about building ooo-build on Fedora 7:

Fedora packaging

Fedora 14

The Fedora 14 spec file can be found at http://koji.fedoraproject.org/koji/buildinfo?buildID=276232 (download the srpm, and uncompress it (rpm2cpio <file> | cpio -idv) ); you'll see the single spec file openoffice.org.spec ; note that it doesn't build cleanly, you need to apply the patch from https://issues.apache.org/ooo/show_bug.cgi?id=114999

Fedora 19

Windows 7, Windows 8.1, Windows 10

Complete requirements found at General Build Requirements and Building on Windows.

This is a sample step-by-step guide - check the complete requirements and report on dev@openoffice.apache.org, if problems with this step-by-step guide occur.

  • Install Cygwin, 32-bit version
    • Browse to https://www.cygwin.com and click on the setup-x86.exe link to download the most recent 32-bit version (the most recent Cygwin DLL at the moment is 3.0.7) or use this direct link
    • Run the installer and click through the questions
    • On the "Choose A Download Site" select a nearby download server
    • Expect a "Setup Alert" dialog box on the first cygwin install on the computer: click OK to close it
    • On the page that allows you to select additional packages select:

      From the Archive category:
      zip, unzip
      From the Devel category:
      autoconf, gperf, gcc-g++, bison, flex, patch, git, make
      From the Net category:
      rsync
      From the Perl category:
      perl, perl-XML-SAX-Expat, perl-Archive-Zip, perl-LWP-Protocol-https, perl-XML-parser, perl-libwww-perl, perl-Digest-SHA, perl-Net-SSLeay
      As a shortcut you can install everything needed with one command:
      setup-x86.exe -P zip -P unzip -P autoconf -P gperf -P gcc-g++ -P bison -P flex -P patch -P git -P make -P rsync -P perl -P perl-XML-SAX-Expat -P perl-Archive-Zip -P perl-LWP-Protocol-https -P perl-XML-parser -P perl-libwww-perl -P perl-Digest-SHA -P perl-Net-SSLeay
      (If you prefer to install packages with a Linux kind of touch, you can skip selecting the packages and instead select just the package lynx (enter lynx in the Search box and select the lynx entry in the Web/Default section). You would then install the other packages from the cygwin command line using lynx as explained ahead. However, selecting the packages from the Cygwin interface is recommended.)
    • Click Next to finish package selection.
    • Click Next to resolve dependencies.
    • After installation is finished click the Finish button to close the dialog.
  • Start Cygwin bash in a terminal
In Windows 7 and later you can just type "cygwin" into the Start Menu search bar and then click on the Cygwin App. Or you can:
  • Press WindowsKey-R
  • Type "C:\cygwin\Cygwin.bat" (if that's the path you installed Cygwin to)
  • Hit Return.
(If you haven't installed the necessary packages from the Cygwin interface yet because you would prefer to install them using lynx from the Cygwin command line, then you should do so now. First install apt-cyg from the Github repository:)
cd /cygdrive/c/temp
(or any other temporary directory of your choice)
lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
chmod +x apt-cyg
mv apt-cyg /usr/local/bin/
Use apt-cyg to install missing cygwin packages:
apt-cyg install perl zip unzip gperf autoconf rsync gcc-g++ bison flex patch subversion make
(You must also provide to install the missing perl packages, for example with "cpan -i Archive::Zip LWP::UserAgent LWP::Protocol XML::Parser" etc. however there can be some dependency conflicts, the recommended method is installing the packages from the cygwin interface)
  • Replace symlinked awk with copy of gawk.exe:
    rm /usr/bin/awk
    mv /usr/bin/gawk.exe /usr/bin/awk.exe
    Note that if the rm command fails then the mv is not necessary.
  • Install Java, 32-bit version
Choose between JDK or OpenJDK. Versions 1.7 and 1.8 are known to work.
(We need the 32-bit version because JNI requires the JVM's bitness to match the C/C++ bitness).
  • Install Apache Ant
    • Browse to https://ant.apache.org/bindownload.cgi
    • Chose a mirror near you.
    • Download the zip archive (currently that is apache-ant-1.9.14-bin.zip or apache-ant-1.10.7-bin.zip).
      Note that Apache Ant 1.10.x will only work with Java 8.
    • Open downloaded archive in file explorer and unzip it to a location of your choice, eg c:\. Note that C:\Program Files (x86) will not work due to problems of quoting the spaces and parentheses.
  • Install Microsoft Windows SDK for Windows 7 and .NET Framework 3.5. SP1 (recommended by Microsoft. Note: later versions of the Windows SDK will not work. AOO can not be built with MSVC 2010 or 2012 - MSVC 2008 is needed and is found in the Windows 7 SDK)
  • Download MS Visual C++ 2008 SP1 Redistributable Package (x86)
    • https://www.microsoft.com/en-us/download/details.aspx?id=26368 (There have been security updates, which are not included in older versions)
    • Download files vcredist_x86.exe and vcredist_x64.exe
      We need both 32 and 64-bit versions because we build 64-bit shell extensions. If you download the most recent version of Apache OpenOffice and unpack it, you will find the files vcredist_x86.exe and vcredist_x64.exe in folder redist. You can use them as well.
  • Optional: Install DirectX SDK (for graphics hardware support in the slide show)
    • Browse to http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=6812
    • Download and run DXSDK_Jun10.exe. Choose to install to a custom path, and use a path that has neither spaces nor parentheses (e.g. C:\Microsoft_DirectX_SDK_June_2010), because otherwise the build will not be able to parse the path and will choke on the spaces or parentheses. (If you receive an S1023 error towards the end of the installation, the fix is simple. The issue occurs because a newer version of the Visual C++ 2010 Redistributable is present on the computer. The June 2010 DirectX SDK installs version 10.0.30319 of the Visual C++ Redistributable. To resolve this issue, you must uninstall all versions of the Visual C++ 2010 Redistributable before installing the June 2010 DirectX SDK. You may have one or more of the following products installed: Visual C++ 2010 Redistributable x86, Visual C++ 2010 Redistributable x64. You can use Add or Remove Programs in Control Panel to uninstall the products. Or, you can run the following commands from an administrator command prompt:
      MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5} 
      MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}
      and then run the DirectX SDK installer. After installing the June 2010 DirectX SDK, you may then reinstall the most current version of the Visual C++ 2010 Redistributable Package.)
  • Optional: Install Windows Driver Kit 7.1.0 (for enabling activex)
    • Download WDK 7.1.0 (is an ISO image). Cannot use later versions of Windows Driver Kit because they do not have ATL which is needed to build AOO with ActiveX. (I recommend to download using Internet Explorer, otherwise the install may fail a Windows Authenticity test, whereas this does not happen using Internet Explorer to download the ISO image.)
    • Mount the ISO image and install.
  • Optional: Install NSIS installer (for creating the EXE installer)
    • Browse to https://sourceforge.net/projects/nsis/files/
    • Download and run the installer (note that versions of NSIS >= 3.* are only compatible with branch 4.1.3 or later! otherwise you will have to install at most NSIS 2.51). Recommended to install to custom location, choose a path without any spaces (e.g. "C:\NSIS").
    • For Asian languages (ja, ko, zh-CN, zh-TW) the language files have to be edited, otherwise the graphics in the first installer windows don't fit. In "{NSISDIR}\Contrib\Language files\Japanese.nlf" (Korean.nlf, TradChinese.nlf, SimpChinese.nlf accordingly) change:
      Font and size - dash (-) means default
      {font-name}
      {font-size}
      to:
      Font and size - dash (-) means default
      -
      -
  • Optional: Install the MozillaBuild tools. These are needed to build the NSS ("Network Security Services") module. Download from here. Install to a custom path without any spaces, such as C:\mozilla-build. MozillaBuild tools version 3.0 or newer require a 64-bit Windows. When building on 32-bit Windows it is recommended to use version 2.2.0.
  • Get AOO source code. You can use the source release or check out from SVN. Build from source release if you want to build OpenOffice once but don't want to contribute patches. If you will contribute patches, you need to generate them against an actual version of trunk. In this case check out from SVN to be able to rebase before generating patches. You can work with subversion or with git-svn. Do not use a tool that changes line endings, such as the default configuration of TortoiseSVN. NOTE: Do not place the source directory under the Cygwin file system. This means that placing it, for example, at '/home/aoo/source' is not recommended.
Source release
  • Browse to http://www.openoffice.org/download/other.html#tested-sdk and locate the table row that starts with "Source code"
  • Download source code in an archive format of your choice (note that tar.bz2 is typically smaller than tar.gz and zip)
  • Optional: Verify the archive - following given link or instructions.
  • Unpack source (in cygwin-terminal). Use the file name exactly as downloaded.
    cd /tmp
    tar -xjf <download-location>/<downloaded-source-release.tar.bz2>
    cd <unpacked-source>/main
    
    Do not use Windows unpacker, they might cause access right problems.
Checkout from SVN using subversion 
  • (If you haven't installed the subversion package from the cygwin interface, please do so now by re-running the cygwin installer, or if you used lynx and apt-cyg then:)
    apt-cyg install subversion
  • Start with creating a parent directory for the source code:
    mkdir /cygdrive/c/source
    cd /cygdrive/c/source
  • Check out source from Apache SVN repository
    svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo-trunk
    cd aoo-trunk/main
Checkout from Gitbox using git (Since 2019-08-03)
  • (If you haven't installed the git package from the cygwin interface, please do so now by re-running the cygwin installer, or if you used lynx and apt-cyg then:)
    apt-cyg install git
  • Start with creating a parent directory for the source code:
    mkdir /cygdrive/c/source
    cd /cygdrive/c/source
  • Check out source from Apache Git repository
    git clone https://gitbox.apache.org/repos/asf/openoffice.git aoo
    cd aoo/main


Checkout from SVN using git-svn 
  • (If you haven't installed git and git-svn from the cygwin interface, please do so now by re-running the cygwin installer, or if you used lynx and apt-cyg then:)
    apt-cyg install git git-svn
  • Get the actual revision number from http://svn.apache.org/viewvc/OpenOffice/trunk/, e.g. 1234567
  • Create an empty directory and change to it, e.g.
    mkdir /cygdrive/c/source
    cd /cygdrive/c/source
  • Check out source from Apache SVN repository
    git svn clone --revision 1234567:HEAD https://svn.apache.org/repos/asf/openoffice/trunk
    cd trunk/main
  • Remember the source path (this is optional, it makes for an easy reference):
    SourceMain=`pwd`
    [Why? I have not used it. Regina (talk) 21:42, 24 February 2013 (UTC)]
[Added explanation above Andre]
  • Optional: Get dbghelp.dll (for using the --enable-dbgutil configure option)
    • This dll is part of MS Visual Studio. If you do not have it installed, download and install "Visual Studio Community" from https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
    • Copy file to main/external/dbghelp. Use Windows file manager or in cygwin terminal
      cp /cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 9.0/Common7/IDE/dbghelp.dll $SourceMain/external/dbghelp
  • Copy vcredist_x86.exe and vcredist_x64.exe (see above) to main/external/vcredist.
    • Use Windows file manager or in cygwin terminal
      cp <download-location>/vcredist_x86.exe $SourceMain/external/vcredist
      cp <download-location>/vcredist_x64.exe $SourceMain/external/vcredist
  • Get GDI+ redistributable:
    • Browse to https://www.microsoft.com/en-us/download/details.aspx?id=18909
    • Download WindowsXP-KB975337-x86-ENU.exe
    • Run WindowsXP-KB975337-x86-ENU.exe
    • Enter a temporary path (eg c:\temp\gdiplus) in the dialog and click OK to extract files
    • Copy gdiplus.dll to main/external/gdiplus
      cp /cygdrive/c/temp/gdiplus/asms/10/msft/windows/gdiplus/gdiplus.dll $SourceMain/external/gdiplus/
    • Remove the temporary path
      rm -fr /cygdrive/c/temp/gdiplus
  • Make sure that you are in the main source directory:
    cd $SourceMain
  • Run autoconf to create the configure script:
    autoconf
  • Call configure
    • For those paths that do have spaces, use the cygpath tool to get a shortened version without any spaces, which you can then use in the configuration directives without any trouble (adapt paths as necessary):
      $ cygpath -m -s "C:\Program Files (x86)\Java\jdk1.8.0_73" 
      C:/PROGRA~2/Java/JDK18~1.0_7 
      $ cygpath -m -s "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC" 
      C:/PROGRA~2/MI1DCA~1.0/VC
      Run configure (again adapt paths as necessary)
      SDK_PATH="/cygdrive/c/Microsoft_SDKs/Windows/v7.0"
      ./configure \
          --with-frame-home="$SDK_PATH" \
          --with-psdk-home="$SDK_PATH" \
          --with-midl-path="$SDK_PATH/bin" \
          --with-ant-home="/cygdrive/c/apache-ant-1.9.14" \
          --with-jdk-home="C:/PROGRA~2/Java/JDK18~1.0_7" \
          --with-csc-path="C:/Windows/Microsoft.NET/Framework/v3.5" \
          --with-cl-home="C:/PROGRA~2/MI1DCA~1.0/VC" \
          --with-asm-home="C:/PROGRA~2/MI1DCA~1.0/VC/bin" \
          --with-dmake-url="https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2" \
          --disable-pch \
          --disable-atl \
          --disable-activex \
          --disable-nss-module \
          --without-junit
      If you have installed the optional DirectX SDK then you can add the switch:
          --with-directx-home="C:/Microsoft_DirectX_SDK_June_2010"
      If you have installed Windows Driver Kit 7.1.0 and would like to build with ATL and ActiveX functionality then remove the --disable-activex and the --disable-atl directives, and add the atl home directives:
          --with-atl-include-dir=/cygdrive/c/WinDDK/7600.16385.1/inc/atl71 \
          --with-atl-lib-dir=/cygdrive/c/WinDDK/7600.16385.1/lib/ATL/i386 \
          --with-mfc-include-dir=/cygdrive/c/WinDDK/7600.16385.1/inc/mfc42 \
          --with-mfc-lib-dir=/cygdrive/c/WinDDK/7600.16385.1/lib/Mfc/i386
      If you have installed NSIS you can use the relative directive
          --with-nsis-path="C:/NSIS"
      If you have installed MozillaBuild tools you can use the relative switch:
          --with-mozilla-build="/cygdrive/d/mozilla-build"
      You may also enable a few more switches (used for official releases: --enable-win-x64-shellext):
          --enable-win-x64-shellext \
          --enable-wiki-publisher \
          --enable-category-b \
          --enable-bundled-dictionaries
      and if you would like to build for different locales you can use the lang switch (in this example, for English United States and for Italian):
          --with-lang="en-US it"
      If you have copied over the dbghelp.dll and would like these extra features you can enable the debug switch:
          --enable-dbgutil
  • Finish configuration and download missing external source tarballs and extensions
    ./bootstrap
  • Include the configured environment
    source winenv.set.sh
  • Build
    cd instsetoo_native/
    build --all
    Depending on your computer this will take one or more hours to finish. You may want to experiment with the -P options for multi process builds to reduce the build time.
    build --all -P<m> -- -P<n>
    tells build to use m processes (build up to m modules in parallel) and n threads for each module.


  • Install
    There are three options:
    1. Regular install with integration into Windows.
      This allows only one instance of AOO to be installed.
      • Start setup.exe and click through dialog:
        $SourceMain/instsetoo_native/wntmsci12.pro/OpenOffice/msi/install/en-US/setup.exe
      • Apache OpenOffice can be started via the Windows start menu.
    2. Install without integration into Windows.
      This allows several instance of AOO, based on the same version, to be installed side by side.
      It still requires Administrator permissions.
      • Start setup.exe with option -a:
        $SourceMain/instsetoo_native/wntmsci12.pro/OpenOffice/msi/install/en-US/setup.exe -a
      • Enter an installation path into the dialog and click through the dialog to finish installation.
      • Start AOO by running
        <installation-path>/program/soffice.exe
    3. Unpack archive without installation.
      This does not require Administrator permissions
      • Go to installation directory:
        cd <installation-target>
      • Unzip archive:
        unzip $SourceMain/instsetoo_native/wntmsci12.pro/Apache_OpenOffice/msi/install/en-US/Apache_OpenOffice_4.1.4_Win_x86_install-arc_en-US.zip
      • Start AOO by running:
        ./Apache_OpenOffice_4.1.4_Win_x86_install-arc_en-US/program/soffice.exe
(Change the version number in the file name to match the version you built)

Build with Cygwin 64-bit

Note: Building AOO with Cygwin 64-bit will only work with latest trunk, it will not work with any 4.1.x branch!

  • Install Cygwin, 64-bit version
    • Browse to https://www.cygwin.com and click on the setup-x86_64.exe link to download the most recent 64-bit version (the most recent Cygwin DLL at the moment is 3.0.7) or use this direct link
    • Run the installer and click through the questions
    • On the "Choose A Download Site" select a nearby download server
    • Expect a "Setup Alert" dialog box on the first cygwin install on the computer: click OK to close it
    • On the page that allows you to select additional packages select:

      From the Archive category:
      zip, unzip
      From the Devel category:
      autoconf, gperf, gcc-g++, bison, flex, patch, git, make
      From the Net category:
      rsync
      From the Perl category:
      perl, perl-XML-SAX-Expat, perl-Archive-Zip, perl-LWP-Protocol-https, perl-XML-parser, perl-libwww-perl, perl-Digest-SHA, perl-Net-SSLeay
      As a shortcut you can install everything needed with one command:
      setup-x86_64.exe -P zip -P unzip -P autoconf -P gperf -P gcc-g++ -P bison -P flex -P patch -P git -P make -P rsync -P perl -P perl-XML-SAX-Expat -P perl-Archive-Zip -P perl-LWP-Protocol-https -P perl-XML-parser -P perl-libwww-perl -P perl-Digest-SHA -P perl-Net-SSLeay
    • Click Next to finish package selection.
    • Click Next to resolve dependencies.
    • After installation is finished click the Finish button to close the dialog.
  • Start Cygwin bash in a terminal and follow all the steps for 32-bit Cygwin up to and including './configure' with relative parameters
    • Finish configuration and download missing external source tarballs and extensions
      ./bootstrap
    • Include the configured environment
      source winenv.set.sh
    • Build
      cd instsetoo_native/
      build --all
      Depending on your computer this will take one or more hours to finish. You may want to experiment with the -P options for multi process builds to reduce the build time.
      build --all -P<m> -- -P<n>
      tells build to use m processes (build up to m modules in parallel) and n threads for each module.

Mac OS X

In order to build OpenOffice on Mac OS X see Building on MacOSX

Personal tools