1/12/02 - 1/14/02
Installing and building OpenOffice on OS X can be a quite interesting experience. The build documents on the OOo website are currently out of date and can't be followed word for word. Additionally, the introduction of new linker features in OS 10.1 makes the sources which you download unbuildable. I'm updating my distribution today to the proper revision, and decided to write up some build instructions to go along with it.
Note: I find it's probably best to set aside a whole day for this process. It takes a while, and does require some patience. I usually find it mingles quite pleasently with football games, hockey games, gardening, cleaning, or just about any other mostly mindless thing that you can do while waiting for builds to finish.
Oh. Also reserve a couple of gigs of hard drive space.
Preparing to Build
In order to prepare to build, you should have the 'standard' development environment set up to work on OOo. Because of special issues involving the instability of the OOo codebase and the devlopment environment Apple provides, some of the porters have come to a somewhat defacto bunch of goals for the environment the port will work on:
You should install both 10.1.2 and the 10.1 development tools before beginning a new distribution. After the Apple tools are installed, proceed to download the OpenOffice source from the cvs repository. First, create a local directory which will be your source root. I used /openoffice in these documents, but you could use otherwise for different drives or the like.
To download the CVS distribution:
After you get the CVS distribution you will need to obtain some external sources not included in the OO638C CVS branch. The first set is the STLPort code. This is a compiler-agnostic STL implementation used with the OOo sources. To obtain the source:
The next set of sources you will need is an opensource polygon clipper library gpc which isn't included with the distribution. The steps below download the appropriate library and extract its contents into /openoffice/external/gpc. The instructions below assume that you have configured Internet Explorer or your other default browser to download directly to your desktop.
Congratulations! You've just finished downloading all of the sources necessary to undertake your first adventurous build of OpenOffice!
The First Build
Before you do the first build you will need to set up your environment. Again, the instructions below assume that you have installed OOo's source into "/openoffice", but you can replace it with whatever you want.
The first step is to run the configure script to properly set up the environment variables for the build environment and create headers describing the features of the compilers. If you used a different STLport installation directory than /openoffice/stlport-4.0 be sure to substitute it into the following directions. Due to some inconsistencies on how the Java headers are located on MacOS X, the configure script will prompt for errors relating to the Java home directory which are inapplicable.
After running the configure script, you will then need to apply your first patch to the source code. The compiler changes introduced in the December build tools apparently broke some of the previous fixes. These headers, unfortunately, are needed to build the tools which are used in the build process used by OOo. To download and apply the patch:
With the patch applied, now we need to create the build utilities that are necessary for building the other components of OpenOffice. To perform this, execute the following:
The bootstrap utilities should build if you've successfully applied the patch. You may have noticed during the bootstrap build that there are "zipdep: command not found" messages. This is because the bootstrap process actually builds zipdep. To find it, if you're continuing the build process in the same terminal or if you've opened a new terminal:
This will cause the shell to rescan the executables available in the search path and will allow zipdep to be found for future builds.
Now we're ready to continue with the build. This roughly follows the instructions from the current docs online at openofficeorg, but with some ordering and patch instructions interspersed.
Since we're building the debug version, we need to apply some more patches to continue building modules. The next module specified in the build, the i18n module, references the rsc module which has a prototype error. This build failure only occurs when doing the debug build. So we need to patch it:
Now we can continue with the build
Note that unlike the build instructions posted on OOo's site, you actually do need to build cpputools before dtrans. This is because dtrans needs to register a component for doing aqua data transfer via the clipboard (?) with the regcomp utility, but that utility is built with cpputools.
Before we do the next build step, we need to apply another patch. This patch addresses an error in the makefiles in the dtrans module which caused them to fail to register properly.
Now we can continue building :)
After that finishes, take a breather. You've finished building the basic abstraction and infrastructure layers of OO! If you've made it this far, you've already either got some dedication, or at least a masochistic streak. Why not consider joining the porting project on the OOo website and filling out the copyright assignment form so you can start contributing patches of your own? :)
So Now Then
What you've built is the basic abstraction and infrastructure layers of the application. Things are still a long way off before it's possible to even begin thinking about building a full OO binary for distribution. Read through the work remaining to be done documents and compiler issues on the OOo Mac porting site for more information.
I found by reading some of the white papers I got a better understanding for the terminology as well as the structure of the program. This was extremely helpful in decoding the build system and making more sense out of other documents on OO.
The next step in the build instructions on OOo mentions building the sample applications. Go for it! You'll find that several of them are broken, so it's a good indication of what still needs to be done.
For more fun, apply all of the latest patches available through OOo issuezilla. There are two patches I've done for vcl and berkeleydb which haven't been applied in these instructions. Other patches from Daniel Boss are available from OOo's IssueZilla and patch the following modules: svx, setup2, odk, scaddins, product, and sj2. There are still more that don't build, and right now that's what I'm kind of addressing along with fixing up bugs in the vcl module (which will require additional work beyond bug fixing as well).
Feel free to read up and join in!