@@ -495,7 +495,7 @@ acceptance-tests: swupdate ${tools-bins} FORCE
PHONY += test
test:
- $(Q)$(MAKE) $(build)=test SWOBJS="$(swupdate-objs)" SWLIBS="$(swupdate-libs) ${swupdate-ipc-lib}" LDLIBS="$(LDLIBS)" tests
+ $(Q)$(MAKE) $(build)=test SWOBJS="$(swupdate-objs)" SWLIBS="$(swupdate-libs) ${swupdate-ipc-lib}" EXTRA_LDFLAGS="$(EXTRA_LDFLAGS)" LDLIBS="$(LDLIBS)" tests
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
@@ -89,7 +89,7 @@ endif
# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES))
define pkg_check_modules
$(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2))
-$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2))
+$(1)_LDFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs-only-L $(2))
$(1)_LDLIBS := $(patsubst -l%,%,$(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs-only-l $(2)))
endef
@@ -112,7 +112,7 @@ ifneq ($(CONFIG_LUA),)
LDFLAGS_swupdate += -Wl,-E
$(eval $(call pkg_check_modules, LUABUILD, ${CONFIG_LUAPKG}))
KBUILD_CFLAGS += $(LUABUILD_CFLAGS)
-KBUILD_LIBS += $(LUABUILD_LIBS)
+EXTRA_LDFLAGS += $(LUABUILD_LDFLAGS)
LDLIBS += $(LUABUILD_LDLIBS)
LUAVER := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --modversion ${CONFIG_LUAPKG} | cut -d'.' -f1,2)
endif
- KBUILD_LIBS was set but unused - (pkg-config)_LIBS was also unused, replace it to get only the -L flags - remember the -L flags in EXTRA_LDFLAGS - also pass EXTRA_LDFLAGS to tests so they can find the lib Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com> --- v2: trivial rebase on master This is required on alpine with lua-5.3, and can be tested by setting CONFIG_LUAPKG="lua5.3" in .config Using the default lua version (5.1) does not require this as liblua.so is populated in /usr/lib then. Makefile | 2 +- Makefile.flags | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)