Dyn

 view release on metacpan or  search on metacpan

dyncall/doc/manual/manual_build.tex  view on Meta::CPAN

library should be able to be built with the default operating systems' build tools, so BSD make on
BSD and derived systems, GNU make on GNU and compatible, mk on Plan9, nmake on Windows, etc..
This is a detailed overview of platforms and their build tools that are known to build
\product{dyncall}:\\
\\


\begin{tabular*}{0.75\textwidth}{lll}
\textbf{Platform}             & Build Tool(s)       & Compiler, SDK                              \\
\hline
\textbf{Windows}              & nmake,Visual Studio & cl, cygwin (gcc), mingw (gcc)              \\
\textbf{Unix-like}            & GNU/BSD/Sun make    & gcc, clang, sunc                           \\
\textbf{Plan9}                & mk                  & 8c                                         \\
\textbf{Haiku/BeOS}           & GNU make            & gcc                                        \\
\textbf{iOS/iPhone}           & GNU make            & gcc and iPhone SDK on Mac OS X             \\
\textbf{Nintendo DS}          & nmake               & devkitPro\cite{devkitPro} tools on Windows \\
\textbf{Playstation Portable} & GNU make            & psptoolchain\cite{psptoolchain} tools      \\
\end{tabular*}\\

\pagebreak

\subsection{Build instructions}


\begin{enumerate}
\item Configure the source (not needed for Makefile.embedded)

\paragraph{*nix flavour}
\begin{lstlisting}
./configure [--option ...]
\end{lstlisting}

Available options (omit for defaults):

\begin{tabular*}{0.75\textwidth}{ll}
{\tt --help}                     & display help                             \\
{\tt --prefix=\textit{path}}     & specify installation prefix (Unix shell) \\
{\tt --target=\textit{platform}} & MacOSX,iOS,iPhoneSimulator,PSP,...       \\
{\tt --sdk=\textit{version}}     & SDK version                              \\
\end{tabular*}

\paragraph{Windows flavour, and cross-build from Windows (PSP, NDS, etc.)}

\begin{lstlisting}
.\configure [/option ...]
\end{lstlisting}

Available options:

\begin{tabular*}{0.75\textwidth}{ll}
{\tt /?}                       & display help                                        \\
{\tt /target-x86}              & build for x86 architecture (default)                \\
{\tt /target-x64}              & build for x64 architecture                          \\
{\tt /target-arm64}            & build for x64 architecture                          \\
{\tt /target-psp}              & cross-build for PlayStation Portable (homebrew SDK) \\
{\tt /target-nds-arm}          & cross-build for Nintendo DS (devkitPro, ARM mode)   \\
{\tt /target-nds-thumb}        & cross-build for Nintendo DS (devkitPro, THUMB mode) \\
{\tt /tool-msvc}               & use Microsoft Visual C++ compiler (default)         \\
{\tt /tool-gcc}                & use GNU Compiler Collection                         \\
{\tt /tool-clang}              & use GNU Compiler Collection                         \\
{\tt /asm-ml}                  & use Microsoft Macro Assembler (default)             \\
{\tt /asm-as}                  & use the GNU or LLVM Assembler                       \\
{\tt /asm-nasm}                & use NASM Assembler                                  \\
\end{tabular*}


\paragraph{Plan 9 flavour}

\begin{lstlisting}
./configure.rc [--option ...]
\end{lstlisting}

Available options (none, at the moment):

\begin{tabular*}{0.75\textwidth}{ll}
{\tt --help} & display help \\
\end{tabular*}


\item Build the static libraries \product{dyncall}, \product{dynload} and \product{dyncallback}
\begin{lstlisting}
make                      # for {GNU,BSD} Make
nmake /f Nmakefile        # for NMake on Windows
mk                        # for mk on Plan9
\end{lstlisting}

\item Install libraries and includes (supported for GNU and BSD make based builds, only)
\begin{lstlisting}
make install 
\end{lstlisting}

\item Optionally, build the test suite
\begin{lstlisting}
make tests                     # for {GNU,BSD} Make
nmake /f Nmakefile tests       # for NMake on Windows
mk tests                       # for mk on Plan9
\end{lstlisting}% @@@ check Plan9, should work already
\end{enumerate}

\subsection{Build-tool specific notes}

Some platforms require some manual tweaks:

Problem: Build fails because CC and/or related are not set, or different compiler,
linker, etc. should be used.

Solution: Set the 'CC' and other environment variables explicitly to the desired
tools. E.g.:

\begin{lstlisting}
CC=gcc make
\end{lstlisting}


Problem: On windows using mingw and msys/unixutils 'Make', the make uses
'cc' for C compilation, which does not exist in mingw.

Solution: Set the 'CC' environment variable explicitly to e.g. 'gcc' (as in the
example above).

\subsection{Build with CMake}



( run in 3.333 seconds using v1.01-cache-2.11-cpan-ceb78f64989 )