diff options
author | Remi Collet <remi@php.net> | 2020-05-04 08:27:31 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2020-05-04 08:27:31 +0200 |
commit | 342754575237da912874f781a24eefe76434ce5a (patch) | |
tree | 21c332209535128a75eb7ce9b3629e95ab7483e5 /ext/enchant | |
parent | 69888c3ff1f2301ead8e37b23ff8481d475e29d2 (diff) | |
download | php-git-342754575237da912874f781a24eefe76434ce5a.tar.gz |
Use libenchant-2 when available
Diffstat (limited to 'ext/enchant')
-rw-r--r-- | ext/enchant/config.m4 | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/ext/enchant/config.m4 b/ext/enchant/config.m4 index f8d4f1b3e2..949db83247 100644 --- a/ext/enchant/config.m4 +++ b/ext/enchant/config.m4 @@ -4,26 +4,38 @@ PHP_ARG_WITH([enchant], [Include Enchant support])]) if test "$PHP_ENCHANT" != "no"; then - PKG_CHECK_MODULES([ENCHANT], [enchant >= 1.4.2]) + PKG_CHECK_MODULES([ENCHANT2], [enchant-2], [found_enchant_2=yes], [found_enchant_2=no]) - PHP_EVAL_INCLINE($ENCHANT_CFLAGS) - PHP_EVAL_LIBLINE($ENCHANT_LIBS, ENCHANT_SHARED_LIBADD) + if test "$found_enchant_2" = "yes"; then - AC_DEFINE(HAVE_ENCHANT, 1, [ ]) + PHP_EVAL_INCLINE($ENCHANT2_CFLAGS) + PHP_EVAL_LIBLINE($ENCHANT2_LIBS, ENCHANT_SHARED_LIBADD) - PHP_CHECK_LIBRARY(enchant, enchant_get_version, - [ AC_DEFINE(HAVE_ENCHANT_GET_VERSION, 1, [ enchant_get_version since 1.6.0 ]) - ], [ ], [ - $ENCHANT_LIBS - ]) - - PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param, - [ - AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ enchant_broker_set_param since 1.5.0 and removed in 2.x ]) - ], [ ], [ - $ENCHANT_LIBS - ]) + + else + AC_MSG_WARN([libenchant-2 not found trying with old libenchant]) + PKG_CHECK_MODULES([ENCHANT], [enchant >= 1.4.2]) + + PHP_EVAL_INCLINE($ENCHANT_CFLAGS) + PHP_EVAL_LIBLINE($ENCHANT_LIBS, ENCHANT_SHARED_LIBADD) + + PHP_CHECK_LIBRARY(enchant, enchant_get_version, + [ + AC_DEFINE(HAVE_ENCHANT_GET_VERSION, 1, [ enchant_get_version since 1.6.0 ]) + ], [ ], [ + $ENCHANT_LIBS + ]) + + PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param, + [ + AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ enchant_broker_set_param since 1.5.0 and removed in 2.x ]) + ], [ ], [ + $ENCHANT_LIBS + ]) + fi + + AC_DEFINE(HAVE_ENCHANT, 1, [ ]) PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared) PHP_SUBST(ENCHANT_SHARED_LIBADD) |