User:Dyrcona/LeopardBuild

From Apache OpenOffice Wiki
< User:Dyrcona
Revision as of 03:06, 16 March 2008 by Dyrcona (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Building OO.o Aqua on Mac OS X

The following are the steps and tools that I use to build development milestones on my MacBook running Mac OS X Leopard (10.5.2).

File Organization

OpenOffice.org is a large project. A fresh checkout of a recent development milestone (DEV300_m0) comprises roughly half a million files, spread over 184 modules, that occupy about 1.8 GB of space on disk. After compilation, the project files balloon to occupy 5.9 GB of space. Each of those 184 modules is itself a directory full of subdirectories. Therefore, it is important that you give some thought to the organization of these files before you begin building and hacking OO.o.

As a programmer who works on several different projects, not just OO.o, I like to keep my code files neatly organized and separate from my other files. To that end, I have created a subdirectory, called Sources, in my home directory. In this directory, I create a subdirectory for each of my major projects. Thus, the code for each project is neatly organized and distinct.

In the case of OO.o, I have developed a further subdivision of the project directory that helps to organize my various builds and other files. First, I have created a main OO.o project directory, ${HOME}/Sources/OpenOffice.org/, where I keep all of my OpenOffice.org-related code and build files. Under this main project directory, I have added a bin subdirectory where I keep some useful scripts and environment files. Side by side with this bin subdirectory sits another called prebuild. It stores the various pre-built binaries that I use to speed up the total OO.o build process. Finally, one of the scripts in the bin will create a build directory for a milestone based on the CVS tag. The structure of this layout looks something like the following:

${HOME}/Sources/OpenOffice.org/
                               bin/
                               prebuild/
                               ${CVSTAG}/
                               .../

Getting Pre-built Binaries

This is currently in a state of flux, but I'll soon post the links and other information needed to get the pre-built binaries for

Mozilla

unowinreg.dll

Scripts and Environment Files

(Some text needs to be filled in here, but it is getting late and I'm tired, so I'll finish this tomorrow.)

env.sh:

export CCACHE_DIR="$(pwd)/.ccache"
export CC="ccache gcc"
export CXX="ccache g++"
export TMP=/tmp
export SYSTEM_OPENSSL=YES

mkBuildDir.sh:

#!/bin/sh

cvsTag=${1};
CVSROOT=:pserver:anoncvs@anoncvs.services.openoffice.org:2401/cvs 
where=$(pwd)

if [ "${where}" != "${HOME}/Sources/OpenOffice.org" ]; then
    cd ${HOME}/Sources/OpenOffice.org
fi

if [ -e ${cvsTag} ]; then
    if [ -d $cvsTag ]; then
        echo "${cvsTag} already exists and is a directory"
        read -p "Do you wish to continue (y|n)? " readContinue
        case "${readContinue}" in
            y|Y|yes|YES)
                echo "Expect undesired results if ${cvsTag} is not empty"
                cd "${cvsTag}"
                ;;
            *)
                 exit 1
                ;;
        esac
    else
        echo "${cvsTag} is not a directory"
        exit 1;
    fi
else
    mkdir ${cvsTag}
    cd ${cvsTag}
fi

cvs -z4 -d ${CVSROOT} co -r ${cvsTag} OpenOffice2

# Copy the Mozilla and unowinreg.dll pre-builts to the proper place.
cp ${HOME}/Sources/OpenOffice.org/prebuild/MACOSXGCC*.zip ./moz/zipped/
cp ${HOME}/Sources/OpenOffice.org/prebuild/unowinreg.dll ./external/unowinreg/

# Link the pre-existing build script
cd config_office/
ln -s ../../bin/build.sh

build.sh:

#!/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="en-US" \
--disable-pasf \
--disable-gtk \
--disable-build-mozilla \
--with-build-version=$OOVERSION-`date +%d-%m-%y` \
--disable-fontconfig \
--disable-headless \
--without-nas \
--with-use-shell=bash \
--with-jdk-home=/System/Library/Frameworks/JavaVM.framework/Home \
--with-stlport=no

The Build

Again, some explanatory text should go here.

In the ${CVSTAG} directory:

source ../bin/env.sh
cd config_office/
./build.sh
cd ..
./bootstrap
source MacOSXX86Env.Set.sh
cd instsetoo_native
build --all -P4 --dlv_switch -link  

Installing/Using the Result

I need to tell where to find the disk image file that is created, etc.

Hacking OO.o

Once I've had some more time for code changes of my own, I'll add a subpage about hacking OO.o on Mac OS X, managing patches, etc. I have an idea for an example hack, too.

Personal tools