summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2016-11-24 07:22:21 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2016-11-24 07:22:21 +0100
commit2f6586fbdb50ab2319d9fb1ab7fe01624366c69e (patch)
tree978fbbbf40920bd71230a57203586204e518485b
parentd3897ebdbf7e181d178e257c556346adb2be7258 (diff)
downloadratpoison-2f6586fbdb50ab2319d9fb1ab7fe01624366c69e.zip
Tweak previous.
Use nicer names that the long ac_cv_* variables. Also, the reason why the third parameter of AC_CHECK_LIB was significant is that, if using the default (empty), the macro adds -lXrandr to LIBS. Later, LIBS is used for compile tests, which fail if libXrandr is not in the default search path of ld(1), for example in /usr/X11R6/lib...
-rw-r--r--configure.ac10
1 files changed, 4 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 63ee565..a55591e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,21 +179,19 @@ AC_CHECK_LIB([X11], [XkbKeycodeToKeysym],
mysavedCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-AC_CHECK_HEADERS([X11/extensions/Xrandr.h], [], [], [
+AC_CHECK_HEADERS([X11/extensions/Xrandr.h], [xrandr_h=yes], [xrandr_h=no], [
#include <X11/Xlib.h>
])
CPPFLAGS="$mysavedCPPFLAGS"
-# XXX Find out why ":" is so important below, with no argument
-# half of config.h ends up #undef'd
-AC_CHECK_LIB(Xrandr, XRRGetScreenResources, [: nothing], [], [$X_LIBS $X_EXTRA_LIBS])
+AC_CHECK_LIB(Xrandr, XRRGetScreenResources, [libxrandr=yes], [libxrandr=no], [$X_LIBS $X_EXTRA_LIBS])
compile_xrandr=no
-AS_CASE(["$with_xrandr:$ac_cv_header_X11_extensions_Xrandr_h:$ac_cv_lib_Xrandr_XRRGetScreenResources"],
+AS_CASE(["$with_xrandr:$xrandr_h:$libxrandr"],
[yes:no:*], [AC_MSG_ERROR([*** Can't enable Xrandr support, header Xrandr.h not found.])],
[yes:*:no], [AC_MSG_ERROR([*** Can't enable Xrandr support, libXrandr not found.])],
[yes:yes:yes|check:yes:yes], [X_LIBS="-lXrandr $X_LIBS"
- AC_DEFINE(HAVE_XRANDR, 1, [Xrandr])
+ AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you want Xrandr support.])
compile_xrandr=yes])
AM_CONDITIONAL(HAVE_XRANDR, [test "$compile_xrandr" = yes])