mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-23 15:45:50 +01:00
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>
40 lines
1.7 KiB
Plaintext
40 lines
1.7 KiB
Plaintext
# wm_xext_check.m4 - Macros to check for X extensions support libraries
|
|
#
|
|
# Copyright (c) 2013 Christophe CURIS
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License along
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
# WM_XEXT_CHECK_XSHAPE
|
|
# --------------------
|
|
#
|
|
# Check for the X Shaped Window extension
|
|
# The check depends on variable 'enable_xshape' 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 XLIBS, and append info to
|
|
# the variable 'supported_xext'
|
|
# When not found, append info to variable 'unsupported'
|
|
AC_DEFUN_ONCE([WM_XEXT_CHECK_XSHAPE],
|
|
[WM_LIB_CHECK([XShape], [-lXext], [XShapeSelectInput], [$XLIBS],
|
|
[wm_save_CFLAGS="$CFLAGS"
|
|
AS_IF([wm_fn_lib_try_compile "X11/extensions/shape.h" "Window win;" "XShapeSelectInput(NULL, win, 0)" ""],
|
|
[],
|
|
[AC_MSG_ERROR([found $CACHEVAR but cannot compile using XShape header])])
|
|
CFLAGS="$wm_save_CFLAGS"],
|
|
[supported_xext], [XLIBS], [enable_shape], [-])dnl
|
|
]) dnl AC_DEFUN
|