xref: /php-src/ext/enchant/config.m4 (revision 5fc68d8b)
1PHP_ARG_WITH([enchant],
2  [whether to build with Enchant support],
3  [AS_HELP_STRING([--with-enchant],
4    [Include Enchant support])])
5
6if test "$PHP_ENCHANT" != "no"; then
7  PKG_CHECK_MODULES([ENCHANT2], [enchant-2],
8    [found_enchant_2=yes],
9    [found_enchant_2=no])
10
11  AS_VAR_IF([found_enchant_2], [yes], [
12    PHP_EVAL_INCLINE([$ENCHANT2_CFLAGS])
13    PHP_EVAL_LIBLINE([$ENCHANT2_LIBS], [ENCHANT_SHARED_LIBADD])
14    AC_DEFINE([HAVE_ENCHANT_GET_VERSION], [1],
15      [Define to 1 if Enchant library has the 'enchant_get_version' function
16      (available since 1.6.0).])
17  ], [
18    AC_MSG_WARN([libenchant-2 not found trying with old libenchant])
19    PKG_CHECK_MODULES([ENCHANT], [enchant >= 1.4.2])
20
21    PHP_EVAL_INCLINE([$ENCHANT_CFLAGS])
22    PHP_EVAL_LIBLINE([$ENCHANT_LIBS], [ENCHANT_SHARED_LIBADD])
23
24    PHP_CHECK_LIBRARY([enchant], [enchant_get_version],
25      [AC_DEFINE([HAVE_ENCHANT_GET_VERSION], [1])],
26      [],
27      [$ENCHANT_LIBS])
28
29    PHP_CHECK_LIBRARY([enchant], [enchant_broker_set_param],
30      [AC_DEFINE([HAVE_ENCHANT_BROKER_SET_PARAM], [1],
31        [Define to 1 if Enchant library has the 'enchant_broker_set_param'
32        function (available since 1.5.0 and removed in 2.x).])],
33      [],
34      [$ENCHANT_LIBS])
35  ])
36
37  AC_DEFINE([HAVE_ENCHANT], [1],
38    [Define to 1 if the PHP extension 'enchant' is available.])
39
40  PHP_NEW_EXTENSION([enchant], [enchant.c], [$ext_shared])
41  PHP_SUBST([ENCHANT_SHARED_LIBADD])
42fi
43