]> gitweb.factorcode.org Git - factor.git/commitdiff
debian: Don't install gcc g++ on debian.
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 9 Mar 2019 03:08:26 +0000 (21:08 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 9 Mar 2019 03:19:33 +0000 (21:19 -0600)
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++.

GNUmakefile
build.sh
vm/Config.linux

index df11a97a6686baf5356027c99cbd339a811ea408..2a779b485562ab534c4d9c073bb78f7ef4f5ac21 100644 (file)
@@ -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 \
index 35f10176d0bc3eef1bc140e2bd3c42059100ab90..f23dd1667108b7a7f322402e7bc88a9d60c9e13d 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -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
 }
 
index aac32fa3c31c154461ee9739be36f0d52937e611..fae2cd4f0e15f8179d7a300d781f1370d7721c1f 100644 (file)
@@ -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