Building on Mac OS X 10.7
Stephan Bergmann
sbergman at redhat.com
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 autogen.sh.)
* --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.
Stephan
-------------- next part --------------
#!/bin/bash
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 http://svn.macports.org/repository/macports/trunk \
"${HOME?}"/Software/lo/mports-src
# "https" instead of "http" fails to work non-interactively due to:
# Error validating server certificate for 'https://svn.macports.org:443':
# - The certificate is not issued by a trusted authority. Use the
# fingerprint to validate the certificate manually!
# Certificate information:
# - Hostname: *.macports.org
# - Valid: from Tue, 22 Feb 2011 17:29:43 GMT until Tue, 18 Mar 2014
# 23:36:56 GMT
# - Issuer: 07969287, http://certificates.godaddy.com/repository,
# GoDaddy.com, 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 \
"${HOME?}"/Software/lo/pkgconfig/
ln -s "${HOME?}"/Software/lo/mports/lib/pkgconfig/libIDL-2.0.pc \
"${HOME?}"/Software/lo/pkgconfig/
git clone ssh://git.freedesktop.org/git/libreoffice/core \
"${HOME?}"/Software/lo/core
# 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 config_host.mk contains a rewritten PATH (where
# "${HOME?}"/Software/lo/bin would always go after /usr/bin):
ln -s "${HOME?}"/Software/lo/mports/bin/egrep \
"${HOME?}"/Software/lo/core/solenv/bin/
# 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
--disable-ccache
--disable-linkoo
--disable-zenity
--enable-binfilter
--enable-dbgutil
--enable-epm
--enable-python=internal
--enable-werror
--with-lang=de en-US
--with-macosx-version-min-required=10.6
--with-max-jobs=2
--with-num-cpus=2
CC=clang -m32
CXX=clang++ -m32
EOF
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