Skip to content

Commit d6f506b

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 6c2febf commit d6f506b

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
@@ -354,13 +354,19 @@ endef
354354
define SREQ_CMDS
355355

356356
ifeq ($$(OSTYPE_$(3)),apple-darwin)
357-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
357+
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
358358
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
359+
TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
360+
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
359361
else
360-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
362+
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
361363
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
364+
TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
365+
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
362366
endif
363367

368+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(HOST_RPATH_VAR$(1)_T_$(2)_H_$(3))
369+
364370
# Pass --cfg stage0 only for the build->host part of stage0;
365371
# if you're building a cross config, the host->* parts are
366372
# effectively stage1, since it uses the just-built stage0.
@@ -376,13 +382,7 @@ ifeq ($(1),0)
376382
ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
377383
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
378384

379-
ifeq ($$(OSTYPE_$(3)),apple-darwin)
380-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
381-
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
382-
else
383-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
384-
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
385-
endif
385+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3))
386386
endif
387387
endif
388388

0 commit comments

Comments
 (0)