gmake assumes default CC is cc, CXX is g++ (not c++).
In order to make this sane (c++), we check if the shell variable CXX was set
and if so we honor it, else we set CXX to c++.
DEBUG ?= 0
REPRODUCIBLE ?= 0
+ # gmake's default CXX is g++, we prefer c++
+ SHELL_CXX = $(shell printenv CXX)
+ ifeq ($(SHELL_CXX),)
+ CXX=c++
+ else
+ CXX=$(SHELL_CXX)
+ endif
+
include $(CONFIG)
CFLAGS = -Wall \
}
install_deps_apt() {
- sudo apt install --yes libc6-dev libpango1.0-dev libx11-dev xorg-dev libgtk2.0-dev gtk2-engines-pixbuf libgtkglext1-dev wget git git-doc rlwrap clang gcc make screen tmux libssl-dev g++
+ sudo apt install --yes libc6-dev libpango1.0-dev libx11-dev xorg-dev libgtk2.0-dev gtk2-engines-pixbuf libgtkglext1-dev wget git git-doc rlwrap clang make screen tmux libssl-dev
check_ret sudo
}
# clang spams warnings if we use -Wl,--no-as-needed with -c
# -Wl,--no-as-needed is a gcc optimization, not required
-ifneq ($(CXX),clang++)
+# we want to work with g++ aliased as c++ here, too
+IS_GCC = $(shell $(CXX) --version | grep '(GCC)')
+
+ifdef ($(IS_GCC))
SITE_CFLAGS += -Wl,--no-as-needed
endif