diff options
author | Torok Edwin <edwintorok@gmail.com> | 2010-02-04 09:31:35 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2010-02-04 09:31:35 +0000 |
commit | 18743f45027f366071a170f56e6a8126593d810d (patch) | |
tree | eb922dcbd383a892ddb1f43c44aedaa4a0887737 /tools/llvm-config | |
parent | 7db21bdb7d4b1d3ff202b5feb553f70b93cfeb38 (diff) |
New flag for GenLibDeps, and llvm-config-perobjincl.
This allows to show the explicit files that need to be built/linked to get an
LLVM component.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95300 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r-- | tools/llvm-config/Makefile | 40 | ||||
-rwxr-xr-x | tools/llvm-config/find-cycles.pl | 5 |
2 files changed, 45 insertions, 0 deletions
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile index e5bdc04063..cc5cf43606 100644 --- a/tools/llvm-config/Makefile +++ b/tools/llvm-config/Makefile @@ -53,6 +53,46 @@ llvm-config.in: $(ConfigInIn) $(ConfigStatusScript) $(Verb) cd $(PROJ_OBJ_ROOT) ; \ $(ConfigStatusScript) tools/llvm-config/llvm-config.in +llvm-config-perobj: llvm-config.in $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a) + $(Echo) "Generating llvm-config-perobj" + $(Verb) $(PERL) $(GenLibDeps) -perobj -flat $(LibDir) "$(NM_PATH)" >PerobjDeps.txt + $(Echo) "Checking for cyclic dependencies between LLVM objects." + $(Verb) $(PERL) $(PROJ_SRC_DIR)/find-cycles.pl < PerobjDepsIncl.txt > PerobjDepsInclFinal.txt || rm -f $@ + $(Verb) $(ECHO) 's/@LLVM_CPPFLAGS@/$(subst /,\/,$(SUB_CPPFLAGS))/' \ + > temp.sed + $(Verb) $(ECHO) 's/@LLVM_CFLAGS@/$(subst /,\/,$(SUB_CFLAGS))/' \ + >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_CXXFLAGS@/$(subst /,\/,$(SUB_CXXFLAGS))/' \ + >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_LDFLAGS@/$(subst /,\/,$(SUB_LDFLAGS))/' \ + >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ + >> temp.sed + $(Verb) $(SED) -f temp.sed < $< > $@ + $(Verb) $(RM) temp.sed + $(Verb) cat PerobjDepsFinal.txt >> $@ + $(Verb) chmod +x $@ + +llvm-config-perobjincl: llvm-config.in $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a) + $(Echo) "Generating llvm-config-perobjincl" + $(Verb) $(PERL) $(GenLibDeps) -perobj -perobjincl -flat $(LibDir) "$(NM_PATH)" >PerobjDepsIncl.txt + $(Echo) "Checking for cyclic dependencies between LLVM objects." + $(Verb) $(PERL) $(PROJ_SRC_DIR)/find-cycles.pl < PerobjDepsIncl.txt > PerobjDepsInclFinal.txt + $(Verb) $(ECHO) 's/@LLVM_CPPFLAGS@/$(subst /,\/,$(SUB_CPPFLAGS))/' \ + > temp.sed + $(Verb) $(ECHO) 's/@LLVM_CFLAGS@/$(subst /,\/,$(SUB_CFLAGS))/' \ + >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_CXXFLAGS@/$(subst /,\/,$(SUB_CXXFLAGS))/' \ + >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_LDFLAGS@/$(subst /,\/,$(SUB_LDFLAGS))/' \ + >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ + >> temp.sed + $(Verb) $(SED) -f temp.sed < $< > $@ + $(Verb) $(RM) temp.sed + $(Verb) cat PerobjDepsInclFinal.txt >> $@ + $(Verb) chmod +x $@ + # Build our final script. $(ToolDir)/llvm-config: llvm-config.in $(FinalLibDeps) $(Echo) "Building llvm-config script." diff --git a/tools/llvm-config/find-cycles.pl b/tools/llvm-config/find-cycles.pl index 8156abd3f0..5cbf5b4b27 100755 --- a/tools/llvm-config/find-cycles.pl +++ b/tools/llvm-config/find-cycles.pl @@ -62,6 +62,11 @@ foreach my $cycle (@CYCLES) { print STDERR "find-cycles.pl: Circular dependency between *.a files:\n"; print STDERR "find-cycles.pl: ", join(' ', @archives), "\n"; push @modules, @archives; # WORKAROUND: Duplicate *.a files. Ick. + } elsif (@modules > 1) { + $cycles_found = $cycles_found + 1; + print STDERR "find-cycles.pl: Circular dependency between *.o files:\n"; + print STDERR "find-cycles.pl: ", join(' ', @modules), "\n"; + push @modules, @modules; # WORKAROUND: Duplicate *.o files. Ick. } # Add to our output. (@modules is already as sorted as we need it to be.) |