原文:http://wiki.documentfoundation.org/Development/Install_Mac_OS_X_Dependencies
安装pkg-config等教程
NOTE: rewrite in progress - detailed instructions yet to follow.
Mac is the easiest platform to start compiling LibreOffice, as you don't need to get tons of stuff (even when this page claimed so previously - it just did contain incorrect infromation).
Actually installing additional stuff not listed here might make compiling LibreOffice much more difficult.
Contents[hide]
|
XCode is provided by Apple, just make sure you install the 10.4u SDK that is not installed by default (and no longer included in the very latest version, so get XCode 2.x or 3.x) How to get
Alternatively
Note that for XCode 3.2.x, the 10.4u SDK is not intalled by default, it must be enabled in the optional modules section during installation (Customize... button)
Yes, that's right, XCode gets you all that is needed to build, at least when you use --disable-mozilla. One exception though: you need gnu make >= 3.81, so when you're on 10.4/PPC and thus are stuck with XCode 2.x: see below
While not needed for regular hacking (as there are also prebuilt zips available that can be hooked up into the build to save time compiling and not loosing functionality) and not loosing much functionality when it is disabled (certificate management for signing documents, ldap access, mozilla address book connectivity): When you want to build it you need
And to satisfy libIDL dependencies, you need:
and
and to make it easier to compile without having to manually specify additional enviornment flags to those
(gettext and glib2 are now part of the sources, so TODO: make use of those when compiling mozilla)
Git version control - as otherwise checking out the sources/updating the sourcetree will involve quite a bit of manual work downloading the tarballs, etc.
It is suggested to build git from source - but as building the documentation (and that includes the man-pages) would require to install tons of dependencies, the recommendation is to not build the documentation files yourself, but to get the corresponding binary package from http://www.kernel.org/pub/software/scm/git/(search for manpages and pick the one matching your version)
To compile and install to /usr/local, just use
./configure make make install
If you're running 10.5 or newer, you can also pick the binary version instead
Both source and binary versions can be obtained via http://git-scm.com/
ccache is short for compiler cache - and it is exactly that. It saves tons of time by not running the actual compiler when nothing changed in the source. This can easily save you two thirds of the overall compile time.
In that case, as the version of xcode only includes a buggy version of gnu make, that cannot handle the complex makefiles that are used, you need
version 3.81 is OK, but just get the current version
what follows is the original page's content stripped from the wrongly listed deps
First you need to install Xcode 3.2.4 with 10.4 SDK (an install option of Xcode that is not pre-selected), and Git
Next, you may want to decide if you need the mozilla-related stuff built. See Development/Native_Build#Disable_mozilla on disabling mozilla. In case of --disable-mozilla you can skip the following dependencies.
Note: the bash sections below are meant to be cut-and-pasted into a console.
We are going to build the dependencies in ~/lodep
cd mkdir lodep cd lodep export PAR="-j8" # change 8 with the approriate number of cpus
curl http://pkgconfig.freedesktop.org/releases/pkg-config-0.25.tar.gz -o pkg-config-0.25.tar.gz tar -xf pkg-config-0.25.tar.gz cd pkg-config-0.25 ./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E" make $PAR sudo make install cd -
curl http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz -o gettext-0.18.1.1.tar.gz tar -xf gettext-0.18.1.1.tar.gz cd gettext-0.18.1.1 ./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E" make $PAR sudo make install cd -
curl ftp://ftp.gnome.org/pub/gnome/sources/glib/2.27/glib-2.27.0.tar.bz2 -o glib-2.27.0.tar.bz2 tar -xf glib-2.27.0.tar.bz2 cd glib-2.27.0 ./configure --with-libiconv=native echo '--- glib-2.27.0-orig/glib/gconvert.c2010-09-17 17:33:50.000000000 -0500' > glib.patch echo '+++ glib-2.27.0/glib/gconvert.c 2010-10-27 00:01:39.000000000 -0500' >> glib.patch echo '@@ -61,9 +61,6 @@' >> glib.patch echo ' #if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)' >> glib.patch echo ' #error GNU libiconv in use but included iconv.h not from libiconv' >> glib.patch echo ' #endif' >> glib.patch echo '-#if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H)' >> glib.patch echo '-#error GNU libiconv not in use but included iconv.h is from libiconv' >> glib.patch echo '-#endif' >> glib.patch echo ' ' >> glib.patch echo ' /**' >> glib.patch echo ' * SECTION:conversions' >> glib.patch patch -p1 < glib.patch make sudo make install make clean ./configure CC="gcc -arch i386" CXX="g++ -arch i386" CPP="gcc -E" CXXCPP="g++ -E" --with-libiconv=native make $PAR lipo -create gio/.libs/libgio-2.0.0.dylib /usr/local/lib/libgio-2.0.0.dylib -output libgio-2.0.0.dylib lipo -create glib/.libs/libglib-2.0.0.dylib /usr/local/lib/libglib-2.0.0.dylib -output libglib-2.0.0.dylib lipo -create gmodule/.libs/libgmodule-2.0.0.dylib /usr/local/lib/libgmodule-2.0.0.dylib -output libgmodule-2.0.0.dylib lipo -create gobject/.libs/libgobject-2.0.0.dylib /usr/local/lib/libgobject-2.0.0.dylib -output libgobject-2.0.0.dylib lipo -create gthread/.libs/libgthread-2.0.0.dylib /usr/local/lib/libgthread-2.0.0.dylib -output libgthread-2.0.0.dylib sudo mv libgio-2.0.0.dylib /usr/local/lib/libgio-2.0.0.dylib sudo mv libglib-2.0.0.dylib /usr/local/lib/libglib-2.0.0.dylib sudo mv libgmodule-2.0.0.dylib /usr/local/lib/libgmodule-2.0.0.dylib sudo mv libgobject-2.0.0.dylib /usr/local/lib/libgobject-2.0.0.dylib sudo mv libgthread-2.0.0.dylib /usr/local/lib/libgthread-2.0.0.dylib cd -
curl http://ftp.acc.umu.se/pub/gnome/sources/libIDL/0.8/libIDL-0.8.14.tar.gz -o libIDL-0.8.14.tar.gz tar -xf libIDL-0.8.14.tar.gz cd libIDL-0.8.14 ./configure make $PAR sudo make install ./configure CC="gcc -arch i386" CXX="g++ -arch i386" CPP="gcc -E" CXXCPP="g++ -E" make $PAR lipo -create .libs/libIDL-2.0.dylib /usr/local/lib/libIDL-2.0.dylib -output libIDL-2.0.dylib lipo -create .libs/libIDL-2.a /usr/local/lib/libIDL-2.a -output libIDL-2.a sudo mv libIDL-2.0.dylib /usr/local/lib/libIDL-2.0.dylib sudo mv libIDL-2.a /usr/local/lib/libIDL-2.a cd -