tools/llvm-config: improve shared library support
authorAndrew Wilkins <axwalk@gmail.com>
Thu, 7 Jan 2016 00:18:56 +0000 (00:18 +0000)
committerAndrew Wilkins <axwalk@gmail.com>
Thu, 7 Jan 2016 00:18:56 +0000 (00:18 +0000)
commitecd5a90fab59c72b1b9c26495646a81ce977c6fc
treeb5d0ca3ba6f567c75ef15af2035fe20dba30fed8
parentc3c982a22ed59646e58a68e9a0069515cf2aa02e
tools/llvm-config: improve shared library support

Summary:
r252532 added support for reporting the monolithic library
when LLVM_BUILD_LLVM_DYLIB is used. This would only be done
if the individual components were not found, and the dynamic
library is found.

This diff extends this as follows:
 - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared
   library, even if all component libraries exist.
 - Two flags, --link-shared and --link-static are introduced
   to provide explicit guidance. If --link-shared is passed
   and the shared library does not exist, an error results.

Additionally, changed the expected shared library names from
(e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an
installation (and then only in CMake builds I think?), and not
in the build tree; this breaks usage of llvm-config during
builds, e.g. by llvm-go.

Reviewers: DiamondLovesYou, beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15033

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257003 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/AddLLVM.cmake
tools/llvm-config/BuildVariables.inc.in
tools/llvm-config/CMakeLists.txt
tools/llvm-config/Makefile
tools/llvm-config/llvm-config.cpp
tools/llvm-go/llvm-go.go