From 8c58e5683cbd90d529eb1ea86fce019e553b2248 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Thu, 5 Aug 2021 18:30:33 +0100 Subject: Cross compilation support --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index b408e55..1bc870b 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,22 @@ linker for certain math.h functions. Run `redo all` to build the library and tests. +### Cross Compilation + +To cross compile, run `./configure` as normal and edit the resulting `config.rc` +to set `TCC` to the target compiler. Additional flags can be passed via the +arrays `TCFLAGS`, `TCPPFLAGS`, `TLDFLAGS`, and `TLDLIBS`. Host specific flags +can be passed via the corresponding `H` arrays. + +For example, to cross compile for windows using `i686-w64-mingw32-gcc` as the +target compiler and `clang` as the host compiler: + +``` +$ CC=clang ./configure +$ echo TCC=i686-w64-mingw32-gcc >>config.rc +$ redo all +``` + Testing ------- -- cgit v1.2.3-54-g00ecf