2 dnl WM_CHECK_LIB(NAME, FUNCTION, EXTRALIBS)
4 AC_DEFUN([WM_CHECK_LIB],
7 LDFLAGS="$LDFLAGS $lib_search_path"
8 AC_CHECK_LIB([$1],[$2],yes=yes,no=no,[$3])
13 dnl WM_CHECK_HEADER(NAME)
15 AC_DEFUN([WM_CHECK_HEADER],
17 CPPFLAGS_old="$CPPFLAGS"
18 CPPFLAGS="$CPPFLAGS $inc_search_path"
20 CPPFLAGS="$CPPFLAGS_old"
25 dnl WM_CHECK_XFT_VERSION(MIN_VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
27 dnl # $XFTFLAGS should be defined before calling this macro,
28 dnl # else it will not be able to find Xft.h
30 AC_DEFUN([WM_CHECK_XFT_VERSION],
32 CPPFLAGS_old="$CPPFLAGS"
33 CPPFLAGS="$CPPFLAGS $XFTFLAGS $inc_search_path"
34 xft_major_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
35 xft_minor_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
36 xft_micro_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
37 AC_MSG_CHECKING([whether libXft is at least version $1])
38 AC_CACHE_VAL(ac_cv_lib_xft_version_ok,
40 [/* Test version of libXft we have */
42 #include <X11/Xft/Xft.h>
44 #if !defined(XFT_VERSION) || XFT_VERSION < $xft_major_version*10000 + $xft_minor_version*100 + $xft_micro_version
45 #error libXft on this system is too old. Consider upgrading to at least $1
48 eval "ac_cv_lib_xft_version_ok=yes",
49 eval "ac_cv_lib_xft_version_ok=no")])
50 if eval "test \"`echo '$ac_cv_lib_xft_version_ok'`\" = yes"; then
52 ifelse([$2], , :, [$2])
55 ifelse([$3], , , [$3])
57 CPPFLAGS="$CPPFLAGS_old"