gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libextractor] branch master updated (a75f40b -> d68210a)


From: gnunet
Subject: [libextractor] branch master updated (a75f40b -> d68210a)
Date: Wed, 17 Apr 2024 20:25:52 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository libextractor.

    from a75f40b  bump gettext version
     new 030ee31  html_extractor: Add support for modern tidy-html.
     new d68210a  fix patch for #8620 to keep it building on Debian

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bootstrap                    |  2 +-
 configure.ac                 | 31 +++++++++++++------------------
 src/plugins/Makefile.am      |  2 ++
 src/plugins/html_extractor.c |  7 +++++++
 4 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/bootstrap b/bootstrap
index 7e15079..0b9420b 100755
--- 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
index d17ff39..703c4a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,6 +176,8 @@ AS_CASE(["$target_os"],
 
 AM_ICONV
 
+PKG_PROG_PKG_CONFIG()
+
 # We define the paths here, because MinGW/GCC expands paths
 # passed through the command line ("-DLOCALEDIR=..."). This would
 # lead to hard-coded paths ("C:\mingw\mingw\bin...") that do
@@ -424,25 +426,19 @@ AC_CHECK_LIB(magic, magic_open,
    AM_CONDITIONAL(HAVE_MAGIC, false))],
   AM_CONDITIONAL(HAVE_MAGIC, false))
 
-AC_MSG_CHECKING(for tidyNodeGetValue -ltidy)
-AC_LANG_PUSH(C++)
-SAVED_LIBS=$LIBS
-LIBS="$LIBS -ltidy"
-AC_LINK_IFELSE(
-  [AC_LANG_PROGRAM([[#include <tidy/tidy.h>]],
-    [[ Bool b = tidyNodeGetValue (NULL, NULL, NULL); ]])],
-  [AC_MSG_RESULT(yes)
-   AM_CONDITIONAL(HAVE_TIDY, true)
-   AC_DEFINE(HAVE_TIDY,1,[Have tidyNodeGetValue in libtidy])],
-  [AC_MSG_RESULT(no)
-   AM_CONDITIONAL(HAVE_TIDY, false)])
-LIBS=$SAVED_LIBS
-AC_LANG_POP(C++)
-
-# restore LIBS
-LIBS=$LIBSOLD
+# 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)],
+ [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)
@@ -453,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
index 69cb1f7..f32114a 100644
--- 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
index 5ebf97b..0a9a89b 100644
--- 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.

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]