|
3 | 3 | ARG_WITH("enchant", "Enchant Support", "no");
|
4 | 4 |
|
5 | 5 | if (PHP_ENCHANT == "yes") {
|
6 |
| - if (CHECK_HEADER_ADD_INCLUDE("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\enchant") && |
7 |
| - CHECK_HEADER_ADD_INCLUDE("glib.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\glib-2.0")) { |
8 |
| - if (CHECK_LIB("libenchant2.lib", "enchant", PHP_ENCHANT)) { |
9 |
| - have_enchant = true; |
10 |
| - } else if (CHECK_LIB("libenchant.lib", "enchant", PHP_ENCHANT)) { |
11 |
| - have_enchant = true; |
12 |
| - AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 1, "Define to 1 if Enchant library has the 'enchant_broker_set_param' function (available since 1.5.0 and removed in 2.x)."); |
13 |
| - } else { |
14 |
| - have_enchant = false; |
15 |
| - WARNING('Could not find libenchant.lib; skipping'); |
16 |
| - } |
17 |
| - if (have_enchant) { |
18 |
| - EXTENSION("enchant", "enchant.c"); |
19 |
| - AC_DEFINE('HAVE_ENCHANT', 1, "Define to 1 if the PHP extension 'enchant' is available."); |
20 |
| - AC_DEFINE('HAVE_ENCHANT_GET_VERSION', 1, "Define to 1 if Enchant library has the 'enchant_get_version' function (available since 1.6.0)."); |
21 |
| - } |
| 6 | + if (PKG_CHECK_MODULES("LIBENCHANT", "libenchant >= 2.0.0")) { |
| 7 | + have_enchant = true; |
| 8 | + } else if (PKG_CHECK_MODULES("LIBENCHANT", "libenchant >= 1.5.0")) { |
| 9 | + have_enchant = true; |
| 10 | + AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 1, "Define to 1 if Enchant library has the 'enchant_broker_set_param' function (available since 1.5.0 and removed in 2.x)."); |
22 | 11 | } else {
|
23 |
| - WARNING('Could not find enchant.h; skipping'); |
| 12 | + have_enchant = false; |
| 13 | + WARNING('enchant not enabled; enchant package not found'); |
| 14 | + } |
| 15 | + if (have_enchant) { |
| 16 | + PHP_EVAL_INCLINE(LIBENCHANT_CFLAGS, "enchant"); |
| 17 | + PHP_EVAL_LIBLINE(LIBENCHANT_LIBS, "enchant"); |
| 18 | + EXTENSION("enchant", "enchant.c"); |
| 19 | + AC_DEFINE('HAVE_ENCHANT', 1, "Define to 1 if the PHP extension 'enchant' is available."); |
| 20 | + AC_DEFINE('HAVE_ENCHANT_GET_VERSION', 1, "Define to 1 if Enchant library has the 'enchant_get_version' function (available since 1.6.0)."); |
24 | 21 | }
|
25 | 22 | }
|
0 commit comments