autoconf: Only kink mcjit component when available.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 21 Jul 2012 10:43:06 +0000 (11:43 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 21 Jul 2012 10:43:35 +0000 (11:43 +0100)
Should fix build failures with older LLVM version, but only tested on
LLVM 3.1.

configure.ac

index 1d60957af5d5e11ce04ed3a7ad47a77ae043f5cb..7b88331aeb7fb4ab596415bce0ad2aae2dcb659f 100644 (file)
@@ -1847,10 +1847,14 @@ if test "x$enable_gallium_llvm" = xyes; then
            dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
            LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`"
        else
-           LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter mcjit`"
+            LLVM_COMPONENTS="engine bitwriter"
+            if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
+                LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
+            fi
             if test "x$enable_opencl" = xyes; then
-                LLVM_LIBS="${LLVM_LIBS} `$LLVM_CONFIG --libs ipo linker instrumentation`"
+                LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
             fi
+            LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
        fi
        LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
        LLVM_BINDIR=`$LLVM_CONFIG --bindir`