From 05d2a0a26b684520346509295521535c73ec87b8 Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 24 Nov 2022 17:10:13 +0200 Subject: [PATCH] add back -ldl, update readme --- README.md | 17 +++-------------- makefile | 5 ++++- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 79a06f72..0d8c89b9 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ 1. `make` - Third-party packages and other ways to run BQN are listed [here](https://mlochbaum.github.io/BQN/running.html) - `make CC=cc` if clang isn't installed - - `make PIE=""` on ARM CPUs (incl. Android & M1) - - `make FFI=0` if your system doesn't have libffi (see [macOS](#macos) for FFI support on macOS) - - Use `gmake` on BSD + - `make PIE=""` on ARM CPUs (incl. Android & Apple M1/M2) + - `make FFI=0` if your system doesn't have libffi (if `pkg-config` doesn't exist, extra configuration may be necessary to allow CBQN to find libffi) + - Use `gmake` on BSD (a `NO_LDL=1` make arg may be useful if the build complains about `-ldl`) - `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 - `make REPLXX=1` to enable replxx (syntax highlighting & some system & variable name completion) @@ -52,17 +52,6 @@ By default, the CBQN will use [precompiled bytecode](https://github.com/dzaima/c 4. Run `said-other-bqn-impl ./build/genRuntime path/to/mlochbaum/BQN build/bytecodeLocal` In the case of the Java impl, `java -jar path/to/dzaima/BQN/BQN.jar ./build/genRuntime ~/git/BQN build/bytecodeLocal` -## 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. - ## Requirements CBQN requires either gcc or clang as the C compiler (though it defaults to `clang`, as optimizations are written based on whether or not clang needs them; add a `CC=cc` make arg to use the default system compiler), and, optionally libffi for `•FFI`, and C++ (C++11; defaults to `c++`, override with `CXX=your-c++`) for replxx. diff --git a/makefile b/makefile index 00efa0ef..42857a08 100644 --- a/makefile +++ b/makefile @@ -84,7 +84,10 @@ ifneq ($(i_FFI),0) i_LIBS_LD += $(shell pkg-config --libs libffi) i_LIBS_CC += $(shell pkg-config --cflags libffi) else - i_LIBS_LD += -lffi -ldl + i_LIBS_LD += -lffi + endif + ifneq ($(NO_LDL),1) + i_LIBS_LD += -ldl endif endif ifeq ($(i_EXPORT),1)