[PATCH xf86-video-nested v4 04/11] Add configure option for choosing driver backend

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Fri Nov 13 10:28:04 PST 2015


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 | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 32e9ab0..0664e91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([xf86-video-nestedy],
+AC_INIT([xf86-video-nested],
         [0.1.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-nested])
@@ -50,6 +50,13 @@ AC_ARG_WITH(xorg-module-dir, [  --with-xorg-module-dir=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])
 
 # Store the list of server defined optional extensions in REQUIRED_MODULES
 #XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
@@ -59,7 +66,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])
@@ -69,3 +81,9 @@ AC_CONFIG_FILES([
                 src/Makefile
 ])
 AC_OUTPUT
+AC_MSG_RESULT([
+	$PACKAGE_NAME	$VERSION
+
+	moduledir:		${moduledir}
+	backend:		${BACKEND}
+])
-- 
2.1.4



More information about the xorg-devel mailing list