From d4f280d325dff99367ac1f6b07e7473298d09a6c Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 9 Jul 2021 17:52:15 +0200 Subject: [PATCH] [configure.ac] Compile with libxml++-5.0 Note, disable CSS if do not want segfaults --- Makefile.config.in | 1 + configure.ac | 12 ++++++++++-- src/document/Makefile | 1 + src/document/xml/tags.c | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index b343a7e0..534a52c4 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -173,6 +173,7 @@ CONFIG_TRUE_COLOR = @CONFIG_TRUE_COLOR@ CONFIG_URI_REWRITE = @CONFIG_URI_REWRITE@ CONFIG_UTF8 = @CONFIG_UTF8@ CONFIG_XBEL_BOOKMARKS = @CONFIG_XBEL_BOOKMARKS@ +CONFIG_XML = @CONFIG_XML@ CONFIG_XMLTO = @CONFIG_XMLTO@ CONFIG_GSSAPI = @CONFIG_GSSAPI@ CONFIG_ZSTD = @CONFIG_ZSTD@ diff --git a/configure.ac b/configure.ac index 96421f5a..9ad30abb 100644 --- a/configure.ac +++ b/configure.ac @@ -643,6 +643,7 @@ AC_ARG_WITH([spidermonkey], # when we know for sure whether we're going to use SpiderMonkey or not. # (features.conf is not supposed to define it.) CONFIG_SPIDERMONKEY= +CONFIG_XML= EL_SAVE_FLAGS case "$with_spidermonkey" in @@ -667,9 +668,12 @@ for package in mozjs-52; do AC_MSG_CHECKING([for SpiderMonkey (mozjs-52) in pkg-config $package]) if $PKG_CONFIG $pkg_config_static --cflags --libs $package > /dev/null 2>&AS_MESSAGE_LOG_FD; then DB_LOCALSTORAGE_LIBS="$($PKG_CONFIG $pkg_config_static --libs sqlite3)" - SPIDERMONKEY_LIBS="$($PKG_CONFIG $pkg_config_static --libs $package) $DB_LOCALSTORAGE_LIBS" + XMLPLUSPLUS_LIBS="$($PKG_CONFIG $pkg_config_static --libs libxml++-5.0)" + SPIDERMONKEY_LIBS="$($PKG_CONFIG $pkg_config_static --libs $package) $DB_LOCALSTORAGE_LIBS $XMLPLUSPLUS_LIBS" DB_LOCALSTORAGE_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags sqlite3)" - SPIDERMONKEY_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags $package) $DB_LOCALSTORAGE_CFLAGS" + XMLPLUSPLUS_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags libxml++-5.0)" + SPIDERMONKEY_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags $package) $DB_LOCALSTORAGE_CFLAGS $XMLPLUSPLUS_CFLAGS" + LIBS="$SPIDERMONKEY_LIBS $LIBS_X" CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS" CPPFLAGS="$CPPFLAGS_X $SPIDERMONKEY_CFLAGS" @@ -697,6 +701,8 @@ done if test -z "$CONFIG_SPIDERMONKEY"; then # Didn't find SpiderMonkey anywhere. CONFIG_SPIDERMONKEY=no +else + CONFIG_XML=yes fi EL_RESTORE_FLAGS @@ -739,9 +745,11 @@ fi if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes || test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then LIBS="$LIBS $SPIDERMONKEY_LIBS" + EL_CONFIG(CONFIG_XML, [libxml++5.0]) AC_SUBST(SPIDERMONKEY_LIBS) AC_SUBST(SPIDERMONKEY_CFLAGS) AC_SUBST(CONFIG_SPIDERMONKEY) + AC_SUBST(CONFIG_XML) CFLAGS="$CFLAGS -fpermissive $SPIDERMONKEY_CFLAGS" fi diff --git a/src/document/Makefile b/src/document/Makefile index 8078075f..9945341d 100644 --- a/src/document/Makefile +++ b/src/document/Makefile @@ -3,6 +3,7 @@ include $(top_builddir)/Makefile.config SUBDIRS-$(CONFIG_CSS) += css SUBDIRS-$(CONFIG_DOM) += dom +SUBDIRS-$(CONFIG_XML) += xml SUBDIRS = gemini html plain diff --git a/src/document/xml/tags.c b/src/document/xml/tags.c index ad355a6d..355a485e 100644 --- a/src/document/xml/tags.c +++ b/src/document/xml/tags.c @@ -26,6 +26,7 @@ #include "document/html/renderer.h" #include "document/html/tables.h" #include "document/options.h" +#include "document/xml/tables.h" #include "document/xml/tags.h" #include "globhist/globhist.h" #include "intl/charsets.h" @@ -3767,7 +3768,7 @@ tags_html_table(struct source_renderer *renderer, void *no, unsigned char *attr, xmlpp::Element *node = no; if (false && html_context->options->tables && html_context->table_level < HTML_MAX_TABLE_LEVEL) { - format_table(attr, html, eof, end, html_context); + tags_format_table(renderer, no); ln_break(html_context, 2); return;