manual: document IOIOLIB_DIR
[xcsoar.git] / doc / manual / en / compiling.tex
blob2832343698d918923f1ff598221417d55e29e8fc
1 \chapter{Compiling XCSoar}\label{cha:compiling}
3 The \texttt{make} command is used to launch the XCSoar build process.
4 You can learn more about the build system internals in chapter
5 \ref{cha:build}.
7 Most of this chapter describes how to build XCSoar on Linux, with
8 examples for Debian/Ubuntu. A cross-compiler is used to build
9 binaries for other operating systems (for example Android and
10 Windows).
12 \section{Getting the Source Code}
14 The XCSoar source code is managed with
15 \href{http://git-scm.com/}{git}. It can be downloaded with the
16 following command:
18 \begin{verbatim*}
19 git clone git://git.xcsoar.org/xcsoar/master/xcsoar.git
20 \end{verbatim*}
22 To update your repository, type:
24 \begin{verbatim*}
25 git pull
26 \end{verbatim*}
28 For more information, please read to the git documentation.
30 \section{Requirements}
32 The following is needed for all targets:
34 \begin{itemize}
35 \item GNU make
36 \item GNU compiler collection (\texttt{gcc}), version 4.6.2 or later
37 or clang/LLVM 3.1 (with "make CLANG=y")
38 \item GNU gettext
39 \item \href{http://librsvg.sourceforge.net/)}{rsvg}
40 \item \href{http://www.imagemagick.org/}{ImageMagick 6.4}
41 \item \href{http://xmlsoft.org/XSLT/xsltproc2.html}{xsltproc}
42 \item Perl and XML::Parser
43 \end{itemize}
45 The following command installs these on Debian:
47 \begin{verbatim*}
48 apt-get install make \
49 librsvg2-bin xsltproc \
50 imagemagick gettext
51 \end{verbatim*}
53 \section{Target-specific Build Instructions}
55 \subsection{Compiling for Linux/UNIX}
57 The following additional packages are needed to build for Linux and
58 similar operating systems:
60 \begin{itemize}
61 \item \href{http://www.boost.org/}{Boost}
62 \item \href{http://www.zlib.net/}{zlib}
63 \item \href{http://curl.haxx.se/}{CURL}
64 \item \href{http://www.libsdl.org/}{SDL}
65 \item \href{http://www.libsdl.org/projects/SDL\_ttf/}{SDL\_ttf}
66 \item \href{http://www.libpng.org/}{libpng}
67 \item \href{http://libjpeg.sourceforge.net/}{libjpeg}
68 \item OpenGL (Mesa)
69 \item to run XCSoar, you need one of the following fonts (Debian
70 package): DejaVu (\texttt{ttf-dejavu}), Droid (\texttt{ttf-droid}),
71 Freefont (\texttt{ttf-freefont})
72 \end{itemize}
74 The following command installs these on Debian:
76 \begin{verbatim*}
77 apt-get install make g++ \
78 libboost-dev zlib1g-dev \
79 libsdl1.2-dev libsdl-ttf2.0-dev \
80 libpng-dev libjpeg-dev \
81 libcurl4-openssl-dev \
82 libxml-parser-perl \
83 librsvg2-bin xsltproc \
84 imagemagick gettext \
85 ttf-dejavu
86 \end{verbatim*}
88 To compile, run:
90 \begin{verbatim*}
91 make
92 \end{verbatim*}
94 You may specify one of the following targets with \texttt{TARGET=x}:
96 \begin{tabular}{lp{8cm}}
98 \texttt{UNIX} & regular build (the default setting) \\
100 \texttt{UNIX32} & generate 32 bit binary \\
102 \texttt{UNIX64} & generate 64 bit binary \\
104 \texttt{OPT} & alias for UNIX with optimisation and no debugging \\
106 \end{tabular}
108 \subsection{Compiling for Android}
110 For Android, you need:
112 \begin{itemize}
113 \item \href{http://developer.android.com/sdk/}{Android SDK level 16}
114 \item \href{http://developer.android.com/sdk/ndk/}{Android NDK r8e}
115 \item \href{http://www.vorbis.com/}{Ogg Vorbis}
116 \item \href{http://ant.apache.org/}{Apache Ant}
117 \end{itemize}
119 To compile, run:
121 \begin{verbatim*}
122 make TARGET=ANDROID
123 \end{verbatim*}
125 Use one of the following targets:
127 \begin{tabular}{lp{8cm}}
129 \texttt{ANDROID} & for ARMv6 CPUs \\
131 \texttt{ANDROID7} & for ARMv7 CPUs \\
133 \texttt{ANDROID7NEON} & with
134 \href{http://www.arm.com/products/processors/technologies/neon.php}{NEON}
135 extension \\
137 \texttt{ANDROID86} & for x86 CPUs \\
139 \texttt{ANDROIDMIPS} & for MIPS CPUs \\
141 \texttt{ANDROIDFAT} & "fat" package for all supported CPUs \\
143 \end{tabular}
145 \subsubsection{Enabling IOIO Support}
147 IOIO support must be enabled explicitly, because it depends on
148 IOIOLib. First get the IOIOLib source code:
150 \begin{verbatim*}
151 git clone git://github.com/ytai/ioio.git
152 \end{verbatim*}
154 Now add the parameter \verb|IOIOLIB_DIR| pointing to this repository:
156 \begin{verbatim*}
157 make TARGET=ANDROID clean
158 make TARGET=ANDROID \
159 IOIOLIB_DIR=/usr/src/git/ioio/software/IOIOLib
160 \end{verbatim*}
162 The first command may be necessary if the output directory already
163 contains binaries without IOIO support.
165 \subsection{Compiling for Windows}
167 To cross-compile to (desktop) Windows, you need the mingw-w64 version
168 of gcc:
170 http://mingw-w64.sourceforge.net/
172 To compile, run one of the following:
174 \begin{verbatim*}
175 make TARGET=PC
176 \end{verbatim*}
178 Use one of the following targets:
180 \begin{tabular}{lp{8cm}}
182 \texttt{PC} & 32 bit Windows (i686) \\
184 \texttt{WIN64} & Windows x64 (amd64 / x86-64) \\
186 \texttt{WINE} & WineLib (experimental) \\
188 \texttt{CYGWIN} & Windows build with Cygwin (experimental) \\
190 \end{tabular}
192 \subsection{Compiling for Windows CE}
194 For PocketPC / Windows CE / Windows Mobile, you need mingw32ce:
196 \begin{itemize}
197 \item \href{http://max.kellermann.name/projects/cegcc/}{mingw32ce}
198 \end{itemize}
200 To compile, run:
202 \begin{verbatim*}
203 make TARGET=WM5X
204 \end{verbatim*}
206 Use one of the following targets:
208 \begin{tabular}{lp{8cm}}
210 \texttt{PPC2000} & PocketPC 2000 / Windows CE 3.0 \\
212 \texttt{PPC2003} & PocketPC 2003 / Windows CE 4.0 \\
214 \texttt{PPC2003X} & for XScale CPUs \\
216 \texttt{WM5} & Windows Mobile / Windows CE 5.0 \\
218 \texttt{WM5X} & for XScale CPUs \\
220 \texttt{ALTAIR} & for Triadis Altair \\
222 \end{tabular}
224 \subsection{Compiling for Mac OS X}
226 For Mac OS X, you need:
228 \begin{itemize}
229 \item GCC 4.6.2 or newer (http://hpc.sourceforge.net/, or homebrew, or Macports)
230 \item \href{http://www.boost.org/}{Boost}
231 \item \href{http://www.zlib.net/}{zlib}
232 \item \href{http://curl.haxx.se/}{CURL}
233 \item \href{http://www.libsdl.org/}{SDL}
234 \item \href{http://www.libsdl.org/projects/SDL\_ttf/}{SDL\_ttf}
235 \item \href{http://www.libpng.org/}{libpng}
236 \item \href{http://libjpeg.sourceforge.net/}{libjpeg}
237 \item \href{http://icns.sourceforge.net/}{libicns}
238 \end{itemize}
240 \subsection{Compiling for the Raspberry Pi}
242 To compile, run:
244 \begin{verbatim*}
245 make TARGET=PI
246 \end{verbatim*}
248 \subsection{Compiling for Kobo E-book Readers}
250 To compile, run:
252 \begin{verbatim*}
253 make TARGET=KOBO
254 \end{verbatim*}