mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
configure: Moved configure's detection of XRandR to a dedicated macro
The original check was not compliant with autoconf's syntax, did not have a very good behaviour for user and was not easy to make evolve. The new macro: - uses as much as possible autoconf macros for portability and code consistency; - checks also for header usability with the compiler; - provides a consistent behaviour on yes/no/auto (if user explicitly enables support, do not silently disable if not found; if library is found but not the header, complain to let user install it or explicitly disable support) Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
73c00fac27
commit
ee3422dd10
21
configure.ac
21
configure.ac
@@ -511,19 +511,13 @@ WM_XEXT_CHECK_XINERAMA
|
|||||||
|
|
||||||
dnl XRandR support
|
dnl XRandR support
|
||||||
dnl ==============
|
dnl ==============
|
||||||
xrandr=no
|
AC_ARG_ENABLE([xrandr],
|
||||||
AC_ARG_ENABLE(xrandr, AS_HELP_STRING([--enable-xrandr], [enable XRandR window extension support (NOT recommended, buggy)]),
|
[AS_HELP_STRING([--enable-xrandr], [enable XRandR extension support (NOT recommended, buggy)])],
|
||||||
xrandr=$enableval, xrandr=no)
|
[AS_CASE(["$enableval"],
|
||||||
added_xext=no
|
[yes|no], [],
|
||||||
|
[AC_MSG_ERROR([bad value $enableval for --enable-xrandr]) ]) ],
|
||||||
LIBXRANDR=
|
[enable_xrandr=no])
|
||||||
if test "$xrandr" = yes; then
|
WM_XEXT_CHECK_XRANDR
|
||||||
AC_CHECK_LIB(Xrandr, XRRQueryExtension, [LIBXRANDR=-lXrandr
|
|
||||||
added_xext=yes
|
|
||||||
AC_DEFINE(USE_XRANDR, 1, [define if you want support for XRandR (set by configure)])],
|
|
||||||
xrandr=no, $XLFLAGS $XLIBS)
|
|
||||||
fi
|
|
||||||
AC_SUBST(LIBXRANDR)
|
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl libWINGS uses math functions, check whether usage requires linking
|
dnl libWINGS uses math functions, check whether usage requires linking
|
||||||
@@ -830,7 +824,6 @@ echo "Supported X extensions: :$supported_xext"
|
|||||||
echo "Supported graphic format libraries :$supported_gfx"
|
echo "Supported graphic format libraries :$supported_gfx"
|
||||||
echo "Unsupported features :$unsupported"
|
echo "Unsupported features :$unsupported"
|
||||||
echo "Antialiased text support in WINGs : $xft"
|
echo "Antialiased text support in WINGs : $xft"
|
||||||
echo "XRandR extension support : $xrandr"
|
|
||||||
echo "Translated message files to install : $mof"
|
echo "Translated message files to install : $mof"
|
||||||
dnl echo "Supported languages beside English : $languages"
|
dnl echo "Supported languages beside English : $languages"
|
||||||
if test "x$MOFILES" != "x"; then
|
if test "x$MOFILES" != "x"; then
|
||||||
|
|||||||
@@ -98,3 +98,27 @@ sed -e 's,^[[^%]]*% *,,' | sed -e 's, *%.*$,,' `" dnl
|
|||||||
])
|
])
|
||||||
AC_SUBST(LIBXINERAMA)dnl
|
AC_SUBST(LIBXINERAMA)dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# WM_XEXT_CHECK_XRANDR
|
||||||
|
# --------------------
|
||||||
|
#
|
||||||
|
# Check for the X RandR (Resize-and-Rotate) extension
|
||||||
|
# The check depends on variable 'enable_xrandr' being either:
|
||||||
|
# yes - detect, fail if not found
|
||||||
|
# no - do not detect, disable support
|
||||||
|
# auto - detect, disable if not found
|
||||||
|
#
|
||||||
|
# When found, append appropriate stuff in LIBXRANDR, and append info to
|
||||||
|
# the variable 'supported_xext'
|
||||||
|
# When not found, append info to variable 'unsupported'
|
||||||
|
AC_DEFUN_ONCE([WM_XEXT_CHECK_XRANDR],
|
||||||
|
[WM_LIB_CHECK([XRandR], [-lXrandr], [XRRQueryExtension], [$XLIBS],
|
||||||
|
[wm_save_CFLAGS="$CFLAGS"
|
||||||
|
AS_IF([wm_fn_lib_try_compile "X11/extensions/Xrandr.h" "Display *dpy;" "XRRQueryExtension(dpy, NULL, NULL)" ""],
|
||||||
|
[],
|
||||||
|
[AC_MSG_ERROR([found $CACHEVAR but cannot compile using XRandR header])])
|
||||||
|
CFLAGS="$wm_save_CFLAGS"],
|
||||||
|
[supported_xext], [LIBXRANDR], [], [-])dnl
|
||||||
|
AC_SUBST([LIBXRANDR])dnl
|
||||||
|
]) dnl AC_DEFUN
|
||||||
|
|||||||
Reference in New Issue
Block a user