#!/bin/bash
set -ev
export PKG_CONFIG=/sw/bin/pkg-config
mkdir DEV300m35
cd DEV300m35
/sw/bin/svn co svn://svn.services.openoffice.org/ooo/tags/DEV300_m35 .
cp /OOO-DEVEL/files/unowinreg.dll external/unowinreg/
cp /OOO-DEVEL/files/mozilla-source-1.7.5.tar.gz moz/download
patch -p 0 < /OOO-DEVEL/patches/patch-moz+xlib
patch -p 0 <<-\EOF
	Index: solenv/bin/deliver.pl
	===================================================================
	--- solenv/bin/deliver.pl	(revision 264107)
	+++ solenv/bin/deliver.pl	(working copy)
	@@ -708,8 +708,11 @@
	 
	     if (-f $file_name.$maybedot) {
	         my $file_type = `file $file_name`;
	-        # OS X file command doesn't know if a file is stripped or not
	-        if (($file_type =~ /not stripped/o) || ($file_type =~ /Mach-O/o) || 
	+        # OS X file command doesn't know if a file is stripped or not (and, on
	+        # OS X, strip -x appears only to be good for shared libraries, not for
	+        # executables, so leave executables unstripped):
	+        if (($file_type =~ /not stripped/o) ||
	+            ($file_type =~ /Mach-O dynamically linked shared library/o) ||
	             (($file_type =~ /PE/o) && ($ENV{GUI} eq 'WNT') &&
	              ($nm_output = `nm $file_name 2>&1`) && $nm_output &&
	              !($nm_output =~ /no symbols/i) && !($nm_output =~ /not recognized/i))) {
EOF
( cd config_office ; ./configure --with-lang=ALL --enable-mozilla --with-mozilla-version=1.7.5 --enable-build-mozilla --with-mozilla-toolkit=xlib --disable-gtk --disable-crashdump --with-gnu-cp=/sw/bin/cp --without-x --with-use-shell=bash )
./bootstrap
. MacOSXPPCEnv.Set.sh
cd smoketestoo_native
shopt -s expand_aliases
build --all -P2 -- -P2

