xref: /PHP-8.0/ext/enchant/config.m4 (revision 9b41f22f)
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], [found_enchant_2=yes], [found_enchant_2=no])
8
9  if test "$found_enchant_2" = "yes"; then
10
11    PHP_EVAL_INCLINE($ENCHANT2_CFLAGS)
12    PHP_EVAL_LIBLINE($ENCHANT2_LIBS, ENCHANT_SHARED_LIBADD)
13
14    AC_DEFINE(HAVE_ENCHANT_GET_VERSION, 1, [ enchant_get_version since 1.6.0 ])
15
16  else
17    AC_MSG_WARN([libenchant-2 not found trying with old libenchant])
18    PKG_CHECK_MODULES([ENCHANT], [enchant >= 1.4.2])
19
20    PHP_EVAL_INCLINE($ENCHANT_CFLAGS)
21    PHP_EVAL_LIBLINE($ENCHANT_LIBS, ENCHANT_SHARED_LIBADD)
22
23    PHP_CHECK_LIBRARY(enchant, enchant_get_version,
24    [
25      AC_DEFINE(HAVE_ENCHANT_GET_VERSION, 1, [ enchant_get_version since 1.6.0 ])
26    ], [ ], [
27      $ENCHANT_LIBS
28    ])
29
30    PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param,
31    [
32      AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ enchant_broker_set_param since 1.5.0 and removed in 2.x ])
33    ], [ ], [
34      $ENCHANT_LIBS
35    ])
36  fi
37
38  AC_DEFINE(HAVE_ENCHANT, 1, [ ])
39
40  PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
41  PHP_SUBST(ENCHANT_SHARED_LIBADD)
42fi
43