e5355745746aad09fbaff8e8eff903542b19c26d
[wmaker-crm.git] / m4 / wm_xext_check.m4
blobe5355745746aad09fbaff8e8eff903542b19c26d
1 # wm_xext_check.m4 - Macros to check for X extensions support libraries
3 # Copyright (c) 2013 Christophe CURIS
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 # WM_XEXT_CHECK_XSHAPE
20 # --------------------
22 # Check for the X Shaped Window extension
23 # The check depends on variable 'enable_xshape' being either:
24 #   yes  - detect, fail if not found
25 #   no   - do not detect, disable support
26 #   auto - detect, disable if not found
28 # When found, append appropriate stuff in XLIBS, and append info to
29 # the variable 'supported_xext'
30 # When not found, append info to variable 'unsupported'
31 AC_DEFUN_ONCE([WM_XEXT_CHECK_XSHAPE],
32 [WM_LIB_CHECK([XShape], [-lXext], [XShapeSelectInput], [$XLIBS],
33     [wm_save_CFLAGS="$CFLAGS"
34      AS_IF([wm_fn_lib_try_compile "X11/extensions/shape.h" "Window win;" "XShapeSelectInput(NULL, win, 0)" ""],
35         [],
36         [AC_MSG_ERROR([found $CACHEVAR but cannot compile using XShape header])])
37      CFLAGS="$wm_save_CFLAGS"],
38     [supported_xext], [XLIBS], [enable_shape], [-])dnl
39 ]) dnl AC_DEFUN