Skip to content
Snippets Groups Projects
Commit 71c75f20 authored by Gurchetan Singh's avatar Gurchetan Singh :speech_balloon:
Browse files

configure: fix issues with GLX build

1) We use the preprocessor flag HAVE_EPOXY_GLX_H, but never
   set it.
2) WITH_GLX diverges with HAVE_EPOXY_EGL_H.
3) virgl_test_server needs to link with X11 when using a GLX
   backend.

To fix this, query epoxy for GLX support and allow the user to
disable it as well.

TEST=./autogen.sh --disable-egl
parent 80b6b372
No related branches found
No related tags found
Loading
...@@ -83,6 +83,7 @@ AC_ARG_ENABLE(tests, ...@@ -83,6 +83,7 @@ AC_ARG_ENABLE(tests,
[build_tests="auto"]) [build_tests="auto"])
AC_ARG_ENABLE([egl], AS_HELP_STRING([--disable-egl], [Disable EGL])) AC_ARG_ENABLE([egl], AS_HELP_STRING([--disable-egl], [Disable EGL]))
AC_ARG_ENABLE([glx], AS_HELP_STRING([--disable-glx], [Disable GLX]))
PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK="yes"], [HAVE_CHECK="no"]) PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
...@@ -133,12 +134,15 @@ if test "x$os_win32" = xno; then ...@@ -133,12 +134,15 @@ if test "x$os_win32" = xno; then
]) ])
fi fi
AC_ARG_WITH([glx], AS_HELP_STRING([--with-glx], [Build with the x11/glx backend])) PKG_CHECK_VAR(epoxy_has_glx, [epoxy], [epoxy_has_glx])
AS_IF([test "x$with_glx" = "xyes"], [ AS_IF([test "x$epoxy_has_glx" = "x1" && test "x$enable_glx" != "xno"], [
PKG_CHECK_MODULES([X11], [x11]) PKG_CHECK_MODULES([X11], [x11])
AC_CHECK_HEADER([epoxy/glx.h]) epoxy_has_glx=yes
AC_DEFINE([HAVE_EPOXY_GLX_H], [1], [Libepoxy has GLX support.])
],[
epoxy_has_glx=no
]) ])
AM_CONDITIONAL([WITH_GLX], [test "x$with_glx" = "xyes"]) AM_CONDITIONAL([HAVE_EPOXY_GLX], [test "x$epoxy_has_glx" = "xyes"])
AC_SUBST([DEFINES]) AC_SUBST([DEFINES])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
...@@ -161,7 +165,7 @@ AC_MSG_NOTICE([ ...@@ -161,7 +165,7 @@ AC_MSG_NOTICE([
c compiler: $CC c compiler: $CC
win32: $os_win32 win32: $os_win32
glx: $with_glx glx: $epoxy_has_glx
egl: $epoxy_has_egl egl: $epoxy_has_egl
debug: $enable_debug debug: $enable_debug
tests: $build_tests tests: $build_tests
......
...@@ -39,7 +39,7 @@ libvrend_la_SOURCES += \ ...@@ -39,7 +39,7 @@ libvrend_la_SOURCES += \
virgl_egl_context.c virgl_egl_context.c
endif endif
if WITH_GLX if HAVE_EPOXY_GLX
libvrend_la_SOURCES += \ libvrend_la_SOURCES += \
virgl_glx.h \ virgl_glx.h \
virgl_glx_context.c virgl_glx_context.c
......
AM_LDFLAGS = $(X11_LIBS)
AM_CFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers/virgl \ -I$(top_srcdir)/src/gallium/drivers/virgl \
-I$(top_srcdir)/src/gallium/include \ -I$(top_srcdir)/src/gallium/include \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment