# Build Scripts

Scripts to build software libraries for various systems.

Libraries for Windows are built for static linking, for simple single-file EXE distribution.

Libraries for Web are built for static linking, as Emscripten does not yet support shared libraries.

# 1 Source Code

code.mathr.co.uk/build-scripts

git clone https://code.mathr.co.uk/build-scripts.git

# 2 Prerequisites

Tested on Debian Bookworm x86_64.

  • mingw-w64, wine, with i386 multiarch (for x86_64 and i686 builds for Windows, pre-installed in /usr/); See distribution packages, current version 10.0.0-3 (Debian Bookworm).

  • llvm-mingw (for aarch64 and armv7 builds for Windows, pre-installed in ${HOME}/opt/llvm-mingw/, with its bin in the PATH environment variable after /usr/bin); See https://github.com/mstorsjo/llvm-mingw/releases, current version 2023-11-28 with LLVM 17.0.6 (Ubuntu 20.04 MSVCRT x86_64).

  • emsdk (for emscripten builds for Web, installed automatically in ${HOME}/opt/src/emsdk); See https://github.com/emscripten-core/emsdk, current version 3.1.53.

  • a complete build of everything needs about 10GB of disk space.

# 3 Usage

  • ./BUILD.sh download "lib ..." will download the source code for the libraries to ${HOME}/opt/src.

  • ./BUILD.sh arch "lib ..." will build the specified libraries for the specified architecture storing the results in ${HOME}/opt/windows/... and ${HOME}/opt/emscripten/...

Both commands default to all libraries if not specified.

# 4 Architectures:

  • x86_64-w64-mingw32 - Windows Intel 64bit
  • i686-w64-mingw32 - Windows Intel 32bit
  • aarch64-w64-mingw32 - Windows ARM 64bit
  • armv7-w64-mingw32 - Windows ARM 32bit
  • emscripten - Web (WASM, Javascript and HTML etc)

# 5 Libraries

These build scripts are kept up to date. More may be added.

  • clew - latest - git clone/update
  • deflate - 1.20
  • emsdk - latest - git clone/update
  • flite - latest - git clone/update
  • fftw3 - 3.3.10
  • glew - 2.2.0 - copies glew.c to include/GL, for compilation with -DGLEW_STATIC
  • glfw - 3.3.10 - not emscripten (suggest using sdl2 instead)
  • glm - 1.0.1
  • gmp - 6.3.0
  • imath - 3.1.11
  • jpeg - 3.0.3 - libjpeg-turbo
  • mpc - 1.3.1 - depends on mpfr (and thus gmp)
  • mpfr - 4.2.1 - depends on gmp
  • mpreal - 3.7.1 - depends on mpfr (and thus gmp) - also known as mpfrc++
  • openexr3 - 3.2.4 - depends on imath and deflate
  • png - 1.6.43 - depends on zlib
  • sdl2 - 2.30.2 - emscripten has a built in version
  • toml11 - latest - git clone/update
  • zlib - 1.3.1

# 5.1 Old Libraries

These build scripts are no longer updated, but may still work if you need them.

  • openexr2 - 2.5.8 - depends on zlib, has a built in version of imath

# 6 Android

See:

code.mathr.co.uk/android-build-scripts

git clone https://code.mathr.co.uk/android-build-scripts.git