2 building and installing ttfautohint from git
3 ============================================
5 Building ttfautohint from the git repository needs some tools that are not
6 required when building from a release:
14 perl (this is a prerequisite of automake also)
16 If you configure to build the documentation files also (which are normally
17 distributed with the release package), the following is necessary:
22 X11 (in particular the `xwininfo' program)
24 lualatex or xelatex (TeXLive 2013)
26 The version numbers in parentheses are known to work. Newer versions should
33 to clone the `gnulib' repository (which gets installed as a git submodule),
34 to build the `configure' script, and to set up necessary auxiliary files.
35 Then you can proceed with the instructions given in the `INSTALL' file with
36 the exception that parellel builds with `make -j' are not supported yet.
39 compilation within the MinGW environment (on Windows)
40 -----------------------------------------------------
44 o Since MSYS, the shell of MinGW, uses LF as line endings, `git checkout'
45 should not convert files to CRLF. Before checking out the FreeType and
46 ttfautohint repositories, you should issue the command
48 git config --global core.autocrlf input
50 to avoid any line ending conversion.
52 o At the time of this writing (February 2014), the current MinGW bundle
53 (in particular mingwrt-4.0.3; the gcc version is 4.8.1) contains a
54 number of bugs that need work-arounds. For this reason, you should use
55 FreeType version 2.5.3 (or the git repository) and HarfBuzz version
56 0.9.27 or newer. The configuration scripts work just fine in an MSYS
59 o Only a very special functionality of HarfBuzz is needed; you might thus
60 reduce dependencies by adding the following options to its `configure'
68 o You need bison 2.5 or newer. MinGW doesn't offer this, but you can
69 download a MinGW port of version 3.0.2 from
71 https://sourceforge.net/projects/ezwinports/files/
73 o To compile a stand-alone version of ttfautohintGUI we must compile a
74 static version of Qt 4 first. I've successfully followed these
75 instructions with version 4.8.5
77 http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/
79 together with the following minor patch to MinGW
81 https://sourceforge.net/p/mingw/mingw-org-wsl/ci/928ddb53a9623fc38de3997a3acce4a8730f4dc6/
83 Note that these build instructions should be executed in a normal
84 cmd.exe shell, *not* MSYS.
86 An alternative is given at
88 http://qt-project.org/wiki/How-to-build-a-static-Qt-for-Windows-MinGW
90 using a PowerShell script. However, you still need the small MinGW
93 It's not necessary to invoke `make install' for Qt. For ttfautohint's
94 `--with-qt' configure script argument in the next build step, use the
95 `bin' subdirectory of the just built Qt library, for example
97 --with-qt=/path/to/qt-4.8.5/bin
99 o Now configure and compile ttfautohint (within an MSYS shell) using
102 CXX='g++ -static-libgcc' \
105 ac_cv_func__set_invalid_parameter_handler=no
106 make LDFLAGS=-all-static
108 (The `ac_cv_func...' argument is another work-around for a MinGW bug,
109 the `CXX' line is a fix for libtool).
112 compilation with mxe (on Unix, for Windows)
113 -------------------------------------------
117 o Check out the mxe git repository.
119 o Apply the following two patches to get smaller ttfautohint binaries.
121 diff --git a/src/harfbuzz.mk b/src/harfbuzz.mk
122 index 6b299da..bb56456 100644
123 --- a/src/harfbuzz.mk
124 +++ b/src/harfbuzz.mk
125 @@ -20,6 +20,10 @@ endef
127 cd '$(1)' && ./configure \
128 $(MXE_CONFIGURE_OPTS) \
130 + --with-gobject=no \
134 $(MAKE) -C '$(1)' -j '$(JOBS)' install
136 diff --git a/src/qt.mk b/src/qt.mk
137 index 889394e..aaf59f7 100644
140 @@ -32,13 +32,16 @@ define $(PKG)_BUILD
141 -device-option PKG_CONFIG='$(TARGET)-pkg-config' \
148 -prefix '$(PREFIX)/$(TARGET)/qt' \
159 @@ -51,11 +54,7 @@ define $(PKG)_BUILD
167 - -qt-sql-tds -D Q_USE_SYBASE \
173 o Put the following patch into a file called `qt-2.patch' and add it to
174 mxe's `src' directory. This also helps reduce the size of the `qt'
177 --- a/mkspecs/win32-g++/qmake.conf
178 +++ b/mkspecs/win32-g++/qmake.conf
180 QMAKE_CFLAGS_DEPS = -M
181 QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
182 QMAKE_CFLAGS_WARN_OFF = -w
183 -QMAKE_CFLAGS_RELEASE = -O2
184 +QMAKE_CFLAGS_RELEASE = -Os -momit-leaf-frame-pointer
185 QMAKE_CFLAGS_DEBUG = -g
186 QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
188 o Now build the necessary mxe infrastructure with
190 make build-requirements
194 These calls download packages with a total size of approx. 530 MByte.
195 Compilation easily takes some hours on a slower computer; it finally
196 occupies slightly more than 2GBytes on the harddisk.
198 o You are now ready to build ttfautohint from the git repository with
200 export PATH=/your/path/to/git/mxe/usr/bin:$PATH
206 --host=i686-w64-mingw32.static \
207 --with-qt=/your/path/to/git/mxe/usr/i686-w64-mingw32.static/qt/bin \
214 Binaries can be found in `out/bin'.