st/xorg: handle updates to DamageUnregister API
[mesa.git] / configure.ac
index d47636d4dad93465ac00444aaef962b1258b2fc2..0a250471eebc1cfe2d90835ec1aecb6d94054c04 100644 (file)
@@ -1005,62 +1005,41 @@ if test "x$enable_dri" = xyes; then
     DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/  */ /g'`
 
     # Check for expat
-    EXPAT_INCLUDES=""
-    EXPAT_LIB=-lexpat
-    AC_ARG_WITH([expat],
-        [AS_HELP_STRING([--with-expat=DIR],
-            [expat install directory])],[
-        EXPAT_INCLUDES="-I$withval/include"
-        CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
-        LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
-        EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
-        ])
-    AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
-    save_LIBS="$LIBS"
-    AC_CHECK_LIB([expat],[XML_ParserCreate],[],
-        [AC_MSG_ERROR([Expat required for DRI.])])
-    LIBS="$save_LIBS"
+    PKG_CHECK_EXISTS([EXPAT], [have_expat=yes], [have_expat=no])
+    if test "x$have_expat" = "xyes"; then
+       PKG_CHECK_MODULES([EXPAT], [expat], [],
+                         AC_MSG_ERROR([Expat required for DRI.]))
+    else
+       # expat version 2.0 and earlier do not provide expat.pc
+       EXPAT_LIBS=-lexpat
+    fi
 
     # If we are building any DRI driver other than swrast.
-    if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
-        # ... libdrm is required
-        if test "x$have_libdrm" != xyes; then
-            AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
+    if test -n "$DRI_DIRS"; then
+        if test x"$DRI_DIRS" != xswrast; then
+            # ... libdrm is required
+            if test "x$have_libdrm" != xyes; then
+                AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
+            fi
+            DRICOMMON_NEED_LIBDRM=yes
+        else
+            DRICOMMON_NEED_LIBDRM=no
         fi
     fi
 
     # put all the necessary libs together
-    DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
-    GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
+    DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
 
     DRI_DRIVER_LDFLAGS="-module -avoid-version -shared -Wl,-Bsymbolic"
 fi
 
-enable_dricore=no
-enable_megadriver=no
-for driver in $DRI_DIRS; do
-    if test $driver != "i965"; then
-        enable_dricore=yes
-    else
-        enable_megadriver=yes
-    fi
-done
-
-# megadriver wants to use libmesa.la, while non-megadrivers want to
-# automatically get libdricore.  Some day hopefully we'll transition
-# everything to megadriver.
-MEGADRIVER_DRI_LIB_DEPS=$DRI_LIB_DEPS
-DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la $DRI_LIB_DEPS"
-
-AM_CONDITIONAL(NEED_LIBDRICORE, test "x$enable_dricore" = xyes)
-AM_CONDITIONAL(NEED_MEGADRIVER, test "x$enable_megadriver" = xyes)
+AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
 AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
                                   "x$enable_osmesa" = xyes -o \
-                                  "x$enable_megadriver" = xyes)
-AC_SUBST([EXPAT_INCLUDES])
+                                  -n "$DRI_DIRS")
 AC_SUBST([DRI_LIB_DEPS])
 AC_SUBST([DRI_DRIVER_LDFLAGS])
-AC_SUBST([MEGADRIVER_DRI_LIB_DEPS])
 AC_SUBST([GALLIUM_DRI_LIB_DEPS])
 
 case $DRI_DIRS in
@@ -1371,8 +1350,8 @@ if test "x$enable_opencl" = xyes; then
                     PKG_CONFIG_PATH environment variable.
                     By default libclc.pc is installed to /usr/local/share/pkgconfig/])
     else
-        LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
-        LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
+        LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
+        LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
         AC_SUBST([LIBCLC_INCLUDEDIR])
         AC_SUBST([LIBCLC_LIBEXECDIR])
     fi
@@ -1777,6 +1756,7 @@ if test "x$with_gallium_drivers" != x; then
             fi
             GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
             gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
+            DRICOMMON_NEED_LIBDRM=yes
             ;;
         xilo)
             HAVE_GALLIUM_ILO=yes
@@ -1784,13 +1764,15 @@ if test "x$with_gallium_drivers" != x; then
             gallium_require_drm_loader
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
             gallium_check_st "intel/drm" "dri-ilo"
+            DRICOMMON_NEED_LIBDRM=yes
             ;;
         xr300)
             HAVE_GALLIUM_R300=yes
             PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
             gallium_require_llvm "Gallium R300"
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
-            gallium_check_st "radeon/drm" "r300/dri" "" "" "r300/xvmc" "r300/vdpau"
+            gallium_check_st "radeon/drm" "r300/dri" "" "" "" ""
+            DRICOMMON_NEED_LIBDRM=yes
             ;;
         xr600)
             HAVE_GALLIUM_R600=yes
@@ -1807,7 +1789,8 @@ if test "x$with_gallium_drivers" != x; then
             if test "x$enable_opencl" = xyes; then
                 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
             fi
-            gallium_check_st "radeon/drm" "r600/dri" "r600/xorg" "" "r600/xvmc" "r600/vdpau"
+            gallium_check_st "radeon/drm" "r600/dri" "" "" "r600/xvmc" "r600/vdpau"
+            DRICOMMON_NEED_LIBDRM=yes
             ;;
         xradeonsi)
             HAVE_GALLIUM_RADEONSI=yes
@@ -1815,7 +1798,8 @@ if test "x$with_gallium_drivers" != x; then
             gallium_require_drm_loader
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
             radeon_llvm_check
-            gallium_check_st "radeon/drm" "radeonsi/dri" "radeonsi/xorg" "" "" "radeonsi/vdpau" ""
+            gallium_check_st "radeon/drm" "radeonsi/dri" "" "" "" "radeonsi/vdpau" ""
+            DRICOMMON_NEED_LIBDRM=yes
             ;;
         xnouveau)
             HAVE_GALLIUM_NOUVEAU=yes
@@ -1823,6 +1807,7 @@ if test "x$with_gallium_drivers" != x; then
             gallium_require_drm_loader
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau"
             gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
+            DRICOMMON_NEED_LIBDRM=yes
             ;;
         xfreedreno)
             HAVE_GALLIUM_FREEDRENO=yes
@@ -1830,6 +1815,7 @@ if test "x$with_gallium_drivers" != x; then
             gallium_require_drm_loader
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
             gallium_check_st "freedreno/drm" "dri-freedreno" "" "" "" ""
+            DRICOMMON_NEED_LIBDRM=yes
             ;;
         xswrast)
             HAVE_GALLIUM_SOFTPIPE=yes
@@ -1842,16 +1828,6 @@ if test "x$with_gallium_drivers" != x; then
             if test "x$enable_dri" = xyes; then
                 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
             fi
-            if test "x$enable_vdpau" = xyes; then
-                GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
-            fi
-            if test "x$enable_xvmc" = xyes; then
-                GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
-            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
             ;;
         *)
             AC_MSG_ERROR([Unknown Gallium driver: $driver])
@@ -1961,11 +1937,7 @@ AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
 
 AC_SUBST([ELF_LIB])
 
-AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
-                                     "x$enable_xlib_glx" = xyes -o \
-                                     "x$enable_osmesa" = xyes -o \
-                                     "x$enable_megadriver" = xyes -o \
-                                     "x$enable_gallium_osmesa" = xyes)
+AM_CONDITIONAL(DRICOMMON_NEED_LIBDRM, test "x$DRICOMMON_NEED_LIBDRM" = xyes)
 AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
 AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
@@ -2062,23 +2034,17 @@ AC_CONFIG_FILES([Makefile
                src/gallium/targets/pipe-loader/Makefile
                src/gallium/targets/radeonsi/dri/Makefile
                src/gallium/targets/radeonsi/vdpau/Makefile
-               src/gallium/targets/radeonsi/xorg/Makefile
                src/gallium/targets/r300/dri/Makefile
-               src/gallium/targets/r300/vdpau/Makefile
-               src/gallium/targets/r300/xvmc/Makefile
                src/gallium/targets/r600/dri/Makefile
                src/gallium/targets/r600/vdpau/Makefile
-               src/gallium/targets/r600/xorg/Makefile
                src/gallium/targets/r600/xvmc/Makefile
                src/gallium/targets/libgl-xlib/Makefile
                src/gallium/targets/vdpau-nouveau/Makefile
-               src/gallium/targets/vdpau-softpipe/Makefile
                src/gallium/targets/xa-vmwgfx/Makefile
                src/gallium/targets/xa-vmwgfx/xatracker.pc
                src/gallium/targets/xorg-i915/Makefile
                src/gallium/targets/xorg-nouveau/Makefile
                src/gallium/targets/xvmc-nouveau/Makefile
-               src/gallium/targets/xvmc-softpipe/Makefile
                src/gallium/tests/trivial/Makefile
                src/gallium/tests/unit/Makefile
                src/gallium/winsys/Makefile
@@ -2128,7 +2094,6 @@ AC_CONFIG_FILES([Makefile
                src/mesa/drivers/osmesa/Makefile
                src/mesa/drivers/osmesa/osmesa.pc
                src/mesa/drivers/x11/Makefile
-               src/mesa/libdricore/Makefile
                src/mesa/main/tests/Makefile
                src/mesa/main/tests/hash_table/Makefile
                src/mesa/program/Makefile