configure: Do not keep assertion if debug was not enabled
[wmaker-crm.git] / m4 / windowmaker.m4
blob317d65e99c1529aecfb6f60c3fd74a553d6c35a1
1 dnl
2 dnl WM_CHECK_LIB(NAME, FUNCTION, EXTRALIBS)
3 dnl
4 AC_DEFUN([WM_CHECK_LIB],
6 LDFLAGS_old="$LDFLAGS"
7 LDFLAGS="$LDFLAGS $lib_search_path"
8 AC_CHECK_LIB([$1],[$2],yes=yes,no=no,[$3])
9 LDFLAGS="$LDFLAGS_old"
12 dnl
13 dnl WM_CHECK_HEADER(NAME)
14 dnl
15 AC_DEFUN([WM_CHECK_HEADER],
17 CPPFLAGS_old="$CPPFLAGS"
18 CPPFLAGS="$CPPFLAGS $inc_search_path"
19 AC_CHECK_HEADER([$1])
20 CPPFLAGS="$CPPFLAGS_old"
24 dnl
25 dnl WM_CHECK_XFT_VERSION(MIN_VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
26 dnl
27 dnl # $XFTFLAGS should be defined before calling this macro,
28 dnl # else it will not be able to find Xft.h
29 dnl
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,
39 [AC_TRY_LINK(
40 [/* Test version of libXft we have */
41 #include <X11/Xlib.h>
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
46 #endif
47 ], [],
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
51   AC_MSG_RESULT(yes)
52   ifelse([$2], , :, [$2])
53 else
54   AC_MSG_RESULT(no)
55   ifelse([$3], , , [$3])
57 CPPFLAGS="$CPPFLAGS_old"