I.e. add HOSTCXX etc make variables, and use the host compiler when
compiling mconfig-gen.
# the new ABI. See BUILD file for more information.
CXX=g++
CXXOPTS=-D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11 -Os -Wall -fno-rtti -fno-plt -flto
-LDFLAGS=-flto
+LDFLAGS=-flto -Os
BUILD_SHUTDOWN=yes
SANITIZEOPTS=-fsanitize=address,undefined
include ../mconfig
+HOSTCXX ?= $(CXX)
+HOSTCXXFLAGS ?= $(CXXFLAGS)
+HOSTLDFLAGS ?= $(LDFLAGS)
+
ifeq ($(BUILD_SHUTDOWN),yes)
SHUTDOWN=shutdown
endif
$(if $(USE_UTMPX),USE_UTMPX=$(USE_UTMPX),) > includes/mconfig.h
mconfig-gen: mconfig-gen.cc ../mconfig
- $(CXX) $(CXXOPTS) -o mconfig-gen mconfig-gen.cc $(LDFLAGS)
+ $(HOSTCXX) $(HOSTCXXOPTS) -o mconfig-gen mconfig-gen.cc $(HOSTLDFLAGS)
$(dinit_objects): includes/mconfig.h