Documentation/Building Guide/Building on MacOSX

From Apache OpenOffice Wiki
Jump to: navigation, search
Please note the new Master Work space (MWS) is now DEV300, means DO NO LONGER USE SRC680


This document tries to wrap-up the build process for OpenOffice.org on Mac OS X using the native windowing-toolkit of the platform named Aqua.

Prerequisites

This document was derived from the description of the X11 build thanksworthy provided by Eric Hoch in this document: MacOSXBuildInstructions.

Here we would like to outline the things you need to build the Aqua Version (besides the OS).

Mandatory

Mac OS X version

=> Minimal version for AquaBuild is Mac OS X 10.4 (aka Tiger).

If you are building on Mac OS X 10.5 (aka Leopard), you will need to be aware of User:Dyrcona/LeopardBuild#flex.

Xcode

This is the only mandatory part to be installed to build Aqua version of OpenOffice.org.

Current verified working version is XCode 2.4.1. Older are deprecated.

Java

Aqua version of OpenOffice.org does not build yet using Java SDK 1.6.0.

Please use either J2SDK 1.4.2 or 1.5.0

To change the Java version -> go into folder : Applications -> Utilities -> Java and modify.


Else, you'll meet unfixed build breakers (patches are welcome anyway)

Note: If you are interested in helping us with Java 1.6 a patch which enables the build using java 1.6 is available here. e.g. several known build issues have to be fixed e.g. hsqldb, but probably other modules are concerned.

Be aware that it may impact important work and/or incompatibilities will occur. Feel free to submit your patches at mac@porting mailing list.

gperf

You need a build of [gperf] in your path for some modules.

Strongly recommended

ccache

If you intend to build OpenOffice.org 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/

In order to use ccache you need to change the following environment variables assuming you're using bash, and just before doing configure command line:

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

Everything is installed ? Now build it...



=> Current Milestone is m20, and current MWS is DEV300



Getting the code (checkout, merge and patch the puppy)

Create a directory for a given milestone, setup CVS access:

mkdir DEV300_m20
cd DEV300_m20
export CVSROOT=":pserver:anoncvs@anoncvs.services.openoffice.org:/cvs"
cvs login
(password is 'anoncvs' )  + Enter

Note: The source should be downloaded to a path that does not contain any spaces, otherwise compiling might be troublesome.

checkout DEV300 (Master workspace since 3.0 branch creation) (1,5 GB):

cvs -z3 co -r DEV300_m20 OpenOffice3 swext apache-commons tomcat hyphen  # don't forget the "3" !! 

Once done, you'll obtain milestone m20 from DEV300 Master workspace

Important: other are for missing alias caused breakages at buildtime

Additional dependencies for current Milestone builds

prebuilt Mozilla archives

To enable the use of macros (disabled by default for security reasons), you'll have to put the prebuilt archives of mozilla binaries in moz/zipped directory after renaming them properly.

Note: archives are Universal Binaries, and you'll have to rename them, depending on your architecture (either Intel or PowerPC)

Archives to be downloaded :

http://eric.bachard.free.fr/mac/moz/sb83/UB/MACOSXGCCUinc.zip

http://eric.bachard.free.fr/mac/moz/sb83/UB/MACOSXGCCUlib.zip

http://eric.bachard.free.fr/mac/moz/sb83/UB/MACOSXGCCUruntime.zip


IMPORTANT : if you want to build OpenOffice.org on Mac OS X using SRC680 sources or DEV300 before sb83 integration (means before DEV300_m4) ,

you MUST use the mozilla archives below :

http://tools.openoffice.org/moz_prebuild/680/MACOSXGCCUBinc.zip

http://tools.openoffice.org/moz_prebuild/680/MACOSXGCCUBlib.zip

http://tools.openoffice.org/moz_prebuild/680/MACOSXGCCUBruntime.zip


If you want to build using them on PowerPC or Intel architecture (with Tiger) please rename them this way  :

Archive Name in Intel architecture Name on PowerPC architecture
headers MACOSXGCCIinc.zip MACOSXGCCPinc.zip
runtime MACOSXGCCIruntime.zip MACOSXGCCPlib.zip
libs MACOSXGCCIlib.zip MACOSXGCCPlib.zip


As you can see, P means PowerPC, and I means Intel (replacing U or the UB (it depends on the builder) in the original name)

.. and put them into <ooo build directory>/DEV300_m20/moz/zipped Once done, you'll obtain milestone m20 from DEV300.

OpenOffice.org should detect and use them if you respect the configure command line as described in Milestone build.

One-Time preparations and scripts

OpenOffice.org's build environment is configured using 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/
DEV300_m20/ 
DEV300_m18/
DEV300_m0/
SRC680_m248/
...

Now I go to the 'config_office' subdir and link in my startscript:

cd DEV300_m20/config_office/
ln -s ../../bin/build.sh


And this is how 'build.sh' (to be written) looks like :

#!/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="en-US de fr" \
--disable-odk \
--disable-pasf \
--disable-gtk \
--disable-headless \
--disable-build-mozilla \
--with-build-version=$OOVERSION-`date +%d-%m-%y` \
--disable-fontconfig \
--without-nas \
--with-use-shell=bash \
--with-jdk-home=/System/Library/Frameworks/JavaVM.framework/Home \
--with-stlport=no \
--disable-mediawiki \
--enable-werror \ 
--disable-vba

Note :

--disable-vba since sb87 (was building by chance only)

--disable-mediawiki because ant version requirement to build the swext is now 1.7.0

--disable-neon has been removed since m217   resync. See Issue 78206 --disable-neon breaks aqua build

--disable-odk : disables SDK build, and 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.

--without-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.

--disable-build-mozilla: will disable the mozilla build (in the moz module), but mozilla pre-built archives will be used instead (they are mandatory to enable the macro security configuration dialog (see Issue 79885 ).

--enable-dbgutil: add this option to enable assertions and other functionality useful for debugging

--with-jdk-home must be set as above with XCode 3.0

--with-stlport=no uses Apple's built-in STL, but will cause some warnings

Doing the build (about 4,5 GB)

Fine, now we have a (hopefully) working 'build.sh' in the config_office subdir. We need to run it beforehand:

cd DEV300_m20/config_office/

./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'.

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:

Mac Intel

cd ..
./bootstrap
source MacOSXX86Env.Set.sh
cd instsetoo_native
export TMP=/tmp
export SYSTEM_OPENSSL=YES

+

build --all -P4 --dlv_switch -link --dontgraboutput

or

build --all -P4 

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

On PowerPC

cd ..
./bootstrap
source MacOSXPPCEnv.Set.sh
cd instsetoo_native
export TMP=/tmp
export SYSTEM_OPENSSL=YES

+

build --all -P2 --dlv_switch -link --dontgraboutput

or

build --all -P2 
Comments on above

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.

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_080312_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



Run the soffice.bin

In one line :

Double click the .dmg , drag the OpenOffice.org icon in the folder you want, and double click to run it !!


Note : soffice.bin leads XCode to not work (because of the dot in the name). The issue has been reported to xcode-users list.

We're nearly through, let's fire-off the binary:


But a lot has to be done, and if you want to trace (using gdb e.g.), just do:

cd <INSTALL_DIR>/OpenOffice.org/Contents/MacOS

and run:

gdb --args soffice.bin

(add any breakpoint you want)

r to run OpenOffice.org

Use vcl menubar and / or vcl menus

Native menus are defaults. If you want to use vcl menus, do:

AQUA_NATIVE_MENUS=FALSE ./soffice.bin

Note: options to not recover is -norestore , and to bypass the user informations to fill in, use -nofirststartwizard

AQUA_NATIVE_MENUS=FALSE ./soffice.bin -nofirststartwizard -norestore

You can also insert environement variables in a Dictionary Class of Info.plist located in the Contents directory of OpenOffice.org bundle.

For example, you can add the following XML in a text editor (or make it generated by Property List Editor) in your Info.plist :

  <key>LSEnvironment</key>
  <dict>
      <key>AQUA_NATIVE_MENUS</key>
      <string>TRUE</string>
      <key>OOO_DISABLE_RECOVERY</key>
      <string>TRUE</string>
      <key>SAL_NO_NWF</key>
       <string>TRUE</string>
  <dict>

Notice that in order to work, the OOO_DISABLE_RECOVERY variable detection must be manually inserted in OOo code using the following patch : http://www.go-oo.org/patches/src680/disable-recovery.diff

This patch is outdated, but you can make the modifications yourself.


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:

Variable Function
SAL_NO_NWF=TRUE disable native controls code
AQUA_NATIVE_MENUS=FALSE disable 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.

Debug and contribute

Reporting and solving bugs

[ http://qa.openoffice.org/issue_handling/pre_submission.html Reporting bugs]

Open issues

Important links for Cocoa development

AquaBuild/Cocoa Informations <== Additionnal informations for advanced developers

Cocoadev Pierre Chatelier page about C++ to Cocoa conversion

Note: .pdf available in both english and french versions. Excellent.

(Outdated): To give a kickstart in the coding involved to get VCL ported to Carbon, please have a look at the excellent Pierre de Filippis Intro To Mac Porting.

We use the bash shell in all examples, 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 of the build environment here: OpenOffice.org Build Environment.

Current Work in progress

Developers are working on the following Child WorkSpaces (only CWS dedicated to the Aqua port)

Closed for development

Concerned modules : extensions scp2

Integrated

Integrated in m20 DEV300 

Integrated in m15 DEV300 

Integrated in m8 DEV300 

Integrated in m6 DEV300 

Integrated in m2 DEV300 

concerned modules : automation avmedia connectivity default_images desktop filter framework

instsetoo_native jvmfwk lingucomponent officecfg sal sc scp2 sfx2 shell vcl

Concerned module : fpicker sfx2 solenv svtools

Concerned modules: offapi, vcl, sfx2, svtools, sw

Integrated m248  

Concerned modules : dtrans svtools vcl

Integrated m247  

Remove a few Mac OS X specialties

Concerned modules: desktop instsetoo_native scp2 setup_native solenv sysui vcl

Integrated in m243  

  • CWS SRC680 stl4leopardppc   : allow OpenOffice.org to be built on Mac OS X 10.5 PowerPC using system stl, using --without-stlport4 configure option.

If possible, continue with other builds (Leopard / Tiger Intel and PowerPC).

Concerned modules : connectivity, cosv, fpicker, autodoc

concerned modules : desktop vcl rsc shell svx sw solenv instsetoo_native


Integrated in m239  

Concerned modules : avmedia scp2 vcl


Integrated in m238  

Concerned module : instsetoo_native


Integrated in m237  

Concerned modules : sw , solenv

Concerned modules : idlc soltools jvmfwk extensions stlport

Integrated in m233  

concerned module : readlicense_oo

Integrated in m233  

concerned modules are desktop, instsetoo_native, solenv, svtools, vcl

Concerned modules: extensions, scp2


Integrated in m229  

concerned modules are : scp2, dbaccess, extensions, connectivity

Concerned modules: lingucomponent, solenv

concerned modules are : desktop, vcl, fpicker, libxmlsec, xmlsecurity, basic


Integrated in m228  

Concerned modules: np_sdk


Integrated in m227  

concerned module: instsetoo_native

Integrated in m223  :


Integrated in m222   :

Integrated in m221  :


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

Known build issues

  • Panther build (X11 only) : currently broken ( work in progress )

Since latest resync, no build issues have been reported.


  • Tiger: no problem nor for X11 nor Aqua versions (main baseline)


  • Leopard Intel : builds OK now. Build is broken in cppu for PowerPC architecture, and builds fine using --without-stlport4 flag
  • Native FilePicker is fixed (aquafilepicker02 + pl fixed repaint issue )
  • Lot of warnings in vcl, due to other deprecated stuff




External links

  1. Bug Database
  2. Mailinglist: mac@porting.openoffice.org (subscribe is mandatory )
  3. IRC Meeting-Logs (#ooo_macport@freenode.org): Previous_Mac_Meeting_logs MacOSXPortMeetings
  4. TX20: http://eric.bachard.free.fr/UTBM_TX20/reports/Carbon_vcl.pdf
  5. OpenOffice Source Directory Structure: http://wiki.services.openoffice.org/wiki/Source_code_directories
  6. Pavels Patch Wiki: http://blog.janik.cz/
  7. Eric Bachard Wiki: http://wiki.services.openoffice.org/wiki/User:Ericb
  8. Sebastien Plisson Wiki: http://splisson.blogspot.com/
  9. Christian Lippka Wiki: http://wiki.services.openoffice.org/wiki/User:CL
  10. Carbon: http://developer.apple.com/carbon
  11. EIS: http://eis.services.openoffice.org/EIS2/servlet/Logon
  12. Runtime Configuration: http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/index.html
  13. OpenOffice Domain Developer http://wiki.services.openoffice.org/wiki/DomainDeveloper
  14. Nakata Maho's package build service http://ooopackages.good-day.net/pub/OpenOffice.org/MacOSX/

Screenshots

  1. Eric Bachard screenshots (some are from Stephan Schaefer) http://eric.bachard.free.fr/mac/aquavcl/screenshots/
  2. Most recent: http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/
  3. Pavel Janik screenshots http://blog.janik.cz/images/MacOSX/2006-08-10
  4. Important screenshot (eventloop issue): http://blog.janik.cz/images/MacOSX/ => See: OOoMenus-separator-and-disabled_entries.png
  5. current Aqua look (taken from CWS aquavcl05):

File:Aqualook.png

More menus: http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/index.html

Personal tools