From 79278ea8bdb43a38a8c25e2bdbcee8adb7c8293d Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 29 Jun 2017 19:46:07 +0000 Subject: [PATCH] defs.mk, projects.py: Fix PREREQ_BUILD ignored in LIBFLAGS PREREQ_BUILD doesn\'t make it into linker flags. This patch hopefully fixes that. Signed-off-by: Jan Lindemann --- make/defs.mk | 10 +++++----- scripts/projects.py | 11 +++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/make/defs.mk b/make/defs.mk index 7e145eef..d3b55884 100644 --- a/make/defs.mk +++ b/make/defs.mk @@ -979,11 +979,11 @@ endif INCLUDE += $(call proj_query, cflags $(PREREQ_BUILD) $(PROJECT)) -#ifneq ($(USE_PROJECT_LIB),false) -LIBFLAGS += $(call proj_query, ldflags $(addprefix --exclude ,$(LDFLAGS_EXCLUDE)) $(PROJECT)) -#else -#LIBFLAGS += $(call proj_query, ldflags $(PREREQ_BUILD)) -#endif +LDFLAGS_QUERY_ARGS = $(addprefix --exclude ,$(LDFLAGS_EXCLUDE)) $(PREREQ_BUILD) $(PROJECT) +ifeq ($(USE_PROJECT_LIB),true) + LDFLAGS_QUERY_ARGS += --add-self +endif +LIBFLAGS += $(call proj_query, ldflags $(LDFLAGS_QUERY_ARGS)) #include $(MODDIR)/make/lib-deps.mk diff --git a/scripts/projects.py b/scripts/projects.py index b3a6999e..d0c98af1 100644 --- a/scripts/projects.py +++ b/scripts/projects.py @@ -273,10 +273,11 @@ def get_ldpathflags(names, exclude = []): r = r + ' -L' + proj_dir(m) + '/lib' print(r[1:]) -def get_ldflags(names, exclude = []): +def get_ldflags(names, exclude = [], add_self_ = False): #print(names) deps = get_modules_from_project_txt(names, 'pkg.requires.jw', 'build', - scope = 1, add_self=False, names_only=True) + scope = 1, add_self=add_self_, names_only=True) + debug("deps = " + ' '.join(deps)) #print(deps) r = '' for m in reversed(deps): @@ -371,11 +372,13 @@ def cmd_libname(args_): print(get_libname(args.module)) def cmd_ldflags(args_): - parser = argparse.ArgumentParser(description='ldlibpath') + parser = argparse.ArgumentParser(description='ldflags') parser.add_argument('module', nargs='*', help='Modules') parser.add_argument('--exclude', action='append', help='Exclude Modules', default=[]) + parser.add_argument('--add-self', '-s', action='store_true', + default=False, help='Include libflags of specified modules, too, not only their dependencies') args=parser.parse_args(args_) - print(get_ldflags(args.module, args.exclude)) + print(get_ldflags(args.module, args.exclude, args.add_self)) def cmd_cflags(args_): parser = argparse.ArgumentParser(description='cflags')