33ARG_WITH ( "tidy" , "TIDY support" , "no" ) ;
44
55if ( PHP_TIDY != "no" ) {
6- var tidy_static = false ;
7- if ( ( CHECK_LIB ( "libtidy_a.lib;tidy_a.lib" , "tidy" , PHP_TIDY ) && ( tidy_static = true ) ||
8- CHECK_LIB ( "libtidy.lib;tidy.lib" , "tidy" , PHP_TIDY ) ) &&
9- (
10- CHECK_HEADER_ADD_INCLUDE ( "tidy.h" , "CFLAGS_TIDY" ) ||
11- CHECK_HEADER_ADD_INCLUDE ( "tidy/tidy.h" , "CFLAGS_TIDY" , null , null , true ) ||
12- CHECK_HEADER_ADD_INCLUDE ( "libtidy/tidy.h" , "CFLAGS_TIDY" , null , null , true )
13- ) ) {
6+ if ( PKG_CHECK_MODULES ( "LIBTIDY" , "libtidy" ) ) {
7+ PHP_EVAL_INCLINE ( LIBTIDY_CFLAGS , "tidy" ) ;
8+ PHP_EVAL_LIBLINE ( LIBTIDY_LIBS , "tidy" ) ;
149
15- if ( CHECK_HEADER_ADD_INCLUDE ( "tidybuffio.h" , "CFLAGS_TIDY" ) ) {
16- AC_DEFINE ( 'HAVE_TIDYBUFFIO_H' , 1 , 'Define to 1 if you have the <tidybuffio.h> header file.' ) ;
17- }
10+ // FIXME: define only if has tidybuffio.h
11+ AC_DEFINE ( 'HAVE_TIDYBUFFIO_H' , 1 , 'Define to 1 if you have the <tidybuffio.h> header file.' ) ;
1812
1913 EXTENSION ( "tidy" , "tidy.c" ) ;
2014 AC_DEFINE ( 'HAVE_TIDY' , 1 , "Define to 1 if the PHP extension 'tidy' is available." ) ;
@@ -25,11 +19,7 @@ if (PHP_TIDY != "no") {
2519 if ( ! PHP_TIDY_SHARED ) {
2620 ADD_DEF_FILE ( "ext\\tidy\\php_tidy.def" ) ;
2721 }
28- if ( tidy_static ) {
29- ADD_FLAG ( "CFLAGS_TIDY" , "/DTIDY_STATIC=1" ) ;
30- }
31-
3222 } else {
33- WARNING ( "tidy not enabled; libraries and headers not found" ) ;
23+ WARNING ( "tidy not enabled; libtidy package not found" ) ;
3424 }
3525}
0 commit comments