Index News Docs Issues Source

Building Chawan

Chawan uses GNU make for builds.

Variables

Following is a list of variables which may be safely overridden. You can also override them by setting an environment variable with the same name.

This list does not include the CC variable, because Nim only supports a limited set of C compilers. If you want to override the C compiler:

  1. Set CC to the respective compiler anyways, because it is used by chaseccomp.
  2. If your compiler is supported by Nim, then set e.g. FLAGS=--cc:clang. Check the list of supported compilers with nim --cc:help.
  3. If your compiler is not supported by Nim, but emulates another compiler driver, then add e.g. FLAGS=--gcc.path=/usr/local/musl/bin --gcc.exe=musl-gcc --gcc.linkerexe=musl-gcc

Phony targets

Cross-compiling

Apparently it’s possible. From user cutenice (with dependencies updated):

With the latest changes, I could simply run CFLAGS=-m32 LDFLAGS=-m32 FLAGS=--cpu:i386 make to cross-compile!

I don’t know if I have any additional insight from today’s exploration.. On Arch I needed these things:

Static linking

Tested with musl as follows:

cc:gcc
gcc.path = "/usr/local/musl/bin"
gcc.exe = "musl-gcc"
gcc.linkerexe = "musl-gcc"
$ export PKG_CONFIG_PATH=/usr/local/musl/lib/pkgconfig:/usr/local/musl/lib64/pkgconfig
$ export CC=musl-gcc STATIC_LINK=1
$ make distclean
$ make