OSDN Git Service

configure: check for x11 on path
authorDaniel Charles <daniel.charles@intel.com>
Tue, 21 Feb 2017 23:31:46 +0000 (15:31 -0800)
committerSean V. Kelley <seanvk@users.noreply.github.com>
Thu, 23 Feb 2017 01:26:17 +0000 (17:26 -0800)
enable-x11 is set to yes by default and during configuration it has to
check for X11 header files on the path then the build system is prepared
to avoid compiling X11 related code if headers are not present.

Fixes #48

TEST="autogen.sh --prefix=<some prefix>, make sure X11 headers are not installed"
TEST="x11 should not print out as supported on the configure summary"

Signed-off-by: Daniel Charles <daniel.charles@intel.com>
configure.ac

index 226df54..1612993 100644 (file)
@@ -142,6 +142,15 @@ AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC],
 
 dnl Check for VA/DRM API
 USE_X11="$enable_x11"
+
+dnl Check for X11
+if test "$enable_x11" = "yes"; then
+    USE_X11="yes"
+    PKG_CHECK_MODULES([X11],    [x11],    [:], [USE_X11="no"])
+    PKG_CHECK_MODULES([XEXT],   [xext],   [:], [USE_X11="no"])
+    PKG_CHECK_MODULES([XFIXES], [xfixes], [:], [USE_X11="no"])
+fi
+
 if test "$USE_X11" = "yes"; then
     PKG_CHECK_MODULES(LIBVA_X11_DEPS, [libva-x11],
       [AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is enabled])],