Difference between revisions of "Documentation/Building Guide/Building on MacOSX"
(→Native menus, native menubar) |
(→Native menus, native menubar) |
||
Line 317: | Line 317: | ||
We're nearly through, let's fire-off the binary: | We're nearly through, let's fire-off the binary: | ||
− | |||
If you only want to test, just double click the Bundle and enjoy. | If you only want to test, just double click the Bundle and enjoy. |
Revision as of 08:18, 28 April 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.
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 purpose 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.
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.
Contents
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.
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)
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 (April 11th 2007) is m208. You may change this to your needs. 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-m208 cd src680-m208 export CVSROOT=:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs cvs login
(password is 'anoncvs' ) + Enter
checkout Milestone m208 (1,5 GB):
[bash,N]
cvs -z3 co -r SRC680_m208 OpenOffice2
Once done, you'll obtain milestone 208. 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 ..etc)
[bash,N]
cvs -z3 co -r cws_src680_aquavcl01 OpenOffice2
The following modules will be present at the end:
canvas
extensions
fpicker
padmin
sal
scp2
sfx2
solenv
dtrans
freetype
psprint
sj2
vcl
toolkit
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-m202 and replace them with the one located in aquavcl01-src.
e.g. : canvas in src680-m208 will become canvas_m208 , and then, cp canvas from aquavcl01-src into src-m208
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-m208 will contain:
[bash,N]
- !/bin/bash
list="canvas extensions fpicker padmin scp2 sfx2 solenv dtrans freetype psprint sj2 vcl sal toolkit" for i in $list ; do
mv $i $i-m208 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-m208/config_office/ ln -s ../../bin/build.sh
And this is how 'build.sh' 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-mozilla \ --with-build-version=$OOVERSION-`date +%d-%m-%y` \ --disable-fontconfig \ --disable-neon \ --without-nas
--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.
--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, 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 requiring testing before for integration
All patches that developers have that need testing or peer review should be added here.
salatslayout.cxx: new implementation of text layout has to be tested.
Native FilePicker
Note: This is experimental stuff, and we suppose aquavcl01 is built and aqua bundle works (X11 backport in progress)
1) Download this patch
2) put it in your root sources dir
3) apply it:
test first:
patch --dry-run -p0<aquafilepicker01_complete2.diff
If no problem occurs, apply it for true:
patch -p0<aquafilepicker01_complete2.diff
4) replace fpicker from aquavcl01 with fpicker from aqufilepicker01
mv fpicker fpicker_aquavcl01
(supposing your CVSROOT ..etc is correct)
cvs -z4 co -r cws_src680_aquafilepicker01 fpicker
5) in scp2, sfx2, fpicker: remove unxmacx{p | i}.pro , rebuild and deliver
6) recreate a new bundle (build instsetoo_native , install the .dmg )
7) activate native fpicker:
WARNING: don't use Mac tools for that, but correct text editor. Else the following changes will FAIL, and corrupt your OpenOffice.org preferences
-> add or adjust this, keeping in mind only one Misc section can be used (but several properties are possible in Misc):
<node oor:name="Misc"> <prop oor:name="UseSystemFileDialog" oor:type="xs:boolean"> <value>true</value> </prop> </node>
in ~/Library/Application Support/OpenOffice.org/2/user/registry/data/org/openoffice/Office/Common.xcu
If unsure, make a backup of your file and use this: Common.xcu
8) enjoy:)
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-m202/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 time dmake
Or (on Mac Intel):
cd .. ./bootstrap source MacOSXX86Env.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
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. Be patient. What can you do meanwhile? Do this:
[bash,N]
while true ; do find . -maxdepth 1 -type d -anewer MacOSXPPCEnv.Set.sh |wc -l ; sleep 5; done
and wait till the number reaches 174
Debug
Installing, preparing and running OpenOffice.org
Run the soffice.bin
We're nearly through, let's fire-off the binary:
If you only want to test, just double click the Bundle and enjoy.
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/program
and run:
gdb --args soffice.bin
(add any breakpoint you want)
r to run OpenOffice.org
Note: see below for other possible options
Warning : if you applied Ericb's patch, program does not exist anymore, because the next changes are about creat the exact tree awaited by Mac OS X for any regular application :
<instal_dir>/OpenOffice.org\ 2.3.app/Contents/MacOS
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
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.
External links
- Bug Database
- Mailinglist: mac@porting.openoffice.org (subscribe is mandatory )
- IRC Meeting-Logs (#ooo_macport@freenode.org): Previous_Mac_Meeting_logs MacOSXPortMeetings
- 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/aqua_menus_05_nov_06/
- 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
- Aqua look (the begining):
More menus: http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/index.html