summaryrefslogtreecommitdiff
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-06 22:38:29 +0000
committerChris Lattner <sabre@nondot.org>2006-06-06 22:38:29 +0000
commitd179de5ca20ff6f5204f2ec37962387c0bbf6bb7 (patch)
tree17df1bbc6745adc6b835bd3da9cf3cf3f6e0bbb2 /tools/llvm-config
parentfc790168a2af2e4519b94d0c8e0e438d74fcffd7 (diff)
downloadllvm-d179de5ca20ff6f5204f2ec37962387c0bbf6bb7.tar.gz
llvm-d179de5ca20ff6f5204f2ec37962387c0bbf6bb7.tar.bz2
llvm-d179de5ca20ff6f5204f2ec37962387c0bbf6bb7.tar.xz
Add a new --libfiles option, for getting fully-qualified pathnames to libraries.
This can be used for tools that want makefile rules to depend on the libraries (e.g. so the tool is relinked when a library changes). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/llvm-config.in.in26
1 files changed, 19 insertions, 7 deletions
diff --git a/tools/llvm-config/llvm-config.in.in b/tools/llvm-config/llvm-config.in.in
index 930d25e998..12d8a57e59 100644
--- a/tools/llvm-config/llvm-config.in.in
+++ b/tools/llvm-config/llvm-config.in.in
@@ -81,6 +81,7 @@ if ($ABS_RUN_DIR eq $ABS_OBJ_ROOT) {
sub usage;
sub fix_library_names (@);
+sub fix_library_files (@);
sub expand_dependecies (@);
sub name_map_entries;
@@ -90,6 +91,7 @@ my @components;
my $has_opt = 0;
my $want_libs = 0;
my $want_libnames = 0;
+my $want_libfiles = 0;
my $want_components = 0;
foreach my $arg (@ARGV) {
if ($arg =~ /^-/) {
@@ -113,6 +115,8 @@ foreach my $arg (@ARGV) {
$has_opt = 1; $want_libs = 1;
} elsif ($arg eq "--libnames") {
$has_opt = 1; $want_libnames = 1;
+ } elsif ($arg eq "--libfiles") {
+ $has_opt = 1; $want_libfiles = 1;
} elsif ($arg eq "--components") {
$has_opt = 1; print join(' ', name_map_entries), "\n";
} elsif ($arg eq "--targets-built") {
@@ -140,14 +144,11 @@ if (@components == 0) {
}
# Handle any arguments which require building our dependency graph.
-if ($want_libs || $want_libnames) {
+if ($want_libs || $want_libnames || $want_libfiles) {
my @libs = expand_dependecies(@components);
- if ($want_libs) {
- print join(' ', fix_library_names(@libs)), "\n";
- }
- if ($want_libnames) {
- print join(' ', @libs), "\n";
- }
+ print join(' ', fix_library_names(@libs)), "\n" if ($want_libs);
+ print join(' ', @libs), "\n" if ($want_libnames);
+ print join(' ', fix_library_files(@libs)), "\n" if ($want_libfiles);
}
exit 0;
@@ -178,6 +179,7 @@ Options:
--ldflags Print Linker flags.
--libs Libraries needed to link against LLVM components.
--libnames Bare library names for in-tree builds.
+ --libfiles Fully qualified library filenames for makefile depends.
--components List of all possible components.
--targets-built List of all targets currently built.
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
@@ -206,6 +208,16 @@ sub fix_library_names (@) {
return @result;
}
+# Turn the list of libraries into a list of files.
+sub fix_library_files(@) {
+ my @libs = @_;
+ my @result;
+ foreach my $lib (@libs) {
+ # Transform the bare library name into a filename.
+ push @result, "$LIBDIR/$lib";
+ }
+ return @result;
+}
#==========================================================================
# Library Dependency Analysis