From 6bfaea0707ba1a7788c4b6d30c18fb094f3a1dd4 Mon Sep 17 00:00:00 2001 From: SCOTT-HAMILTON Date: Sun, 29 Aug 2021 16:34:25 +0200 Subject: autotools: use pkg-config instead of AC_PATH_XTRA --- configure.ac | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 3f200a6c..a806ed8e 100644 --- a/configure.ac +++ b/configure.ac @@ -1100,6 +1100,10 @@ AC_SUBST([LIBDBUS_LIBS]) DBUS_X_LIBS= DBUS_X_CFLAGS= +AC_ARG_WITH([x], + [AS_HELP_STRING([--without-x], [build without X11 support])], + [], [with_x=auto]) + AC_ARG_ENABLE([x11-autolaunch], AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]), [], [enable_x11_autolaunch=auto]) @@ -1111,16 +1115,23 @@ if test "x$dbus_win" = xyes; then enable_x11_autolaunch=no have_x11=no -else - AC_PATH_XTRA +else if test "x$with_x" = xauto; then + PKG_CHECK_MODULES([X], [x11], + [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])], + [ have_x11=no ]) - if test "x$no_x" = xyes; then - have_x11=no + if test "x$have_x11" = xno; then + AC_MSG_WARN([Couldn't found X11, tried with pkg-config.]) else have_x11=yes - DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" + DBUS_X_LIBS="$X_LIBS" DBUS_X_CFLAGS="$X_CFLAGS" fi +else + AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [ + AC_MSG_ERROR([--enable-x11-autolaunch and --without-x are not compatible]) + ]) +fi fi if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then -- cgit v1.2.1