Skip to content

Commit

Permalink
debian: Don't install gcc g++ on debian.
Browse files Browse the repository at this point in the history
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++.
  • Loading branch information
erg committed Mar 9, 2019
1 parent 4403155 commit d6c3cff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions GNUmakefile
Expand Up @@ -5,6 +5,14 @@ ifdef CONFIG
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 \
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Expand Up @@ -686,7 +686,7 @@ make_boot_image() {
}

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
}

Expand Down
5 changes: 4 additions & 1 deletion vm/Config.linux
Expand Up @@ -5,6 +5,9 @@ LIBS = -ldl -lm -lrt -lpthread -Wl,--export-dynamic

# 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

0 comments on commit d6c3cff

Please sign in to comment.