Difference between revisions of "Documentation/Building Guide/Building on MacOSX"

From Apache OpenOffice Wiki
Jump to: navigation, search
(The perl module Archive::Zip ( optional ))
 
(859 intermediate revisions by 43 users not shown)
Line 1: Line 1:
<big>'''This document tries to wrap-up the build process for [[OpenOffice.org]] on MacOS X using the native windowing-toolkit of the platform named Aqua.''' </big>
+
{{Documentation/Building Guide TOC
 +
|ShowNextPage=none
 +
|ShowPrevPage=none
 +
}}
  
An important goal is to get the demonstration programs "svdem" up and running. They act as a fairly good starting point to further endeavours, since they are used to test the capabilities of the underlying [[VCL]] layer. If this is achieved, one can build and Install the full-fledged OpenOffice.org Package. The bias of this document is to describe the cumbersome build process of OpenOffice.org rather than to give a kickstart in the coding involved to get VCL ported to Carbon. A starting point for this is Pierre de Filippis excellent [[Intro To Mac Porting]].
+
{{DISPLAYTITLE:Building OpenOffice 3.x or Apache OpenOffice 4.0 on Mac OSX}}
 +
[[Category:MacOSX]]
 +
{{Note|These instructions have been '''DEPRECATED'''}}
 +
{{SeeAlso|EN|
 +
* [[Documentation/Building_Guide_AOO/Building_on_MacOsX]] }}
 +
__TOC__
 +
<!-- insert comment -->
 +
= Overview =
 +
This document explains how to build older OpenOffice source code on Mac OS X systems.  
 +
{{Note|<code>$SRC_ROOT</code> will denote the directory in which the source code of Apache OpenOffice is stored.}}
 +
{{Tip|You are advised to check the release notes for the release you are building to inform yourself about changes since previous releases.}}
  
I use the bash shell in all examples, since to my belief users of the C-shell are smart enough to figure out the differences anyway. If you want to dig deeper into the build process, please have a look at the description of the build enviroment here: [http://tools.openoffice.org/build_env.html Open OfficeBuild Environment].
+
= Requirements =
  
Many thanks for help and assistance go to Pavel Janik and Eric Bachard.
+
To build the office on Mac OS X several requirements/prerequisites have to be fulfilled.  
  
== '''Prerequisites''' ==
+
== Mandatory Requirements ==
 +
* '''Mac OS X''' version 10.4 (aka Tiger) or later (if using 10.5 aka Leopard, have a look at [[User:Dyrcona/LeopardBuild#flex]]
 +
* '''Mac 10.4 SDK'''
 +
* '''XCode''' version 2.4.1 or any XCode 3. If you want to use a newer version than the one that is shipped with your Mac OS X installation media, you need to register at the [https://connect.apple.com/ Apple Developer Connection] site (free of charge) to be able to [http://developer.apple.com/technology/xcode.html download it].  On Mac OS X 10.6 (Snow Leopard), make sure to install the optional 10.4 SDK with XCode.
 +
* '''dmake''', the build environment depends currently on a special patched version of dmake that you can download and build on demand during configure and bootstrap. Or you can provide a prebuilt version and can specify it during configure.
 +
* '''epm''', the build environment depends currently on a special patched version of epm (easy package manager) that you can download and build on demand during configure and bootstrap. Or you can provide a prebuilt version and can specify it during configure. 
 +
 +
{{Note|XCode 3 and SDK 10.4 is currently required for building trunk or the releases. Work on supporting XCode>=4 is ongoing.}}
  
This document was derived from the description of the X11 build thanksworthy provided by Eric Hoch in this document: [[MacOSXBuildInstructions]]. Here i like to outline the things you need to buld the Aqua Version (besides the OS). Your are much better off to install the Fink Package Manager on your Apple, to resolve these dependencies (and get some cool stuff too). Go to [http://fink.sourceforge.net Fink]
+
== Optional Requirements ==
  
=== Mandatory ===
+
=== Prebuilt unowinreg.dll ===
  
==== Xcode ====
+
This library is Windows only but will be packed in the Apache OpenOffice SDK to ensure that it is available on all platforms. The library provides some glue code to setup a working UNO environment for UNO client applications connecting to an office and doing some remote automation via API. The library should be stored in ''main/external/unowinreg''. Only necessary for building the SDK.
  
This is (with GNU cp, soon optional) the only mandatory part to be installed to build Aqua version of OpenOffice.org.
+
The library can be downloaded under
 +
* http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll
  
Current verified working version is XCode 2.4
 
  
Xcode 2.2, 2.3 are known to work for Aqua development. Please add earlier versions work as well, please add them here.
+
== Recommended tools ==
  
==== X11SDK  (soon optional) ====
+
* '''ccache'''
 +
If you intend to build Apache OpenOffice several times, you probably can benefit of ccache since it will speed up your future builds. The first time you make a build with ccache you won't notice it, but the next time the build will go up to five times faster.
  
A dependency for Mozilla plugin needs some prototype defined in some Xllib.h header.  
+
You can install it using '''[http://www.finkproject.org/ Fink]'''. It is simply named "ccache". For '''[http://www.macports.org/ MacPorts]''' users the package is called "ccache".  
  
Please note, this dependency is not needed in runtime, but only at buildtime.  
+
If you don't use fink, you can download and build it yourself using the source provided at http://ccache.samba.org/
  
X11SDK.pkg archive is located in your Tiger's DVD, and has to be installed in the case of you're using Mozilla prebuild archives
+
There are two ways to enable ccache - one is to set environment variables, the other way is to use symlinks.
  
'''Workaround''' XCode does contain Xlib headers. Just modify INCLUDE path properly will solve the build issue.
+
Using environment variables:
 +
  export CC="ccache gcc"
 +
  export CXX="ccache g++"
  
Meant replace ( not existing)
+
Using the symlink approach:
/usr/X11R6/include
+
# create a directory for the links
 +
mkdir ~/bin
 +
# create the symlinks pointing to ccache with the name of the compiler
 +
ln -s /path/to/ccache ~/bin/gcc
 +
ln -s /path/to/ccache ~/bin/g++
 +
ln -s /path/to/ccache ~/bin/cc
 +
ln -s /path/to/ccache ~/bin/c++
 +
# no all you need to enable ccache is to prepend ~/bin to your PATH
 +
$ export PATH=~/bin:$PATH
  
with (existing) : /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include
+
for both methody, you can add the "export ..." lines to your ~/.profile - that way you don't need to manually set it when building. You can still temporarily disable ccache (export CCACHE_DISABLE=1) in case you don't want to use it.
  
Doing a symlink between them :
+
Since OOo is rather huge, you should increase the cache-size to 1 GB or more
<code>
+
ccache -M 1G
sudo ln -s /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include  /usr/X11R6/include
+
</code>
+
  
 +
* '''subversion''' version '''1.5.4 or later'''
 +
Since OOo's source code is managed using Subversion currently, you also need the svn client to checkout sources (otherwise you would be bount to source-tarballs that aren't generated that frequently). You can either compile yourself or use the subversion universal binaries from the [http://subversion.tigris.org subversion project] Version 1.5.4 or later is required because of important fixes related to the merge-feature.
  
This issue should be fixed soon.
+
== Get the source and prepare to build it ==
  
==== gnu copy ( soon optional ) ====
+
=== Get the source from SVN ===
  
Note : cloph04 will fix GNU cp version needed, and the one provided with XCode will become sufficient.  
+
You need about 4.7 GB for a checkout from the svn repository. Building the source requires another 5GB.<br>
  
In Fink terms this is in the package ''fileutils''.
+
* '''check out the latest source from svn'''
  
If you prefer direct download, GNU coreutils can be found at http://www.gnu.org/software/coreutils/coreutils.html.
+
svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo
  
After installing, you should copy or rename the newly installed cp to gnucp (located at /usr/local/bin/cp or /sw/bin/cp if you used Fink) (cf. http://qa.openoffice.org/issues/show_bug.cgi?id=69711)
+
=== One-Time preparation and scripts ===
  
=== Strongly recommended ===
+
Apache OpenOffice build environment is configured using the open-source configuration-management package 'autoconf'. So you can do your beloved './configure' command, is now done in the '''main''' source directory.
  
==== ccache ====
+
To save the configure parameters and use them with different milestones it is useful to create your own build script to configure the environment and to trigger the build.
If you indend to build several times OpenOffice, you probably can benefit of ccache. ccache will speed up your future builds. The first time you make a build with ccache you won't notice it, but then the build will go up to five times faster.
+
  
You can install it using fink. It is simply named "ccache".
+
The directory structure when you have checked out the sources from svn looks like:
  
If you don't use fink, you can download it and build it yourself using the source provided at http://ccache.samba.org/
+
aoo/
 +
aoo/main
 +
aoo/extras
 +
aoo/test
 +
aoo/ext_libraries
 +
aoo/ext_sources
  
Then, in order to use it, you need to change the following environment variables (using bash) :
+
Move into '''main''' and configure a minimal environment to build your first version of Apache OpenOffice:
 
+
<pre>
+
export CC="ccache gcc"
+
export CXX="ccache g++"
+
</pre>
+
 
+
=== Optional ===
+
 
+
==== Java ====
+
 
+
Normally installed with XCode.
+
 
+
==== The perl module Archive::Zip ( optional ) ====
+
 
+
Nothing is needed anymore with recent versions of XCode (means : not needed with XCode 2.4 at least).
+
 
+
If you still have issues doing configure because of that, please install Archive::Zip repecting the instructions below :
+
 
+
<code>[bash,N]
+
perl -MCPAN -eshell
+
install Archive::Zip
+
</code>
+
 
+
==== gpc ( optional) ====
+
GPC is available here: ftp://ftp.cs.man.ac.uk/pub/toby/gpc/gpc231.tar.Z>
+
Attention: Direct Link to the download but it's only a few hundred KB.
+
Note: You can alternatively use the libart_lgpl library instead of GPC. This requires an additional configure flag (--enable-libart) and a precompiled libart library installed in a standard location, such as /usr/lib.
+
 
+
==== pkg-config (optional) ====
+
 
+
Nothing to install on Aqua build, since --disable-gtk is forced
+
 
+
Called ''pkgconfig'' in Fink.
+
 
+
pkg-config can be found here : http://pkgconfig.freedesktop.org/wiki/
+
 
+
 
+
 
+
==== Apache Ant 1.6.5 (optional) ====
+
'''Not Adviced''' : XCode does provide a perfectly working version of ant.
+
 
+
It is up to you if you prefer use this one.
+
 
+
An up to date version of ant is shipped with XCode.
+
 
+
For the OpenOffice Builds you need to have Apache's Ant in the source-directory. You have to have Ant Version 1.6.5+. My Ant usually resides in /opt/ant so i link it in from there:
+
<code>[bash,N]
+
cd src680-m195/
+
ln -s /opt/ant/ apache-ant-1.6.5
+
</code>
+
 
+
To set them, you just need to add these two previous parameters to your build.sh (see [[#One-Time preparations and scripts]] for details).
+
 
+
== '''Some Background (what is aquavcl01, EIS)''' ==
+
 
+
=== EIS ===
+
OpenOffice sources are basically kept in the CVS server located at anoncvs.services.openoffice.org. However this repository is managed by a database on top called EIS (Environment Information System) which is used to keep track of Master- and Client Workspaces. Master Workspaces are used to keep track of changes going back of the mainline trunk and undergo extensive QA-cycles. These Master Workspaces are driven to official releases. Child workspaces in contrast are copies of certain Master Workspaces used to develop and test bugfixes and additional functionality. These Child Workspaces are later (hopefully) merged back to mainlain Master Workspaces. The TX20 Report mentioned in the Links section gives a very good overview about the overall process. To learn more about Childworkspaces (CWS) have a look here: [[CWS]].
+
 
+
Go to EIS http://eis.services.openoffice.org/EIS2/servlet/Logon and Logon as guest/guest to get yourself an impression. You can find information about the different workspaces, their dates and times there.
+
 
+
=== VCL (Visual Class Libraries) ===
+
 
+
Porting OpenOffice.org to a new Windowing Toolkit is mostly porting of the OpenOffice's VCL Layer (Visual Class Libraries) to the new platforms toolkit. The VCL-Layer is responsible of mapping the OpenOffice Application calls to the windowing toolkit.
+
 
+
The (native) OpenOffice port to MacOSX using the Aqua Windowing Toolkit is developed in a child workspace called '''aquavcl01'''. This child workspace consists of the modules (aka subdirs): canvas dtrans extensions freetype padmin scp2 sj2 solenv vcl.
+
 
+
The basic approach to prepare a developer's client system to succsessfully build OpenOffice/Aqua is the following:
+
 
+
# checkout a given OpenOffice Milestone.
+
# checkout aquavcl01 Child Workspace.
+
# merge them together.
+
# apply the latest patches.
+
 
+
The last point here is a cumbersome but nevertheless necessary operation, since this porting project is in flux. Thanks to Pavel and many others improvements are happening at tremendous pace at the moment. All of these improvements get distributed as patches/diffs against aquavcl01. Aquavcl01 needs to remain stable all the time, therefore the team needs to work on this patch-by-patch aproach at the moment.
+
 
+
== '''Getting the code (checkout, merge and patch the puppy)''' ==
+
 
+
Now let's have a look what to check-out and where. All these milestone numbers below highly depend on the given point-in-time. The current milestone as of now (November 8th 2006) is m195. You may change this to your needs. You can finde the current milestone of each cws in the EIS database.
+
 
+
You also need to bear in mind that you have to access to the CVS-Server's default port (2401). If a firewall stop's you here you have to setup a CVS-Tunnel.
+
 
+
==== create a directory for a given milestone, setup CVS access: ====
+
<code>[bash,N]
+
mkdir src680-m196
+
cd src680-m196
+
 
   
 
   
  export CVSROOT=:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs
+
  cd main
cvs login
+
</code>
+
Please Enter the password 'anoncvs'
+
  
==== checkout Milestone m196 (1,5 GB): ====
+
Run the autoconf command to prepare a new configure based on the latest changes in configure.in
<code>[bash,N]
+
cvs -z3 co -r SRC680_m196 OpenOffice2
+
</code>
+
Once done, you'll obtain milestone 196. this not exactly what we want, because all changes concerning aquavcl01 Child workspace are not included. To complete, we need to check aquavcl01 changes.
+
  
==== checkout Aquavcl01 (50 MB): ====
+
autoconf
  
1) First possibility : create a dedicated tree (cool backup )
+
Run configure
  
To check aquavcl01 Child workspace, the most simple is to create aquavcl01 directory, and go inside this dir
+
  ./configure --without-stlport --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 --with-epm-url=http://www.msweet.org/files/project2/epm-3.7-source.tar.gz
<code>[bash,N]
+
  mkdir aquavcl01-src
+
+
cd aquavcl01-src
+
</code>
+
(assuming you arelady did cvs login ..etc )
+
<code>[bash,N]
+
cvs -z3 co -r cws_src680_aquavcl01 OpenOffice2
+
</code>
+
The following modules will be present at the end :
+
 
+
canvas
+
extensions
+
fpicker
+
padmin
+
scp2
+
sfx2
+
solenv
+
dtrans
+
freetype
+
psprint
+
sj2
+
vcl
+
+
All these modules are the ones we modified to create the native version :  they all are tagged "aquavcl01" (see all CVS/Tag files in the tree) and all you have to do is either rename or delete the one located in src680-m196 and replace them with the one located in aquavcl01-src.
+
 
+
e.g.  : canvas in src680-m196 will become canvas_m196 , and then, cp canvas from aquavcl01-src into src-m196
+
 
+
This applies for all the modules listed above.
+
 
+
2) Second possibility : use a little script to extract changes : extract_aquavcl01.sh
+
 
+
This shell script, located in src680-m196 will contain :
+
<code>[bash,N]
+
#!/bin/bash
+
  list="canvas extensions fpicker padmin scp2 sfx2 solenv dtrans freetype psprint sj2 vcl"
+
  for i in $list ;  do
+
    cd $i
+
    cvs up -j CWS_SRC680_AQUAVCL01_ANCHOR -j cws_src680_aquavcl01
+
    cd ..
+
  done
+
</code>
+
 
+
Then chmod +x extract_aquavcl01.sh
+
 
+
and run it :
+
 
+
./extract_aquavcl01.sh
+
 
+
When finished, and if no problem occurs, you should have a complete tree.
+
 
+
=== One-Time preparations and scripts ===
+
 
+
OpenOffice building gets configured by the popular open-source configuration-management package 'autoconf'. So you can do your beloved './configure' command, but in our case this is done in the 'config_office' subdirectory. To save the configure parameters and use them with different milestones I used to link-in my shellscript to fire up the ./configure line.
+
 
+
My directory-structure looks like this:
+
 
+
bin/
+
src680-m176/
+
src680-m182/
+
...
+
 
+
Now I go to the 'config_office' subdir and link in my startscript:
+
<code>[bash,N]
+
cd src680-m196/config_office/
+
ln -s ../../bin/build.sh
+
</code>
+
And this is how 'build.sh' looks like:
+
 
+
<code>[bash,N]
+
#!/bin/sh
+
export BASE=`pwd|sed 's/\/config_office//'`
+
export OOVERSION=`echo $BASE|sed 's/^\/.*\///'`
+
echo Building from      : $BASE
+
echo OpenOffice Version : $OOVERSION
+
./configure \
+
--with-lang="de en-US" \
+
--with-jdk-home=/Library/Java/Home/ \
+
--with-gnu-cp=/sw/bin/cp \
+
--with-epm=internal \
+
--disable-mozab \
+
--disable-odk \
+
--disable-pasf \
+
--disable-gtk \
+
--disable-mozilla \
+
--with-build-version=$OOVERSION-`date +%d-%m-%y` \
+
--disable-fontconfig \
+
--disable-neon \
+
--without-nas
+
</code>
+
 
+
--disable-odk will avoid you to download some windows dll which is not needed for aqua-build.
+
--disable-pasf : pasf stands for Portable Audio System file. As we want to use system library rather than portable ones, we disabled this. However, at this time not all functionality will be available with pasf disabled. You might willing to use --with-pasf if you want working audio in your build.
+
--disable-nas : nas stands for Network Audio System, it uses X11, if you want to use it in your build, just remove this flag. You will need to install the X11 package provided in your CDs/DVD Mac OS X installation. X11 SDK from xCode tools is not required for build this.
+
 
+
This is allowedly a pretty much limited setup, but my overall goal is to get people to have 'svdem' build to start coding rather than to have a production ready build for the final release. Therefore I switched off most of the stuff. How these offical builds are done in the long run is to be decided when we get there.
+
 
+
 
+
 
+
== '''List of Patches for a given Milestone''' ==
+
 
+
Here is a list of Patches one has to apply against a given Milestone of SRC680 (including CWS aquavcl01). Please keep the older Milestones here, since people are probably still on these Versions.
+
  
                            <!-'''<big>IMPORTANT :  m195 resync is CURRENTLY in progress : please wait </big>'''-->
+
This commands prepares a minimal environment to build the office without any category-b enabled external libraries. A pure Apache license compatible version. See also the configure switches ''--with-dmake-path'' and ''--with-epm'' to specify prebuilt versions of dmake or epm.
  
PLEASE NOTE : '''Current milestone for Aqua build is m196'''  (older milestones are deprecated)
+
Finally you should run bootstrap to trigger further preparations and to create platform specific shell script to setup a working build environment. On Mac OS x for example '''MacOSXX86Env.Set.sh''' on a Intel based system.  
  
 +
=== Build environment with enabled category-b dependencies ===
  
{| border="1" cellpadding="5" cellspacing="0"
+
To prepare a build environment that provides more features and make use of further external libraries which are under copyleft but viral licenses you have to explicitly enable this '''category-b''' components.
|-
+
! Milestone || Patch to apply || Status
+
|-
+
| ''' m196'''  || To avoid crashes with several entries in menu  apply [http://eric.bachard.free.fr/patches/aqua/about_workaround/diff_salframe.diff about_workaround patch] in vcl/aqua/source/window  ||Work in progress
+
|-
+
| ''' (deprecated) m195'''  || To avoid crashes with several entries in menu  apply [http://eric.bachard.free.fr/patches/aqua/about_workaround/diff_salframe.diff about_workaround patch] in vcl/aqua/source/window  ||Work in progress
+
|-
+
|}
+
  
== '''Known build issues''' ==
+
./configure --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 \
 +
    --with-epm-url=http://www.msweet.org/files/project2/epm-3.7-source.tar.gz \
 +
    --disable-build-mozilla \
 +
    --without-stlport \
 +
    --enable-verbose \
 +
    '''--enable-category-b'''\
 +
    --enable-wiki-publisher
  
m196:  Breakage in pyuno
 
  
See [http://www.openoffice.org/issues/show_bug.cgi?id=72372 pyuno not found]
+
===Example build script to simplify user specific configurations===
 +
As mentioned before to save the configure parameters and use them with different versions it is useful to create your own build script to configure the environment.
  
'''Workaround''' :
+
Create 'build.sh' (to be written) :
  
 
<pre>
 
<pre>
1) either use the patch provided in issue 72372
+
#! /bin/bash
  
2) or simply do ( in the same terminal, or please source the environment before):
+
echo "### checking for unowinreg.dll ... "
 +
if [ ! -e  ./external/unowinreg/unowinreg.dll ]; then
 +
    wget -O external/unowinreg/unowinreg.dll http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll
 +
else
 +
    echo "  unowinreg.dll found"
 +
fi
  
cd bridges
+
echo "### checking for moz prebuild libs ... "
build && deliver
+
if [ ! -e  ./moz/zipped/MACOSXGCCIinc.zip ]; then
cd ../pyuno
+
    wget -O ./moz/zipped/MACOSXGCCIinc.zip http://www.openoffice.org/tools/moz_prebuild/OOo3.2/MACOSXGCCIinc.zip
build && deliver
+
    wget -O ./moz/zipped/MACOSXGCCIlib.zip http://www.openoffice.org/tools/moz_prebuild/OOo3.2/MACOSXGCCIlib.zip
 +
    wget -O ./moz/zipped/MACOSXGCCIruntime.zip http://www.openoffice.org/tools/moz_prebuild/OOo3.2/MACOSXGCCIruntime.zip
 +
else
 +
    echo "  moz prebuild libs found"
 +
fi
  
-> pyuno should build without any problem
+
if [ ! -e  ./configure ]; then
 +
    echo "### autoconf ..."
 +
    autoconf
 +
else
 +
    echo "### autoconf ..."
 +
    rm ./configure
 +
    autoconf
 +
fi
  
cd .. && dmake  
+
echo "### Configure"
 +
./configure --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 --with-epm-url=http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz
  
will complete your build
+
#./configure --with-build-version="$(date +"%Y-%m-%d %H:%M:%S (%a, %d %b %Y)") - Rev. $(echo $(svn info) | sed -e 's/^.*Last Changed Rev: //g' -e 's/ .*//g')" \
 +
    --disable-build-mozilla \
 +
    --enable-verbose --enable- category-b --enable-minimizer --enable-presenter-console --enable-wiki-publisher \
 +
    --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 \
 +
    --with-epm-url=http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz
  
 +
./bootstrap
 
</pre>
 
</pre>
[[User:Ericb|Ericb]] 14:52, 13 December 2006 (CET)
 
  
== '''Doing the build (about 4,5 GB)''' ==
+
Put this script into ~/bin and make sure it is executable :
  
Fine, now we have a (hopefully) working 'build.sh' in the config_office subdir. We need to run it beforehand:
+
chmod ug+x ~/bin/build.sh
  
cd src680-m196/config_office/
+
<b>We used the bash shell in all example, since to our belief users of the C-shell are smart enough to figure out the differences anyway. If you want to dig deeper into the build process, please have a look at the description  [http://tools.openoffice.org/build_env.html OpenOffice.org's Build Environment].</b>
./build.sh
+
  
This will setup the necessary includefiles and create a couple of files in the '''parent''' directory (bootstrap, MacOSXPPCEnv.Set.sh, MacOSXPPCEnv.Set). If you are using the sh, ksh or bash you only need to take care for 'MacOSXPPCEnv.Set.sh'.
+
== Doing the build ==
  
Now we need to get back to our base-directory, run the bootstrap script, source our Enviroment (MacOSXPPCEnv.Set.sh) and finally start the build-process:
+
After running configure and bootstrap we should have a working build environment and all necessary scripts should have been created. From now on you can use '''MacOSXX86Env.Set.sh''' to prepare a new shell with a working build environment.
  
On PowerPC :
+
=== On Mac Intel ===
  
cd ..
+
  source MacOSXX86Env.Set.sh
./bootstrap
+
  cd instsetoo_native
  source MacOSXPPCEnv.Set.sh
+
build --all
  time dmake
+
  
 +
or
  
Or (on Mac Intel ) :
+
build --all -P4
  
cd ..
+
=== On PowerPC ===
./bootstrap
+
source MacOSXIntelEnv.Set.sh
+
time dmake
+
  
The main purpose of the '''boostrap''' script is to build (if necessary) the dmake utility used. Dmake once was a unix make-clone made by wticorp but got incorporated into OpenOffice since it was orphaned. For more information about dmake, it's history and manpage have a look here: http://tools.openoffice.org/dmake/index.html
+
source MacOSXPPCEnv.Set.sh
 +
cd instsetoo_native
 +
build --all
  
Sourcing MacOSXPPCEnv.Set.sh is very important not only for building but also for '''running''' svdem later on. Here all the Enviroment-Variables for the Build will be set up. For a detailed descripton see [[Environment_Variables]]. Please note that on Intel machines, 'MacOSXPPCEnv.Set' should be substituted with 'MacOSXIntelEnv.Set'.
+
or
  
This Build process takes on my box (Dual 1.8 GHz G5, 1.5GB RAM) roughly 10 hours. Be paitioned. What can you do meanwhile? Do this:
+
  build --all -P2
<code>[bash,N]
+
  while true ; do find . -maxdepth 1 -type d -anewer MacOSXPPCEnv.Set.sh |wc -l ; sleep 5; done
+
</code>
+
and wait till the number reaches 174
+
  
== '''Creating Debug-Versions of Modules''' ==
+
=== Comments on above ===
  
<pre> Important: a new section about use XCode for OpenOffice.org debug has been created.
+
'''TODO TODO TODO ....'''
See :</pre>
+
  
[[MacOSX_Debug_OpenOffice.org_using_XCode]]
+
if you run into trouble with --dlv_switch (see: {{Bug|77360}})
  
 +
The main purpose of the '''bootstrap''' script is to build (if necessary) the dmake utility used. Dmake once was a unix make-clone made by wticorp but got incorporated into OpenOffice since it was orphaned. For more information about dmake, it's history and manpage have a look here: http://tools.openoffice.org/dmake/index.html
  
'''Is it possible to build the complete set with symbols included ?'''
+
Sourcing MacOSXPPCEnv.Set.sh is very important not only for building but also for '''running''' svdem later on. Here all the Environment-Variables for the Build will be set up. For a detailed description see [[Environment_Variables]]. Please note that on Intel machines, 'MacOSXPPCEnv.Set.sh' should be substituted with 'MacOSXX86Env.Set.sh'.
  
Currently not possible, and not adviced.
+
This Build process takes on my box (Dual 1.8 GHz G5, 1.5GB RAM) roughly 10 hours, and 3 to 6 hours on Mac Intel (3:30h on a 2GHz DualCore INTEL iMac). Be patient.
  
''' is it possible to build some modules with symbols ?'''
+
If you want to see how the progress on that build  is you can use two '''build''' options to get a comfortable view:
  
Yes, and that's the simplest way to proceed. Some modules, like sal and vcl can be rebuilt using debug.
+
build ... <see above> ... --html --html_path /Users/$USER/Sites
  
Example :
+
where $USER is your user name. Then you can load in Firefox (not Safari!) the HTML file '''unxmacxi.pro.build.html''' via the in Mac OS X included Apache web server or diretctly form the directory ''/Users/$USER/Sites/''. This file is automatically being updated and is showing the status of the build and also the time needed since the build started.
  
To rebuild sal with symbols included, do:
+
If you build on Snow Leopard (aka Mac OS X 10.6): Set DYLD_INSERT_LIBRARIES to point to the correct libsqlite3.dylib:
 +
<pre>
 +
DYLD_INSERT_LIBRARIES=/usr/lib/libsqlite3.dylib
 +
</pre>
  
<code>[bash,N]
+
== '''Installing, preparing and running OpenOffice.org''' ==
cd sal
+
rm -rf unxmacxp.pro
+
build debug=true
+
</code>
+
  
and recopy the libs into the bundle. gdb will display the symbols, and make your life easier.
+
===''' Find the Bundle''' ===
  
Note :  debug string is tested, and DEBUG is active when debug string is not empty. So debug=t works too.
+
Once the build completed, the final product ( en-US version ) is named :  OOo_3.0.0_*_MacOSXIntel_install.dmg ( for version 3.0beta e.g.)
  
''' How change gdb options, and use e.g. -g -ggdb or -gdwarf-2  ?'''
+
And is located in instsetoo_native/unxmacxi.pro/OpenOffice/dmg/install/en-US  directory ( replace en-US with your locale )
  
To rebuild the module, you just have to modify the option in solenv/inc/unxmacx.mk, replacing -g with -ggdb
+
[[Image:Bundle_Location3.0beta.jpg]]
  
'''Known issues'''
+
=== '''Install the new Build''' ===
  
Sometimes a build error, or a runtime error, may be seen in the normal build, 
+
* double-click on the *.dmg icon
but the error goes away when --enable-debug is used or if the module is compiled with debug=true.
+
* drag the OpenOffice icon into a folder of your choice
  
The DEBUG build turns off optimisation, so this is a hint that compiler optimisation causes the error.
+
=== '''Run the new Build''' ===
  
The error might be due to incorrect code or a compiler fault.  Such errors might not be seen on all platforms,
+
* double click the application icon in that folder
  
and might not be seen in different compiler versions on one platform.
+
=== '''Screenshots''' ===
  
If the code can not be fixed there is a workaround using NOOPTFILES to build specified files with no optimisation.
+
Now you can start to work with this [[Aqua_Screenshots | amazing productivity suite]].
+
Example :
+
  
jvmfwk on Mac OS X: build jvmfwk in m183 on Mac OS X Intel leads to Bus Error when javaldx is run.
+
== '''Contribute by finding, isolating, debugging or solving issues''' ==
  
Solution : use trial and error to rebuild individual files with debug=true. This proves the problem lies with vendorbase.cxx
+
=== '''Isolate a problem''' ===
  
Have a look in sc/source/core/data/makefile.mk for an example to use NOOPTFILES
+
==== '''Reduce a problem''' ====
  
To solve our problem: just add : NOOPTFILES= $(SLO)$/vendorbase.obj in the corresponding makefile.
+
* make a problem reproducable
 +
* reduce it to a test case that is as small and simple as possible
 +
* if a problem is specific to a document then please attach it to the issue. A mininal excerpt of the document that still shows the problem is even better.
 +
* a screenshot of is a good idea if it clearly shows the problem
  
Take care in case some .IF is needed to prevent interference with other platforms.
+
==== '''Using application switches''' ====
  
There's some additional information around debugging on Christians Page [[User:CL#2006-09-03]]
+
Application switches are often valuable for isolating a problem. Most of OpenOffice.org's options can be found its Tools->Options menu.
 +
<br><br>
 +
Some switches are so special that there is no user interface to change them. They are only useful for debugging and isolating a problem, but they are very valuable a that. So a developer might suggest to isolate a problem by setting an environment variable before running the application. E.g. for isolating problems with the menubar a developer might suggest to set the environment variable [[AQUA_NATIVE_MENUS]] to false. This is done by typing these commands into a terminal:
 +
* cd <INSTALL_DIR>/OpenOffice.org/Contents/MacOS
 +
* export AQUA_NATIVE_MENUS=false
 +
* ./soffice.bin
  
== Building and running svdem ==
+
==== '''Provide a call stack for crash problems''' ====
  
We want to run the demonstration programs called "svdem". There are a couple of binaries called "svdem", which area they cover is still somewhat unclear to me, I hope some of you guys can shed some light here. But hey, this is a wiki! Just correct here :-).
+
Please note that bugs involving crashes should provide a description of how to reproduce the problem and a callstack.
 +
There are several ways to provide the callstack:
 +
* the preferred method is to use OOo"s builtin [[CrashReporting|crash reporting tool]]
 +
* developers may provide a [[Providing_a_gdb_backtrace | gdb backtrace]] of the problem
 +
* if the above two methods don"t work then please attach a file with the details provided by the AppleCrashReporter
  
==== svdem from VCL ====
+
=== '''Check against known issues''' ===
To have the VCL Testprogram build you have to do:
+
  
'''[FIXME] replace this scetion with the same, but about svdem from svtools'''
+
Check the list of [http://www.openoffice.org/issues/buglist.cgi?issue_status=UNCONFIRMED&issue_status=NEW&issue_status=STARTED&issue_status=REOPENED&email1=&emailtype1=exact&emailassigned_to1=1&email2=&emailtype2=exact&emailreporter2=1&issueidtype=include&issue_id=&changedin=&votes=&chfieldfrom=&chfieldto=&chfieldvalue=&short_desc=&short_desc_type=fulltext&long_desc=&long_desc_type=fulltext&issue_file_loc=&issue_file_loc_type=fulltext&status_whiteboard=&status_whiteboard_type=fulltext&keywords=aqua&keywords_type=anytokens&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&Submit+query=Submit+query open issues]
  
cd vcl; build --all
+
=== '''Report a new issue''' ===
  
This should have created a file called "svdem" here: vcl/unxmacxp.pro/bin/svdem. If you managed to build these binaries, you are nearly there. What you need now, is a wrapper directory structure to make this binary a fellow Mac OSX application. I mean the ones which have this structure:
+
Report [http://qa.openoffice.org/issue_handling/pre_submission.html new issues] after you have [[AquaBuild#Isolate_a_problem | isolated the problem]]
  
svdem.app/
+
=== '''Debug a problem''' ===
svdem.app/Contents
+
svdem.app/Contents/Info.plist
+
svdem.app/Contents/MacOS
+
svdem.app/Contents/MacOS/applicat.rdb
+
svdem.app/Contents/MacOS/svdem
+
  
You can basically create this structure anywhere you want. And you can link-in the file you just created (svdem). So you build up this structure once and link-in the freshly created svdem there:
+
Debugging problems is often easier in an development environment:
 +
<ul>
 +
<li>With XCode: [[MacOSX_Debug_OpenOffice.org_using_XCode]]</li>
 +
<li>With Xemacs: [http://www.mikesicotte.com/2007/02/21/debugging-ooo-with-xemacs-and-gdb Michael Sicotte's blog entry]</li>
 +
</ul>
  
ls -l svdem applicat.rdb
+
Please note that XCode still has some problems with the executable named soffice.bin (because of the dot in the name). The issue has been reported to xcode-users list.
svdem -> /opt/src/openoffice/src680-m195/vcl/unxmacxp.pro/bin/svdem
+
applicat.rdb -> /opt/src/openoffice/src680-m195/vcl/unxmacxp.pro/bin/applicat.rdb
+
  
Now only the Info.plist file is missing, so here we go:
+
== '''Current Work in progress (Aqua specific work only)''' ==
  
<code>[xml,N]
+
With OOO300 the Aqua port became a mainstream port, so most Aqua issues are handled in regular GSL-Layer childworkspaces instead of dedicated Aqua CWSses. Other CWSses that are purely Aqua specific are being tracked below:
<?xml version="1.0" encoding="UTF-8"?>
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
<plist version="1.0">
+
<dict>
+
        <key>CFBundleDevelopmentRegion</key>
+
        <string>English</string>
+
        <key>CFBundleDisplayName</key>
+
        <string>SvDem</string>
+
        <key>CFBundleExecutable</key>
+
        <string>svdem</string>
+
        <key>CFBundleIdentifier</key>
+
        <string>com.yourcompany.svdem</string>
+
        <key>CFBundleInfoDictionaryVersion</key>
+
        <string>6.0</string>
+
        <key>CFBundlePackageType</key>
+
        <string>APPL</string>
+
        <key>CFBundleSignature</key>
+
        <string>????</string>
+
        <key>CFBundleVersion</key>
+
        <string>1.0</string>
+
        <key>LSRequiresCarbon</key>
+
        <true/>
+
</dict>
+
</plist>
+
</code>
+
  
If you created the directory structure properly you can do './svdem' in the 'svdem.app/Contents/MacOS/' directory. You should see the svdem coming up.
+
* '''{{CWS|ogltrans4mac|DEV300}}''' : Implement the 3D (OpenGL) transitions in Impress ( see :  [[Mac_OS_X_Porting_-_OpenGL_transitions|  OpenGL transitions on Mac OS X ]] )
  
==== svdem from svtools ====
 
* Copy the application package you created for the vcl svdem.
 
* Source your MacOSX[PPC-Intel]Env.Set.sh
 
* Go into svtools/workben
 
* build svdem using dmake in the workben directory
 
* link the svdem and applicat.rdb from Contents/MacOS to the ones located in svtools/unxmacxp.pro/bin
 
  
You are done : you can now source your environment and run svdem using your usual shell.
 
  
== '''Installing, preparing and running OpenOffice.org''' ==
+
==='''Child WorkSpaces in development''' ===
  
Here I like to outline the steps to run OpenOffice.org after a successful build from the sources. Running the native Aqua Version of OpenOffice.org is somewhat tricky at the moment, since the installation procedure and mode are not in their final state. So right now one has to manually do some preparations to run the Office suite. This will change in the future when we are about to release some Alpha Builds to a wider audience.
+
* '''{{CWS|appleremote03|DEV300}}''' :  use the contextual menu in presentation mode with Impress. preliminary step
  
=== Drag & Drop Install the Application from the Diskimage ===
+
* '''{{CWS|hotmac|OOO300}}''' : fix memory deallocation problems in exit()
  
When you are one of the lucky few (Don't give up, Eric!), who have a successful build, you are going to see something like this as the last lines of the build:
+
* '''{{CWS|macosxscanner01|DEV300}}''' (planned)
  
.
+
All patches that developers have that need testing or peer review should be added here.
.
+
.
+
......................................................................................................................................................
+
    (CRC32 $11685D33: DiscRecording 3.1.3f2 (Apple_HFS : 2))
+
Ressourcen hinzufügen…
+
......................................................................................................................................................
+
Dauer: 15.406s
+
Dateigröße: 144732418 Bytes, Prüfsumme: CRC32 $14E0BB67
+
Bearbeitete Sektoren: 773848, 773845 komprimiert
+
Geschwindigkeit: 24.5M Bytes/Sek
+
Ersparnis: 63.5 %
+
created: /opt/src/openoffice/src680-m196/instsetoo_native/unxmacxp.pro/OpenOffice/install/de/OpenOffice.org-2.1_de.dmg
+
  
In this final step the ""instsetoo_native"" target creates the install Diskimages using Apple's 'hdiutil'. In my case it gives its output in German. After this disk image(s) have been created, double click the disk image to mount it (or type open <path to the DMG Image>) , and then move the icon named "OpenOffice.org 2.1" to your ''Applications'' folder (or any other folder you want this program to reside). The "OpenOffice.org 2.1" icon shown in the Finder is in fact a subdirectory called "OpenOffice.org 2.1.app". Subdirectories named ".app" (along with some well-know files inside like Info.plist, etc) are called ''Bundles'' in Apple's lingo.
+
==='''Child WorkSpaces in testing (closed for development)''' ===
  
=== Prepare the installation ===
+
*'''{{CWS|macmiscfixes}}''' : misc fixes for mac
  
After the OpenOffice 2.1 Application has been copied to its destination, you have to go into this bundle and run a small shell script provided by Pavel Janik to prepare soffice.bin (OpenOffice.org launcher) for running. You have to run this script in the directory where a Universal Binary called "droplet" is located. This "droplet" binary was used to fire-off the X11 version of OpenOffice.org. Expect this to change, but as of now we have to do it like this.
+
*'''{{CWS|maccrashrep}}''' : support crash reporting for OSX builds
  
I have put my OpenOffice.org build in my home directory's private "Application" folder (/Users/schmidtm/Applications), so please change this path to your installation. Now go to into the bundle and run the script:
+
*'''{{CWS|quicklookplugin01}}''' : a plugin for the QuickLook system available in MacOSX from versions 10.5 onwards
  
cd /Users/schmidtm/Applications/OpenOffice.org 2.1.app/Contents/MacOS
+
==='''Child WorkSpaces waiting for integration''' ===
/opt/src/openoffice/bin/fix_installed_OOo
+
  
<code>[bash,N]
+
* '''{{CWS|appleremote02|DEV300}}''' : improve the Apple Remote use with Impress (use MEDIA_COMMAND stuff, improve code robustness, and portability )
#!/bin/bash
+
+
[ ! -f droplet ] && {
+
    echo "Please run me in the directory, where binary named droplet is located."
+
    exit 0
+
}
+
+
mv THIRDPARTYLICENSEREADME.html help presets share ..
+
mv droplet droplet.orig
+
mv program/* .
+
rmdir program
+
+
cd ..
+
ln -sf MacOS program
+
sed 's#droplet#soffice.bin#' Info.plist >Info.plist.new
+
mv Info.plist.new Info.plist
+
cd MacOS
+
</code>
+
  
=== Run the soffice.bin ===
+
==='''Child Workspaces integrated into OpenOffice's trunk''' ===
  
 +
A historical overview of [[Aqua_Integrated_CWS | old Aqua specific ChildWorkspaces]].
  
We're nearly through, let's fire-off the binary:
+
== '''Known build issues '''==
 +
*'''Tiger''':  no known issues
 +
*'''Leopard''': no known issues
 +
*'''Snow Leopard''': no known issues
 +
*'''Lion''': no known issues
 +
*'''Mountain Lion''': no known issues
  
AQUA_NATIVE_MENUS=TRUE ./soffice.bin -nofirststartwizard -norestore
+
<div align="left" style="color:grey; font-size:12px">[[AquaBuild/Some Background | '''Some Background (what is a CWS, EIS) (click me to know more) ''']]</div>
  
Notice the enviroment variable here. AQUA_NATIVE_MENUS is experimental stuff created by Pavel, SAL_NO_NWF was created some times ago, and is located in vcl/source/window/window.cxx . At the moment we have:
+
== '''External links''' ==
 +
* [https://issues.apache.org/ooo Apache OpenOffice Issuezilla] : a database of bugs, changes and enhancements
 +
* There are [[MacOSXPortMeetings | regular meetings]] on IRC (archives are [[Previous_Mac_Meeting_logs | available]]).
 +
* Apache OpenOffice has a complicated code base. [[Source_code_directories | Here]] is an overview.
 +
* the official Apache OpenOffice blog is at [https://blogs.apache.org/OOo/]
 +
* [http://www.cocoadev.com Cocoadev] provides great resources to get up to speed in Cocoa development
 +
* Pierre Chatelier's excellent [http://ktd.club.fr/programmation/objective-c.php Objective C for C++ developers] is available in both english and french versions
 +
* Details about OSX's [http://developer.apple.com/cocoa Cocoa API] are available in the XCode documentation
  
{| border="1" cellpadding="5" cellspacing="0"
 
|-
 
! Variable || Function
 
|-
 
| SAL_NO_VCL=TRUE  || disable native controls code
 
|-
 
| AQUA_NATIVE_MENUS=TRUE || enable experimental native menus code
 
|}
 
 
Both changes are marked with comments in the source code, and when we remove them in the future, native controls and native menus will be enabled by default.
 
 
 
 
'''HACK''' : with current code, to enable native menus by defaut without have to define an environment variable, just comment as follow :
 
 
in vcl/aqua/source/window/salmenu.cxx, around line 124 :
 
<code>
 
/*
 
    static const char *pExperimental = getenv ("AQUA_NATIVE_MENUS");
 
 
    if ( !pExperimental || strcasecmp(pExperimental, "TRUE") )
 
        return FALSE;
 
*/
 
</code>
 
 
== External links ==
 
 
# Bug Database: http://www.openoffice.org/issues/query.cgi
 
# Mailinglist: mac@porting.openoffice.org
 
# IRC Meeting-Logs (#ooo_macport@freenode.org): http://eric.bachard.free.fr/mac/aquavcl/logs_meetings/
 
# TX20: http://eric.bachard.free.fr/UTBM_TX20/reports/Carbon_vcl.pdf
 
# OpenOffice Source Directory Structure: http://wiki.services.openoffice.org/wiki/Source_code_directories
 
# Pavels Patch Wiki: http://blog.janik.cz/
 
# Eric Bachard Wiki: http://wiki.services.openoffice.org/wiki/User:Ericb
 
# Christian Lippka Wiki: http://wiki.services.openoffice.org/wiki/User:CL
 
# Carbon: http://developer.apple.com/carbon
 
# EIS: http://eis.services.openoffice.org/EIS2/servlet/Logon
 
# Runtime Configuration: http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/index.html
 
# OpenOffice Domain Developer http://wiki.services.openoffice.org/wiki/DomainDeveloper
 
 
== Screenshots ==
 
 
# Eric Bachard screenshots (some are from Stephan Schaefer) http://eric.bachard.free.fr/mac/aquavcl/screenshots/
 
# Most recent: http://eric.bachard.free.fr/mac/aquavcl/screenshots/scrollbar_01sept
 
# Pavel Janik screenshots http://blog.janik.cz/images/MacOSX/2006-08-10
 
# Important screenshot (eventloop issue) : http://blog.janik.cz/images/MacOSX/  => See : OOoMenus-separator-and-disabled_entries.png
 
# Native Menus : http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_native_controls_03_11_06/aqua_menus_01.jpg
 
 
More menus : http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/index.html
 
 
 
 
[[Category:MacOSX]]
 
[[Category:Porting]]
 
[[Category:Development]]
 
 
[[Category:Aqua]]
 
[[Category:Aqua]]
 +
[[Category:Build_System]]

Latest revision as of 07:38, 18 July 2018

[[{{{PrevPage}}}|< Previous Page

]]

[[{{{NextPage}}}|Next Page
>]]
Documentation note.png These instructions have been DEPRECATED



See Also


Overview

This document explains how to build older OpenOffice source code on Mac OS X systems.

Documentation note.png $SRC_ROOT will denote the directory in which the source code of Apache OpenOffice is stored.
Tip.png You are advised to check the release notes for the release you are building to inform yourself about changes since previous releases.


Requirements

To build the office on Mac OS X several requirements/prerequisites have to be fulfilled.

Mandatory Requirements

  • Mac OS X version 10.4 (aka Tiger) or later (if using 10.5 aka Leopard, have a look at User:Dyrcona/LeopardBuild#flex
  • Mac 10.4 SDK
  • XCode version 2.4.1 or any XCode 3. If you want to use a newer version than the one that is shipped with your Mac OS X installation media, you need to register at the Apple Developer Connection site (free of charge) to be able to download it. On Mac OS X 10.6 (Snow Leopard), make sure to install the optional 10.4 SDK with XCode.
  • dmake, the build environment depends currently on a special patched version of dmake that you can download and build on demand during configure and bootstrap. Or you can provide a prebuilt version and can specify it during configure.
  • epm, the build environment depends currently on a special patched version of epm (easy package manager) that you can download and build on demand during configure and bootstrap. Or you can provide a prebuilt version and can specify it during configure.
Documentation note.png {{{1}}}

Optional Requirements

Prebuilt unowinreg.dll

This library is Windows only but will be packed in the Apache OpenOffice SDK to ensure that it is available on all platforms. The library provides some glue code to setup a working UNO environment for UNO client applications connecting to an office and doing some remote automation via API. The library should be stored in main/external/unowinreg. Only necessary for building the SDK.

The library can be downloaded under


Recommended tools

  • ccache

If you intend to build Apache OpenOffice several times, you probably can benefit of ccache since it will speed up your future builds. The first time you make a build with ccache you won't notice it, but the next time the build will go up to five times faster.

You can install it using Fink. It is simply named "ccache". For MacPorts users the package is called "ccache".

If you don't use fink, you can download and build it yourself using the source provided at http://ccache.samba.org/

There are two ways to enable ccache - one is to set environment variables, the other way is to use symlinks.

Using environment variables:

export CC="ccache gcc"
export CXX="ccache g++"

Using the symlink approach:

# create a directory for the links 
mkdir ~/bin
# create the symlinks pointing to ccache with the name of the compiler
ln -s /path/to/ccache ~/bin/gcc
ln -s /path/to/ccache ~/bin/g++
ln -s /path/to/ccache ~/bin/cc
ln -s /path/to/ccache ~/bin/c++
# no all you need to enable ccache is to prepend ~/bin to your PATH
$ export PATH=~/bin:$PATH

for both methody, you can add the "export ..." lines to your ~/.profile - that way you don't need to manually set it when building. You can still temporarily disable ccache (export CCACHE_DISABLE=1) in case you don't want to use it.

Since OOo is rather huge, you should increase the cache-size to 1 GB or more

ccache -M 1G
  • subversion version 1.5.4 or later

Since OOo's source code is managed using Subversion currently, you also need the svn client to checkout sources (otherwise you would be bount to source-tarballs that aren't generated that frequently). You can either compile yourself or use the subversion universal binaries from the subversion project Version 1.5.4 or later is required because of important fixes related to the merge-feature.

Get the source and prepare to build it

Get the source from SVN

You need about 4.7 GB for a checkout from the svn repository. Building the source requires another 5GB.

  • check out the latest source from svn
svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo

One-Time preparation and scripts

Apache OpenOffice build environment is configured using the open-source configuration-management package 'autoconf'. So you can do your beloved './configure' command, is now done in the main source directory.

To save the configure parameters and use them with different milestones it is useful to create your own build script to configure the environment and to trigger the build.

The directory structure when you have checked out the sources from svn looks like:

aoo/
aoo/main 
aoo/extras
aoo/test
aoo/ext_libraries
aoo/ext_sources

Move into main and configure a minimal environment to build your first version of Apache OpenOffice:

cd main

Run the autoconf command to prepare a new configure based on the latest changes in configure.in

autoconf

Run configure

./configure --without-stlport --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 --with-epm-url=http://www.msweet.org/files/project2/epm-3.7-source.tar.gz

This commands prepares a minimal environment to build the office without any category-b enabled external libraries. A pure Apache license compatible version. See also the configure switches --with-dmake-path and --with-epm to specify prebuilt versions of dmake or epm.

Finally you should run bootstrap to trigger further preparations and to create platform specific shell script to setup a working build environment. On Mac OS x for example MacOSXX86Env.Set.sh on a Intel based system.

Build environment with enabled category-b dependencies

To prepare a build environment that provides more features and make use of further external libraries which are under copyleft but viral licenses you have to explicitly enable this category-b components.

./configure --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 \
    --with-epm-url=http://www.msweet.org/files/project2/epm-3.7-source.tar.gz \
    --disable-build-mozilla \
    --without-stlport \
    --enable-verbose \
    --enable-category-b\
    --enable-wiki-publisher


Example build script to simplify user specific configurations

As mentioned before to save the configure parameters and use them with different versions it is useful to create your own build script to configure the environment.

Create 'build.sh' (to be written) :

#! /bin/bash

echo "### checking for unowinreg.dll ... "
if [ ! -e  ./external/unowinreg/unowinreg.dll ]; then
    wget -O external/unowinreg/unowinreg.dll http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll
else
    echo "  unowinreg.dll found" 
fi

echo "### checking for moz prebuild libs ... "
if [ ! -e  ./moz/zipped/MACOSXGCCIinc.zip ]; then
    wget -O ./moz/zipped/MACOSXGCCIinc.zip http://www.openoffice.org/tools/moz_prebuild/OOo3.2/MACOSXGCCIinc.zip
    wget -O ./moz/zipped/MACOSXGCCIlib.zip http://www.openoffice.org/tools/moz_prebuild/OOo3.2/MACOSXGCCIlib.zip
    wget -O ./moz/zipped/MACOSXGCCIruntime.zip http://www.openoffice.org/tools/moz_prebuild/OOo3.2/MACOSXGCCIruntime.zip
else
    echo "  moz prebuild libs found" 
fi

if [ ! -e  ./configure ]; then
    echo "### autoconf ..."
    autoconf
else
    echo "### autoconf ..."
    rm ./configure
    autoconf
fi

echo "### Configure"
./configure --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 --with-epm-url=http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz

#./configure --with-build-version="$(date +"%Y-%m-%d %H:%M:%S (%a, %d %b %Y)") - Rev. $(echo $(svn info) | sed -e 's/^.*Last Changed Rev: //g' -e 's/ .*//g')" \
    --disable-build-mozilla \
    --enable-verbose --enable- category-b --enable-minimizer --enable-presenter-console --enable-wiki-publisher \
    --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 \
    --with-epm-url=http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz

./bootstrap

Put this script into ~/bin and make sure it is executable :

chmod ug+x ~/bin/build.sh

We used the bash shell in all example, since to our belief users of the C-shell are smart enough to figure out the differences anyway. If you want to dig deeper into the build process, please have a look at the description OpenOffice.org's Build Environment.

Doing the build

After running configure and bootstrap we should have a working build environment and all necessary scripts should have been created. From now on you can use MacOSXX86Env.Set.sh to prepare a new shell with a working build environment.

On Mac Intel

source MacOSXX86Env.Set.sh
cd instsetoo_native
build --all 
or
build --all -P4 

On PowerPC

source MacOSXPPCEnv.Set.sh
cd instsetoo_native
build --all 
or
build --all -P2 

Comments on above

TODO TODO TODO ....

if you run into trouble with --dlv_switch (see: Issue 77360 )

The main purpose of the bootstrap script is to build (if necessary) the dmake utility used. Dmake once was a unix make-clone made by wticorp but got incorporated into OpenOffice since it was orphaned. For more information about dmake, it's history and manpage have a look here: http://tools.openoffice.org/dmake/index.html

Sourcing MacOSXPPCEnv.Set.sh is very important not only for building but also for running svdem later on. Here all the Environment-Variables for the Build will be set up. For a detailed description see Environment_Variables. Please note that on Intel machines, 'MacOSXPPCEnv.Set.sh' should be substituted with 'MacOSXX86Env.Set.sh'.

This Build process takes on my box (Dual 1.8 GHz G5, 1.5GB RAM) roughly 10 hours, and 3 to 6 hours on Mac Intel (3:30h on a 2GHz DualCore INTEL iMac). Be patient.

If you want to see how the progress on that build is you can use two build options to get a comfortable view:

build ... <see above> ... --html --html_path /Users/$USER/Sites

where $USER is your user name. Then you can load in Firefox (not Safari!) the HTML file unxmacxi.pro.build.html via the in Mac OS X included Apache web server or diretctly form the directory /Users/$USER/Sites/. This file is automatically being updated and is showing the status of the build and also the time needed since the build started.

If you build on Snow Leopard (aka Mac OS X 10.6): Set DYLD_INSERT_LIBRARIES to point to the correct libsqlite3.dylib:

DYLD_INSERT_LIBRARIES=/usr/lib/libsqlite3.dylib

Installing, preparing and running OpenOffice.org

Find the Bundle

Once the build completed, the final product ( en-US version ) is named : OOo_3.0.0_*_MacOSXIntel_install.dmg ( for version 3.0beta e.g.)

And is located in instsetoo_native/unxmacxi.pro/OpenOffice/dmg/install/en-US directory ( replace en-US with your locale )

Bundle Location3.0beta.jpg

Install the new Build

  • double-click on the *.dmg icon
  • drag the OpenOffice icon into a folder of your choice

Run the new Build

  • double click the application icon in that folder

Screenshots

Now you can start to work with this amazing productivity suite.

Contribute by finding, isolating, debugging or solving issues

Isolate a problem

Reduce a problem

  • make a problem reproducable
  • reduce it to a test case that is as small and simple as possible
  • if a problem is specific to a document then please attach it to the issue. A mininal excerpt of the document that still shows the problem is even better.
  • a screenshot of is a good idea if it clearly shows the problem

Using application switches

Application switches are often valuable for isolating a problem. Most of OpenOffice.org's options can be found its Tools->Options menu.

Some switches are so special that there is no user interface to change them. They are only useful for debugging and isolating a problem, but they are very valuable a that. So a developer might suggest to isolate a problem by setting an environment variable before running the application. E.g. for isolating problems with the menubar a developer might suggest to set the environment variable AQUA_NATIVE_MENUS to false. This is done by typing these commands into a terminal:

  • cd <INSTALL_DIR>/OpenOffice.org/Contents/MacOS
  • export AQUA_NATIVE_MENUS=false
  • ./soffice.bin

Provide a call stack for crash problems

Please note that bugs involving crashes should provide a description of how to reproduce the problem and a callstack. There are several ways to provide the callstack:

  • the preferred method is to use OOo"s builtin crash reporting tool
  • developers may provide a gdb backtrace of the problem
  • if the above two methods don"t work then please attach a file with the details provided by the AppleCrashReporter

Check against known issues

Check the list of open issues

Report a new issue

Report new issues after you have isolated the problem

Debug a problem

Debugging problems is often easier in an development environment:

Please note that XCode still has some problems with the executable named soffice.bin (because of the dot in the name). The issue has been reported to xcode-users list.

Current Work in progress (Aqua specific work only)

With OOO300 the Aqua port became a mainstream port, so most Aqua issues are handled in regular GSL-Layer childworkspaces instead of dedicated Aqua CWSses. Other CWSses that are purely Aqua specific are being tracked below:


Child WorkSpaces in development

All patches that developers have that need testing or peer review should be added here.

Child WorkSpaces in testing (closed for development)

  • CWS quicklookplugin01   : a plugin for the QuickLook system available in MacOSX from versions 10.5 onwards

Child WorkSpaces waiting for integration

  • CWS DEV300 appleremote02   : improve the Apple Remote use with Impress (use MEDIA_COMMAND stuff, improve code robustness, and portability )

Child Workspaces integrated into OpenOffice's trunk

A historical overview of old Aqua specific ChildWorkspaces.

Known build issues

  • Tiger: no known issues
  • Leopard: no known issues
  • Snow Leopard: no known issues
  • Lion: no known issues
  • Mountain Lion: no known issues

External links

Personal tools