From ed64a9233ef3aa05459bbc5a28269519a6442087 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 7 Apr 2017 18:29:08 +0200 Subject: [PATCH] okl4: don't rely on BASE_DIR for vpath This patch is required to build the OKL4 version of core from a source archive. It avoids fetching source codes from BASE_DIR, and moves the vpath wildcard for %.cc after all specific vpath definitins, in particular those that are x86-specific. Without the latter change, core would always end up using the generic version of 'platform_services.cc', omitting the IO_PORT service from core. --- repos/base-okl4/lib/mk/core-okl4.inc | 6 +++--- repos/base-okl4/lib/mk/spec/x86/core-okl4.mk | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/repos/base-okl4/lib/mk/core-okl4.inc b/repos/base-okl4/lib/mk/core-okl4.inc index 6abd8c8a12..e69cd218d5 100644 --- a/repos/base-okl4/lib/mk/core-okl4.inc +++ b/repos/base-okl4/lib/mk/core-okl4.inc @@ -2,7 +2,8 @@ CC_OPT_PIC = LIBS += okl4_boot_info base-okl4-common syscall-okl4 cxx -GEN_CORE_DIR = $(BASE_DIR)/src/core +GEN_CORE_DIR := $(dir $(call select_from_repositories,src/core/main.cc)) +GEN_SRC_DIR := $(realpath $(GEN_CORE_DIR)/..) SRC_CC += stack_area.cc \ core_mem_alloc.cc \ @@ -41,7 +42,7 @@ SRC_CC += stack_area.cc \ trace_session_component.cc INC_DIR += $(REP_DIR)/src/core/include $(GEN_CORE_DIR)/include \ - $(REP_DIR)/src/include $(BASE_DIR)/src/include + $(REP_DIR)/src/include $(GEN_SRC_DIR)/include include $(GEN_CORE_DIR)/version.inc @@ -68,4 +69,3 @@ vpath dump_alloc.cc $(GEN_CORE_DIR) vpath default_log.cc $(GEN_CORE_DIR) vpath stack_area.cc $(GEN_CORE_DIR) vpath pager_ep.cc $(GEN_CORE_DIR) -vpath %.cc $(REP_DIR)/src/core diff --git a/repos/base-okl4/lib/mk/spec/x86/core-okl4.mk b/repos/base-okl4/lib/mk/spec/x86/core-okl4.mk index 02c1cd93af..b616baf988 100644 --- a/repos/base-okl4/lib/mk/spec/x86/core-okl4.mk +++ b/repos/base-okl4/lib/mk/spec/x86/core-okl4.mk @@ -10,3 +10,5 @@ vpath platform_services.cc $(GEN_CORE_DIR)/spec/x86 vpath platform_thread_x86.cc $(REP_DIR)/src/core/spec/x86 vpath crt0.s $(dir $(call select_from_repositories,src/lib/startup/spec/x86_32/crt0.s)) + +vpath %.cc $(REP_DIR)/src/core