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

From Apache OpenOffice Wiki
Jump to: navigation, search
(Linux: Substitute section's contents with a link to the dedicated page)
(Windows 7, Windows 8.1, Windows 10: Substitute sections' contents with link to dedicated page)
Line 9: Line 9:
 
=[[Documentation/Building Guide AOO/Step by step Linux|Linux]]=
 
=[[Documentation/Building Guide AOO/Step by step Linux|Linux]]=
  
= Windows 7, Windows 8.1, Windows 10 =
+
=[[Documentation/Building Guide AOO/Step by step Windows|Windows]]=
 
+
'''Complete requirements found at [https://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO#General_Build_Requirements General Build Requirements] and [https://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO/Building_on_Windows 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 https://www.cygwin.com] and click on the setup-x86.exe link to download the 32-bit version (the latest Cygwin DLL known to work is 3.1.7-1) or use [https://www.cygwin.com/setup-x86.exe this direct link]. Note: "make" has to be downgraded to version 4.2.1-2 for building AOO up to version 4.1.7.
+
**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: <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 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.
+
:::<i>(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 <b>apt-cyg</b> from the Github repository:)<pre>cd /cygdrive/c/temp</pre>(or any other temporary directory of your choice)<pre>lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg&#10;chmod +x apt-cyg&#10;mv apt-cyg /usr/local/bin/</pre>Use <b>apt-cyg</b> to install missing cygwin packages:<pre>apt-cyg install perl zip unzip gperf autoconf rsync gcc-g++ bison flex patch git make</pre>(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)</i>
+
 
+
* Replace symlinked awk with copy of gawk.exe:<pre>rm /usr/bin/awk&#10;mv /usr/bin/gawk.exe /usr/bin/awk.exe</pre>Note that if the <code>rm</code> command fails then the <code>mv</code> 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.15-bin.zip or apache-ant-1.10.8-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.
+
   
+
* 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)
+
** Browse to http://www.microsoft.com/en-us/download/details.aspx?id=3138.
+
** Download winsdk_web.exe and run the web installer. You can use the default values in the installation dialog, except when prompted with the installation path use a path that has no spaces or parentheses (e.g. "C:\Microsoft_SDKs\Windows\v7.0"), because otherwise the build process will choke on those spaces or parentheses.
+
** Alternatively download the iso image http://www.microsoft.com/en-us/download/details.aspx?id=18950. Burn it to a dvd or unzip it.
+
 
+
* 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<br /> 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. <code>C:\Microsoft_DirectX_SDK_June_2010</code>), because otherwise the build will not be able to parse the path and will choke on the spaces or parentheses. <i>(If you receive an S1023 error towards the end of the installation, [https://support.microsoft.com/it-it/kb/2728613 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: <pre>MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5} &#10;MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}</pre> and then run the DirectX SDK installer. After installing the June 2010 DirectX SDK, you may then reinstall the most current version of the [http://www.microsoft.com/download/details.aspx?id=26999 Visual C++ 2010 Redistributable Package].)</i>
+
 
+
* Optional: Install Windows Driver Kit 7.1.0 (for enabling activex)
+
** Download [http://www.microsoft.com/en-us/download/details.aspx?id=11800 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/ 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 [https://sourceforge.net/projects/nsis/files/NSIS%202/2.51/nsis-2.51-setup.exe/download 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: <pre>Font and size - dash (-) means default&#10;{font-name}&#10;{font-size}</pre> to:<pre>Font and size - dash (-) means default&#10;-&#10;-</pre>
+
 
+
* Optional: Install the MozillaBuild tools. These are needed to build the <b>NSS</b> ("Network Security Services") module. Download from [https://ftp.mozilla.org/pub/mozilla/libraries/win32/ here]. Install to a custom path without any spaces, such as <code>C:\mozilla-build</code>. 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.<pre>cd /tmp&#10;tar -xjf <download-location>/<downloaded-source-release.tar.bz2>&#10;cd <unpacked-source>/main&#10;</pre>Do not use Windows unpacker, they might cause access right problems.
+
 
+
::; Checkout from SVN using subversion :
+
::*<i>(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:)<pre>apt-cyg install subversion</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 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 :
+
::*<i>(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:)<pre>apt-cyg install git git-svn</pre></i>
+
::*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.<pre>mkdir /cygdrive/c/source&#10;cd /cygdrive/c/source</pre>
+
::*Check out source from Apache SVN repository<pre>git svn clone --revision 1234567:HEAD https://svn.apache.org/repos/asf/openoffice/trunk&#10;cd trunk/main</pre>
+
 
+
* Remember the source path (this is optional, it makes for an easy reference):<pre>SourceMain=`pwd`</pre> [Why? I have not used it. [[User:Regina|Regina]] ([[User talk:Regina|talk]]) 21:42, 24 February 2013 (UTC)]
+
:[Added explanation above [[User:Andre|Andre]]]
+
 
+
* Optional: Get dbghelp.dll (for using the <code>--enable-dbgutil</code> 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 <code>main/external/dbghelp</code>. Use Windows file manager or in cygwin terminal<pre>cp /cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 9.0/Common7/IDE/dbghelp.dll $SourceMain/external/dbghelp</pre>
+
 
+
* Copy vcredist_x86.exe and vcredist_x64.exe (see above) to main/external/vcredist.
+
** Use Windows file manager or in cygwin terminal<pre>cp <download-location>/vcredist_x86.exe $SourceMain/external/vcredist&#10;cp <download-location>/vcredist_x64.exe $SourceMain/external/vcredist</pre>
+
 
+
* 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<pre>cp /cygdrive/c/temp/gdiplus/asms/10/msft/windows/gdiplus/gdiplus.dll $SourceMain/external/gdiplus/</pre>
+
** Remove the temporary path<pre>rm -fr /cygdrive/c/temp/gdiplus</pre>
+
 
+
* Get msvcr100.dll:
+
**We need the 32-bit dll (version 10.0.40219.325), available from: https://www.microsoft.com/en-US/download/details.aspx?id=26999<pre>cp /cygdrive/c/Windows/System32/msvcr100.dll $SourceMain/external/msvcp100</pre>
+
 
+
* Make sure that you are in the main source directory:<pre>cd $SourceMain</pre>
+
 
+
* Run autoconf to create the configure script:<pre>autoconf</pre>
+
 
+
* 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.15" \&#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://github.com/jimjag/dmake/archive/v4.13.1/dmake-4.13.1.tar.gz" \&#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>
+
* Include the configured environment<pre>source winenv.set.sh</pre>
+
* Build<pre>cd instsetoo_native/&#10;build --all</pre>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. <pre>build --all -P<m> -- -P<n></pre> tells build to use <code>m</code> processes (build up to <code>m</code> modules in parallel) and <code>n</code> threads for each module.
+
 
+
 
+
* Install<br/>There are three options:
+
*# Regular install with integration into Windows.<br/>This allows only one instance of AOO to be installed.
+
*#* Start setup.exe and click through dialog:<br/><pre>$SourceMain/instsetoo_native/wntmsci12.pro/OpenOffice/msi/install/en-US/setup.exe</pre>
+
*#* Apache OpenOffice can be started via the Windows start menu.
+
*# Install without integration into Windows.<br/>This allows several instance of AOO, based on the same version, to be installed side by side.<br/>It still requires Administrator permissions.
+
*#* Start <code>setup.exe</code> with option <code>-a</code>:<br/><pre>$SourceMain/instsetoo_native/wntmsci12.pro/OpenOffice/msi/install/en-US/setup.exe -a</pre>
+
*#* Enter an installation path into the dialog and click through the dialog to finish installation.
+
*#* Start AOO by running<br/><pre><installation-path>/program/soffice.exe</pre>
+
*# Unpack archive without installation.<br/>This does not require Administrator permissions
+
*#* Go to installation directory:<br/><pre>cd <installation-target></pre>
+
*#* Unzip archive:<br/><pre>unzip $SourceMain/instsetoo_native/wntmsci12.pro/Apache_OpenOffice/msi/install/en-US/Apache_OpenOffice_4.1.4_Win_x86_install-arc_en-US.zip</pre>
+
*#* Start AOO by running:<br/><pre>./Apache_OpenOffice_4.1.4_Win_x86_install-arc_en-US/program/soffice.exe</pre>
+
::: (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 trunk and the 4.2.x branch, it will '''not''' work with any 4.1.x branch!
+
 
+
* 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 64-bit version (the latest Cygwin DLL known to work is 3.1.7-1) or use [https://www.cygwin.com/setup-x86_64.exe this direct link]. Note: For some older revisions "make" has to be downgraded to version 4.2.1-2 to build AOO from trunk or AOO42X.
+
** 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: <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 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<pre>./bootstrap</pre>
+
** Include the configured environment<pre>source winenv.set.sh</pre>
+
** Build<pre>cd instsetoo_native/&#10;build --all</pre>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. <pre>build --all -P<m> -- -P<n></pre> tells build to use <code>m</code> processes (build up to <code>m</code> modules in parallel) and <code>n</code> threads for each module.
+
  
 
=Mac OS X=
 
=Mac OS X=

Revision as of 21:00, 9 January 2021


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.

This version limits itself to either relatively recent versions of operating systems, or systems in which the OpenOffice PMC are activity using. A historical version of this page can be found here

Linux

Windows

Mac OS X

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

Personal tools