@@ -4,13 +4,23 @@ ARG_WITH("enchant", "Enchant Support", "no");
4
4
5
5
if ( PHP_ENCHANT == "yes" ) {
6
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
- CHECK_LIB ( "libenchant.lib" , "enchant" , PHP_ENCHANT ) ) {
9
- EXTENSION ( "enchant" , "enchant.c" ) ;
10
- AC_DEFINE ( 'HAVE_ENCHANT' , 1 , 'Have Enchant support' , false ) ;
11
- AC_DEFINE ( 'HAVE_ENCHANT_GET_VERSION' , 1 ) ;
12
- AC_DEFINE ( 'HAVE_ENCHANT_BROKER_SET_PARAM' , 1 ) ;
13
- ADD_FLAG ( "CFLAG_ENCHANT" , "/D _WIN32" ) ;
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
+ AC_DEFINE ( 'HAVE_ENCHANT_BROKER_SET_PARAM' , 0 ) ;
11
+ } else if ( CHECK_LIB ( "libenchant.lib" , "enchant" , PHP_ENCHANT ) ) {
12
+ have_enchant = true ;
13
+ AC_DEFINE ( 'HAVE_ENCHANT_BROKER_SET_PARAM' , 1 ) ;
14
+ } else {
15
+ have_enchant = false ;
16
+ WARNING ( 'Could not find libenchant.lib; skipping' ) ;
17
+ }
18
+ if ( have_enchant ) {
19
+ EXTENSION ( "enchant" , "enchant.c" ) ;
20
+ AC_DEFINE ( 'HAVE_ENCHANT' , 1 , 'Have Enchant support' , false ) ;
21
+ AC_DEFINE ( 'HAVE_ENCHANT_GET_VERSION' , 1 ) ;
22
+ ADD_FLAG ( "CFLAG_ENCHANT" , "/D _WIN32" ) ;
23
+ }
14
24
} else {
15
25
WARNING ( 'Could not find enchant.h; skipping' ) ;
16
26
}
0 commit comments