add back -ldl, update readme

This commit is contained in:
dzaima 2022-11-24 17:10:13 +02:00
parent c4d0f8bdc4
commit 05d2a0a26b
2 changed files with 7 additions and 15 deletions

View File

@ -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.

View File

@ -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)