php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #72554
Patch ftbsf_tidy.patch revision 2016-07-06 15:55 UTC by l dot declercq at nuxwin dot com

Patch ftbsf_tidy.patch for Tidy Bug #72554

Patch version 2016-07-06 15:55 UTC

Return to Bug #72554 | Download this patch
Patch Revisions:

Developer: l.declercq@nuxwin.com

Description: ftbfs - buffio.h renamed to tinybuffio.h in tidy-html5
Author: Laurent Declercq <l.declercq@nuxwin.com>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/ext/tidy/config.m4
+++ b/ext/tidy/config.m4
@@ -27,6 +27,12 @@ if test "$PHP_TIDY" != "no"; then
     AC_MSG_ERROR(Cannot find libtidy)
   fi
 
+  if test -r "$TIDY_INCDIR/tidybuffio.h"; then
+    PHP_TIDY_BUFFIO_H_PATH="$TIDY_INCDIR/tidybuffio.h"
+  else
+    PHP_TIDY_BUFFIO_H_PATH="$TIDY_INCDIR/buffio.h"
+  fi
+
   TIDY_LIBDIR=$TIDY_DIR/$PHP_LIBDIR
 
   PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
@@ -37,8 +43,20 @@ if test "$PHP_TIDY" != "no"; then
   AC_DEFINE(HAVE_TIDYOPTGETDOC,1,[ ])
   ],[],[])
 
+    AC_MSG_CHECKING([if your cpp allows macro usage in include lines])
+    AC_TRY_COMPILE([
+#define FOO <$PHP_TIDY_BUFFIO_H_PATH>
+#include FOO
+    ], [], [
+      AC_MSG_RESULT([yes])
+      PHP_DEFINE([PHP_TIDY_BUFFIO_H_PATH], [<$PHP_TIDY_BUFFIO_H_PATH>],[ext/tidy])
+      AC_DEFINE_UNQUOTED([PHP_TIDY_BUFFIO_H_PATH], [<$PHP_TIDY_BUFFIO_H_PATH>], [Path to buffio.h])
+    ], [
+      AC_MSG_RESULT([no])
+    ])
 
   PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
   PHP_SUBST(TIDY_SHARED_LIBADD)
+  PHP_INSTALL_HEADERS([ext/tidy/])
   AC_DEFINE(HAVE_TIDY,1,[ ])
 fi
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -31,7 +31,12 @@
 #include "ext/standard/info.h"
 
 #include "tidy.h"
-#include "buffio.h"
+
+#ifdef PHP_TIDY_BUFFIO_H_PATH
+#include PHP_TIDY_BUFFIO_H_PATH
+#else
+#include <buffio.h>
+#endif
 
 /* compatibility with older versions of libtidy */
 #ifndef TIDY_CALL
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri May 27 15:03:39 2022 UTC