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
|
|
55 \begin{tabular}{l l l}
|
|
56 {\bf{\large Platform}} & Build Tool(s) & Compiler, SDK \\
|
|
57 \hline
|
|
58 {\bf{\large Windows}} & nmake,Visual Studio & cl, cygwin (gcc), mingw (gcc) \\
|
|
59 {\bf{\large Unix-like}} & GNU/BSD/Sun make & gcc, clang, sunc \\
|
|
60 {\bf{\large Plan9}} & mk & 8c \\
|
|
61 {\bf{\large Haiku/BeOS}} & GNU make & gcc \\
|
|
62 {\bf{\large iOS/iPhone}} & GNU make & gcc and iPhone SDK on Mac OS X \\
|
|
63 {\bf{\large Nintendo DS}} & nmake & devkitPro\cite{devkitPro} tools on Windows \\
|
|
64 {\bf{\large Playstation Portable}} & GNU make & psptoolchain\cite{psptoolchain} tools \\
|
|
65
|
|
66 \end{tabular}\\
|
|
67
|
|
68 \pagebreak
|
|
69
|
|
70 \subsection{Build instructions}
|
|
71
|
|
72
|
|
73 \begin{enumerate}
|
|
74 \item Configure the source (not needed for Makefile.embedded)
|
|
75
|
|
76 \paragraph{*nix flavour}
|
|
77 \begin{lstlisting}
|
|
78 ./configure [--option ...]
|
|
79 \end{lstlisting}
|
|
80
|
|
81 Available options (omit for defaults):
|
|
82
|
|
83 \begin{tabular}{ll}
|
|
84 {\tt --help} & display help \\
|
|
85 {\tt --prefix={\it path}} & specify installation prefix (Unix shell) \\
|
|
86 {\tt --target={\it platform}} & MacOSX,iOS,iPhoneSimulator,PSP,... \\
|
|
87 {\tt --sdk={\it version}} & SDK version \\
|
|
88 \end{tabular}
|
|
89
|
|
90 \paragraph{Windows flavour, and cross-build from Windows (PSP, NDS, etc.)}
|
|
91
|
|
92 \begin{lstlisting}
|
|
93 .\configure [/option ...]
|
|
94 \end{lstlisting}
|
|
95
|
|
96 Available options:
|
|
97
|
|
98 \begin{tabular}{ll}
|
|
99 {\tt /?} & display help \\
|
|
100 {\tt /prefix {\it path}} & set installation prefix (GNU make only) \\
|
|
101 {\tt /prefix-bd {\it path}} & set build directory prefix (GNU make only) \\
|
|
102 {\tt /target-x86} & build for x86 architecture (default) \\
|
|
103 {\tt /target-x64} & build for x64 architecture \\
|
|
104 {\tt /target-psp} & build for PlayStation Portable (homebrew SDK) \\
|
|
105 {\tt /target-nds-arm} & build for Nintendo DS (devkitPro, ARM mode) \\
|
|
106 {\tt /target-nds-thumb} & build for Nintendo DS (devkitPro, THUMB mode) \\
|
|
107 {\tt /tool-msvc} & use Microsoft Visual C++ compiler (default) \\
|
|
108 {\tt /tool-gcc} & use GNU Compiler Collection \\
|
|
109 {\tt /asm-ml} & use Microsoft Macro Assembler (default) \\
|
|
110 {\tt /asm-as} & use the GNU Assembler \\
|
|
111 {\tt /asm-nasm} & use NASM Assembler \\
|
|
112 {\tt /config-release} & build release version (default) \\
|
|
113 {\tt /config-debug} & build debug version \\
|
|
114 \end{tabular}
|
|
115
|
|
116
|
|
117 \paragraph{Plan 9 flavour}
|
|
118
|
|
119 \begin{lstlisting}
|
|
120 ./configure.rc [--option ...]
|
|
121 \end{lstlisting}
|
|
122
|
|
123 Available options (none, at the moment):
|
|
124
|
|
125 \begin{tabular}{ll}
|
|
126 {\tt --help} & display help \\
|
|
127 \end{tabular}
|
|
128
|
|
129
|
|
130 \item Build the static libraries \product{dyncall}, \product{dynload} and \product{dyncallback}
|
|
131 \begin{lstlisting}
|
|
132 make # for {GNU,BSD} Make
|
|
133 nmake /f Nmakefile # for NMake on Windows
|
|
134 mk # for mk on Plan9
|
|
135 \end{lstlisting}
|
|
136
|
|
137 \item Install libraries and includes (supported for GNU and BSD make based builds, only)
|
|
138 \begin{lstlisting}
|
|
139 make install
|
|
140 \end{lstlisting}
|
|
141
|
|
142 \item Optionally, build the test suite
|
|
143 \begin{lstlisting}
|
|
144 make tests # for {GNU,BSD} Make
|
|
145 nmake /f Nmakefile tests # for NMake on Windows
|
|
146 mk tests # for mk on Plan9
|
|
147 \end{lstlisting}% @@@ check Plan9, should work already
|
|
148 \end{enumerate}
|
|
149
|
|
150 \subsection{Build-tool specific notes}
|
|
151
|
|
152 Some platforms require some manual tweaks:
|
|
153
|
|
154 Problem: Build fails because CC and/or related are not set, or different compiler,
|
|
155 linker, etc. should be used.
|
|
156
|
|
157 Solution: Set the 'CC' and other environment variables explicitly to the desired
|
|
158 tools. E.g.:
|
|
159
|
|
160 \begin{lstlisting}
|
|
161 CC=gcc make
|
|
162 \end{lstlisting}
|
|
163
|
|
164
|
|
165 Problem: On windows using mingw and msys/unixutils 'Make', the make uses
|
|
166 'cc' for C compilation, which does not exist in mingw.
|
|
167
|
|
168 Solution: Set the 'CC' environment variable explicitly to 'gcc' (as in
|
|
169 the example above).
|
|
170
|
|
171 \subsection{Build with CMake}
|
|
172
|
|
173 \begin{lstlisting}
|
|
174 cmake -DCMAKE_INSTALL_PREFIX=<location>
|
|
175 make
|
|
176 \end{lstlisting}
|
|
177
|