build: llvm libs may not be in system search path, add rpath
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 24 Feb 2014 17:43:17 +0000 (12:43 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 25 Feb 2014 20:30:13 +0000 (15:30 -0500)
On my gentoo system, llvm libs are in /usr/lib64/llvm, and llvm-config
--ldflags does not provide the rpath (it does, of course, provide a -L).
This adds the llvm dir to the rpath. It should be harmless if the path
is a system path, and should make things work when it's not.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
configure.ac

index b8e3161e116521771eb08a84b6c4e70f357ced52..0e0fd1820f415f5298be947c1598a38b91d37340 100644 (file)
@@ -1558,6 +1558,7 @@ if test "x$enable_gallium_llvm" = xyes; then
         LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
         LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
         LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
+        LLVM_LDFLAGS="-Wl,-rpath,$LLVM_LIBDIR $LLVM_LDFLAGS"
 
         AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
             [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])