make the allocation be per-thread a configure option fixed compilation

* include/libxml/globals.h configure.in global.data: make
  the allocation be per-thread a configure option
* encoding.c include/libxml/parser.h: fixed compilation
  errors
Daniel
diff --git a/configure.in b/configure.in
index 9f50db7..45145ef 100644
--- a/configure.in
+++ b/configure.in
@@ -249,6 +249,7 @@
 THREAD_LIBS=""
 WITH_THREADS=0
 THREAD_CFLAGS=""
+
 AC_ARG_WITH(threads, [  --with-threads          Add multithread support(off)])
 if test "$with_threads" = "yes" ; then
     echo Enabling multithreaded support
@@ -264,6 +265,11 @@
         THREAD_CFLAGS="$XML_CFLAGS -D_REENTRANT"
     fi
 fi
+AC_ARG_WITH(thread-alloc, [  --with-thread-alloc     Add per-thread memory(off)])
+if test "$with_threads" = "yes" -a "$WITH_THREADS" = "1" ; then
+    THREAD_CFLAGS="$XML_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
+fi
+
 AC_SUBST(THREAD_LIBS)
 AC_SUBST(WITH_THREADS)
 AC_SUBST(THREAD_CFLAGS)