diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-08-17 19:13:32 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-08-17 19:13:32 -0400 |
commit | 50b1e92bb07c296befdaa3d0d9158882bd3e1146 (patch) | |
tree | 49239cbe2d2cda7514376efc420e1b3b1e5b31bc /build-aux/Makefile.once.head/10-lt.mk | |
parent | dd52f6b23bc39848c610b15632f0f65ec5e40a3d (diff) |
Rethink the lt dependency_libs logic with the clarity of having slept on it
This avoids passing extra .la arguments to CCLD; lt.lib.post is the ONLY
variable that needs to know the recursive dependencies (so change
lt.{lib,exe}.files.all to not expand them); for the others,
libtool will figure it out from dependency_libs. Further, if the library
is public (lt.lib.rpath is set), then we DON'T need to adjust
depedency_libs, as we've already told libtool about them in
lt.lib.files.ld.
This also changes how lt.lib.files.ld is implemented. This is just for
readability, the old and new definitions are equivalent (except for
possible whitespace differences?).
Diffstat (limited to 'build-aux/Makefile.once.head/10-lt.mk')
-rw-r--r-- | build-aux/Makefile.once.head/10-lt.mk | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/build-aux/Makefile.once.head/10-lt.mk b/build-aux/Makefile.once.head/10-lt.mk index 3c6bea4222..355a5b4343 100644 --- a/build-aux/Makefile.once.head/10-lt.mk +++ b/build-aux/Makefile.once.head/10-lt.mk @@ -5,13 +5,17 @@ _lt.patsubst-all = $(if $1,$(call _lt.patsubst-all,$(wordlist 2,$(words $1),$1), _lt.unLIBPATTERNS = $(foreach _lt.tmp,$1,$(if $(filter $(.LIBPATTERNS),$(notdir $(_lt.tmp))),$(call _lt.patsubst-all,$(.LIBPATTERNS),-l%,$(notdir $(_lt.tmp))),$(_lt.tmp))) _lt.rest = $(wordlist 2,$(words $1),$1) _lt.dedup = $(if $1,$(if $(filter $(firstword $1),$(call _lt.rest,$1)),,$(firstword $1) )$(call _lt.dedup,$(call _lt.rest,$1))) -_lt.static_dependency_libs = $(foreach _lt.tmp,$1,$(_lt.tmp)$(if $(filter %.la,$(_lt.tmp)), $(shell . $(_lt.tmp); echo $$static_dependency_libs))) +_lt.dependency_libs = $(foreach _lt.tmp,$1,$(_lt.tmp)$(if $(filter %.la,$(_lt.tmp)), $(shell . $(_lt.tmp); echo $$dependency_libs))) -lt.lib.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(files.sys)))) -lt.lib.files.all = $(call _lt.dedup,$(filter %.lo %.la -l%,$(call _lt.static_dependency_libs,$(call _lt.unLIBPATTERNS,$^)))) -lt.lib.files.ld = $(filter %.lo -l% $(if $(lt.lib.rpath),%.la),$(lt.lib.files.all)) -lt.lib.files.la = $(filter %.la,$(lt.lib.files.all)) -lt.lib.post = $(if $(lt.lib.files.la),printf '\nstatic_dependency_libs="$(lt.lib.files.la)"\ndependency_libs="$$dependency_libs $$static_dependency_libs"\n' >> $@) + lt.lib.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(files.sys)))) + lt.lib.files.all = $(filter %.lo %.la -l%,$(call _lt.unLIBPATTERNS,$^)) + lt.lib.files.ld = $(strip $(if $(lt.lib.rpath),\ + $(lt.lib.files.all),\ + $(filter-out %.la,$(lt.lib.files.all)))) +_lt.lib.files.dep = $(strip $(call _lt.dedup,$(filter %.la -l%,$(call _lt.dependency_libs,$(lt.lib.files.all))))) + lt.lib.post = $(strip $(if $(lt.lib.rpath),\ + true,\ + sed -i 's|^dependency_libs=.*|dependency_libs='\''$(_lt.lib.files.dep)'\''|' $@)) -lt.exe.files.all = $(call _lt.dedup,$(filter %.o %.la -l%,$(call _lt.static_dependency_libs,$(call _lt.unLIBPATTERNS,$^)))) +lt.exe.files.all = $(filter %.o %.la -l%,$(call _lt.unLIBPATTERNS,$^)) lt.exe.files.ld = $(lt.exe.files.all) |