tools/trace: Return dummy fence object to silence warnings.
[mesa.git] / configure.ac
index b7fbb362d85a785a1c20c77aee716018214a7df4..6832b0d8973fb61975ba3d9fead8dc17b0314492 100644 (file)
@@ -6,7 +6,7 @@ dnl Tell the user about autoconf.html in the --help output
 m4_divert_once([HELP_END], [
 See docs/autoconf.html for more details on the options for Mesa.])
 
-AC_INIT([Mesa], [9.2.0],
+AC_INIT([Mesa], [9.2.0-devel],
     [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
 AC_CONFIG_AUX_DIR([bin])
 AC_CONFIG_MACRO_DIR([m4])
@@ -31,7 +31,7 @@ AC_SUBST([OSMESA_VERSION])
 
 dnl Versions for external dependencies
 LIBDRM_REQUIRED=2.4.24
-LIBDRM_RADEON_REQUIRED=2.4.42
+LIBDRM_RADEON_REQUIRED=2.4.45
 LIBDRM_INTEL_REQUIRED=2.4.38
 LIBDRM_NVVIEUX_REQUIRED=2.4.33
 LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
@@ -652,7 +652,7 @@ GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
 AC_ARG_WITH([gallium-drivers],
     [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
         [comma delimited Gallium drivers list, e.g.
-        "i915,nouveau,r300,r600,radeonsi,freedreno,svga,swrast"
+        "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast"
         @<:@default=r300,r600,svga,swrast@:>@])],
     [with_gallium_drivers="$withval"],
     [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
@@ -676,19 +676,16 @@ if test "x$enable_opengl" = xno -a \
     AC_MSG_ERROR([at least one API should be enabled])
 fi
 
-API_DEFINES=""
-if test "x$enable_opengl" = xno; then
-    API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
-else
-    API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
-fi
-if test "x$enable_gles1" = xyes; then
-    API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
+# Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
+if test "x$enable_opengl" = xno -a \
+        "x$enable_gles1" = xyes; then
+    AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
 fi
-if test "x$enable_gles2" = xyes; then
-    API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
+
+if test "x$enable_opengl" = xno -a \
+        "x$enable_gles2" = xyes; then
+    AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
 fi
-AC_SUBST([API_DEFINES])
 
 AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
 AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
@@ -742,11 +739,6 @@ if test "x$enable_dri" = xno; then
     enable_shared_glapi=no
 fi
 
-if test "x$enable_shared_glapi" = xyes; then
-    # libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
-    # the remap table)
-    DEFINES="$DEFINES -DIN_DRI_DRIVER"
-fi
 AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
 
 dnl
@@ -762,14 +754,13 @@ xyesyes)
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
     GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
     GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
-    HAVE_WINSYS_XLIB="yes"
+    NEED_WINSYS_XLIB="yes"
     ;;
 esac
 
 if test "x$enable_dri" = xyes; then
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
     GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
-    HAVE_ST_DRI="yes"
 fi
 
 if test "x$enable_osmesa" = xyes; then
@@ -777,9 +768,6 @@ if test "x$enable_osmesa" = xyes; then
     GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
 fi
 
-AC_SUBST([GALLIUM_TARGET_DIRS])
-AC_SUBST([GALLIUM_WINSYS_DIRS])
-AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
 AC_SUBST([MESA_LLVM])
 
 # Check for libdrm
@@ -950,7 +938,7 @@ DRI_DIRS=""
 case "$with_dri_drivers" in
 no) ;;
 yes)
-    # classic DRI drivers require FEATURE_GL to build
+    # classic DRI drivers
     if test "x$enable_opengl" = xyes; then
         DRI_DIRS="yes"
     fi
@@ -974,7 +962,7 @@ if test "x$enable_dri" = xyes; then
     # Platform specific settings and drivers to build
     case "$host_os" in
     linux*)
-        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
+        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
         DEFINES="$DEFINES -DHAVE_ALIAS"
 
         case "$host_cpu" in
@@ -999,21 +987,21 @@ if test "x$enable_dri" = xyes; then
         ;;
     freebsd* | dragonfly* | *netbsd*)
         DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
-        DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
+        DEFINES="$DEFINES -DHAVE_ALIAS"
 
         if test "x$DRI_DIRS" = "xyes"; then
             DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
         fi
         ;;
     gnu*)
-        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
+        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
         DEFINES="$DEFINES -DHAVE_ALIAS"
        ;;
     solaris*)
-        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
+        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
         ;;
     cygwin*)
-        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
+        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
         if test "x$DRI_DIRS" = "xyes"; then
             DRI_DIRS="swrast"
         fi
@@ -1228,14 +1216,14 @@ if test "x$enable_gallium_egl" = xyes; then
 
     GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
     GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
-    HAVE_ST_EGL="yes"
 fi
+AM_CONDITIONAL(HAVE_GALLIUM_EGL, test "x$enable_gallium_egl" = xyes)
 
 dnl
 dnl gbm Gallium configuration
 dnl
 if test "x$enable_gallium_gbm" = xauto; then
-    case "$enable_gbm$HAVE_ST_EGL$enable_dri$with_egl_platforms" in
+    case "$enable_gbm$enable_gallium_egl$enable_dri$with_egl_platforms" in
         yesyesyes*drm*)
             enable_gallium_gbm=yes ;;
          *)
@@ -1256,9 +1244,9 @@ if test "x$enable_gallium_gbm" = xyes; then
 
     GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
     GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
-    HAVE_ST_GBM="yes"
     enable_gallium_loader=yes
 fi
+AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes)
 
 dnl
 dnl X.Org DDX configuration
@@ -1271,8 +1259,8 @@ if test "x$enable_xorg" = xyes; then
         HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
         HAVE_XEXTPROTO_71="no")
     GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
-    HAVE_ST_XORG=yes
 fi
+AM_CONDITIONAL(HAVE_ST_XORG, test "x$enable_xorg" = xyes)
 
 dnl
 dnl XA configuration
@@ -1288,11 +1276,11 @@ fi
 fi
 if test "x$enable_xa" = xyes; then
     GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
-    HAVE_ST_XA=yes
     AC_SUBST(AWK)
     AC_SUBST(GREP)
     AC_SUBST(NM)
 fi
+AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
 
 dnl
 dnl OpenVG configuration
@@ -1313,7 +1301,6 @@ if test "x$enable_openvg" = xyes; then
     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
     VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
     GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
-    HAVE_ST_VEGA=yes
     VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
     AC_SUBST([VG_PC_LIB_PRIV])
 fi
@@ -1322,16 +1309,7 @@ AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
 dnl
 dnl Gallium G3DVL configuration
 dnl
-AC_ARG_ENABLE([gallium-g3dvl],
-    [AS_HELP_STRING([--enable-gallium-g3dvl],
-        [build gallium g3dvl @<:@default=disabled@:>@])],
-    [enable_gallium_g3dvl="$enableval"],
-    [enable_gallium_g3dvl=no])
-if test "x$enable_gallium_g3dvl" = xyes; then
-    if test "x$with_gallium_drivers" = x; then
-        AC_MSG_ERROR([cannot enable G3DVL without Gallium])
-    fi
-
+if test -n "$with_gallium_drivers"; then
     if test "x$enable_xvmc" = xauto; then
        PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
     fi
@@ -1344,14 +1322,14 @@ fi
 if test "x$enable_xvmc" = xyes; then
     PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8])
     GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
-    HAVE_ST_XVMC="yes"
 fi
+AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
 
 if test "x$enable_vdpau" = xyes; then
     PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8])
     GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
-    HAVE_ST_VDPAU="yes"
 fi
+AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
 
 dnl
 dnl OpenCL configuration
@@ -1398,10 +1376,7 @@ if test "x$enable_opencl" = xyes; then
     GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
     enable_gallium_loader=yes
 fi
-
-if test "x$enable_gallium_gbm" = xyes || test "x$enable_opencl" = xyes; then
-    GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
-fi
+AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
 
 dnl
 dnl Gallium configuration
@@ -1452,10 +1427,6 @@ fi
 egl_platforms=`IFS=', '; echo $with_egl_platforms`
 for plat in $egl_platforms; do
        case "$plat" in
-       fbdev|null)
-               GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/$plat"
-               ;;
-
        wayland)
                PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.0.2 wayland-server >= 1.0.2])
                GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
@@ -1478,7 +1449,7 @@ for plat in $egl_platforms; do
                        AC_MSG_ERROR([EGL platform drm needs gbm])
                ;;
 
-       android|gdi)
+       android|fbdev|gdi|null)
                ;;
 
        *)
@@ -1503,6 +1474,9 @@ fi
 
 EGL_PLATFORMS="$egl_platforms"
 
+if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
+    NEED_WINSYS_XLIB=yes
+fi
 AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
 AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
 AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
@@ -1610,13 +1584,6 @@ if test "x$enable_gallium_llvm" = xyes; then
             LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
         fi
 
-        if test "x$enable_debug" = xyes; then
-            # Debug builds require OProfileJIT if LLVM was built with support for it
-            if $LLVM_CONFIG --components | grep -q '\<oprofilejit\>'; then
-                LLVM_COMPONENTS="${LLVM_COMPONENTS} oprofilejit"
-            fi
-        fi
-
         if test "x$enable_opencl" = xyes; then
             LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
             # LLVM 3.3 >= 177971 requires IRReader
@@ -1668,6 +1635,11 @@ if test "x$enable_gallium_tests" = xyes; then
 fi
 AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
 
+if test "x$enable_gallium_loader" = xyes; then
+    GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
+fi
+AM_CONDITIONAL(NEED_GALLIUM_LOADER, test "x$enable_gallium_loader" = xyes)
+
 dnl Directory for VDPAU libs
 AC_ARG_WITH([vdpau-libdir],
     [AS_HELP_STRING([--with-vdpau-libdir=DIR],
@@ -1688,28 +1660,26 @@ dnl
 dnl Gallium helper functions
 dnl
 gallium_check_st() {
-    if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
-        test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
-        test "x$HAVE_ST_VDPAU" = xyes; then
+    if test "x$NEED_NONNULL_WINSYS" = xyes; then
          if test "x$have_libdrm" != xyes; then
             AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
          fi
          GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
     fi
-    if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
+    if test "x$enable_dri" = xyes && test "x$2" != x; then
          GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
          HAVE_COMMON_DRI=yes
     fi
-    if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
+    if test "x$enable_xorg" = xyes && test "x$3" != x; then
          GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
     fi
-    if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then
+    if test "x$enable_xa" = xyes && test "x$4" != x; then
          GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
     fi
-    if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
+    if test "x$enable_xvmc" = xyes && test "x$5" != x; then
          GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
     fi
-    if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
+    if test "x$enable_vdpau" = xyes && test "x$6" != x; then
          GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
     fi
 }
@@ -1744,13 +1714,20 @@ radeon_llvm_check() {
                       sources with the --enable-experimental-targets=R600
                       configure flag])
     fi
-    LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader"
+    LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
     NEED_RADEON_LLVM=yes
     AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
                                  [AC_MSG_ERROR([radeonsi and r600g require libelf when using LLVM])])
 }
 
 dnl Gallium drivers
+if test "x$enable_dri" = xyes -o "x$enable_xorg" = xyes -o \
+        "x$enable_xa" = xyes -o "x$enable_xvmc" = xyes -o \
+        "x$enable_vdpau" = xyes; then
+    NEED_NONNULL_WINSYS=yes
+fi
+AM_CONDITIONAL(NEED_NONNULL_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes)
+
 dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
 if test "x$with_gallium_drivers" != x; then
     gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
@@ -1771,6 +1748,13 @@ if test "x$with_gallium_drivers" != x; then
             GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
             gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
             ;;
+        xilo)
+            HAVE_GALLIUM_ILO=yes
+            PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
+            gallium_require_drm_loader
+            GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
+            gallium_check_st "intel/drm" "dri-ilo"
+            ;;
         xr300)
             HAVE_GALLIUM_R300=yes
             PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
@@ -1786,7 +1770,7 @@ if test "x$with_gallium_drivers" != x; then
             if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
                 radeon_llvm_check
                 R600_NEED_RADEON_GALLIUM=yes;
-                LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo bitreader asmparser"
+                LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
             fi
             if test "x$enable_r600_llvm" = xyes; then
                 USE_R600_LLVM_COMPILER=yes;
@@ -1826,20 +1810,19 @@ if test "x$with_gallium_drivers" != x; then
                 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
             fi
 
-            if test "x$HAVE_ST_DRI" = xyes; then
+            if test "x$enable_dri" = xyes; then
                 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
+                HAVE_COMMON_DRI=yes
             fi
-            if test "x$HAVE_ST_VDPAU" = xyes; then
+            if test "x$enable_vdpau" = xyes; then
                 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
             fi
-            if test "x$HAVE_ST_XVMC" = xyes; then
+            if test "x$enable_xvmc" = xyes; then
                 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
             fi
-            if test "x$HAVE_ST_VDPAU" = xyes ||
-               test "x$HAVE_ST_XVMC" = xyes; then
-               if test "x$HAVE_WINSYS_XLIB" != xyes; then
-                  GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
-               fi
+            if test "x$enable_vdpau" = xyes -o "x$enable_xvmc" = xyes; then
+                NEED_WINSYS_XLIB=yes
+                GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
             fi
             ;;
         *)
@@ -1894,6 +1877,7 @@ fi
 
 AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
+AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
@@ -1902,23 +1886,22 @@ AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
 
+AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -o \
+                                                  "x$HAVE_GALLIUM_I915" = xyes -o \
+                                                  "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
+AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
+                                                  "x$HAVE_GALLIUM_SOFTPIPE" = xyes -a \
+                                                  "x$MESA_LLVM" = x1)
+
 if test "x$enable_gallium_loader" = xyes; then
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
-    GALLIUM_PIPE_LOADER_DEFINES="-DHAVE_PIPE_LOADER_SW"
-    GALLIUM_PIPE_LOADER_LIBS="\$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la"
-    GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la"
-
-    if test "x$HAVE_WINSYS_XLIB" = xyes; then
-        GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
-        GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la"
-    fi
 
     if test "x$enable_gallium_drm_loader" = xyes; then
         GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
         PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
                           pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
         if test "x$pipe_loader_have_xcb" = xyes; then
-            GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DPIPE_LOADER_HAVE_XCB"
+            GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XCB"
             GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
         fi
     fi
@@ -1927,24 +1910,6 @@ if test "x$enable_gallium_loader" = xyes; then
     AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
 fi
 
-dnl Tell Automake which drivers to build
-for driver in $GALLIUM_DRIVERS_DIRS; do
-    case "x$driver" in
-        xgalahad)
-            HAVE_GALAHAD_GALLIUM=yes;
-           ;;
-       xidentity)
-           HAVE_IDENTITY_GALLIUM=yes;
-           ;;
-       xnoop)
-           HAVE_NOOP_GALLIUM=yes;
-           ;;
-        *)
-            GALLIUM_MAKE_DIRS="$GALLIUM_MAKE_DIRS $driver"
-           ;;
-    esac
-done
-
 AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
 AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
 AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
@@ -1953,9 +1918,13 @@ AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
 AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
 AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
 
-AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes)
-AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes)
-AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes)
+AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes -a \
+                                            "x$HAVE_GALLIUM_R300" = xyes -o \
+                                            "x$HAVE_GALLIUM_R600" = xyes -o \
+                                            "x$HAVE_GALLIUM_RADEONSI" = xyes)
+AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
+                                         "x$HAVE_GALLIUM_SVGA" = xyes)
+AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
 AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
 AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes)
 AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
@@ -1965,7 +1934,6 @@ AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
 AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
 AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
 
-AC_SUBST([GALLIUM_MAKE_DIRS])
 AC_SUBST([ELF_LIB])
 
 AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
@@ -2016,7 +1984,10 @@ AC_CONFIG_FILES([Makefile
                src/gallium/auxiliary/pipe-loader/Makefile
                src/gallium/drivers/Makefile
                src/gallium/drivers/freedreno/Makefile
+               src/gallium/drivers/freedreno/a2xx/Makefile
+               src/gallium/drivers/freedreno/a3xx/Makefile
                src/gallium/drivers/i915/Makefile
+               src/gallium/drivers/ilo/Makefile
                src/gallium/drivers/llvmpipe/Makefile
                src/gallium/drivers/nouveau/Makefile
                src/gallium/drivers/nv30/Makefile
@@ -2047,6 +2018,7 @@ AC_CONFIG_FILES([Makefile
                src/gallium/targets/Makefile
                src/gallium/targets/dri-freedreno/Makefile
                src/gallium/targets/dri-i915/Makefile
+               src/gallium/targets/dri-ilo/Makefile
                src/gallium/targets/dri-nouveau/Makefile
                src/gallium/targets/dri-r300/Makefile
                src/gallium/targets/dri-r600/Makefile
@@ -2080,10 +2052,10 @@ AC_CONFIG_FILES([Makefile
                src/gallium/winsys/freedreno/drm/Makefile
                src/gallium/winsys/i915/drm/Makefile
                src/gallium/winsys/i915/sw/Makefile
+               src/gallium/winsys/intel/drm/Makefile
                src/gallium/winsys/nouveau/drm/Makefile
                src/gallium/winsys/radeon/drm/Makefile
                src/gallium/winsys/svga/drm/Makefile
-               src/gallium/winsys/sw/Makefile
                src/gallium/winsys/sw/dri/Makefile
                src/gallium/winsys/sw/fbdev/Makefile
                src/gallium/winsys/sw/null/Makefile
@@ -2135,7 +2107,6 @@ dnl Sort the dirs alphabetically
 GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
 GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
 GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
-GALLIUM_MAKE_DIRS=`echo $GALLIUM_MAKE_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
 GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
 
 AC_OUTPUT
@@ -2199,7 +2170,7 @@ if test "$enable_egl" = yes; then
         egl_drivers="$egl_drivers builtin:egl_dri2"
     fi
 
-    if test "x$HAVE_ST_EGL" = xyes; then
+    if test "x$enable_gallium_egl" = xyes; then
         echo "        EGL drivers:    ${egl_drivers} egl_gallium"
         echo "        EGL Gallium STs:$EGL_CLIENT_APIS"
     else