Index: configure ================================================================== --- configure +++ configure @@ -1376,11 +1376,11 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-html5 build with HTML5 parsing support (default: no) + --enable-html5 build with HTML5 parsing support (default: off) --enable-threads build with threads --enable-shared build and link with shared libraries (default: on) --enable-stubs build and link with stub libraries. Always true for shared builds (default: on) --enable-64bit enable 64bit support (default: off) @@ -5542,22 +5542,34 @@ tcl_ok=$enableval else tcl_ok=no fi HTML5_LIBS="" + HTML5_INCLUDES="" + if test "$tcl_ok" = "yes" ; then + # Check if pkg-config is available + PKGCONFIG=no + pkg-config --version > /dev/null 2>&1 && PKGCONFIG=yes + if test "$PKGCONFIG" = no; then + tcl_ok=no + as_fn_error $? "**** Cannot find pkg-config needed for --enable-html5." "$LINENO" 5 + as_fn_error $? "**** Despite configure request HTML5 parser _NOT_ enabled." "$LINENO" 5 + fi + fi if test "$tcl_ok" = "yes" ; then HAVEGUMBO=`pkg-config --exists gumbo && echo "1"` if test "$HAVEGUMBO" = "1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define TDOM_HAVE_GUMBO 1" >>confdefs.h if test "${TEA_PLATFORM}" = "windows" ; then - HTML5_LIBS="-Wl,-Bstatic `pkg-config --static --cflags --libs gumbo` -Wl,-Bdynamic" + HTML5_LIBS="-Wl,-Bstatic `pkg-config --static --libs gumbo` -Wl,-Bdynamic" else - HTML5_LIBS="`pkg-config --cflags --libs gumbo`" + HTML5_LIBS="`pkg-config --libs gumbo`" fi + HTML5_INCLUDES="`pkg-config --cflags gumbo`" else as_fn_error $? "The required lib gumbo not found" "$LINENO" 5 fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -5633,11 +5645,11 @@ PKG_HEADERS="$PKG_HEADERS $i" done - vars="-I${srcdir}/generic ${AOL_INCLUDES}" + vars="-I${srcdir}/generic ${AOL_INCLUDES} ${HTML5_INCLUDES}" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done Index: configure.in ================================================================== --- configure.in +++ configure.in @@ -108,11 +108,11 @@ generic/tdominit.c \ generic/tclexpat.c \ generic/tclpull.c \ generic/tdomStubInit.c]) TEA_ADD_HEADERS([generic/tdom.h]) -TEA_ADD_INCLUDES([-I${srcdir}/generic ${AOL_INCLUDES}]) +TEA_ADD_INCLUDES([-I${srcdir}/generic ${AOL_INCLUDES} ${HTML5_INCLUDES}]) TEA_ADD_LIBS([${AOL_LIBS} ${HTML5_LIBS}]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([generic/tdomStubLib.c]) TEA_ADD_TCL_SOURCES([lib/tdom.tcl]) Index: tdom.m4 ================================================================== --- tdom.m4 +++ tdom.m4 @@ -226,30 +226,41 @@ AC_DEFUN(TDOM_ENABLE_HTML5, [ AC_MSG_CHECKING([whether to enable support for HTML5 parsing (using gumbo)]) AC_ARG_ENABLE(html5, AC_HELP_STRING([--enable-html5], - [build with HTML5 parsing support (default: no)]), + [build with HTML5 parsing support (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) if test "${enable_html5+set}" = set; then enableval="$enable_html5" tcl_ok=$enableval else tcl_ok=no fi HTML5_LIBS="" + HTML5_INCLUDES="" + if test "$tcl_ok" = "yes" ; then + # Check if pkg-config is available + PKGCONFIG=no + pkg-config --version > /dev/null 2>&1 && PKGCONFIG=yes + if test "$PKGCONFIG" = no; then + tcl_ok=no + AC_MSG_ERROR([cannot find pkg-config needed for --enable-html5.]) + fi + fi if test "$tcl_ok" = "yes" ; then HAVEGUMBO=`pkg-config --exists gumbo && echo "1"` if test "$HAVEGUMBO" = "1" ; then AC_MSG_RESULT([yes]) AC_DEFINE(TDOM_HAVE_GUMBO) if test "${TEA_PLATFORM}" = "windows" ; then - HTML5_LIBS="-Wl,-Bstatic `pkg-config --static --cflags --libs gumbo` -Wl,-Bdynamic" + HTML5_LIBS="-Wl,-Bstatic `pkg-config --static --libs gumbo` -Wl,-Bdynamic" else - HTML5_LIBS="`pkg-config --cflags --libs gumbo`" + HTML5_LIBS="`pkg-config --libs gumbo`" fi + HTML5_INCLUDES="`pkg-config --cflags gumbo`" else AC_MSG_ERROR([The required lib gumbo not found]) fi else AC_MSG_RESULT([no])