beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / acinclude.m4
blobdcf54f9357d66bf2f25b44b60833197f379af4fc
1 dnl -*- mode: autoconf -*-
3 dnl [m4_newline] didn't appear until autoconf 2.62
4 m4_ifdef([m4_newline],,[m4_define([m4_newline],[
5 ])])
7 dnl These are not available in autoconf 2.59
9 m4_ifdef([m4_foreach_w],,[m4_define([m4_foreach_w],
10 [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
12 m4_ifdef([AS_CASE],,[
13 m4_define([_AS_CASE],
14 [m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
15        [$#], 1, [  *) $1 ;;],
16        [$#], 2, [  $1) m4_default([$2], [:]) ;;],
17        [  $1) m4_default([$2], [:]) ;;
18 $0(m4_shift2($@))])dnl
20 m4_defun([AS_CASE],
21 [m4_ifval([$2$3],
22 [case $1 in
23 _AS_CASE(m4_shift($@))
24 esac
25 ])dnl
26 ])# AS_CASE
29 m4_ifdef([m4_shift2],, [m4_define([m4_shift2], [m4_shift(m4_shift($@))])])
32 dnl ==========================================================================
34 dnl This has to be in acinclude.m4 as it includes other files
36 dnl Parse Version.mk and declare m4 variables out of it
37 m4_define([CAIRO_PARSE_VERSION],dnl
38                 m4_translit(dnl
39                 m4_bpatsubst(m4_include(cairo-version.h),
40                              [^.define \([a-zA-Z0-9_]*\)  *\([0-9][0-9]*\)],
41                              [[m4_define(\1, \2)]]),
42                             [A-Z], [a-z])dnl
43 )dnl
45 dnl ==========================================================================
47 m4_pattern_forbid([^cr_])
49 dnl AC_AUTOCONF_VERSION was introduced in 2.62, so its definition works as
50 dnl a conditional on version >= 2.62.  Older versions did not call
51 dnl m4_pattern_allow from AC_DEFINE and friends.  To avoid lots of warnings we
52 dnl only forbid CAIRO_ if autoconf is recent enough.
53 m4_ifdef([AC_AUTOCONF_VERSION],
54 [m4_pattern_forbid([CAIRO])],
55 [m4_pattern_forbid([_CAIRO])])