0
|
1 %//////////////////////////////////////////////////////////////////////////////
|
|
2 %
|
|
3 % Copyright (c) 2007,2009 Daniel Adler <dadler@uni-goettingen.de>,
|
|
4 % Tassilo Philipp <tphilipp@potion-studios.com>
|
|
5 %
|
|
6 % Permission to use, copy, modify, and distribute this software for any
|
|
7 % purpose with or without fee is hereby granted, provided that the above
|
|
8 % copyright notice and this permission notice appear in all copies.
|
|
9 %
|
|
10 % THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
11 % WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
12 % MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
13 % ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
14 % WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
15 % ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
16 % OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
17 %
|
|
18 %//////////////////////////////////////////////////////////////////////////////
|
|
19
|
|
20 \newpage
|
|
21 \section{Building the library}
|
|
22
|
|
23 The library has been built and used successfully on several
|
|
24 platform/architecture configurations and build systems.
|
|
25 Please see notes on specfic platforms to check if the target
|
|
26 architecture is currently supported.
|
|
27
|
|
28
|
|
29 \subsection{Requirements}
|
|
30
|
|
31 The following tools are supported directly to build the \product{dyncall} library.
|
|
32 However, as the number of source files to be compiled for a given
|
|
33 platform is small, it shouldn't be difficult to build it manually with
|
|
34 another toolchain.
|
|
35 \begin{itemize}
|
|
36 \item C compiler to build the \product{dyncall} library (GCC, Clang, SunPro or Microsoft C/C++ compiler)
|
|
37 \item C++ compiler to build the optional test cases (GCC, Clang, SunPro or Microsoft C/C++ compiler)
|
|
38 \item BSD make, GNU make, Microsoft nmake or mk (on Plan9) as automated build tools
|
|
39 \item Python (optional - for generation of some test cases)
|
|
40 \item Lua (optional - for generation of some test cases)
|
|
41 \item CMake (optional support)
|
|
42 \end{itemize}
|
|
43
|
|
44
|
|
45 \subsection{Supported/tested platforms and build systems}
|
|
46
|
|
47 Building \product{dyncall} is a straightforward two-step process, first configure, then make. The
|
|
48 library should be able to be built with the default operating systems' build tools, so BSD make on
|
|
49 BSD and derived systems, GNU make on GNU and compatible, mk on Plan9, nmake on Windows, etc..
|
|
50 This is a detailed overview of platforms and their build tools that are known to build
|
|
51 \product{dyncall}:\\
|
|
52 \\
|
|
53
|
|
54
|
76
|
55 \begin{tabular*}{0.75\textwidth}{lll}
|
|
56 \textbf{Platform} & Build Tool(s) & Compiler, SDK \\
|
0
|
57 \hline
|
76
|
58 \textbf{Windows} & nmake,Visual Studio & cl, cygwin (gcc), mingw (gcc) \\
|
|
59 \textbf{Unix-like} & GNU/BSD/Sun make & gcc, clang, sunc \\
|
|
60 \textbf{Plan9} & mk & 8c \\
|
|
61 \textbf{Haiku/BeOS} & GNU make & gcc \\
|
|
62 \textbf{iOS/iPhone} & GNU make & gcc and iPhone SDK on Mac OS X \\
|
|
63 \textbf{Nintendo DS} & nmake & devkitPro\cite{devkitPro} tools on Windows \\
|
|
64 \textbf{Playstation Portable} & GNU make & psptoolchain\cite{psptoolchain} tools \\
|
|
65 \end{tabular*}\\
|
0
|
66
|
|
67 \pagebreak
|
|
68
|
|
69 \subsection{Build instructions}
|
|
70
|
|
71
|
|
72 \begin{enumerate}
|
|
73 \item Configure the source (not needed for Makefile.embedded)
|
|
74
|
|
75 \paragraph{*nix flavour}
|
|
76 \begin{lstlisting}
|
|
77 ./configure [--option ...]
|
|
78 \end{lstlisting}
|
|
79
|
|
80 Available options (omit for defaults):
|
|
81
|
76
|
82 \begin{tabular*}{0.75\textwidth}{ll}
|
73
|
83 {\tt --help} & display help \\
|
|
84 {\tt --prefix=\textit{path}} & specify installation prefix (Unix shell) \\
|
|
85 {\tt --target=\textit{platform}} & MacOSX,iOS,iPhoneSimulator,PSP,... \\
|
|
86 {\tt --sdk=\textit{version}} & SDK version \\
|
76
|
87 \end{tabular*}
|
0
|
88
|
|
89 \paragraph{Windows flavour, and cross-build from Windows (PSP, NDS, etc.)}
|
|
90
|
|
91 \begin{lstlisting}
|
|
92 .\configure [/option ...]
|
|
93 \end{lstlisting}
|
|
94
|
|
95 Available options:
|
|
96
|
76
|
97 \begin{tabular*}{0.75\textwidth}{ll}
|
|
98 {\tt /?} & display help \\
|
|
99 {\tt /prefix \textit{path}} & set installation prefix (GNU make only) \\
|
|
100 {\tt /prefix-bd \textit{path}} & set build directory prefix (GNU make only) \\
|
|
101 {\tt /target-x86} & build for x86 architecture (default) \\
|
|
102 {\tt /target-x64} & build for x64 architecture \\
|
73
|
103 {\tt /target-psp} & build for PlayStation Portable (homebrew SDK) \\
|
76
|
104 {\tt /target-nds-arm} & build for Nintendo DS (devkitPro, ARM mode) \\
|
73
|
105 {\tt /target-nds-thumb} & build for Nintendo DS (devkitPro, THUMB mode) \\
|
76
|
106 {\tt /tool-msvc} & use Microsoft Visual C++ compiler (default) \\
|
|
107 {\tt /tool-gcc} & use GNU Compiler Collection \\
|
|
108 {\tt /asm-ml} & use Microsoft Macro Assembler (default) \\
|
|
109 {\tt /asm-as} & use the GNU Assembler \\
|
|
110 {\tt /asm-nasm} & use NASM Assembler \\
|
|
111 {\tt /config-release} & build release version (default) \\
|
|
112 {\tt /config-debug} & build debug version \\
|
|
113 \end{tabular*}
|
0
|
114
|
|
115
|
|
116 \paragraph{Plan 9 flavour}
|
|
117
|
|
118 \begin{lstlisting}
|
|
119 ./configure.rc [--option ...]
|
|
120 \end{lstlisting}
|
|
121
|
|
122 Available options (none, at the moment):
|
|
123
|
76
|
124 \begin{tabular*}{0.75\textwidth}{ll}
|
0
|
125 {\tt --help} & display help \\
|
76
|
126 \end{tabular*}
|
0
|
127
|
|
128
|
|
129 \item Build the static libraries \product{dyncall}, \product{dynload} and \product{dyncallback}
|
|
130 \begin{lstlisting}
|
|
131 make # for {GNU,BSD} Make
|
|
132 nmake /f Nmakefile # for NMake on Windows
|
|
133 mk # for mk on Plan9
|
|
134 \end{lstlisting}
|
|
135
|
|
136 \item Install libraries and includes (supported for GNU and BSD make based builds, only)
|
|
137 \begin{lstlisting}
|
|
138 make install
|
|
139 \end{lstlisting}
|
|
140
|
|
141 \item Optionally, build the test suite
|
|
142 \begin{lstlisting}
|
|
143 make tests # for {GNU,BSD} Make
|
|
144 nmake /f Nmakefile tests # for NMake on Windows
|
|
145 mk tests # for mk on Plan9
|
|
146 \end{lstlisting}% @@@ check Plan9, should work already
|
|
147 \end{enumerate}
|
|
148
|
|
149 \subsection{Build-tool specific notes}
|
|
150
|
|
151 Some platforms require some manual tweaks:
|
|
152
|
|
153 Problem: Build fails because CC and/or related are not set, or different compiler,
|
|
154 linker, etc. should be used.
|
|
155
|
|
156 Solution: Set the 'CC' and other environment variables explicitly to the desired
|
|
157 tools. E.g.:
|
|
158
|
|
159 \begin{lstlisting}
|
|
160 CC=gcc make
|
|
161 \end{lstlisting}
|
|
162
|
|
163
|
|
164 Problem: On windows using mingw and msys/unixutils 'Make', the make uses
|
|
165 'cc' for C compilation, which does not exist in mingw.
|
|
166
|
|
167 Solution: Set the 'CC' environment variable explicitly to 'gcc' (as in
|
|
168 the example above).
|
|
169
|
|
170 \subsection{Build with CMake}
|
|
171
|
|
172 \begin{lstlisting}
|
|
173 cmake -DCMAKE_INSTALL_PREFIX=<location>
|
|
174 make
|
|
175 \end{lstlisting}
|
|
176
|