commit d68210a0a0cc069dfa278d044595940a7c9ec17b
parent 030ee3197daf59a906f4bc6f289a39c16aa189cd
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 17 Apr 2024 20:25:47 +0200
fix patch for #8620 to keep it building on Debian
Diffstat:
4 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/bootstrap b/bootstrap
@@ -27,7 +27,7 @@ else
fi
if existence libtool || existence libtoolize || existence glibtoolize || existence slibtool; then
- autoreconf -I m4 -i ${1+"$@"}
+ autoreconf -f -I m4 -i ${1+"$@"}
else
echo "*** No libtoolize (libtool) or libtool found, please install it ***" >&2;
exit 1
diff --git a/configure.ac b/configure.ac
@@ -426,14 +426,20 @@ AC_CHECK_LIB(magic, magic_open,
AM_CONDITIONAL(HAVE_MAGIC, false))],
AM_CONDITIONAL(HAVE_MAGIC, false))
-dnl tidyNodeGetValue was already available in 5.0.0, released in 2015.
+# tidyNodeGetValue was already available in 5.0.0, released in 2015.
+maybe_tidy=1
PKG_CHECK_MODULES([TIDY], [tidy >= 5.0.0],
[AC_DEFINE(HAVE_TIDY, 1, [Have tidy])
AM_CONDITIONAL(HAVE_TIDY, true)],
- [AM_CONDITIONAL(HAVE_TIDY, false)])
+ [maybe_tidy=0])
CFLAGS="$CFLAGS $TIDY_CFLAGS"
LIBS="$LIBS $TIDY_LIBS"
+AC_CHECK_HEADERS([tidy.h],,
+ AC_CHECK_HEADERS([tidy/tidy.h],,[maybe_tidy=0]))
+
+AM_CONDITIONAL(HAVE_TIDY, test "x$maybe_tidy" = "x1")
+
# should 'make check' run tests?
AC_MSG_CHECKING(whether to run tests)
AC_ARG_ENABLE([testruns],
@@ -443,7 +449,6 @@ AC_ARG_ENABLE([testruns],
AC_MSG_RESULT($enable_test_run)
AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
-
AC_HEADER_DIRENT
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([iconv.h fcntl.h netinet/in.h stdlib.h string.h unistd.h libintl.h limits.h stddef.h zlib.h])
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
@@ -363,6 +363,8 @@ test_gstreamer_CFLAGS = \
libextractor_html_la_SOURCES = \
html_extractor.c
+libextractor_html_la_CFLAGS = \
+ $(TIDY_CFLAGS)
libextractor_html_la_LDFLAGS = \
$(PLUGINFLAGS)
libextractor_html_la_LIBADD = \
diff --git a/src/plugins/html_extractor.c b/src/plugins/html_extractor.c
@@ -26,8 +26,15 @@
#include "platform.h"
#include "extractor.h"
#include <magic.h>
+#if HAVE_TIDY_H
#include <tidy.h>
#include <tidybuffio.h>
+#elif HAVE_TIDY_TIDY_H
+#include <tidy/tidy.h>
+#include <tidy/tidybuffio.h>
+#else
+Broken build, fix tidy detection.
+#endif
/**
* Mapping of HTML META names to LE types.