glapi: Move to src/mapi/.
[mesa.git] / configure.ac
index 8e25163f75b7b79d07daa0d50c68c3d5dde4b427..4f37e16e3f062d2766c86979b07fa4ca337da334 100644 (file)
@@ -463,7 +463,7 @@ dnl Driver specific build directories
 dnl
 
 dnl this variable will be prepended to SRC_DIRS and is not exported
-CORE_DIRS="glsl mesa"
+CORE_DIRS="mapi/glapi glsl mesa"
 
 SRC_DIRS="glew"
 GLU_DIRS="sgi"
@@ -496,6 +496,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
@@ -677,7 +678,10 @@ AC_SUBST([GL_PC_LIB_PRIV])
 AC_SUBST([GL_PC_CFLAGS])
 AC_SUBST([DRI_PC_REQ_PRIV])
 AC_SUBST([GLESv1_LIB_DEPS])
+AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
 AC_SUBST([GLESv2_LIB_DEPS])
+AC_SUBST([GLESv2_PC_LIB_PRIV])
+
 
 dnl
 dnl More X11 setup
@@ -743,21 +747,27 @@ AC_ARG_ENABLE([gles2],
     [enable_gles2=no])
 
 API_DEFINES=""
+APIS=""
 if test "x$enable_opengl" = xno; then
     API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
 else
     API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
+    APIS="$APIS gl"
 fi
 if test "x$enable_gles1" = xyes; then
     API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
+    APIS="$APIS es1"
 fi
 if test "x$enable_gles2" = xyes; then
     API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
+    APIS="$APIS es2"
 fi
-if test "x$enable_gles1" = xyes -o "x$enable_gles2"; then
+if test "x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
+    CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
     SRC_DIRS="$SRC_DIRS gles"
 fi
 AC_SUBST([API_DEFINES])
+AC_SUBST([APIS])
 
 dnl If $with_dri_drivers is yes, directories will be added through
 dnl platform checks
@@ -1002,7 +1012,7 @@ if test "x$enable_egl" = xyes; then
     fi
 
     if test "$with_demos" = yes; then
-        PROGRAM_DIRS="$PROGRAM_DIRS egl/opengl"
+        PROGRAM_DIRS="$PROGRAM_DIRS egl/eglut egl/opengl"
     fi
 fi
 AC_SUBST([EGL_LIB_DEPS])
@@ -1229,8 +1239,16 @@ 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])
 fi
 
+AC_SUBST([LLVM_CFLAGS])
+AC_SUBST([LLVM_LIBS])
+AC_SUBST([LLVM_LDFLAGS])
+AC_SUBST([LLVM_VERSION])
+
 dnl
 dnl Gallium state trackers configuration
 dnl
@@ -1291,6 +1309,9 @@ yes)
             HAVE_ST_XORG="yes"
             ;;
         es)
+            if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
+               CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
+            fi
             # mesa/es is required to build es state tracker
             CORE_DIRS="$CORE_DIRS mesa/es"
             ;;
@@ -1364,6 +1385,35 @@ AC_ARG_WITH([max-height],
            [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
 )
 
+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
+       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"
+           DEFINES="$DEFINES -DHAVE_UDIS86"
+       fi
+       LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
+       GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
+       DEFINES="$DEFINES -DMESA_LLVM -D__STDC_CONSTANT_MACROS"
+       MESA_LLVM=1
+    else
+       MESA_LLVM=0
+    fi
+else
+    MESA_LLVM=0
+fi
+
 dnl
 dnl Gallium helper functions
 dnl
@@ -1509,6 +1559,15 @@ fi
 fi
 echo "        Use XCB:         $enable_xcb"
 
+echo ""
+if test "x$MESA_LLVM" == x1; then
+    echo "        llvm:            yes"
+    echo "        llvm-config:     $LLVM_CONFIG"
+    echo "        llvm-version:    $LLVM_VERSION"
+else
+    echo "        llvm:            no"
+fi
+
 echo ""
 if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
     echo "        Gallium:         yes"