summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-12-16 11:22:22 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-12-16 11:22:22 +0000
commitce142e080bf8d79b47f9a10b75610ae3bcb3a815 (patch)
tree800286e3c723a96352b11c44c6730f002a734725 /llvm/tools/llvm-config/llvm-config.cpp
parent25c683891c5a1ff465b46e32110552e8f1690073 (diff)
downloadbcm5719-llvm-ce142e080bf8d79b47f9a10b75610ae3bcb3a815.tar.gz
bcm5719-llvm-ce142e080bf8d79b47f9a10b75610ae3bcb3a815.zip
llvm-config: Print SYSTEM_LIBS with --libs, instead of --ldflags.
LLVM libs are printed in the first line, and system libs are printed in the next line. $ bin/llvm-config --libs object -lLLVMObject -lLLVMSupport -lrt -ldl -ltinfo -lpthread -lz It is workaround for PR3347 and PR8449. llvm-svn: 197380
Diffstat (limited to 'llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r--llvm/tools/llvm-config/llvm-config.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index f7b643e6f21..63f099f1dac 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -278,8 +278,7 @@ int main(int argc, char **argv) {
} else if (Arg == "--cxxflags") {
OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
} else if (Arg == "--ldflags") {
- OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS
- << ' ' << LLVM_SYSTEM_LIBS << '\n';
+ OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n';
} else if (Arg == "--libs") {
PrintLibs = true;
} else if (Arg == "--libnames") {
@@ -358,6 +357,13 @@ int main(int argc, char **argv) {
OS << ActiveLibDir << '/' << Lib;
}
}
+
+ // Print system libs in the next line.
+ // Assume LLVMSupport depends on system_libs.
+ // FIXME: LLVMBuild may take care of dependencies to system_libs.
+ if (PrintLibs)
+ OS << '\n' << LLVM_SYSTEM_LIBS;
+
OS << '\n';
} else if (!Components.empty()) {
errs() << "llvm-config: error: components given, but unused\n\n";
OpenPOWER on IntegriCloud