Mac OS X Build Instructions (X11)

From Apache OpenOffice Wiki
Jump to: navigation, search

This page is archived for historical reasons only. It is no longer maintained and information may not be current.

OpenOffice has become a native Mac OSX application many years ago, so page this is obsolete as it is about the former X11 based build. If you want to build the native version, please have a look at AquaBuild

For historical reasons, there is also Mac OS X Build Instructions of SRC_m71

Note: supported compilers for Mac can be found in Compiler versions used by port maintainers and release engineers

Other Mac OS X related Wiki pages.

Building X11 for Mac OS X PPC and Mac OS X x86

Authors: Eric Hoch

Revised 2006-01-23


These build instructions are based upon milestone 680_m140 and higher.

Due to the nature of a port in progress this document cannot give a general overview of all the current patches necessary to build a specific milestone. To get this information we recommend you to subscribe to our porting mailing list

There you'll get all the latest information about patches and everything else related to and needed to port to the Mac.

Special Thanks

Before we begin let me thank all the people without whom these build instructions would make no sense, the coders who are helping to bring OOo 2.0 to Mac OS X. The coders and supporters behind the Mac port are:

   Eric Bachard
   Thorsten Behrens
   Etsushi Kato
   Florian Heckl
   Pavel Janik
   Nakata Maho
   James McKenzie
   Tino Rachui
   Stephan Schäfer
   Eric Hoch
   Shaun McDonald


   * The fastest machine you can find. It'd be good if it had memory, too.
   * Mac OS X 10.3.5 or Mac OS X 10.4.x including all the latest available Security Updates for 
     your version of Mac OS X
   * on Mac OS X 10.3.x: XCode 1.5 plus November 2004 gcc 3.3 Update for 
   * on Mac OS X 10.4.x: XCode 2.1
     Note: You can get both applications after a free registration at
   * JDK 1.4.2 plus latest SDK Updates (with full JDK SDK for the headers)
   * an installed X-Server. We recommend Apple's X11 but you can also use the ones of or Xfree86
   * You need a version of [gperf] in your path for some modules
   * A minimum of 4 to 5GB for a standard build. 
     Note: Usage of disk space depends upon the number of localizations you build for. 
     More localizations means more disk space needed.
     A minimum of 18GB for a full debug build.
   * If you can afford it we recommend you to backup clean sources and work with a second set of sources.
     With a second set of clean sources you can easily go back to clean sources if a module doesn't build, 
     a patch doesn't solve the problem, you have to revert a patch or for any other reason there may be. 
     In the meantime cvs sources could have been edited and you need to recompile more modules then just 
     one and that's probably not what you want...

Determine the shell you use for compilation

The default shell of a cleanly installed Mac OS X 10.3.x/Mac OS X 10.4.x is bash. If you did an update to 10.3.x or 10.4.x from early versions of Mac OS X while keeping your personal settings you may still use the tcsh shell, the default shell of Mac OS X 10.0 to 10.2.x.

Where necessary this read-me distinguishes between bash and tcsh.

To determine the shell you currently use open and type the following command:

ps -p $$

The output shows you which shell you're currently using.

-/bin/bash or -bash means you are using bash

-/bin/tcsh or -tcsh means you are using the c-shell

Getting and External Sources

Getting Source from CVS

Once you have X properly installed, it's time to get the sources and other external sources. If you've built from previous sources and have applied other patches, you will need to start from scratch with a fresh CVS version of the sources.

Download the CVS distribution for SRC680_mXXX (replace XXX by the current milestonenumber):

  1. Open a new Terminal (/Applications/Utilities/Terminal)
  2. mkdir 680_mXXX/source
  3. cd 680_mXXX/source
  4. Now set the CVSROOT
         * for bash do:
         * for tcsh do:
           setenv CVSROOT
  5. cvs login
  6. Enter the password anoncvs
  7. cvs -z3 co -r SRC680_mXXX OpenOffice2
     for later milestones simply replace the XXX with the most current milestonenumber
  8. go get some coffee, or a beer, since it'll take a while to get it all 

Note that if your computer is behind a firewall and you're trying to get the sources from the CVS server, you may need to find a proper way to get it to tunnel through the firewall. The protocol runs on port 2401, and some firewalls will not allow communication on this port.

Attention: We recommend a broadband connection and a not too small amount of volume or time left within your contract since the sources are about 300MB and the checkout could take up to an hour or longer depending on the server load.

For further information on this topic see get the source

To get a second copy of the sources use the following commands within your 680_mXXX directory:

  1. cd ..
  2. mkdir build
  3. cd build
  4. cp -R ../source/* .

Additional software that's not in the official sources

Now that you have the sources it's time to get the software that is not in the official OOo Source Code Tree.

   * The perl module Archive::Zip
   * gpc - optional - NOT NEEDED
   * pkg-config
   * gtk2 - optional - not needed
   * X11
   * unowinreg.dll

To install Archive::Zip use the following commands in

  1. perl -MCPAN -eshell
  2. install Archive::Zip

If this is your first installation of a module using CPAN you're asked to configure the CPAN environment. If you're not 100% sure what to answer simply accept the default answers.

Note: In some cases using CPAN with Mac OS X is a bit problematic. In this case simply follow the instructions given here on this website to solve the problem.

GPC is available here:>

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.

Since OS X comes with no pkg-config, or to be more specific it's simply not complete in OS X, you have to install it via fink (, MacPorts ( or the gentoo port system (

If you need cups headers (on Mac OS X 10.3., building reports "cups.h missing"), then download them from and put the headers to "/usr/include/cups".

If you want to compile with gtk2 support you have to install gtk2 via your porting_mechanism Note: The most current versions of gkt2 and pkg-config are in about 90% of all cases only available as sources that you need to compile and not as binaries. Please consider this while preparing your mac.

Additional Note for fink users: You need to install both packages gtk2 and gtk2-devel using fink install </package name>

Yes, there are other porting mechanisms out there such as the one of NetBSD or you can get precompiled versions of gtk, gnu_copy and pkg-config via pages like osxgnu but the author of these build instructions has no experiences with these so no recommendation for them here.

Note: If you need help with installing or maintaining packages please contact the project that provides the porting_mechanism.

It's also possible to compile pkg-config, gnu_copy as part of the gnu-coreutils and gtk2 without fink or Macports. Be aware that in this case you need to resolve the various dependencies yourself. So we recommend using one of the porting mechanisms.

Because OS X does not install X11 by default and up to now you haven't installed one, now may be the time do so. There are various X for Mac OS X out there e.g. Apple's X11,'s XDarwin or simply use your porting_mechanism to install either 6.8.x or Xfree86 >=4.3. For help with your X11 please contact the provider of the package or your porting mechanism project

By default OOo builds an Office Development Kit. This ODK requires you to download the unowinreg.dll from here

Preparing to Build

Adding gpc to OOo sources

  1. uncompress <path to gpc>/gpc231.tar.Z
  2. tar xvf <path to gpc>/gpc231.tar
  3. cp <path to gpc>/gpc.[hc] <ooo source directory>/build/external/gpc/
  4. rmdir gpc231

Adding unowinreg.dll to OOo sources

Copy the downloaded unowinreg.dll to <ooo source directory>/build/external/unowinreg/

Applying Patches

To apply a patch cd into the direcotory for the module which needs to be patched and do a: patch -p0 <path/to/the patch>

Most of the patches use the naming scheme modul_(subdirectory_subdirectory_etc)_filetopatch.patch.

To find all current patches do a search for issues in component subcomponent MacOSX.

You can grab the patches necessary to avoid the freetype crash from my idisk public folder

Due to the fact that not all the patches are from one author it's sometimes necessary to change to the subdirectory/ies or not. In this case the patch knows which subdirectories to jump over.


Now that we've got it all the source, it's time to execute the build!

  1. Open up a new Terminal.
  2. Configure for your build
  3. cd <path to ooo>/680_mXXX/build/config_office
  4. ./configure --with-x --with-lang="de fr en-US"
     --disable-build-mozilla --disable-neon --disable-gtk
     Instead of using --with-freetype2=... you can also use --with-system-freetype
     Attention: Darwinports gnu_copy is named gcp to avoid conflicts with Mac OS X cp
     If you want to build with gtk-support please add --with-gtk2 to your configure script
     and/or want to use your own apache-ant add --with-ant-home=<your path>/680_mxx/apache-ant-1.6.5
  5. If configure fails it will output an error message saying what's missing or 
     what else causes it's breakage.
     Be sure to also check the warnings configure outputs at the end of the configuration process.
     Please report any breakage here with the error message output to
  6. cd ..
  7. ./bootstrap
  8. Set up your shell build enviroment:
         * for bash do:
           PPC: source
           Intel: source
         * for tcsh do:
           PPC: source MacOSXPPCEnv.Set
           Intel: source MacOSXX86Env.Set
  9. dmake
 10. Report any and all build failures to mail list
 11. cd instsetoo_native/
     Within this directory you will find a folder for each language that
     you build for. Those folders contain the installation disk images.

Additional Information for Macports Users

When using Darwinports be sure to use ./configure without freetype since it leads to crashing with a version mismatch error when using Macport's freetype. You will find the additional patches needed to build freetype within in the subdirectory freetype2_patches of the patch archive.

Using Mozilla within

If you decided to use Mozilla packages to get special functions provides you, as I did in the example configure script, you have two choices to get them:


You let compile them. Be aware that this adds additional tim to your compiling time.

If you decide to let compile Mozilla remove --disable-build-mozilla from the ./configure script and will compile Mozilla within the moz directory.

  1. Before building Mozilla be sure to download Mozilla Sources. You can get them e.g. here:
  2. cp mozilla-source-1.7.5.tar.gz <your path>/680_mXXX/moz/download
  3. cd <your path>/680_mXXX/moz
  4. cd config_office
  5. Use the same ./configure script out of but this time remove --disable-build-mozilla
  6. Continue with Step 5 of the "Building" paragraph should now compile mozilla within its build process.


You grab the Mozilla packages for PPC here: and put them into <ooo build directory>/680_mXXX/moz/zipped should detect and use them.

Please use the Mozilla packages from these libraries are universal binaries. If you want to build using them on PPC architecture (with Tiger) please rename them this way  :

Archive Name in Intel architecture Name on PowerPC architecture

As you can see, P means PowerPC, and I means Intel

Building the whole suite or just a single Project with Debug Information

To build the whole Suite with debug informations add --enable-debug to the configure command.

To rebuild a complete project with debug information, remove all object files by removing the directory. Then run dmake with the debug option set to true:

   cd $SRC_ROOT/(module-name)
   $SRC_ROOT/(module-name)> rm -rf
   $SRC_ROOT/(module-name)> build debug=true
   $SRC_ROOT/(module-name)> deliver
Personal tools