Source: tdom
Version: 0.9.1-1
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

tdom fails to cross build from source, because and autoconf macro hard
codes the build architecture pkg-config. In principle, one should be
using PKG_PROG_PKG_CONFIG or even PKG_CHECK_MODULES here, however that's
not possible, because tdom confuses the meaning of aclocal.m4 and
acinclude.m4 and therefore we cannot run aclocal. It would be a good
idea to fix that as well. Therefore, the attached patch resorts to a
more bare bones fixes. Please consider applying it.

Helmut
--- tdom-0.9.1.orig/tdom.m4
+++ tdom-0.9.1/tdom.m4
@@ -225,6 +225,7 @@
 #------------------------------------------------------------------------
 
 AC_DEFUN(TDOM_ENABLE_HTML5, [
+    AC_PATH_TOOL([PKG_CONFIG],[pkg-config])
     AC_MSG_CHECKING([whether to enable support for HTML5 parsing (using gumbo)])
     AC_ARG_ENABLE(html5,
         AC_HELP_STRING([--enable-html5],
@@ -241,24 +242,22 @@
     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
+        if test "x$PKG_CONFIG" = x; 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"`
+        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 --libs gumbo` -Wl,-Bdynamic"
+                HTML5_LIBS="-Wl,-Bstatic `$PKG_CONFIG --static --libs gumbo` -Wl,-Bdynamic"
             else
-                HTML5_LIBS="`pkg-config --libs gumbo`"
+                HTML5_LIBS="`$PKG_CONFIG --libs gumbo`"
             fi
-            HTML5_INCLUDES="`pkg-config --cflags gumbo`"
+            HTML5_INCLUDES="`$PKG_CONFIG --cflags gumbo`"
         else
             AC_MSG_ERROR([The required lib gumbo not found])
         fi

Reply via email to