From 3431a3808f92384459b16dd638b2ad50c45831b7 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 16 Oct 2022 16:15:51 +0300 Subject: [PATCH] information about FFI usage on macOS --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3198fa9..e749fbee 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - Third-party packages and other ways to run BQN are listed [here](https://mlochbaum.github.io/BQN/running.html) - `make CC=gcc` if clang isn't installed - `make PIE=""` on ARM CPUs (incl. Android & M1) - - `make FFI=0` if your system doesn't have libffi + - `make FFI=0` if your system doesn't have libffi (see [macOS](#macos) for FFI support on macOS) - Use `gmake` on BSD - `make clean` if anything breaks and you want a clean build slate - Run `sudo make install` afterwards to install into `/usr/local/bin/bqn` (a `PREFIX=/some/path` argument will install to `/some/path/bin/bqn`); `sudo make uninstall` to uninstall @@ -39,6 +39,17 @@ - Tests can be run with `./BQN path/to/mlochbaum/BQN/test/this.bqn` (add `-noerr` if using `make heapverify`). - [Some implementation docs](https://github.com/dzaima/CBQN/tree/master/src#readme) +## macOS + +To use FFI in macOS, libffi must be installed, and manually added to `C_INCLUDE_PATH` and `LIBRARY_PATH`. In addition, the `NO_DYNAMIC_LIST=1` make argument is needed, so the full command might, depending on where libffi is installed, look like one of these: + +```sh +C_INCLUDE_PATH=/opt/homebrew/opt/libffi/include:$C_INCLUDE_PATH LIBRARY_PATH=/opt/homebrew/opt/libffi/lib:$LIBRARY_PATH make PIE="" NO_DYNAMIC_LIST=1 +C_INCLUDE_PATH=/usr/local/opt/libffi/include:$C_INCLUDE_PATH LIBRARY_PATH=/usr/local/opt/libffi/lib:$LIBRARY_PATH make PIE="" NO_DYNAMIC_LIST=1 +``` + +Further configuration (different build type, compiler options, etc) can still be done by adding more make arguments. + ## License Any file without an explicit copyright message is copyright (c) 2021 dzaima, GNU GPLv3 - see LICENSE \ No newline at end of file