base-hw: problems with timeout lib in src recipe

This commit fixes two issues with the timeout lib and the base-hw src recipe:

* Add source files of timeout lib to recipe content.
  The files weren't copied to the depot until now. However, the archive
  nonetheless built successfully because of the second issue that is described
  below.

* Get rid of the usage of the BASE_DIR variable in the timeout lib.
  The BASE_DIR variable always resolves to the repos/base directory even when
  building in a depot. That said, the use of BASE_DIR in make-files that are
  not part of the build system itself must be avoided. Instead, REP_DIR,
  REP_INC_DIR, and $(call select_from_repositories, ...) should be used.

Ref #4209
This commit is contained in:
Martin Stein 2022-09-20 12:23:46 +02:00 committed by Christian Helmuth
parent da150dbb1c
commit c23b74e150
5 changed files with 16 additions and 6 deletions

View File

@ -4,6 +4,6 @@ SRC_CC += timer_connection_time.cc
SRC_CC += hw/timer_connection_timestamp.cc
SRC_CC += duration.cc
INC_DIR += $(BASE_DIR)/src/include
REP_INC_DIR += src/include
vpath % $(BASE_DIR)/src/lib/timeout
vpath % $(call select_from_repositories,src/lib/timeout)

View File

@ -115,6 +115,12 @@ SRC_LIB_BASE += $(notdir $(wildcard $(BASE_HW_DIR)/src/lib/base/*.cc)) \
$(notdir $(wildcard $(BASE_DIR)/src/lib/base/*.cc)) \
${call selected_content,SRC_LIB_BASE_SPECS}
SRC_LIB_TIMEOUT += duration.cc \
hw/timer_connection_timestamp.cc \
timeout.cc \
timer_connection.cc \
timer_connection_time.cc
SRC_LIB_STARTUP += init_main_thread.cc _main.cc \
$(addprefix spec/,${call selected_content,SRC_LIB_STARTUP_SPECS})
@ -142,6 +148,7 @@ CONTENT += $(addprefix src/timer/,$(SRC_TIMER)) \
$(addprefix src/bootstrap/,$(SRC_BOOTSTRAP)) \
$(addprefix lib/mk/,$(LIB_MK)) \
$(addprefix src/lib/base/,$(SRC_LIB_BASE)) \
$(addprefix src/lib/timeout/,$(SRC_LIB_TIMEOUT)) \
$(addprefix src/lib/startup/,$(SRC_LIB_STARTUP)) \
$(addprefix src/core/,$(SRC_CORE)) \
src/lib/hw src/lib/ld src/lib/cxx \

View File

@ -1,5 +1,8 @@
FROM_BASE_NOVA := etc include
FROM_BASE := lib/mk/timeout.mk src/lib/timeout
# base-nova.lib.a depends on timeout.lib.a, which includes base/internal/gloabls.h
FROM_BASE := lib/mk/timeout.mk src/lib/timeout \
src/include/base/internal/globals.h
content: $(FROM_BASE_NOVA) $(FROM_BASE) LICENSE

View File

@ -3,6 +3,6 @@ SRC_CC += timer_connection.cc
SRC_CC += arm/timer_connection_time.cc
SRC_CC += duration.cc
INC_DIR += $(BASE_DIR)/src/include
REP_INC_DIR += src/include
vpath % $(BASE_DIR)/src/lib/timeout
vpath % $(call select_from_repositories,src/lib/timeout)

View File

@ -4,6 +4,6 @@ SRC_CC += timer_connection_time.cc
SRC_CC += timer_connection_timestamp.cc
SRC_CC += duration.cc
INC_DIR += $(BASE_DIR)/src/include
REP_INC_DIR += src/include
vpath % $(call select_from_repositories,src/lib/timeout)