@@ -63,7 +63,7 @@ PHP ?= $(X_PHP_TOOL)
6363PKG_CONFIG ?= $(X_PKG_CONFIG )
6464
6565# Define tool variables for host build
66- ifeq ($(CROSS_COMPILE ) ,1 )
66+ ifeq ($(call fcheck,crosscompile, $( BUILD_FEATURES ) ,ON) ,ON )
6767 HOST_CC ?= $(X_CC_TOOL )
6868 HOST_CXX ?= $(X_CXX_TOOL )
6969 HOST_AS ?= $(X_AS_TOOL )
@@ -118,37 +118,37 @@ else ifeq ($(PLATFORM),BSD)
118118 NOARCH_SO_FLAGS += -L/usr/local/lib
119119endif
120120
121- ifeq ($(DEBUG ) ,1 )
121+ ifeq ($(call fcheck,debug, $( BUILD_FEATURES ) ,ON) ,ON )
122122 NOARCH_CFLAGS += -Og -g3 -DLSP_DEBUG -falign-functions=16
123123 NOARCH_CXXFLAGS += -Og -g3 -DLSP_DEBUG -falign-functions=16
124124else
125125 NOARCH_CFLAGS += -O2
126126 NOARCH_CXXFLAGS += -O2
127127endif
128128
129- ifeq ($(ASAN ) ,1 )
129+ ifeq ($(call fcheck,asan, $( BUILD_FEATURES ) ,ON) ,ON )
130130 NOARCH_CFLAGS += -fsanitize=address
131131 NOARCH_CXXFLAGS += -fsanitize=address
132132 NOARCH_EXE_FLAGS += -fsanitize=address
133133 NOARCH_SO_FLAGS += -fsanitize=address
134134endif
135135
136- ifeq ($(PROFILE ) ,1 )
136+ ifeq ($(call fcheck,profile, $( BUILD_FEATURES ) ,ON) ,ON )
137137 NOARCH_CFLAGS += -pg -DLSP_PROFILE
138138 NOARCH_CXXFLAGS += -pg -DLSP_PROFILE
139139endif
140140
141- ifeq ($(TRACE ) ,1 )
141+ ifeq ($(call fcheck,trace, $( BUILD_FEATURES ) ,ON) ,ON )
142142 NOARCH_CFLAGS += -DLSP_TRACE
143143 NOARCH_CXXFLAGS += -DLSP_TRACE
144144endif
145145
146- ifeq ($(STRICT ) ,1 )
146+ ifeq ($(call fcheck,strict, $( BUILD_FEATURES ) ,ON) ,ON )
147147 NOARCH_CFLAGS += -Werror
148148 NOARCH_CXXFLAGS += -Werror
149149endif
150150
151- ifeq ($(TEST ) ,1 )
151+ ifeq ($(call fcheck,test, $( BUILD_FEATURES ) ,ON) ,ON )
152152 NOARCH_CFLAGS += -DLSP_TESTING
153153 NOARCH_CXXFLAGS += -DLSP_TESTING
154154 EXPORT_SYMBOLS ?= 1
@@ -222,6 +222,7 @@ TOOL_VARS := \
222222
223223.PHONY : toolvars
224224toolvars :
225+ echo " "
225226 echo " List of tool variables:"
226227 echo " AR Archiver tool for target build"
227228 echo " AS Assembler tool for target build"
@@ -254,4 +255,13 @@ toolvars:
254255 echo " PKG_CONFIG Installed package management tool for target build"
255256 echo " SO_FLAGS Flags to link shared object/library files for target build"
256257 echo " "
257-
258+ echo " Available compilation FEATURES:"
259+ echo " asan Build with address sanitizer enabled"
260+ echo " crosscompile Build with additional debug information and debug logs enabled"
261+ echo " debug Build with additional debug information and debug logs enabled"
262+ echo " devel Use development (SSH) links for remote repositories instead of HTTPS"
263+ echo " profile Build with gprof profiling options"
264+ echo " strict Strict compilation: treat all compilation warning as errors"
265+ echo " test Enable tests and build test binary"
266+ echo " trace Enable output of additional trace logs"
267+ echo " "
0 commit comments