Use the right llvm codegen when cross compiling.
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 14 Nov 2012 20:22:19 +0000 (15:22 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 14 Nov 2012 21:09:06 +0000 (16:09 -0500)
configure.in

index f440fa07bfb4e3d30c2f00fe2ca5d47e0d3ff3f1..81f3f8207d780c6c227f7b38075d3ef3f2cf5f80 100644 (file)
@@ -2216,13 +2216,21 @@ if test "x$enable_llvm" = "xyes"; then
          AC_MSG_ERROR([llvm-config not found.])
    fi
 
+   llvm_codegen="x86codegen"
+   case "$target" in
+   arm*)
+               llvm_codegen="armcodegen"
+               ;;
+   esac
+
+
    # The output of --cflags seems to include optimizations flags too
    LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
    # LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
    # from LLVM classes.
    LLVM_CXXFLAGS="`$LLVM_CONFIG --cxxflags` -fno-rtti"
    LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
-   LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit x86codegen`
+   LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit $llvm_codegen`
    LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
 
    # Should be something like '2.6' or '2.7svn'