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

From Apache OpenOffice Wiki
Jump to: navigation, search
m (checkout Aquavcl01 (50 MB):)
('''Doing the build (about 4,5 GB)''')
Line 214: Line 214:
 
Fine, now we have a (hopefully) working 'build.sh' in the config_office subdir. We need to run it beforehand:
 
Fine, now we have a (hopefully) working 'build.sh' in the config_office subdir. We need to run it beforehand:
  
  cd SRC680_m214/config_office/
+
  cd SRC680_m217/config_office/
 
  ./build.sh
 
  ./build.sh
  

Revision as of 22:14, 25 June 2007

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.


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.

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

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

If you really cannot use XCode 2.4.1 nor XCode 2.4:

Xcode 2.2, 2.3 are known to work for Aqua development. If any earlier versions work as well, please add them here.

X11SDK (soon optional)

A dependency for Mozilla plugin needs some prototype defined in some Xlib.h header.

Please note, this dependency is not needed in runtime, but only at buildtime.

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

This issue should be fixed soon.

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 -> go into folder : Applications -> Utilities -> Java and modify.

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

Strongly recommended

ccache

If you intend 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".

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

Then, in order to use it, you need to change the following environment variables using bash, and just before doing configure command line:

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




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

aquavcl01 cws does use SRC680 master workspace, and is regularly resynchronized with recent milestones.

The current_milestone is m217 as of now (June 25th 2007)


All these milestone numbers below highly depend on the given point-in-time. You can find 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:

[bash,N]

mkdir SRC680_m217
cd SRC680_m217

export CVSROOT=":pserver:anoncvs@anoncvs.services.openoffice.org:/cvs"
cvs login

(password is 'anoncvs' ) + Enter [bash,N] Note: The source should be downloaded to a path that does not contain any spaces, otherwise compiling might be troublesome.

checkout milestone m217 (1,5 GB):

[N]

cvs -z3 co -r SRC680_m217 OpenOffice2

Once done, you'll obtain milestone 217. 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):

1) First possibility: create a dedicated tree (cool backup)

To check aquavcl01 Child workspace, the most simple is to create aquavcl01 directory, and go inside this dir [bash,N]

mkdir aquavcl01-src 

cd aquavcl01-src

(assuming you already did cvs login, and typing all the command line below in one line)

[bash,N]

cvs -z3 co -r cws_src680_aquavcl01 basebmp boost canvas desktop dtrans extensions framework fpicker \

               freetype instsetoo_native padmin psprint sal scp2 sfx2 sj2 solenv sot svtools toolkit vcl

All the modules listed above will be present at the end ( everyone represents a new directory ) and they are the ones we modified to create the native version.

To verify nothing's wrong, 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_m217 and replace them with the one located in aquavcl01-src.

e.g. : canvas in SRC680_m217 will become canvas_m217 , and then, cp canvas from aquavcl01-src into src_m217

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_m217 will contain: [bash,N]

  1. !/bin/bash

list="basebmp boost canvas desktop dtrans extensions fpicker framework freetype instsetoo_native \ padmin psprint sal scp2 sfx2 sj2 solenv sot svtools toolkit vcl" for i in $list ; do

  mv $i $i_m217
  cvs -z3 co -r cws_src680_aquavcl01 $i

done

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_m182/
SRC680_m196/
...

Now I go to the 'config_office' subdir and link in my startscript: [bash,N]

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

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

[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-epm=internal \
--disable-mozab \
--disable-odk \
--disable-pasf \
--disable-gtk \
--disable-headless \
--disable-mozilla \
--with-build-version=$OOVERSION-`date +%d-%m-%y` \
--disable-fontconfig \
--without-nas

Note : --disable-neon has been removed since m217 resync. See issue : [--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.

This is allowedly a pretty much limited setup for now, but it will progressively change, with the progress we'll do with Aqua port.

List of Patches requiring testing before for integration

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

Note : Aqua FilePicker should be integrated soon, and add it is not adviced since the current resync for AquaFilePicker01 (m216) does not match with Aquavcl01 anymore ( resynchronized with m217). Mix them will cause build issues ( ubc/ucbhelpers changes )

Known build issues

Since latest resync, no build issues have been reported.

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 SRC680_m217/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:

On PowerPC:

cd ..
./bootstrap
source MacOSXPPCEnv.Set.sh
cd instsetoo_native
build --all -P2


Or (on Mac Intel):

cd ..
./bootstrap
source MacOSXX86Env.Set.sh
cd instsetoo_native
build --all -P4

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' should be substituted with 'MacOSXX86Env.Set'.

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. Be patient.

Installing, preparing and running OpenOffice.org

Find the Bundle

Once the build completed, the Final product ( en-US version ) is named : OpenOffice.org-2.3.0_en-US.dmg ( for version 2.3.0 e.g.)

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

File:Bundle location.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\ 2.3.app/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

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

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. Aqua look (the begining):

combobox_search_and_replace02_14mars07.jpg

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

Personal tools