From 394603b7e6869a2df85daf0e88cec5737c62978c Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Sat, 14 Sep 2024 20:19:54 +0300 Subject: [PATCH] Updated build scripts --- CHANGELOG | 1 + Makefile | 4 ++-- make/configure.mk | 12 +++++++++++- make/paths.mk | 10 +++++++--- make/system.mk | 6 ++++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a8722f6..61d6a0f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ === 1.0.38 === * Locale settings from the are now applied in thread-local context. +* Updated build scripts. === 1.0.37 === * Updated definition of atomic operations. diff --git a/Makefile b/Makefile index d9e6b2f..3fe13d9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ #!/usr/bin/make -f # -# Copyright (C) 2020 Linux Studio Plugins Project -# (C) 2020 Vladimir Sadovnikov +# Copyright (C) 2024 Linux Studio Plugins Project +# (C) 2024 Vladimir Sadovnikov # # This file is part of lsp-common-lib # diff --git a/make/configure.mk b/make/configure.mk index d6449e1..aca76ec 100644 --- a/make/configure.mk +++ b/make/configure.mk @@ -49,7 +49,7 @@ MERGED_DEPENDENCIES := \ $(TEST_DEPENDENCIES) UNIQ_MERGED_DEPENDENCIES := $(call uniq, $(MERGED_DEPENDENCIES)) DEPENDENCIES = $(UNIQ_MERGED_DEPENDENCIES) -FEATURES := $(call uniq, $(call subtraction,$(SUB_FEATURES),$(DEFAULT_FEATURES) $(ADD_FEATURES))) +FEATURES := $(sort $(call subtraction,$(SUB_FEATURES),$(DEFAULT_FEATURES) $(ADD_FEATURES))) # Determine versions ifeq ($(findstring -devel,$(ARTIFACT_VERSION)),-devel) @@ -123,6 +123,10 @@ define _modconfig = $(if $($(name)_OBJ_TEST),, $(eval $(name)_OBJ_TEST := "$($(name)_BIN)/$($(name)_NAME)-test.o")) $(if $($(name)_MFLAGS),, $(eval $(name)_MFLAGS := $(if $(publisher),,"-D$(name)_BUILTIN -fvisibility=hidden"))) + $(if $(HOST_$(name)_NAME),, $(eval HOST_$(name)_NAME := $($(name)_NAME))) + $(if $(HOST_$(name)_DESC),, $(eval HOST_$(name)_DESC := $($(name)_DESC))) + $(if $(HOST_$(name)_URL),, $(eval HOST_$(name)_URL := $($(name)_URL$(X_URL_SUFFIX)))) + $(if $(HOST_$(name)_PATH),, $(eval HOST_$(name)_PATH := $(MODULES)/$($(name)_NAME))) $(if $(HOST_$(name)_INC),, $(eval HOST_$(name)_INC := $(HOST_$(name)_PATH)/include)) $(if $(HOST_$(name)_SRC),, $(eval HOST_$(name)_SRC := $(HOST_$(name)_PATH)/src)) @@ -160,6 +164,10 @@ define hdrconfig = $(if $($(name)_TESTING),, $(eval $(name)_TESTING := 0)) $(if $($(name)_CFLAGS),, $(eval $(name)_CFLAGS := "$(if $($(name)_INC_OPT),$($(name)_INC_OPT) ,-I )\"$($(name)_INC)\""$(if $(publisher), "-D$(name)_PUBLISHER"))) $(if $($(name)_MFLAGS),, $(eval $(name)_MFLAGS := "-D$(name)_BUILTIN -fvisibility=hidden")) + + $(if $(HOST_$(name)_NAME),, $(eval HOST_$(name)_NAME := $($(name)_NAME))) + $(if $(HOST_$(name)_DESC),, $(eval HOST_$(name)_DESC := $($(name)_DESC))) + $(if $(HOST_$(name)_URL),, $(eval HOST_$(name)_URL := $($(name)_URL$(X_URL_SUFFIX)))) $(if $(HOST_$(name)_PATH),, $(eval HOST_$(name)_PATH := $(MODULES)/$($(name)_NAME))) $(if $(HOST_$(name)_INC),, $(eval HOST_$(name)_INC := $(HOST_$(name)_PATH)/include)) @@ -233,6 +241,8 @@ CONFIG_VARS = \ $(name)_OBJ \ $(name)_OBJ_TEST \ \ + HOST_$(name)_NAME \ + HOST_$(name)_DESC \ HOST_$(name)_PATH \ HOST_$(name)_INC \ HOST_$(name)_SRC \ diff --git a/make/paths.mk b/make/paths.mk index 7faab46..7db861e 100644 --- a/make/paths.mk +++ b/make/paths.mk @@ -1,6 +1,6 @@ # -# Copyright (C) 2020 Linux Studio Plugins Project -# (C) 2020 Vladimir Sadovnikov +# Copyright (C) 2024 Linux Studio Plugins Project +# (C) 2024 Vladimir Sadovnikov # # This file is part of lsp-common-lib # @@ -42,7 +42,11 @@ SHAREDDIR := $(PREFIX)/share INCDIR := $(PREFIX)/include BUILDDIR := $(BASEDIR)/.build TARGET_BUILDDIR := $(BUILDDIR)/target -HOST_BUILDDIR := $(BUILDDIR)/host +ifeq ($(CROSS_COMPILE),1) + HOST_BUILDDIR := $(BUILDDIR)/host +else + HOST_BUILDDIR := $(TARGET_BUILDDIR) +endif MODULES := $(BASEDIR)/modules CONFIG := $(BASEDIR)/.config.mk diff --git a/make/system.mk b/make/system.mk index 5796e89..7abdf3a 100644 --- a/make/system.mk +++ b/make/system.mk @@ -1,6 +1,6 @@ # -# Copyright (C) 2020 Linux Studio Plugins Project -# (C) 2020 Vladimir Sadovnikov +# Copyright (C) 2024 Linux Studio Plugins Project +# (C) 2024 Vladimir Sadovnikov # # This file is part of lsp-plugins # @@ -180,6 +180,7 @@ COMMON_VARS = \ ARCHITECTURE \ ARCHITECTURE_FAMILY \ ARCHITECTURE_CFLAGS \ + CROSS_COMPILE \ DEBUG \ EXECUTABLE_EXT \ EXPORT_SYMBOLS \ @@ -205,6 +206,7 @@ sysvars: echo " ARCHITECTURE_CFLAGS compiler flags to specify architecture" echo " ARCHITECTURE_FAMILY compiler flags to specify architecture family" echo " ARCHITECTURE_LDFLAGS linker flags to specify architecture" + echo " CROSS_COMPILE enable/disable cross-compilation" echo " DEBUG build with debug options" echo " DEVEL build with modules checked out for read/write URL" echo " EXECUTABLE_EXT file extension for executable files"