Building the library
The library has been built and used successfully on several platform/architecture configurations and build systems. Please see notes on specfic platforms to check if the target architecture is currently supported.
Requirements
The following tools are supported directly to build the dyncall library. However, as the number of source files to be compiled for a given platform is small, it shouldn’t be difficult to build it manually with another toolchain.
- C compiler to build the dyncall library (GCC, Clang, SunPro or Microsoft C/C++ compiler)
- C++ compiler to build the optional test cases (GCC, Clang, SunPro or Microsoft C/C++ compiler)
- BSD make, GNU make, Microsoft nmake or mk (on Plan9) as automated build tools
- Python (optional - for generation of some test cases)
- Lua (optional - for generation of some test cases)
- CMake (optional support)
Supported/tested platforms and build systems
Building dyncall is a straightforward two-step process, first configure, then make. The 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 dyncall:
Platform | Build Tool(s) | Compiler, SDK |
Windows | nmake,Visual Studio | cl, cygwin (gcc), mingw (gcc) |
Unix-like | GNU/BSD/Sun make | gcc, clang, sunc |
Plan9 | mk | 8c |
Haiku/BeOS | GNU make | gcc |
iOS/iPhone | GNU make | gcc and iPhone SDK on Mac OS X |
Nintendo DS | nmake | devkitPro[43] tools on Windows |
Playstation Portable | GNU make | psptoolchain[44] tools |
Build instructions
- Configure the source (not needed for Makefile.embedded)
*nix flavour
Available options (omit for defaults):
Windows flavour, and cross-build from Windows (PSP, NDS, etc.)--help display help --prefix=path specify installation prefix (Unix shell) --target=platform MacOSX,iOS,iPhoneSimulator,PSP,... --sdk=version SDK version Available options:
Plan 9 flavour/? display help /target-x86 build for x86 architecture (default) /target-x64 build for x64 architecture /target-arm64 build for x64 architecture /target-psp cross-build for PlayStation Portable (homebrew SDK) /target-nds-arm cross-build for Nintendo DS (devkitPro, ARM mode) /target-nds-thumb cross-build for Nintendo DS (devkitPro, THUMB mode) /tool-msvc use Microsoft Visual C++ compiler (default) /tool-gcc use GNU Compiler Collection /tool-clang use GNU Compiler Collection /asm-ml use Microsoft Macro Assembler (default) /asm-as use the GNU or LLVM Assembler /asm-nasm use NASM Assembler Available options (none, at the moment):
--help display help - Build the static libraries dyncall, dynload and dyncallback
- Install libraries and includes (supported for GNU and BSD make based builds, only)
- Optionally, build the test suite
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.:
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).
Build with CMake