Mac OS X Build Instructions (X11)

From Apache OpenOffice Wiki
Revision as of 08:22, 30 December 2006 by Pmsyyz (Talk | contribs)

Jump to: navigation, search

The current build instructions also at: Those are being moved to this page at OOo Wiki.

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 on Darwin PPC

Authors: Eric Hoch

Revised 2006-01-15


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 informations we recommend you to subscribe to our porting mailing list

There you'll get all the latest informations 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 those build instructions would make no sense, the coders that help bringing 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


   * 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
   * 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 recommand 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 serverload.

For further informations 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
   * Apache Ant - optional - not needed
   * gpc
   * pkg-config
   * gnu_copy
   * cups headers (for those building on Mac OS X 10.3. Panther) 
   * gtk2 - optional - not needed
   * X11

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

You can grep Apache Ant 1.6.5 here: Attention: Direct Link to the download site. Before the download starts you need to choose a mirror. The size of Apache Ant is about 6.4MB.

After the download put Apache Ant into the following directory: <your path>/680_mxx/apache-ant-1.6.5

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 (, Darwinports ( or the gentoo port system (

Begining with m101 for Mac OS X gnu_copy is needed to copy files within the build process of OOo. Please use your porting mechanism to install gnu_copy. For Darwinports the package name is coreutils, for fink it's fileutils.

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 Darwinports. Be aware that in this case you need to resolve the various depencies yourself. So we recommand 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

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

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.

Additional steps for Mac OS X 10.4.x aka Tiger Users milestones and 2.0.x stable both now compile with gcc 4.0. Remember that you have to use XCode2.1 gcc 4.0 If you're using Mac OS X 10.4 aka Tiger and you want to use gcc 3.3 instead of the default gcc 4.0 you can do so by using the following commands within your shell.

  1. Open up a new Terminal
  2. sudo gcc_select 3.3

Do not use XCode 2.2.1 due to Issue 69314


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"
     --with-ant-home=<path to 680_mxx>/apache-ant-1.6.5/ --with-epm=internal
     --enable-mozab --enable-pasf --with-gtk2 --with-gnu-cp=<path to your version of gnu_copy>
     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
  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 MacosxIntelEnv.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 Informations for Darwinports Users

When using Darwinports be sure to use ./configure without freetype since it leads to crashing with a version mismatch error when using Darwinport'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 simply add --enable-build-mozilla to 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 step4 in paragraph "Buiding" and add
  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.

For Intel please use the ones from these libraries appear to be universal binaries, can someone building on PPC (with Tiger) please check at some point?

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