Building on Mac OS X 10.7

Stephan Bergmann sbergman at
Thu Jun 7 00:13:51 PDT 2012

FYI, attached BUILD-lo script allowed me to build recent LO master on 
Mac OS X 10.7 with Xcode 4.  A few comments:

* It builds into ~/Software/lo (which must not yet exist).

* It uses MacPorts for the various dependencies, but in a way that does 
not pollute the machine (by checking out and building a MacPorts 
installation completely local to the LO build).

* The pkgconfig and libidl stuff, and maybe also the grep stuff, is 
probably only needed for moz (at least, that's the first module where I 
encounter need for it).

* Instead of symlinking doxygen into ~/Software/lo/bin, it could also be 
included in autogen.lastrun via --with-doxygen=... if it were clarified 
how to escape content in autogen.lastrun (newlines in HOME, anyone?). 
(This would of course be avoided if the script would pass the 
configuration arguments to an explicit call of

* --with-macosx-version-min-required=10.6 (instead of 10.7) is needed at 
least for the moz and python modules.

* As per SUS an unset or null PATH means implementation-defined 
behaviour (that cannot easily be added to with PATH=${PATH}:...), the 
script simply fails on an unset or null PATH.

-------------- next part --------------
set -ex -o pipefail

# On latest Mac OS X 10.7.4 with latest Xcode 4.3.2 (incl. Command Line Tools):

mkdir "${HOME?}"/Software/lo

svn checkout \
 # "https" instead of "http" fails to work non-interactively due to:
 #   Error validating server certificate for '':
 #    - The certificate is not issued by a trusted authority. Use the
 #      fingerprint to validate the certificate manually!
 #   Certificate information:
 #    - Hostname: *
 #    - Valid: from Tue, 22 Feb 2011 17:29:43 GMT until Tue, 18 Mar 2014
 #      23:36:56 GMT
 #    - Issuer: 07969287,,
 #, Inc., Scottsdale, Arizona, US
 #    - Fingerprint:
 #      4d:ea:4a:77:55:ac:8e:2e:9e:11:8a:59:3d:ec:c7:45:7d:b0:72:19
 #   (R)eject, accept (t)emporarily or accept (p)ermanently?
(cd "${HOME?}"/Software/lo/mports-src/base && ./configure \
 --prefix="${HOME?}"/Software/lo/mports --with-no-root-privileges \
 --with-applications-dir="${HOME?}"/Software/lo/mports-apps \
 --with-tclpackage="${HOME?}"/Software/lo/mports-tcl && make && make install) \
 || exit 1
"${HOME?}"/Software/lo/mports/bin/port selfupdate
"${HOME?}"/Software/lo/mports/bin/port install libidl +universal
"${HOME?}"/Software/lo/mports/bin/port install automake doxygen grep pkgconfig

mkdir "${HOME?}"/Software/lo/bin
ln -s "${HOME?}"/Software/lo/mports/bin/aclocal "${HOME?}"/Software/lo/bin/
ln -s "${HOME?}"/Software/lo/mports/bin/autoconf "${HOME?}"/Software/lo/bin/
ln -s "${HOME?}"/Software/lo/mports/bin/autom4te "${HOME?}"/Software/lo/bin/
ln -s "${HOME?}"/Software/lo/mports/bin/doxygen "${HOME?}"/Software/lo/bin/

mkdir "${HOME?}"/Software/lo/pkgconfig
ln -s "${HOME?}"/Software/lo/mports/lib/pkgconfig/glib-2.0.pc \
ln -s "${HOME?}"/Software/lo/mports/lib/pkgconfig/libIDL-2.0.pc \

git clone ssh:// \

# moz/unxmacxi/misc/build/mozilla/configure:20225 fails with "egrep: Regular
# expression too big" with default /usr/bin/egrep ("egrep (GNU grep) 2.5.1"),
# and adding this replacement to "${HOME?}"/Software/lo/bin (which is added to
# PATH) does not help, as contains a rewritten PATH (where
# "${HOME?}"/Software/lo/bin would always go after /usr/bin):
ln -s "${HOME?}"/Software/lo/mports/bin/egrep \

# moz/unxmacxi/misc/build/mozilla/gfx/src/mac/nsRegionPool.cpp uses NewRgn,
# DisposeRgn, etc. that got removed in 10.7 SDK:
cat >"${HOME?}"/Software/lo/core/autogen.lastrun <<\EOF
--with-lang=de en-US
CC=clang -m32
CXX=clang++ -m32

ulimit -c unlimited

cd "${HOME?}"/Software/lo/core
printf '%s' "${HOME?}" | grep -Fqv : || exit 1
PATH=${PATH:?}:${HOME?}/Software/lo/bin \
 PKG_CONFIG=${HOME?}/Software/lo/mports/bin/pkg-config \
 PKG_CONFIG_LIBDIR=${HOME?}/Software/lo/pkgconfig make check

More information about the LibreOffice mailing list