From cd4333a3302502c0cfc08432098b6953274cda08 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Thu, 14 Apr 2016 10:40:20 -0400 Subject: [PATCH] [glx] Add logic to prevent both gallium and classic xlib-glx The addition of --enable-gallium-xlib-glx allows one to chose between either the classic xlib-glx implementation or the gallium xlib-glx implementation. --- configure.ac | 32 +++++++++++++++++++++++++++----- src/gallium/Makefile.am | 2 ++ src/mesa/Makefile.am | 2 ++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index c426c72..920eb02 100644 --- a/configure.ac +++ b/configure.ac @@ -930,10 +930,9 @@ AC_ARG_ENABLE([xlib-glx], [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])], [enable_xlib_glx="$enableval"], [enable_xlib_glx=no]) - AC_ARG_ENABLE([gallium-tests], [AS_HELP_STRING([--enable-gallium-tests], - [Enable optional Gallium tests) @<:@default=disabled@:>@])], + [Enable optional Gallium tests @<:@default=disabled@:>@])], [enable_gallium_tests="$enableval"], [enable_gallium_tests=no]) @@ -957,6 +956,17 @@ case "$with_gallium_drivers" in no) with_gallium_drivers='' ;; esac +if test -n "$with_gallium_drivers" -a "x$enable_glx$enable_xlib_glx" = xyesyes; then + GALLIUM_XLIB_GLX_DEFAULT="yes" +else + GALLIUM_XLIB_GLX_DEFAULT="no" +fi +AC_ARG_ENABLE([gallium-xlib-glx], + [AS_HELP_STRING([--enable-gallium-xlib-glx], + [enable Gallium implementation of the Xlib-based GLX library @<:@default=enabled if using gallium and xlib-glx@:>@])], + [enable_gallium_xlib_glx="$enableval"], + [enable_gallium_xlib_glx="$GALLIUM_XLIB_GLX_DEFAULT"]) + if test "x$enable_opengl" = xno -a \ "x$enable_gles1" = xno -a \ "x$enable_gles2" = xno -a \ @@ -1000,6 +1010,15 @@ fi if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL]) fi +if test -z "$with_gallium_drivers" -a \ + "x$enable_gallium_xlib_glx" = xyes; then + AC_MSG_ERROR([Gallium Xlib-GLX cannot be built without Gallium]) +fi +if test "x$enable_xlib_glx$enable_gallium_xlib_glx" = xnoyes; then + AC_MSG_ERROR([Gallium Xlib-GLX cannot be built without Xlib-GLX]) +fi +AM_CONDITIONAL(HAVE_GALLIUM_X11_DRIVER, test "x$enable_gallium_xlib_glx" = xyes) + # Disable GLX if OpenGL is not enabled if test "x$enable_glx$enable_opengl" = xyesno; then @@ -2604,11 +2623,14 @@ if test "x$enable_dri" != xno; then echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" fi -case "x$enable_glx$enable_xlib_glx" in -xyesyes) +case "x$enable_glx$enable_xlib_glx$enable_gallium_xlib_glx" in +xyesyesyes) + echo " GLX: Xlib-based (Gallium)" + ;; +xyesyesno) echo " GLX: Xlib-based" ;; -xyesno) +xyesno*) echo " GLX: DRI-based" ;; *) diff --git a/src/gallium/Makefile.am b/src/gallium/Makefile.am index 086e170..c4dc224 100644 --- a/src/gallium/Makefile.am +++ b/src/gallium/Makefile.am @@ -141,8 +141,10 @@ SUBDIRS += state_trackers/dri targets/dri endif if HAVE_X11_DRIVER +if HAVE_GALLIUM_X11_DRIVER SUBDIRS += state_trackers/glx/xlib targets/libgl-xlib endif +endif if HAVE_ST_OMX SUBDIRS += state_trackers/omx targets/omx diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am index 3903818..7abc7b0 100644 --- a/src/mesa/Makefile.am +++ b/src/mesa/Makefile.am @@ -22,8 +22,10 @@ SUBDIRS = . main/tests if HAVE_X11_DRIVER +if !HAVE_GALLIUM_X11_DRIVER SUBDIRS += drivers/x11 endif +endif if HAVE_DRICOMMON SUBDIRS += drivers/dri -- 2.5.5