From 345f22a5e7de024235b508e5dca92b67b131fff4 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Sun, 29 May 2016 02:02:53 +0200 Subject: [PATCH] mk: shortcircuit select_from_ports for pkg tool --- repos/base/mk/util.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/repos/base/mk/util.inc b/repos/base/mk/util.inc index 9377a95d3e..748c2d6930 100644 --- a/repos/base/mk/util.inc +++ b/repos/base/mk/util.inc @@ -54,4 +54,15 @@ _checked_port = $(if $2,$2,$(call _port_missing,$1)) _checked_port_dir = $(call _checked_port,$1,$(call _port_dir,$1)) endif +# +# Search port within the 'CONTRIB_DIR' if defined, which is the case when +# using the build system in the regular way. If the build system is invoked +# by the package-build tool, however, all source codes are - by definition - +# part of the package. In this case, 'CONTRIB_DIR' is undefined and we can +# simply return the package's 'REP_DIR'. +# +ifneq ($(CONTRIB_DIR),) select_from_ports = $(call _checked_port_dir,$1) +else +select_from_ports = $(REP_DIR) +endif