Index: blfs-tool
===================================================================
--- blfs-tool	(revision 6ef1f449ac9ac865dc00a6dfea04d10d1664b85a)
+++ blfs-tool	(revision 4abc9ec56cc3e675fa973813fb6ae9acdaf271b1)
@@ -73,4 +73,9 @@
 [[ $VERBOSITY > 0 ]] && echo "OK"
 
+[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_check_version.sh>..."
+source $COMMON_DIR/func_check_version.sh
+[[ $? > 0 ]] && echo " function module did not load.." && exit 2
+[[ $VERBOSITY > 0 ]] && echo "OK"
+
 [[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
 source $COMMON_DIR/func_validate_configs.sh
@@ -94,4 +99,43 @@
             * )  TREE=tags/${BRANCH_ID}/BOOK ;;
 esac
+
+# Check for minimun dependencies versions
+xsltprocVer=`xsltproc -V | head -n1 `
+  libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
+ libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
+    tidyVer=`tidy -V | cut -d " " -f9`
+
+  # Version numbers are packed strings not xx.yy.zz format.
+check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
+check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
+check_version "2004"     "${tidyVer}"                                             "TIDY"
+
+XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
+<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
+<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
+  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
+<article>
+  <title>Test file</title>
+  <sect1>
+    <title>Some title</title>
+    <para>Some text</para>
+  </sect1>
+</article>"
+
+if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
+  check_version "4.4" "4.4" "DocBook XML DTD"
+else
+  echo "Warning: not found a working DocBook XML DTD 4.4 installation"
+  exit 2
+fi
+
+if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
+  check_version "1.69.1" "1.69.1" "DocBook XSL"
+else
+  echo "Warning: not found a working DocBook XSL 1.69.1 installation"
+  exit 2
+fi
+
+echo "${SD_BORDER}${nl_}"
 
 # For consistency with other books
Index: jhalfs
===================================================================
--- jhalfs	(revision 6ef1f449ac9ac865dc00a6dfea04d10d1664b85a)
+++ jhalfs	(revision 4abc9ec56cc3e675fa973813fb6ae9acdaf271b1)
@@ -250,4 +250,5 @@
 check_version "1.15.0"  "${tarVer}"      "TAR"
 
+# Check for minimum sudo version
 SUDO_LOC="`whereis -b sudo | cut -d " " -f2`"
 if [ -x $SUDO_LOC ]; then
@@ -259,13 +260,54 @@
 fi
 
+# Check for minimum libxml2 and libxslt versions
 xsltprocVer=`xsltproc -V | head -n1 `
   libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
  libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
-    tidyVer=`tidy -V | cut -d " " -f9`
-    
-# Version numbers are packed strings not xx.yy.zz format.
+
+  # Version numbers are packed strings not xx.yy.zz format.
 check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
 check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
-check_version "2004"   "${tidyVer}"        "TIDY"
+
+# The next versions checks are required only when BLFS_TOOL is set and
+# this dependencies has not be selected for installation
+if [[ "$BLFS_TOOL" = "y" ]] ; then
+
+  if [[ -z "$DEP_TIDY" ]] ; then
+    tidyVer=`tidy -V | cut -d " " -f9`
+    check_version "2004" "${tidyVer}" "TIDY"
+  fi
+
+# Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed
+XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
+<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
+<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
+  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
+<article>
+  <title>Test file</title>
+  <sect1>
+    <title>Some title</title>
+    <para>Some text</para>
+  </sect1>
+</article>"
+
+  if [[ -z "$DEP_DBXML" ]] ; then
+    if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
+      check_version "4.4" "4.4" "DocBook XML DTD"
+    else
+      echo "Warning: not found a working DocBook XML DTD 4.4 installation"
+      exit 2
+    fi
+  fi
+
+  if [[ -z "$DEP_DBXSL" ]] ; then
+    if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
+      check_version "1.69.1" "1.69.1" "DocBook XSL"
+    else
+      echo "Warning: not found a working DocBook XSL 1.69.1 installation"
+      exit 2
+    fi
+  fi
+
+fi
 
 echo "${SD_BORDER}${nl_}"
