Skip to content

Commit 0f364cd

Browse files
committed
Support tidy
1 parent f40fd0f commit 0f364cd

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

.pkg-config/pkgconfig/libtidy.pc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prefix=C:/usr
2+
libdir=${prefix}/lib
3+
includedir=${prefix}/include
4+
5+
Name: libtidy
6+
Description: winlibs libtidy package
7+
Url: https://github.com/winlibs/libtidy
8+
Version: 5.6.0-1
9+
Libs: -L${libdir} -ltidy_a
10+
Cflags: -I${includedir} /DTIDY_STATIC=1

ext/tidy/config.w32

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33
ARG_WITH("tidy", "TIDY support", "no");
44

55
if (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

Comments
 (0)