aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/Makefile.template
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-11-04 16:20:13 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-11-04 16:20:13 -0700
commitd7b1bdf8f44b82d979ebe2421b625d5b9ad072fa (patch)
treed8318eb69286855996cc54545185d5d25bced2b9 /templates/Makefile.template
parentfbe344483871473cf257e0fe1d34152dc3fc16df (diff)
Fix dependency glitch
Diffstat (limited to 'templates/Makefile.template')
-rw-r--r--templates/Makefile.template17
1 files changed, 11 insertions, 6 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 6f16ef5b0a..109de33c31 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -1491,7 +1491,7 @@
common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)'
- libs = ''
+ link_libs = ''
lib_deps = ' $(ZLIB_DEP)'
mingw_libs = ''
mingw_lib_deps = ' $(ZLIB_DEP)'
@@ -1506,10 +1506,15 @@
mingw_lib_deps = mingw_lib_deps + ' ' + lib_archive
else:
for dep in lib.get('deps', []):
- libs = libs + ' -l' + dep
- lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT_' + lang_to_var[lib.language] + ')'
+ dep_lib = None
+ for dl in libs:
+ if dl.name == dep:
+ dep_lib = dl
+ assert dep_lib, 'lib %s not found (in %s)' % (dep, lib.name)
+ link_libs = link_libs + ' -l' + dep
+ lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT_' + lang_to_var[dep_lib.language] + ')'
mingw_libs = mingw_libs + ' -l' + dep + '-imp'
- mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT_' + lang_to_var[lib.language] + ')'
+ mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT_' + lang_to_var[dep_lib.language] + ')'
security = lib.get('secure', 'check')
if security == True:
@@ -1547,9 +1552,9 @@
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin)
- $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT_${lang_to_var[lib.language]}) -dynamiclib -o ${out_libbase}.$(SHARED_EXT_${lang_to_var[lib.language]}) ${common}${libs}
+ $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT_${lang_to_var[lib.language]}) -dynamiclib -o ${out_libbase}.$(SHARED_EXT_${lang_to_var[lib.language]}) ${common}${link_libs}
else
- $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.core_version.major} -o ${out_libbase}.$(SHARED_EXT_${lang_to_var[lib.language]}) ${common}${libs}
+ $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.core_version.major} -o ${out_libbase}.$(SHARED_EXT_${lang_to_var[lib.language]}) ${common}${link_libs}
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT_${lang_to_var[lib.language]}) ${out_libbase}.so.${settings.get(lang_to_var[lib.language].lower() + '_version').major}
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT_${lang_to_var[lib.language]}) ${out_libbase}.so
endif