From 0655191a9c486290bc7ccfb4305625ee9ce4bad8 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Fri, 17 May 2019 21:25:12 +1000 Subject: Use PKG_CHECK_MODULES to detect the Enchant library --- ext/enchant/config.m4 | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/ext/enchant/config.m4 b/ext/enchant/config.m4 index 44fee08738..cd2765c7ef 100644 --- a/ext/enchant/config.m4 +++ b/ext/enchant/config.m4 @@ -1,39 +1,21 @@ PHP_ARG_WITH([enchant], - [for ENCHANT support], - [AS_HELP_STRING([[--with-enchant[=DIR]]], - [Include enchant support. GNU Aspell version 1.1.3 or higher required.])]) + [whether to build with Enchant support], + [AS_HELP_STRING([--with-enchant], + [Include Enchant support])]) if test "$PHP_ENCHANT" != "no"; then - PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared) - if test "$PHP_ENCHANT" != "yes"; then - ENCHANT_SEARCH_DIRS=$PHP_ENCHANT - else - ENCHANT_SEARCH_DIRS="/usr/local /usr" - fi - for i in $ENCHANT_SEARCH_DIRS; do - if test -f $i/include/enchant/enchant.h; then - ENCHANT_DIR=$i - ENCHANT_INCDIR=$i/include/enchant - elif test -f $i/include/enchant.h; then - ENCHANT_DIR=$i - ENCHANT_INCDIR=$i/include - fi - done + PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared) - if test -z "$ENCHANT_DIR"; then - AC_MSG_ERROR(Cannot find enchant) - fi + PKG_CHECK_MODULES([ENCHANT], [enchant]) - ENCHANT_LIBDIR=$ENCHANT_DIR/lib + PHP_EVAL_INCLINE($ENCHANT_CFLAGS) + PHP_EVAL_LIBLINE($ENCHANT_LIBS, ENCHANT_SHARED_LIBADD) - AC_DEFINE(HAVE_ENCHANT,1,[ ]) - PHP_SUBST(ENCHANT_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD) - PHP_ADD_INCLUDE($ENCHANT_INCDIR) - PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param, - [ - AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ ]) - AC_DEFINE(ENCHANT_VERSION_STRING, "1.5.x", [ ]) - ], [], [ -L$ENCHANT_LIBDIR $ENCHANT_SHARED_LIBADD]) + AC_DEFINE(HAVE_ENCHANT, 1, [ ]) + PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param, + [ + AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ ]) + AC_DEFINE(ENCHANT_VERSION_STRING, "1.5.x", [ ]) + ]) fi -- cgit v1.2.1 From 0f7d641724d2f36548256fef9f1adcd1c9208bcc Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 17 May 2019 19:39:22 +0200 Subject: Add enchant pkg-config notice in UPGRADING --- UPGRADING | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UPGRADING b/UPGRADING index c5d7c17a54..1de5b39187 100644 --- a/UPGRADING +++ b/UPGRADING @@ -498,6 +498,9 @@ The following extensions and SAPIs are affected: - Curl: . --with-curl no longer accepts a directory. +- Enchant: + . --with-enchant no longer accepts a directory. + - FPM: . --with-fpm-systemd now uses only pkg-config for libsystem checks. The libsystemd minimum required version is 209. -- cgit v1.2.1