As you may imagine, this is a BASIC compiler. The language variant is reasonably close to QB64 but we're willing to break compatibility with programs from 1985 when needed.
Building L-BASIC is more complex than a regular QB64 program, particularly because of the need to link against LLVM. Also, neither the L-BASIC source tree or any prerequisites can be installed in a path containing spaces - this is a limitation of make
. L-BASIC itself can handle paths with spaces though.
Install prerequisites:
- QB64 (Phoenix edition), version 3.4.1: https://github.com/QB64-Phoenix-Edition/QB64pe/releases/download/v3.4.1/qb64pe_win-x64-3.4.1.7z [SHA-256: 41ba1d4da734c2c2ac309d923b48a9ccf3afbf936b1d23a3be9a885840a7f95d]
- MSYS2: https://www.msys2.org/
- LLVM-mingw (ucrt edition), version 20220323/14.0.0: https://github.com/mstorsjo/llvm-mingw/releases/download/20220323/llvm-mingw-20220323-ucrt-x86_64.zip [SHA-256: 3014a95e4ec4d5c9d31f52fbd6ff43174a0d9c422c663de7f7be8c2fcc9d837a]
Inside an MSYS environment:
- Install git and make:
pacman -S git make
- Extract LLVM-mingw to
~
- Extract QB64 to to
~
- Configure environment:
export QB64=~/qb64pe/qb64pe.exe export LLVM_INSTALL=~/llvm-mingw-20220323-ucrt-x86_64 export PYTHON=$LLVM_INSTALL/python/bin/python3.exe
- Build:
./build.sh
The output binary is out/lbasic.exe
. To compile a program:
./out/lbasic.exe -t hello.bas
./hello.exe
Install prerequisites:
- QB64 (Phoenix edition), version 3.13.1: https://github.com/QB64-Phoenix-Edition/QB64pe/releases/download/v3.13.1/qb64pe_lnx-3.13.1.tar.gz [SHA-256: 78d86be389d6a2bb963cf0c822a950d297cc13dfa7b41d8917c924cd9bc47f38]
- clang, version 14. On apt based systems:
sudo apt install clang-14
. If your distro doesn't have that version, the LLVM project provides a custom repository: https://apt.llvm.org/ - Configure environment:
export QB64=~/qb64pe/qb64pe
- Build:
./build.sh
The output binary is out/lbasic
. To compile a program:
./out/lbasic -t hello.bas
./hello
These may be set as environment variables before running build.sh:
QB64
: Path to QB64 compiler programQBFLAGS
: QB64 compilation flags to useOUT_DIR
: Directory to place final output binariesLBASIC_CORE_COMPILER
: L-BASIC compiler used to build internal libraries. Defaults to the just-built lbasic in OUT_DIR.TOOLS_DIR
: Location of the tools source directoryLLVM_INSTALL
: Directory containing the bin and lib folder for the LLVM installation. If empty or set tosystem
, expect programs to be on the PATH.CC
: C compiler used to build foundation libraryAR
: Archiver used to build internal librariesCFLAGS
: C compiler flags used to build foundation libraryPYTHON
: Path to python program used to run python build steps