mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Use libenchant2 if available on Windows
This is basically the same as commit 3427545[1], but for Windows. [1] <http://git.php.net/?p=php-src.git;a=commitdiff;h=342754575237da912874f781a24eefe76434ce5a>
This commit is contained in:
@@ -4,13 +4,23 @@ ARG_WITH("enchant", "Enchant Support", "no");
|
||||
|
||||
if (PHP_ENCHANT == "yes") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\enchant") &&
|
||||
CHECK_HEADER_ADD_INCLUDE("glib.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\glib-2.0") &&
|
||||
CHECK_LIB("libenchant.lib", "enchant", PHP_ENCHANT) ) {
|
||||
EXTENSION("enchant", "enchant.c");
|
||||
AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
|
||||
AC_DEFINE('HAVE_ENCHANT_GET_VERSION', 1);
|
||||
AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 1);
|
||||
ADD_FLAG("CFLAG_ENCHANT", "/D _WIN32");
|
||||
CHECK_HEADER_ADD_INCLUDE("glib.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\glib-2.0")) {
|
||||
if (CHECK_LIB("libenchant2.lib", "enchant", PHP_ENCHANT)) {
|
||||
have_enchant = true;
|
||||
AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 0);
|
||||
} else if (CHECK_LIB("libenchant.lib", "enchant", PHP_ENCHANT)) {
|
||||
have_enchant = true;
|
||||
AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 1);
|
||||
} else {
|
||||
have_enchant = false;
|
||||
WARNING('Could not find libenchant.lib; skipping');
|
||||
}
|
||||
if (have_enchant) {
|
||||
EXTENSION("enchant", "enchant.c");
|
||||
AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
|
||||
AC_DEFINE('HAVE_ENCHANT_GET_VERSION', 1);
|
||||
ADD_FLAG("CFLAG_ENCHANT", "/D _WIN32");
|
||||
}
|
||||
} else {
|
||||
WARNING('Could not find enchant.h; skipping');
|
||||
}
|
||||
|
||||
@@ -335,9 +335,13 @@ libenchant_ispell.dll
|
||||
$ENCHANT_DLLS = array(
|
||||
array('', 'glib-2.dll'),
|
||||
array('', 'gmodule-2.dll'),
|
||||
array('lib/enchant', 'libenchant_myspell.dll'),
|
||||
array('lib/enchant', 'libenchant_ispell.dll'),
|
||||
);
|
||||
if (file_exists("$php_build_dir/bin/libenchant2.dll")) {
|
||||
$ENCHANT_DLLS[] = array('lib/enchant', 'libenchant2_hunspell.dll');
|
||||
} else {
|
||||
$ENCHANT_DLLS[] = array('lib/enchant', 'libenchant_myspell.dll');
|
||||
$ENCHANT_DLLS[] = array('lib/enchant', 'libenchant_ispell.dll');
|
||||
}
|
||||
foreach ($ENCHANT_DLLS as $dll) {
|
||||
$dest = "$dist_dir/$dll[0]";
|
||||
$filename = $dll[1];
|
||||
|
||||
Reference in New Issue
Block a user