The above function implies using the the xlib winsys, which
has additional library dependencies that should not be forced.
Make the software xlib pipe loader optional thus avoid all
the dependency hell. A user that wishes to use the particular
pipe-loader would need to set the following within configure.ac.
enable_gallium_xlib_loader=yes
v2:
- Wrap sw/xlib/xlib_sw_winsys.h to handle compilation on systems
lacking X11 headers. Spotted by Christian Prochaska.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75356
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
if test "x$enable_gallium_loader" = xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
if test "x$enable_gallium_loader" = xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
+ if test "x$enable_gallium_xlib_loader" = xyes; then
+ GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
+ NEED_WINSYS_XLIB="yes"
+ GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
+ 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],
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],
AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES])
AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS])
fi
AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES])
AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS])
fi
+AM_CONDITIONAL(NEED_PIPE_LOADER_XLIB, test "x$enable_gallium_xlib_loader" = xyes)
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_I915_DRI, test x$HAVE_I915_DRI = xyes)
AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/winsys
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/winsys
-if NEED_WINSYS_XLIB
-AM_CPPFLAGS += -DHAVE_WINSYS_XLIB
-endif
-
noinst_LTLIBRARIES =
if HAVE_LOADER_GALLIUM
noinst_LTLIBRARIES =
if HAVE_LOADER_GALLIUM
#include "pipe/p_compiler.h"
#include "pipe/p_compiler.h"
+#ifdef HAVE_PIPE_LOADER_XLIB
#include <X11/Xlib.h>
#endif
#include <X11/Xlib.h>
#endif
void
pipe_loader_release(struct pipe_loader_device **devs, int ndev);
void
pipe_loader_release(struct pipe_loader_device **devs, int ndev);
+#ifdef HAVE_PIPE_LOADER_XLIB
/**
* Initialize Xlib for an associated display.
/**
* Initialize Xlib for an associated display.
#include "util/u_dl.h"
#include "sw/dri/dri_sw_winsys.h"
#include "sw/null/null_sw_winsys.h"
#include "util/u_dl.h"
#include "sw/dri/dri_sw_winsys.h"
#include "sw/null/null_sw_winsys.h"
+#ifdef HAVE_PIPE_LOADER_XLIB
+/* Explicitly wrap the header to ease build without X11 headers */
#include "sw/xlib/xlib_sw_winsys.h"
#include "sw/xlib/xlib_sw_winsys.h"
#include "target-helpers/inline_sw_helper.h"
#include "state_tracker/drisw_api.h"
#include "target-helpers/inline_sw_helper.h"
#include "state_tracker/drisw_api.h"
+#ifdef HAVE_PIPE_LOADER_XLIB
bool
pipe_loader_sw_probe_xlib(struct pipe_loader_device **devs, Display *display)
{
bool
pipe_loader_sw_probe_xlib(struct pipe_loader_device **devs, Display *display)
{
+if NEED_PIPE_LOADER_XLIB
+gbm_gallium_drm_la_LIBADD += \
+ $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
+ -lX11 -lXext -lXfixes \
+ $(LIBDRM_LIBS)
+endif
+
gbm_gallium_drm_la_LDFLAGS = -no-undefined -avoid-version -module
# FIXME: this shouldn't be needed
gbm_gallium_drm_la_LDFLAGS = -no-undefined -avoid-version -module
# FIXME: this shouldn't be needed
-lclangBasic \
$(LLVM_LIBS)
-lclangBasic \
$(LLVM_LIBS)
+if NEED_PIPE_LOADER_XLIB
+lib@OPENCL_LIBNAME@_la_LIBADD += \
+ $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
+ -lX11 -lXext -lXfixes \
+ $(LIBDRM_LIBS)
+endif
+
lib@OPENCL_LIBNAME@_la_SOURCES =
# Force usage of a C++ linker
lib@OPENCL_LIBNAME@_la_SOURCES =
# Force usage of a C++ linker
$(LIBUDEV_LIBS) \
$(LIBDRM_LIBS)
$(LIBUDEV_LIBS) \
$(LIBDRM_LIBS)
+if NEED_PIPE_LOADER_XLIB
+libxatracker_la_LIBADD += \
+ $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
+ -lX11 -lXext -lXfixes \
+ $(LIBDRM_LIBS)
+endif
+
libxatracker_la_LDFLAGS = \
-no-undefined \
-version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY)
libxatracker_la_LDFLAGS = \
-no-undefined \
-version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY)
+if NEED_PIPE_LOADER_XLIB
+LDADD += \
+ $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
+ -lX11 -lXext -lXfixes \
+ $(LIBDRM_LIBS)
+endif
+
noinst_PROGRAMS = compute tri quad-tex
compute_SOURCES = compute.c
noinst_PROGRAMS = compute tri quad-tex
compute_SOURCES = compute.c