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.


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.

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[40] tools on Windows
Playstation Portable GNU make psptoolchain[41] tools

Build instructions

  1. Configure the source (not needed for Makefile.embedded) *nix flavour
    ./configure [--option ...]

    Available options (omit for defaults):

    --help display help
    --prefix=path specify installation prefix (Unix shell)
    --target=platform MacOSX,iOS,iPhoneSimulator,PSP,...
    --sdk=version SDK version
    Windows flavour, and cross-build from Windows (PSP, NDS, etc.)
    .\configure [/option ...]

    Available options:

    /? display help
    /prefix path set installation prefix (GNU make only)
    /prefix-bd path set build directory prefix (GNU make only)
    /target-x86 build for x86 architecture (default)
    /target-x64 build for x64 architecture
    /target-psp build for PlayStation Portable (homebrew SDK)
    /target-nds-arm build for Nintendo DS (devkitPro, ARM mode)
    /target-nds-thumb build for Nintendo DS (devkitPro, THUMB mode)
    /tool-msvc use Microsoft Visual C++ compiler (default)
    /tool-gcc use GNU Compiler Collection
    /asm-ml use Microsoft Macro Assembler (default)
    /asm-as use the GNU Assembler
    /asm-nasm use NASM Assembler
    /config-release build release version (default)
    /config-debug build debug version
    Plan 9 flavour
    ./configure.rc [--option ...]

    Available options (none, at the moment):

    --help display help
  2. Build the static libraries dyncall, dynload and dyncallback
    make                      # for {GNU,BSD} Make 
    nmake /f Nmakefile        # for NMake on Windows 
    mk                        # for mk on Plan9
  3. Install libraries and includes (supported for GNU and BSD make based builds, only)
    make install
  4. Optionally, build the test suite
    make tests                     # for {GNU,BSD} Make 
    nmake /f Nmakefile tests       # for NMake on Windows 
    mk tests                       # for mk on Plan9

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.:

CC=gcc make

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 ’gcc’ (as in the example above).

Build with CMake

cmake -DCMAKE_INSTALL_PREFIX=<location>