[PATCH xf86-video-nested v2 4/5] Add configure option for choosing driver backend

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Thu Nov 6 09:18:13 PST 2014


This patch will introduce a new configure option --with-backend=NAME,
that will allow switching easily between available client backend
implementations when building xf86-video-nested.

Signed-off-by: Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>
---
 configure.ac    | 16 +++++++++++++++-
 src/Makefile.am |  2 +-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7bdb8ca..65be273 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,6 +53,14 @@ AC_ARG_WITH([xorg-module-dir],
             [moduledir="$libdir/xorg/modules"])
 AC_SUBST([moduledir])
 
+# Define a configure option for choosing the client backend when building driver
+AC_ARG_WITH([backend],
+            AS_HELP_STRING([--with-backend=NAME],
+                           [Backend to be used when building the driver. Available options: xlib, xcb (default: xlib)]),
+            [BACKEND="$withval"],
+            [BACKEND=xlib])
+AC_SUBST([BACKEND])
+
 # Define a configure option to enable/disable nested input driver build
 AC_ARG_ENABLE([nested-input],
               AS_HELP_STRING([--enable-nested-input],
@@ -73,7 +81,12 @@ PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
 
 # Checks for libraries.
 PKG_CHECK_MODULES(X11, x11)
-PKG_CHECK_MODULES(XEXT, xext)
+case "$BACKEND" in
+    xlib)
+        PKG_CHECK_MODULES(XEXT, xext)
+    ;;
+esac
+
 
 DRIVER_NAME=nested
 AC_SUBST([DRIVER_NAME])
@@ -87,5 +100,6 @@ AC_MSG_RESULT([
 	$PACKAGE_NAME	$VERSION
 
 	moduledir:		${moduledir}
+	backend:		${BACKEND}
 	nested input:		${NESTED_INPUT}
 ])
diff --git a/src/Makefile.am b/src/Makefile.am
index 11e610d..0588b6b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,7 +30,7 @@ nested_drv_la_LIBADD = $(XORG_LIBS) $(X11_LIBS) $(XEXT_LIBS)
 
 nested_drv_ladir = @moduledir@/drivers
 
-nested_drv_la_SOURCES = driver.c client.h compat-api.h xlibclient.c
+nested_drv_la_SOURCES = driver.c client.h compat-api.h @BACKEND at client.c
 
 if NESTED_INPUT
 nested_drv_la_SOURCES += nested_input.h nested_input.c
-- 
2.1.2



More information about the xorg-devel mailing list