[runtime] Get Mono's LLVM API version from the LLVM repo when cross compiling.
authorJoão Matos <joao@tritao.eu>
Fri, 23 Jan 2015 16:46:11 +0000 (16:46 +0000)
committerJoão Matos <joao@tritao.eu>
Fri, 23 Jan 2015 16:46:32 +0000 (16:46 +0000)
The previous code was hardcoding Mono's LLVM API version which was less than ideal. The API has been bumped twice since without this being updated.

This depends on a recent Mono LLVM version, at least https://github.com/mono/llvm/commit/607aeaae423da73e6ddfe49af4741fa1bc5f9e78.

configure.ac

index c7a5493ac806fe53f73e489bba0ff584316e6712..c2d45b2bb0163106d221d56bfee3890a0f7eec39 100644 (file)
@@ -2688,7 +2688,9 @@ if test "x$enable_llvm" = "xyes"; then
          -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore \
          -lLLVMSupport -lstdc++"
        LLVM_LIBS="$LLVM_LIBS $LLVM_SYSTEM_LIBS"
-       llvm_api_version=1
+
+       llvm_config_path=$with_llvm/include/llvm/Config/llvm-config.h
+       llvm_api_version=`awk '/MONO_API_VERSION/ { print $3 }' $llvm_config_path`
    fi  
 
    if test "x$llvm_api_version" = "x"; then