-Building LyX/Mac-1.4.0
+Building LyX/Mac-1.5
Ronald Florence <ron@18james.com>
-Modified by Bennett Helm <bennett.helm@fandm.edu>
+Modified by Bennett Helm <bennett.helm@fandm.edu>, Anders
+Ekberg <anek@mac.com> and Jean-Marc Lasgouttes <lasgouttes@lyx.org>.
LyX/Mac is built from the LyX source, the GPL-licensed Trolltech
Qt/Mac library, and a custom application bundle.
You will need the MacOSX development tools. The procedure described
-here builds LyX linked with a static Qt library. If you are using the
-tcsh shell, change the "export VAR=value" statements to
-"setenv VAR value".
+here builds LyX linked with a static Qt library. Also note that
+building LyX/Mac requires gcc version 4.0 or higher. (You can check
+your version by entering "gcc -v" in the Terminal; you can change
+your gcc version to version 4.0, for example, by entering
+"sudo gcc_select 4.0".)
+
PREREQUISITES
-1. Qt/Mac Free Edition, version 3.3. This library is GPL-licensed
-and can be downloaded from
-<http://www.trolltech.com/download/qt/mac.html>. You will need to
-compile it yourself (as described below).
+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.
+
+1. Qt/Mac Opensource Edition, version 4. This library is GPL-
+licensed and can be downloaded from
+<http://trolltech.com/developer/downloads/qt/mac/>. 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
+Decompress Qt/Mac in a convenient directory, cd to the top of the
+Qt source hierarcy, and enter:
+
+ ./configure -static -no-exceptions -nomake examples -nomake tools -nomake demos -prefix /path/to/QT4
+ make
+ make install
+ cd /path/to/QT4/lib
+ rm *.la
+
+2. [Needed only for developmental builds:] automake, version 1.5
+or higher (check with automake --version). Probably the easiest
+way to get this is to use MacPorts (from http://www.macports.org/)
+and install automake using
+
+ sudo port install automake
+
+3. [Needed only for developmental builds:] gettext version >= 0.12
+(check with gettext --version). If the installed version is
+insufficient the easiest way to obtain a later version is to use
+MacPorts (from http://www.macports.org/) and install gettext
+using:
+
+ sudo port install gettext
+
+4. [Useful to simplify detection of Qt:] pkg-config >= 0.9.0. Again,
+the simplest way is through MacPorts:
+
+ sudo port install pkgconfig
-2. automake, version 1.9 or higher. The easiest way to get this is
-to use FinkCommander, which can be downloaded from
-<http://finkcommander.sourceforge.net/>.
BUILD INSTRUCTIONS
-Note that building LyX/Mac requires gcc version 3.3 or higher. (You
-can check your version by entering "gcc -v" in the Terminal; you
-can change your gcc version to version 3.3, for example, by entering
-"sudo gcc_select 3.3".)
+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
+where you installed Qt for /path/to/QT4 (as above).
+
+(a) Official Releases
+
+If you did not install pkg-config, first set the LDFLAGS variable:
-1. Decompress Qt/Mac in a convenient directory, cd to the top of the
-Qt source hierarcy, and:
+ export LDFLAGS="-framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework Cocoa"
- export QTDIR=`pwd`
- ./configure -static -no-exceptions -lresolv [for OS X 10.2, use "./configure -static -no-exceptions"]
+Then, cd to the top of the LyX source hierarchy, and enter:
+
+ ./configure --prefix=/path/to/LyX.app --with-version-suffix=-1.5 --without-x --with-qt4-dir=/path/to/QT4 --with-included-gettext --enable-optimization=-Os
make
- rm lib/libqt.la
+ make install-strip
+
+(Note that the --with-version-suffix=-1.5 option will result in LyX's
+user's directory being located at ~/Library/Application Support/LyX-1.5.)
-2. The LyX/Mac application bundle skeleton (LyX.app) can be found in
-the LyX source hierarchy at development/MacOSX. The default settings
-assume that this bundle has been moved to /Applications and is named
-LyX.app. You can rename it or move it somewhere else, but make sure
-you read the note in step 3.
-3. Using the same terminal session you used to build the Qt library,
-cd to the top of the LyX source hierarchy, and:
+(b) Developmental Versions (svn checkouts)
+
+Building LyX from developmental sources requires a few more steps.
+Instead of the instructions above, do the following:
+
+If you did not install pkg-config, first set the LDFLAGS variable:
+
+ export LDFLAGS="-framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework Cocoa"
+
+Then, cd to the top of the LyX source hierarchy, and enter:
- export LDFLAGS="-framework Carbon -framework OpenGL -framework AGL -framework QuickTime -lz"
./autogen.sh
- ./configure --with-frontend=qt --without-x --with-included-gettext --enable-optimization=-Os --disable-concept-checks
-
-[Note: If you have moved or renamed the LyX/Mac application bundle
-skeleton, you will need to add "--prefix=/path/to/LyX.app"
-(substituting the appropriate path, of course) to this ./configure
-line. (If you do not specify anything for --prefix, the default is
---prefix=/Applications/LyX.app.)]
-
+ ./configure --prefix=/path/to/LyX.app --with-version-suffix=-1.5 --without-x --with-qt4-dir=/path/to/QT4 --with-included-gettext --enable-optimization=-Os
make
- make install
+ make install-strip
+Note that by default svn versions use some extra debugging code that
+somewhat slows LyX down. If it is a real problem, you can pass the
+option --disable-stdlib-debug to configure.
The information on this page is believed to be accurate, has been used
successfully on many systems and sites, and has benefited from the