From 8b8280e3619f0e1f51b41dbdaf44c573eaa03c17 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 8 Mar 2024 11:09:03 +1300 Subject: [PATCH] Change default CONFIG to none - Use default value of `CXX` instead of forcing override to `clang++`. - Add base `CXXFLAGS` and `ABCMKARGS` in else condition of `ifeq ($(CONFIG),..)` block and output the value of `CXX`. - Change readme to mention `CXX` envvar and that using `make config-clang` etc will ignore `CXX`. --- Makefile | 7 ++++++- README.md | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 81715ded523..62a17168036 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ -CONFIG := clang +CONFIG := none +# CONFIG := clang # CONFIG := gcc # CONFIG := afl-gcc # CONFIG := emcc @@ -362,6 +363,10 @@ EXE = .exe else ifneq ($(CONFIG),none) $(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, emcc, mxe, msys2-32, msys2-64) +else +$(info Using provided C++ compiler, '$(CXX)'.) +CXXFLAGS += -std=$(CXXSTD) -Os +ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H $(ABC_ARCHFLAGS)" endif ifeq ($(ENABLE_LIBYOSYS),1) diff --git a/README.md b/README.md index 660bd5c6d57..d3aea85345d 100644 --- a/README.md +++ b/README.md @@ -105,11 +105,17 @@ For Cygwin use the following command to install all prerequisites, or select the setup-x86_64.exe -q --packages=bison,flex,gcc-core,gcc-g++,git,libffi-devel,libreadline-devel,make,pkg-config,python3,tcl-devel,boost-build,zlib-devel -To configure the build system to use a specific compiler, use one of +The environment variable `CXX` can be used to control the C++ compiler used, or +run one of the following: $ make config-clang $ make config-gcc +Note that these will result in `make` ignoring the `CXX` environment variable, +unless `CXX` is assigned in the call to make, e.g. + + $ make CXX=$CXX + For other compilers and build configurations it might be necessary to make some changes to the config section of the Makefile.