summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-04-22 14:59:29 +1000
committerDave Airlie <airlied@redhat.com>2010-04-24 18:55:50 +1000
commit81fe19843ac2afdc4fa1e1c87bc979b295af240e (patch)
treedfbd886ffdfef5fe4cc8f8aaca4377c8c410c90b /configure.ac
parente3eed8bf218c04127484e0664c67c100703fa1d8 (diff)
llvmpipe: add initial autoconf support.
allows the swrastg_dri.so to be built with llvmpipe, also links llvm to all dri drivers use --enable-gallium-llvm to use it. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac42
1 files changed, 42 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0e77707433..bcf4104515 100644
--- a/configure.ac
+++ b/configure.ac
@@ -488,6 +488,7 @@ AC_SUBST([GALLIUM_TARGET_DIRS])
AC_SUBST([GALLIUM_WINSYS_DIRS])
AC_SUBST([GALLIUM_DRIVERS_DIRS])
AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
+AC_SUBST([MESA_LLVM])
dnl
dnl User supplied program configuration
@@ -1181,8 +1182,26 @@ AC_ARG_ENABLE([gallium],
[enable_gallium=yes])
if test "x$enable_gallium" = xyes; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
+ AC_CHECK_HEADER([udis86.h], [HAS_UDIS86="yes"],
+ [HAS_UDIS86="no"])
+ AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
+ if test "x$LLVM_CONFIG" != xno; then
+ LLVM_VERSION=`$LLVM_CONFIG --version`
+ LLVM_CFLAGS=`$LLVM_CONFIG --cflags`
+ LLVM_LIBS="`$LLVM_CONFIG --libs jit interpreter nativecodegen bitwriter` -lstdc++"
+
+ if test "x$HAS_UDIS86" != xno; then
+ LLVM_LIBS="$LLVM_LIBS -ludis86"
+ fi
+ LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
+ fi
fi
+AC_SUBST([LLVM_CFLAGS])
+AC_SUBST([LLVM_LIBS])
+AC_SUBST([LLVM_LDFLAGS])
+AC_SUBST([LLVM_VERSION])
+
dnl
dnl Gallium state trackers configuration
dnl
@@ -1317,6 +1336,29 @@ AC_ARG_WITH([max-height],
)
dnl
+dnl Gallium LLVM
+dnl
+AC_ARG_ENABLE([gallium-llvm],
+ [AS_HELP_STRING([--enable-gallium-llvm],
+ [build gallium LLVM support @<:@default=disabled@:>@])],
+ [enable_gallium_llvm="$enableval"],
+ [enable_gallium_llvm=auto])
+if test "x$enable_gallium_llvm" = xyes; then
+ if test "x$LLVM_CONFIG" != xno; then
+ GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
+ DEFINES="$DEFINES -DMESA_LLVM -D__STDC_CONSTANT_MACROS"
+ if test "x$HAS_UDIS86" != xno; then
+ DEFINES="$DEFINES -DHAVE_UDIS86"
+ fi
+ MESA_LLVM=1
+ else
+ MESA_LLVM=0
+ fi
+else
+ MESA_LLVM=0
+fi
+
+dnl
dnl Gallium helper functions
dnl
gallium_check_st() {