enhanced for enabling build in a different directory. Added (optional)

* Makefile.am, gentest.py: enhanced for enabling build in
  a different directory.  Added (optional) param to gentest.py
  to specify the source directory (bug #155468)
* doc/Makefile.am: changed destination of NEWS from (top_srcdir)
  to (top_builddir) (bug #155468)
* python/Makefile.am, python/generator.py: enhanced for enabling
  build in a different directory(bug #155468).  Added (optional)
  param to generator.py to specify the source directory.  Added
  a new table of functions which have possible "foreign" encodings
  (e.g. UTF16), and code to use python 't' format instead of
  'z' format (mostly solving bug #152286, but still need to
  populate the table).
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 459872e..1bdcb79 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -26,7 +26,7 @@
 
 man_MANS = xmllint.1 xmlcatalog.1
 
-all: web $(top_srcdir)/NEWS libxml2.xsa $(man_MANS)
+all: web $(top_builddir)/NEWS libxml2.xsa $(man_MANS)
 
 api: libxml2-api.xml libxml2-refs.xml $(APIPAGES) $(srcdir)/html/index.html $(WIN32_DIR)/libxml2.def.src ../elfgcchack.h
 
@@ -49,9 +49,9 @@
 	  echo "Validating the HTML Web pages" ; \
 	  $(XMLLINT) --nonet --valid --noout $(PAGES) ; fi );
 
-$(top_srcdir)/NEWS: $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html
+$(top_builddir)/NEWS: $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html
 	-@(if [ -x $(XSLTPROC) ] ; then \
-	  $(XSLTPROC) --nonet $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html > $(top_srcdir)/NEWS ; fi );
+	  $(XSLTPROC) --nonet $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html > $(top_builddir)/NEWS ; fi );
 
 libxml2.xsa: $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html
 	-@(if [ -x $(XSLTPROC) ] ; then \