Skip to content

Commit 2b267b1

Browse files
committed
Refactoring: Introduce distinct host and target rpath var setters.
`HOST_RPATH_VAR$(1)_T_$(2)_H_$(3)` and `TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3)` both match the format of the old `RPATH_VAR$(1)_T_$(2)_H_$(3)` (which is still being set the same way that it was before, to one of either HOST/TARGET depending on what stage we are building). Namely, the format is <XXX>_RPATH_VAR = "<LD_LIB_PATH_ENVVAR>=<COLON_SEP_PATH_ENTRIES>" This should be a pure refactoring apart from the introduction of the two new make environment variables.
1 parent 16f7699 commit 2b267b1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

mk/main.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,19 @@ endef
357357
define SREQ_CMDS
358358

359359
ifeq ($$(OSTYPE_$(3)),apple-darwin)
360-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
360+
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
361361
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
362+
TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
363+
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
362364
else
363-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
365+
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
364366
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
367+
TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
368+
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
365369
endif
366370

371+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(HOST_RPATH_VAR$(1)_T_$(2)_H_$(3))
372+
367373
# Pass --cfg stage0 only for the build->host part of stage0;
368374
# if you're building a cross config, the host->* parts are
369375
# effectively stage1, since it uses the just-built stage0.
@@ -379,13 +385,7 @@ ifeq ($(1),0)
379385
ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
380386
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
381387

382-
ifeq ($$(OSTYPE_$(3)),apple-darwin)
383-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
384-
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
385-
else
386-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
387-
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
388-
endif
388+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3))
389389
endif
390390
endif
391391

0 commit comments

Comments
 (0)