Mercurial > pub > dyncall > dyncall
annotate doc/manual/manual_build.tex @ 663:127b569978cc default tip
- another tweak handling clang trying to be too smart (see last commit)
author | Tassilo Philipp |
---|---|
date | Sun, 24 Mar 2024 13:52:44 +0100 |
parents | 191aeb9d3bff |
children |
rev | line source |
---|---|
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 | |
467 | 20 \clearpage |
0 | 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} |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
98 {\tt /?} & display help \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
99 {\tt /target-x86} & build for x86 architecture (default) \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
100 {\tt /target-x64} & build for x64 architecture \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
101 {\tt /target-arm64} & build for x64 architecture \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
102 {\tt /target-psp} & cross-build for PlayStation Portable (homebrew SDK) \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
103 {\tt /target-nds-arm} & cross-build for Nintendo DS (devkitPro, ARM mode) \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
104 {\tt /target-nds-thumb} & cross-build for Nintendo DS (devkitPro, THUMB mode) \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
105 {\tt /tool-msvc} & use Microsoft Visual C++ compiler (default) \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
106 {\tt /tool-gcc} & use GNU Compiler Collection \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
107 {\tt /tool-clang} & use GNU Compiler Collection \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
108 {\tt /asm-ml} & use Microsoft Macro Assembler (default) \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
109 {\tt /asm-as} & use the GNU or LLVM Assembler \\ |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
467
diff
changeset
|
110 {\tt /asm-nasm} & use NASM Assembler \\ |
76 | 111 \end{tabular*} |
0 | 112 |
113 | |
114 \paragraph{Plan 9 flavour} | |
115 | |
116 \begin{lstlisting} | |
117 ./configure.rc [--option ...] | |
118 \end{lstlisting} | |
119 | |
120 Available options (none, at the moment): | |
121 | |
76 | 122 \begin{tabular*}{0.75\textwidth}{ll} |
0 | 123 {\tt --help} & display help \\ |
76 | 124 \end{tabular*} |
0 | 125 |
126 | |
127 \item Build the static libraries \product{dyncall}, \product{dynload} and \product{dyncallback} | |
128 \begin{lstlisting} | |
129 make # for {GNU,BSD} Make | |
130 nmake /f Nmakefile # for NMake on Windows | |
131 mk # for mk on Plan9 | |
132 \end{lstlisting} | |
133 | |
134 \item Install libraries and includes (supported for GNU and BSD make based builds, only) | |
135 \begin{lstlisting} | |
136 make install | |
137 \end{lstlisting} | |
138 | |
139 \item Optionally, build the test suite | |
140 \begin{lstlisting} | |
141 make tests # for {GNU,BSD} Make | |
142 nmake /f Nmakefile tests # for NMake on Windows | |
143 mk tests # for mk on Plan9 | |
144 \end{lstlisting}% @@@ check Plan9, should work already | |
145 \end{enumerate} | |
146 | |
147 \subsection{Build-tool specific notes} | |
148 | |
149 Some platforms require some manual tweaks: | |
150 | |
151 Problem: Build fails because CC and/or related are not set, or different compiler, | |
152 linker, etc. should be used. | |
153 | |
154 Solution: Set the 'CC' and other environment variables explicitly to the desired | |
155 tools. E.g.: | |
156 | |
157 \begin{lstlisting} | |
158 CC=gcc make | |
159 \end{lstlisting} | |
160 | |
161 | |
162 Problem: On windows using mingw and msys/unixutils 'Make', the make uses | |
163 'cc' for C compilation, which does not exist in mingw. | |
164 | |
639 | 165 Solution: Set the 'CC' environment variable explicitly to e.g. 'gcc' (as in the |
166 example above). | |
0 | 167 |
168 \subsection{Build with CMake} | |
169 | |
170 \begin{lstlisting} | |
171 cmake -DCMAKE_INSTALL_PREFIX=<location> | |
172 make | |
173 \end{lstlisting} | |
174 |