diff --git a/CHANGELOG b/CHANGELOG index 7564528..1fcabaa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ === 1.0.22 === * Fixed compilation on modern compilers. +* Updated build scripts and dependencies. === 1.0.21 === * Added support of sidechain passed by shared memory link. diff --git a/make/configure.mk b/make/configure.mk index bf04ab5..73b2244 100644 --- a/make/configure.mk +++ b/make/configure.mk @@ -53,7 +53,7 @@ MERGED_DEPENDENCIES := \ $(PLUGIN_SHARED) UNIQ_MERGED_DEPENDENCIES := $(call uniq, $(MERGED_DEPENDENCIES)) DEPENDENCIES = $(UNIQ_MERGED_DEPENDENCIES) -FEATURES := $(sort $(call subtraction,$(SUB_FEATURES),$(DEFAULT_FEATURES) $(ADD_FEATURES))) +BUILD_FEATURES := $(sort $(call subtraction,$(SUB_FEATURES),$(if $(FEATURES),$(FEATURES),$(DEFAULT_FEATURES)) $(ADD_FEATURES))) # Determine versions ifeq ($(findstring -devel,$(ARTIFACT_VERSION)),-devel) @@ -69,6 +69,9 @@ else ) endif +$(info PKG_CONFIG = $(PKG_CONFIG)) +$(info HOST_PKG_CONFIG = $(HOST_PKG_CONFIG)) + define pkgconfig = $(eval name=$(1)) @@ -320,7 +323,7 @@ $(CONFIG_VARS): prepare config: $(CONFIG_VARS) echo "Host architecture: $(HOST_ARCHITECTURE_FAMILY)/$(HOST_ARCHITECTURE) ($(HOST_ARCHITECTURE_CFLAGS))" echo "Architecture: $(ARCHITECTURE_FAMILY)/$(ARCHITECTURE) ($(ARCHITECTURE_CFLAGS))" - echo "Features: $(FEATURES)" + echo "Features: $(BUILD_FEATURES)" echo "Configured OK" help: | pathvars toolvars sysvars diff --git a/make/system.mk b/make/system.mk index 08de252..e044d0d 100644 --- a/make/system.mk +++ b/make/system.mk @@ -53,6 +53,17 @@ else endif BUILD_ARCH := $(if $(ARCHITECTURE),$(ARCHITECTURE),$(HOST_BUILD_ARCH)) +ifeq ($(PLATFORM),Linux) + OBJ_LDFLAGS_X86 = -m elf_i386 + OBJ_LDFLAGS_X86_64 = -m elf_x86_64 +else ifeq ($(PLATFORM),BSD) + OBJ_LDFLAGS_X86 = -m elf_i386 + OBJ_LDFLAGS_X86_64 = -m elf_x86_64 +else ifeq ($(PLATFORM),Windows) + OBJ_LDFLAGS_X86 = -m i386pe + OBJ_LDFLAGS_X86_64 = -m i386pep +endif + # Set actual architecture for HOST and TARGET builds # The current architecture can be obtained by: gcc -Q --help=target define detect_architecture = @@ -100,30 +111,37 @@ define detect_architecture = $(2)_NAME = x86_64 $(2)_FAMILY = x86_64 $(2)_CFLAGS := -march=x86-64 -m64 + $(2)_LDFLAGS := $(OBJ_LDFLAGS_X86_64) else ifeq ($(patsubst %amd64%,amd64,$(1)),amd64) $(2)_NAME = x86_64 $(2)_FAMILY = x86_64 $(2)_CFLAGS := -march=x86-64 -m64 + $(2)_LDFLAGS := $(OBJ_LDFLAGS_X86_64) else ifeq ($(patsubst %AMD64%,AMD64,$(1)),AMD64) $(2)_NAME = x86_64 $(2)_FAMILY = x86_64 $(2)_CFLAGS := -march=x86-64 -m64 + $(2)_LDFLAGS := $(OBJ_LDFLAGS_X86_64) else ifeq ($(1),i86pc) $(2)_NAME = x86_64 $(2)_FAMILY = x86_64 $(2)_CFLAGS := -march=x86-64 -m64 + $(2)_LDFLAGS := $(OBJ_LDFLAGS_X86_64) else ifeq ($(patsubst %i686%,i686,$(1)),i686) $(2)_NAME = i686 $(2)_FAMILY = ia32 $(2)_CFLAGS := -march=i686 -m32 + $(2)_LDFLAGS := $(OBJ_LDFLAGS_X86) else ifeq ($(patsubst i%86,i586,$(1)),i586) $(2)_NAME = i586 $(2)_FAMILY = ia32 $(2)_CFLAGS := -march=i586 -m32 + $(2)_LDFLAGS := $(OBJ_LDFLAGS_X86) else ifeq ($(1),x86) $(2)_NAME = i686 $(2)_FAMILY = ia32 $(2)_CFLAGS := -march=i686 -m32 + $(2)_LDFLAGS := $(OBJ_LDFLAGS_X86) else ifeq ($(1),riscv32) $(2)_NAME = riscv32 $(2)_FAMILY = riscv32 @@ -191,11 +209,11 @@ COMMON_VARS = \ ARCHITECTURE \ ARCHITECTURE_FAMILY \ ARCHITECTURE_CFLAGS \ + BUILD_FEATURES \ CROSS_COMPILE \ DEBUG \ EXECUTABLE_EXT \ EXPORT_SYMBOLS \ - FEATURES \ HOST_ARCHITECTURE \ HOST_ARCHITECTURE_FAMILY \ HOST_ARCHITECTURE_CFLAGS \ diff --git a/src/Makefile b/src/Makefile index 16a320a..0eead45 100644 --- a/src/Makefile +++ b/src/Makefile @@ -63,7 +63,7 @@ ARTIFACT_OBJ = \ $(ARTIFACT_OBJ_META) \ $(ARTIFACT_OBJ_DSP) \ $(ARTIFACT_OBJ_SHARED) \ - $(call fcheck,ui,$(FEATURES),$(ARTIFACT_OBJ_UI)) + $(call fcheck,ui,$(BUILD_FEATURES),$(ARTIFACT_OBJ_UI)) CXX_SRC_STUB = $(ARTIFACT_BIN)/stub.cpp CXX_SRC_MAIN_META = $(call rwildcard, main/meta, *.cpp)