summaryrefslogtreecommitdiffstats
path: root/scripts/mk/buildtools.mk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:11 +0000
commitb4f7d8b1566e3220d0e9004499ef9c257e079c57 (patch)
treece0468ca8cf21380bef3d2aaacc9fcb30116e757 /scripts/mk/buildtools.mk
parentReleasing progress-linux version 1.22.6-0.0~progress7.99u1. (diff)
downloaddpkg-b4f7d8b1566e3220d0e9004499ef9c257e079c57.tar.xz
dpkg-b4f7d8b1566e3220d0e9004499ef9c257e079c57.zip
Merging upstream version 1.22.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/mk/buildtools.mk')
-rw-r--r--scripts/mk/buildtools.mk23
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/mk/buildtools.mk b/scripts/mk/buildtools.mk
index 933fdcf..1f63bee 100644
--- a/scripts/mk/buildtools.mk
+++ b/scripts/mk/buildtools.mk
@@ -25,7 +25,10 @@
# The variables are not exported by default. This can be changed by
# defining DPKG_EXPORT_BUILDTOOLS.
-dpkg_datadir = $(srcdir)/mk
+ifndef dpkg_buildtools_mk_included
+dpkg_buildtools_mk_included = yes
+
+dpkg_datadir ?= $(dir $(lastword $(MAKEFILE_LIST)))
include $(dpkg_datadir)/architecture.mk
# We set the TOOL_FOR_BUILD variables to the specified value, and the TOOL
@@ -33,18 +36,18 @@ include $(dpkg_datadir)/architecture.mk
# not defined or contain the make built-in defaults. On native builds if
# TOOL is defined and TOOL_FOR_BUILD is not, we fallback to use TOOL.
define dpkg_buildtool_setvar
- ifeq (,$(findstring $(3),$(DEB_BUILD_OPTIONS)))
- ifeq ($(origin $(1)),default)
+ ifeq (,$(filter $(3),$(DEB_BUILD_OPTIONS)))
+ ifneq (,$(filter default undefined,$(origin $(1))))
$(1) = $(DEB_HOST_GNU_TYPE)-$(2)
- else
- $(1) ?= $(DEB_HOST_GNU_TYPE)-$(2)
endif
# On native build fallback to use TOOL if that's defined.
- ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
- $(1)_FOR_BUILD ?= $$($(1))
- else
- $(1)_FOR_BUILD ?= $(DEB_BUILD_GNU_TYPE)-$(2)
+ ifeq (undefined,$(origin $(1)_FOR_BUILD))
+ ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+ $(1)_FOR_BUILD = $$($(1))
+ else
+ $(1)_FOR_BUILD = $(DEB_BUILD_GNU_TYPE)-$(2)
+ endif
endif
else
$(1) = :
@@ -74,3 +77,5 @@ $(eval $(call dpkg_buildtool_setvar,AR,ar))
$(eval $(call dpkg_buildtool_setvar,RANLIB,ranlib))
$(eval $(call dpkg_buildtool_setvar,PKG_CONFIG,pkgconf))
$(eval $(call dpkg_buildtool_setvar,QMAKE,qmake))
+
+endif # dpkg_buildtools_mk_included