[at-spi2-core] Allow building without Xtst, Xi with --disable-x11



commit 5f63b4ef4de59755c062330316e5648d3ae158ea
Author: dolphinling <dolphinling dolphinling net>
Date:   Mon May 9 08:21:55 2016 -0400

    Allow building without Xtst, Xi with --disable-x11
    
    This also fixes a bug where specifying --enable-x11 would disable x11
    support.

 configure.ac |   88 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 45 insertions(+), 43 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4b5a495..4efac23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,54 +75,56 @@ AC_ARG_ENABLE(x11,
                               [disable the X11 backend])],,
                              [enable_x11=auto])
 
-if test x$no_x = xyes ; then
-       AC_MSG_WARN([X development libraries not found])
-  AM_CONDITIONAL(USE_X11, false)
-elif test x$enable_x11 = xauto; then
-       X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
-  AC_DEFINE(HAVE_X11, 1, [Define to use X11])
-  AM_CONDITIONAL(USE_X11, true)
+if test x$enable_x11 = xno; then
+       AM_CONDITIONAL(USE_X11, false)
+elif test x$no_x = xyes ; then
+       AC_MSG_ERROR([X development libraries not found])
 else
-  AM_CONDITIONAL(USE_X11, false)
-fi
-AC_SUBST(X_LIBS)
-AC_SUBST(HAVE_X11)
-
-save_LIBS="$LIBS"
-LIBS=""
-CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
-       AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
-       $X_LIBS)
-AC_SUBST(XTST_LIBS)
-LIBS="$LIBS $save_LIBS"
+       AM_CONDITIONAL(USE_X11, true)
+       X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+       AC_SUBST(X_LIBS)
+       AC_DEFINE(HAVE_X11, 1, [Define to use X11])
+       AC_SUBST(HAVE_X11)
 
-save_LIBS="$LIBS"
-LIBS=""
-AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe", have_xkb="no", $X_LIBS)
-if test "x$have_xkb" = "xmaybe"; then 
-       AC_CHECK_HEADER([X11/XKBlib.h], have_xkb=yes)
-fi
-if test "x$have_xkb" = "xyes"; then
-       AC_DEFINE([HAVE_XKB], [], [Xkb is present])
-fi
-LIBS="$LIBS $save_LIBS"
+       dnl Check for Xtst
+       save_LIBS="$LIBS"
+       LIBS=""
+       CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+       AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
+               AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
+               $X_LIBS)
+       AC_SUBST(XTST_LIBS)
+       LIBS="$LIBS $save_LIBS"
+
+       dnl Check for XkbQueryExtension
+       save_LIBS="$LIBS"
+       LIBS=""
+       AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe", have_xkb="no", $X_LIBS)
+       if test "x$have_xkb" = "xmaybe"; then 
+               AC_CHECK_HEADER([X11/XKBlib.h], have_xkb=yes)
+       fi
+       if test "x$have_xkb" = "xyes"; then
+               AC_DEFINE([HAVE_XKB], [], [Xkb is present])
+       fi
+       LIBS="$LIBS $save_LIBS"
 
-save_LIBS="$LIBS"
-LIBS=""
-AC_CHECK_LIB(Xi, XOpenDevice, have_xinput="maybe", have_xinput="no", $X_LIBS)
-if test "x$have_xinput" = "xmaybe"; then
+       dnl Check for Xi
        save_LIBS="$LIBS"
-       LIBS="$LIBS $X_LIBS"
-       AC_CHECK_HEADER([X11/extensions/XInput.h], [have_xinput="yes"])
-       LIBS="$save_LIBS"
-fi
-if test "x$have_xinput" != "xyes"; then
-       AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details])
+       LIBS=""
+       AC_CHECK_LIB(Xi, XOpenDevice, have_xinput="maybe", have_xinput="no", $X_LIBS)
+       if test "x$have_xinput" = "xmaybe"; then
+               save_LIBS="$LIBS"
+               LIBS="$LIBS $X_LIBS"
+               AC_CHECK_HEADER([X11/extensions/XInput.h], [have_xinput="yes"])
+               LIBS="$save_LIBS"
+       fi
+       if test "x$have_xinput" != "xyes"; then
+               AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details])
+       fi
+       XINPUT_LIBS="-lXi"
+       AC_SUBST(XINPUT_LIBS)
+       LIBS="$LIBS $save_LIBS"
 fi
-XINPUT_LIBS="-lXi"
-AC_SUBST(XINPUT_LIBS)
-LIBS="$LIBS $save_LIBS"
 
 save_LIBS="$LIBS"
 LIBS=""


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]