2010-09-14 08:58:48 +00:00
|
|
|
Building LyX/Mac-2.0
|
2004-09-23 13:22:16 +00:00
|
|
|
Ronald Florence <ron@18james.com>
|
2010-09-14 08:58:48 +00:00
|
|
|
Modified by Bennett Helm <bennett.helm@fandm.edu>,
|
|
|
|
Anders Ekberg <anek@mac.com>,
|
|
|
|
Jean-Marc Lasgouttes <lasgouttes@lyx.org> and
|
|
|
|
Stephan Witt <st.witt@gmx.de>.
|
2003-09-09 15:12:56 +00:00
|
|
|
|
2004-09-23 13:22:16 +00:00
|
|
|
LyX/Mac is built from the LyX source, the GPL-licensed Trolltech
|
|
|
|
Qt/Mac library, and a custom application bundle.
|
2003-09-09 15:12:56 +00:00
|
|
|
|
2004-09-23 13:22:16 +00:00
|
|
|
You will need the MacOSX development tools. The procedure described
|
2010-09-14 08:58:48 +00:00
|
|
|
here builds LyX linked with a shared Qt library. Also note that
|
|
|
|
building LyX/Mac requires gcc version 4.0 or higher.
|
2007-05-14 08:51:06 +00:00
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
You may build LyX with different SDK versions resulting in different
|
|
|
|
minimum required MacOSX versions. The first supported version is
|
|
|
|
10.4 (Tiger) for which the build has to use gcc4.0.
|
2003-09-09 15:12:56 +00:00
|
|
|
|
2006-01-04 15:14:21 +00:00
|
|
|
PREREQUISITES
|
2005-09-22 08:38:35 +00:00
|
|
|
|
2007-05-14 08:51:06 +00:00
|
|
|
Note: Only Qt/Mac is needed for building official LyX releases, and
|
|
|
|
so steps 2 and 3 can be skipped in these cases. Those wanting to
|
|
|
|
build developmental versions must have automake and gettext as
|
|
|
|
well.
|
|
|
|
|
2010-04-14 13:22:00 +00:00
|
|
|
1. Qt/Mac Opensource Edition, version 4.
|
2010-10-01 14:31:57 +00:00
|
|
|
|
2010-04-14 13:22:00 +00:00
|
|
|
This library is GPL-licensed and can be downloaded from
|
2010-10-01 14:31:57 +00:00
|
|
|
<http://trolltech.com/developer/downloads/qt/mac/>.
|
|
|
|
An alternative location is <ftp://ftp.qt.nokia.com/qt/source>.
|
|
|
|
To compile it, create a directory where you want to install Qt4.
|
|
|
|
In the following, the full path to this directory is called /path/to/Qt4
|
2007-05-14 08:51:06 +00:00
|
|
|
Decompress Qt/Mac in a convenient directory, cd to the top of the
|
|
|
|
Qt source hierarcy, and enter:
|
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
./configure -opensource -silent -shared -release -universal -fast \
|
|
|
|
-no-exceptions -no-webkit -no-qt3support -no-javascript-jit -no-dbus \
|
|
|
|
-nomake examples -nomake demos -nomake docs \
|
|
|
|
-nomake tools -no-framework \
|
|
|
|
-prefix /path/to/Qt4
|
2007-05-14 08:51:06 +00:00
|
|
|
make
|
|
|
|
make install
|
2010-04-14 13:22:00 +00:00
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
This will result in an Qt library set for i386 and ppc applications.
|
2010-04-14 13:22:00 +00:00
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
To build Qt with Tiger support run configure with:
|
|
|
|
|
|
|
|
CC=gcc-4.0 OBJC=gcc-4.0 CXX=g++-4.0 \
|
|
|
|
./configure -opensource -silent -shared -release -universal -fast \
|
|
|
|
-sdk /Developer/SDKs/MacOSX10.4u.sdk \
|
|
|
|
-no-exceptions -no-webkit -no-qt3support -no-javascript-jit -no-dbus \
|
|
|
|
-nomake examples -nomake demos -nomake docs \
|
|
|
|
-nomake tools -no-framework \
|
|
|
|
-prefix /path/to/Qt4
|
|
|
|
|
|
|
|
To build the libraries with 64bit architecture you have to replace the
|
|
|
|
"-universal" option with "-arch x86_64". Note: you cannot build Qt with
|
|
|
|
32bit and 64bit mixed architecture mode. (At least not with Qt4.6)
|
|
|
|
And the build with 64bit has known problems - so it's not recommended.
|
2005-09-22 08:38:35 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
Furthermore Apples developer documentation states:
|
|
|
|
"Although 64-bit executables make it easier for you to manage large
|
|
|
|
data sets ..., the use of 64-bit executables may raise other issues.
|
|
|
|
Therefore you should transition your software to a 64-bit executable
|
|
|
|
format only when the 64-bit environment offers a compelling advantage
|
|
|
|
for your specific purposes."
|
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
|
|
|
|
2. [Needed only for developmental builds:] automake, version 1.10.1
|
2007-05-14 08:51:06 +00:00
|
|
|
or higher (check with automake --version). Probably the easiest
|
2007-05-29 15:30:22 +00:00
|
|
|
way to get this is to use MacPorts (from http://www.macports.org/)
|
|
|
|
and install automake using
|
2007-03-15 15:13:59 +00:00
|
|
|
|
2007-05-14 08:51:06 +00:00
|
|
|
sudo port install automake
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
|
2010-11-07 21:08:23 +00:00
|
|
|
3. [Needed only for developmental builds:] gettext version >= 0.18
|
2007-05-14 08:51:06 +00:00
|
|
|
(check with gettext --version). If the installed version is
|
|
|
|
insufficient the easiest way to obtain a later version is to use
|
2007-05-29 15:30:22 +00:00
|
|
|
MacPorts (from http://www.macports.org/) and install gettext
|
|
|
|
using:
|
2007-05-14 08:51:06 +00:00
|
|
|
|
2007-03-15 15:13:59 +00:00
|
|
|
sudo port install gettext
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
4. pkg-config >= 0.9.0. Again, the simplest way is through MacPorts:
|
2007-07-12 12:57:59 +00:00
|
|
|
|
|
|
|
sudo port install pkgconfig
|
|
|
|
|
2006-01-04 15:14:21 +00:00
|
|
|
|
2010-04-14 13:22:00 +00:00
|
|
|
5. To build with included spell checker (ASpell):
|
|
|
|
The aspell library is GPL-licensed and can be downloaded from
|
|
|
|
ftp://ftp.gnu.org/gnu/aspell or one of the mirrors.
|
|
|
|
At the time of writing aspell-0.60.tar.gz is the current version.
|
|
|
|
Unpack the tarball in the same directory where you placed the
|
2013-05-27 16:13:09 +00:00
|
|
|
git checkout or LyX tarball.
|
2010-04-14 13:22:00 +00:00
|
|
|
|
2006-01-04 15:14:21 +00:00
|
|
|
BUILD INSTRUCTIONS
|
|
|
|
|
2007-05-14 08:51:06 +00:00
|
|
|
In what follows, /path/to/LyX.app is the location where you want LyX
|
|
|
|
to create the LyX binary. You should substitute something appropriate,
|
|
|
|
like: ~/Desktop/LyX.app. Also, substitute the appropriate path to
|
2010-09-14 08:58:48 +00:00
|
|
|
where you installed Qt for /path/to/Qt4 (as above).
|
|
|
|
|
|
|
|
Dependent on the Qt-libraries you have and the build system you're using
|
|
|
|
you have to tell configure the compiler and compiler options to use.
|
|
|
|
If your Qt-libraries don't match your compiler defaults you may
|
|
|
|
adjust some environment variables to do so.
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
1. Environment
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
(a) Qt-4.6 self compiled universal libs
|
2010-09-14 08:58:48 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
Since MacOSX 10.6 the default is to compile 64bit applications.
|
|
|
|
We have to change the default if using that build system.
|
2010-09-14 08:58:48 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
export CPPFLAGS="-arch i386"
|
|
|
|
export LDFLAGS="-arch i386"
|
2010-09-14 08:58:48 +00:00
|
|
|
|
|
|
|
(b) Qt-4.6 libraries 64bit
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
You're at least on MacOSX 10.6 and don't have to change anything.
|
|
|
|
Note: Your LyX binary will run only on 10.6 64bit Intel machines.
|
|
|
|
Additionally you'll have to provide your Qt libraries somehow...
|
|
|
|
FIXME: actually this is a dream, 64bit LyX crashes on startup!
|
2010-09-14 08:58:48 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
(c) Qt-4.6 self compiled libraries with Tiger support
|
2010-09-14 08:58:48 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
You have to choose the gcc4.0 compiler suite and the correct SDK:
|
2006-01-04 15:14:21 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
export CC=gcc-4.0
|
|
|
|
export OBJC=gcc-4.0
|
|
|
|
export CXX=g++-4.0
|
|
|
|
export CPPFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
|
|
|
|
export LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
|
2004-01-07 16:40:30 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
(d) When working without pkgconfig or pkgconfig fails to detect Carbon and Appkit frameworks
|
2007-07-12 12:57:59 +00:00
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
Current pkgconfig from macports is able to detect the frameworks Qt4 is using.
|
2010-10-01 14:31:57 +00:00
|
|
|
The build of LyX succeeds because the frameworks are added automatically to the linker options.
|
|
|
|
If you need to add them yourself because of link errors, e. g.
|
|
|
|
lyx Undefined symbols: "_FSPathMakeRef"...
|
|
|
|
you have to verify the required frameworks with otool and add them to the LDFLAGS.
|
|
|
|
|
|
|
|
Check the output of
|
|
|
|
otool -L /path/to/QT4/lib/libQtGui.dylib
|
|
|
|
and look for lines with Frameworks.
|
|
|
|
|
|
|
|
Currently there are two different Qt4 builds available for download:
|
|
|
|
* with Tiger support it's with Carbon. You have to add
|
|
|
|
export LDFLAGS="$LDFLAGS -framework ApplicationServices -framework Carbon -framework AppKit"
|
|
|
|
* with Cocoa framework without Tiger support you have to add
|
|
|
|
export LDFLAGS="$LDFLAGS -framework ApplicationServices -framework Cocoa -framework AppKit"
|
|
|
|
|
|
|
|
Note: The latter is untested.
|
|
|
|
|
|
|
|
(e) When working with the Qt4 frameworks provided by Nokia
|
|
|
|
|
|
|
|
We have to help again with some environment variables to make configure work.
|
|
|
|
|
|
|
|
In case pkgconfig is installed... disable it.
|
|
|
|
The Qt4 frameworks come without the required .pc files.
|
|
|
|
|
|
|
|
export PKG_CONFIG=""
|
|
|
|
|
|
|
|
The required compiler flags to compile a Qt4 application has to be provided.
|
|
|
|
|
|
|
|
export QT4_CORE_CFLAGS="-FQtCore"
|
|
|
|
export QT4_CORE_LIBS="-framework QtCore"
|
|
|
|
export QT4_FRONTEND_CFLAGS="-FQtGui"
|
|
|
|
export QT4_FRONTEND_LIBS="-framework QtGui"
|
|
|
|
|
|
|
|
Depending on the architecture and target os add the compiler flags:
|
2007-05-14 08:51:06 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
- for default SDK
|
|
|
|
export CPPFLAGS="-arch i386"
|
|
|
|
export CPPFLAGS="$CPPFLAGS -I/Library/Frameworks/QtCore.framework/Headers"
|
|
|
|
export CPPFLAGS="$CPPFLAGS -I/Library/Frameworks/QtGui.framework/Headers"
|
|
|
|
export LDFLAGS="-arch i386 -framework ApplicationServices -framework Carbon -framework AppKit"
|
2007-07-12 12:57:59 +00:00
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
- or to force 10.5 SDK
|
|
|
|
|
|
|
|
export CPPFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4"
|
|
|
|
export CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks/QtCore.framework/Headers"
|
|
|
|
export CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks/QtGui.framework/Headers"
|
|
|
|
export LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4"
|
|
|
|
export LDFLAGS="$LDFLAGS -framework ApplicationServices -framework Carbon -framework AppKit"
|
|
|
|
|
|
|
|
Note: it may depend on Qt4 frameworks what actually works.
|
|
|
|
The 4.6.2 frameworks has to be used with 10.5 SDK.
|
2010-09-14 08:58:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
2. Configure and build
|
|
|
|
|
|
|
|
(a) Official Releases (compile from tar-ball)
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
cd to the top of the LyX source hierarchy, and enter:
|
2010-09-14 08:58:48 +00:00
|
|
|
|
|
|
|
./configure \
|
2010-10-01 14:31:57 +00:00
|
|
|
--with-version-suffix=-2.0 \
|
|
|
|
--with-libiconv-prefix=/usr \
|
|
|
|
--with-x=no \
|
|
|
|
--prefix=/path/to/LyX.app \
|
|
|
|
--with-qt4-dir=/path/to/Qt4
|
2004-10-26 21:16:44 +00:00
|
|
|
make
|
2007-05-14 08:51:06 +00:00
|
|
|
make install-strip
|
|
|
|
|
2010-04-14 13:22:00 +00:00
|
|
|
(Note that the --with-version-suffix=-2.0 option will result in LyX's
|
|
|
|
user's directory being located at ~/Library/Application Support/LyX-2.0)
|
2007-03-15 15:13:59 +00:00
|
|
|
|
2004-03-10 17:36:14 +00:00
|
|
|
|
2013-05-27 16:13:09 +00:00
|
|
|
(b) Developmental Versions (git checkouts)
|
2004-10-26 21:16:44 +00:00
|
|
|
|
2007-05-14 08:51:06 +00:00
|
|
|
Building LyX from developmental sources requires a few more steps.
|
|
|
|
Instead of the instructions above, do the following:
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
cd to the top of the LyX source hierarchy, and enter:
|
2004-01-07 16:40:30 +00:00
|
|
|
|
2006-01-04 15:14:21 +00:00
|
|
|
./autogen.sh
|
2010-09-14 08:58:48 +00:00
|
|
|
./configure \
|
2010-10-01 14:31:57 +00:00
|
|
|
--with-version-suffix=-2.0 \
|
|
|
|
--with-libiconv-prefix=/usr \
|
|
|
|
--with-x=no \
|
|
|
|
--disable-stdlib-debug \
|
|
|
|
--prefix=/path/to/LyX.app \
|
|
|
|
--with-qt4-dir=/path/to/Qt4
|
2004-01-07 16:40:30 +00:00
|
|
|
make
|
2007-03-15 15:13:59 +00:00
|
|
|
make install-strip
|
2003-09-09 15:12:56 +00:00
|
|
|
|
2010-09-14 08:58:48 +00:00
|
|
|
|
|
|
|
(c) Distribution build
|
|
|
|
|
|
|
|
The distribution package build of LyX is supported by the shell script
|
|
|
|
"LyX-Mac-binary-release.sh" in the development sub-directory of the
|
|
|
|
LyX source hierarchy.
|
|
|
|
|
|
|
|
Please read the script if you're about to make a distributable disk image.
|
|
|
|
|
|
|
|
To use it, cd to the top of the LyX source hierarchy, and enter:
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
sh development/LyX-Mac-binary-release.sh --with-qt4-dir=/path/to/Qt4
|
2010-09-14 08:58:48 +00:00
|
|
|
|
|
|
|
This script automates all steps of the build process.
|
|
|
|
It detects the sources for Qt4, Aspell and Hunspell when placed in a
|
|
|
|
sibling directory and builds them ready to use for LyX packaging.
|
|
|
|
These libraries are then bundled with the LyX application as private
|
|
|
|
frameworks. Therefore the Qt4 libraries are build as frameworks.
|
|
|
|
Per default the resulting LyX application is build for ppc and i386
|
|
|
|
to be usable on all systems from Tiger upwards.
|
|
|
|
|
2010-10-01 14:31:57 +00:00
|
|
|
|
2013-05-27 16:13:09 +00:00
|
|
|
(d) Development Versions (git checkouts and Qt4 frameworks)
|
2010-10-01 14:31:57 +00:00
|
|
|
|
|
|
|
Instead of the instructions in (b), do the following:
|
|
|
|
|
|
|
|
cd to the top of the LyX source hierarchy, and enter:
|
|
|
|
|
|
|
|
./autogen.sh
|
|
|
|
./configure \
|
|
|
|
--with-version-suffix=-2.0 \
|
|
|
|
--with-libiconv-prefix=/usr \
|
|
|
|
--with-x=no \
|
|
|
|
--disable-stdlib-debug \
|
|
|
|
--prefix=/path/to/LyX.app
|
|
|
|
make
|
|
|
|
make install-strip
|
|
|
|
|
|
|
|
Note: The produced binary depends on the frameworks in location
|
|
|
|
/Library/Frameworks. These frameworks have to match the frameworks
|
|
|
|
you used on build.
|
|
|
|
|
|
|
|
|
|
|
|
3. Disclaimer
|
|
|
|
|
2004-09-23 13:22:16 +00:00
|
|
|
The information on this page is believed to be accurate, has been used
|
|
|
|
successfully on many systems and sites, and has benefited from the
|
|
|
|
comments and suggestions of many users. Due to the variations in
|
|
|
|
individual systems, this information is conveyed as is with no
|
|
|
|
warranty of any kind.
|
2003-09-11 14:36:22 +00:00
|
|
|
|
2007-01-30 20:09:12 +00:00
|
|
|
For more information on LyX/Mac, see <http://wiki.lyx.org/Mac/Mac>.
|