Index: doc/tex4ht-options.tex
===================================================================
--- doc/tex4ht-options.tex	(revision 689)
+++ doc/tex4ht-options.tex	(working copy)
@@ -18,8 +18,6 @@
 \chapter{Various Options for \TeX4ht}
 \fi
 
-\catcode`\#=11 \catcode`\^=11 \catcode`\_=11
-
 \begin{description}
 
 \item[-css] to ignore \css code, use command line option \verb=-css=.
@@ -58,9 +56,9 @@
 
 \item[TocLink] option to request links from the tables of contents.
   
-\item[\tt ^13] option for active superscript character.
+\item[\textasciicircum13] option for active superscript character.
 
-\item[\tt _13] option for active subscript character.
+\item[\textunderscore 13] option for active subscript character.
 
 %\item[accent-]
 
@@ -91,10 +89,10 @@
 % \item[draw]
 % \item[dtd]
 
-\item[\tt early^] for default catcode of superscript in the
+\item[early\textasciicircum] for default catcode of superscript in the
   \verb=\Preamble=.
 
-\item[\tt early_] for default catcode of subscript in the
+\item[early\textunderscore] for default catcode of subscript in the
   \verb=\Preamble=.
 
 %\item[edit]
@@ -129,10 +127,10 @@
 \item[frames-] for frames support. \verb=frames= is also valid option
   for frames support.
 
-\item[frames-fn] for content, \chfont{TOC}\xspace and footnotes in
+\item[frames-fn] for content, {\chfont TOC} and footnotes in
   three frames.
 
-\item[frames] for \chfont{TOC}\space and content in two frames.
+\item[frames] for {\chfont TOC} and content in two frames.
 
 %\item[fussy]
 
@@ -205,7 +203,7 @@
 
 \item[mathplayer] for \mathml on Internet Explorer + MathPlayer.
 
-\item[minitoc<] for mini tocs immediately after the header use the
+\item[minitoc\textless] for mini tocs immediately after the header use the
   command line option, \verb=minitoc<=.
 
 \item[mouseover] for pop ups on mouse over.
@@ -217,7 +215,7 @@
 \item[nikud] for Hebrew vowels, use the command line option,
   \verb=nikud=.
 
-\item[no-DOCTYPE] to remove \chfont{DOCTYPE}\space declaration from
+\item[no-DOCTYPE] to remove {\chfont DOCTYPE} declaration from
   the output.
 
 \item[no-VERSION] to remove \verb+<?xml version="..."?>+ processing
@@ -231,13 +229,13 @@
 % \item[no-matrix]
 % \item[no-pmatrix]
 
-\item[\tt no^] for non-active \verb=^= (superscript), use the option
+\item[no\textasciicircum] for non-active \verb=^= (superscript), use the option
   \verb=no^=.
 
-\item[\tt no_] for non-active \verb=_= (subscript command), use the
+\item[no\textunderscore] for non-active \verb=_= (subscript command), use the
   command line option, \verb=no_=.
 
-\item[\tt no_^] for both non-active superscript and subscript, use the
+\item[no\textunderscore\textasciicircum] for both non-active superscript and subscript, use the
   option \verb=no_^=.
 
 \item[nolayers] to remove overlays of slides, use this option.
@@ -343,11 +341,11 @@
 
 % \item[url-]
 
-\item[url-enc] for \chfont{URL}\space encoding within href, use this
+\item[url-enc] for {\chfont URL} encoding within href, use this
   option.  \verb=\Configure{url-encoder}= can be used to fine tune
   encoding.
 
-\item[url-il2-pl] for il2-pl \chfont{URL} encoding.
+\item[url-il2-pl] for il2-pl {\chfont URL} encoding.
 
 \item[ver] for vertically stacked frames. Effective when \verb=frames=
   option is requested.
Index: doc/tex4ht.tex
===================================================================
--- doc/tex4ht.tex	(revision 689)
+++ doc/tex4ht.tex	(working copy)
@@ -5,7 +5,7 @@
 % Top-level driver for tex4ht documentation.
 
 \documentclass[a4paper,11pt]{report}
-\usepackage{fullpage,xspace,graphicx,cvrblog}
+\usepackage{fullpage,xspace,graphicx,cvrblog,textcomp}
 \let\clearpage=\relax
 
 \title{\TeX4ht}
Index: lit/Makefile
===================================================================
--- lit/Makefile	(revision 689)
+++ lit/Makefile	(working copy)
@@ -11,11 +11,15 @@
 # and look for xmlint/vcss in ./extra-bin
 export PATH := $(ht_bin):$(extra_bin):$(PATH)
 
+homedir ?= tex4ht.dir
 wd = work.dir
 htmldir = html.dir
 xtpipesdir = xtpipes.dir
 deriveddir = derived.dir
+texmf_t4ht_bin = texmf/tex4ht/bin
 
+dirs = homedir wd htmldir xtpipesdir deriveddir texmf_t4ht_bin
+
 tex_opts = --interaction=nonstopmode -recorder #--file-line-error
 tex_1opt = "$(tex_opts)" # must be quoted, passing to shell script
 dev_null = </dev/null    # when we don't call tex directly.
@@ -32,7 +36,7 @@
 # Michal 10/05/2017: it seems that when mktex4ht.4ht is included as
 # common, it causes constant recompilatiations
 common_no_cond_sty = tex4ht-cpright.tex common.tex common-code.tex \
-  ProTex.sty AlProTex.sty
+  ProTex.sty AlProTex.sty tex4ht-dir.tex
 # common = mktex4ht.4ht tex4ht.sty $(common_no_cond_sty)
 common = tex4ht.sty $(common_no_cond_sty)
 common_info = $(common) common-info.tex
@@ -76,7 +80,7 @@
 tex4ht_docbook_derived = docbook.4ht docbook-math.4ht docbook-mml.4ht
 
 derived += $(tex4ht_docbook_xtpipes_derived)
-tex4ht_docbook_xtpipes_derived = docbook.4xt DbUtilities.java
+tex4ht_docbook_xtpipes_derived = docbook.4xt $(wd)/src/DbUtilities.java
 
 derived += $(tex4ht_env_derived)
 tex4ht_env_derived = tex4ht.env-unix tex4ht.env-win32 tex4ht.env
@@ -89,7 +93,7 @@
 
 # noncjk.tex \input's modern, but seems more maintainable
 # to have separate lists.
-ht_fonts_devdir = tex4ht.dir/texmf/tex4ht/ht-fonts
+ht_fonts_devdir = $(homedir)/texmf/tex4ht/ht-fonts
 derived += $(tex4ht_fonts_noncjk_derived)
 tex4ht_fonts_noncjk_derived = \
   $(ht_fonts_devdir)/alias/ec/eccc.htf \
@@ -110,7 +114,7 @@
 	$(ht_fonts_devdir)/alias/t1fonts/XCharter-Roman-tlf-t1--base.htf \
 	$(ht_fonts_devdir)/alias/t1fonts/XCharter-Italic-tlf-t1--base.htf \
 	$(ht_fonts_devdir)/alias/t1fonts/XCharter-Bold-tlf-t1--base.htf \
-  SearchFonts.java \
+  $(wd)/src/SearchFonts.java \
   lm-htf.tex
 derived += $(tex4ht_fonts_modern_derived)
 tex4ht_fonts_modern_derived = \
@@ -149,7 +153,7 @@
 tex4ht_html_speech_derived = html-speech.4ht html-speech-math.4ht emacspeak.4ht
 
 derived += $(tex4ht_html_speech_xtpipes_derived)
-tex4ht_html_speech_xtpipes_derived = htspk.4xt HtSpk.java
+tex4ht_html_speech_xtpipes_derived = htspk.4xt $(wd)/src/HtSpk.java
 
 derived += $(tex4ht_html0_derived)
 tex4ht_html0_derived = html0.4ht
@@ -194,7 +198,7 @@
 derived += $(tex4ht_jsml_xtpipes_derived)
 tex4ht_jsml_xtpipes_derived = \
   jsml.4xt \
-  HtJsml.java GroupMn.java JsmlFilter.java JsmlMathBreak.java
+  $(addprefix $(wd)/src/,HtJsml.java GroupMn.java JsmlFilter.java JsmlMathBreak.java)
 
 derived += $(tex4ht_jsml_derived)
 tex4ht_jsml_derived = jsml.4ht jsml-math.4ht
@@ -220,7 +224,7 @@
 derived += $(tex4ht_oo_xtpipes_derived)
 tex4ht_oo_xtpipes_derived = \
    oo-math.4xt oo-text.4xt \
-   OoUtilities.java OomFilter.java OoFilter.java
+   $(addprefix $(wd)/src/,OoUtilities.java OomFilter.java OoFilter.java)
 
 derived += $(tex4ht_ooffice_derived)
 tex4ht_ooffice_derived = ooffice.4ht ooffice-mml.4ht
@@ -253,10 +257,10 @@
 tex4ht_word_derived = htmlw.4ht
 
 derived += $(tex4ht_xhtml_xtpipes_derived)
-tex4ht_xhtml_xtpipes_derived = xhtml.4xt XhtmlEmails.java
+tex4ht_xhtml_xtpipes_derived = xhtml.4xt $(wd)/src/XhtmlEmails.java
 
 derived += $(tex4ht_xhtmml_xtpipes_derived)
-tex4ht_xhtmml_xtpipes_derived = xhtmml.4xt XhtmmlUtilities.java
+tex4ht_xhtmml_xtpipes_derived = xhtmml.4xt $(wd)/src/XhtmmlUtilities.java
 
 derived += $(tex4ht_mathjax_derived)
 tex4ht_mathjax_derived = mathjax-latex-4ht.4ht
@@ -267,14 +271,15 @@
 
 derived += $(xtpipes_derived)
 xtpipes_derived = \
-  $(wd)/xtpipes.java \
-  $(wd)/xtpipes/FileInfo.java \
-  $(wd)/xtpipes/InputObject.java \
-  $(wd)/xtpipes/Xtpipes.java \
-  $(wd)/xtpipes/XtpipesPrintWriter.java \
-  $(wd)/xtpipes/XtpipesUni.java \
-  $(wd)/xtpipes/util/ScriptsManager.java \
-  $(wd)/xtpipes/util/ScriptsManagerLH.java \
+  $(addprefix $(wd)/src/, \
+	xtpipes.java \
+	xtpipes/FileInfo.java \
+	xtpipes/InputObject.java \
+	xtpipes/Xtpipes.java \
+	xtpipes/XtpipesPrintWriter.java \
+	xtpipes/XtpipesUni.java \
+	xtpipes/util/ScriptsManager.java \
+	xtpipes/util/ScriptsManagerLH.java ) \
   xtpipes-default.4xt \
   xtpipes-map.dtd \
   xtpipes.dtd \
@@ -373,7 +378,7 @@
 $(tex4ht_jsmath_derived): tex4ht-jsmath.tex $(common)
 	xhlatex $< "html,3,sections+" "" "" $(tex_1opt)
 
-$(tex4ht_jsml_xtpipes_derived): tex4ht-jsml-xtpipes.tex $(common)
+$(tex4ht_jsml_xtpipes_derived): tex4ht-jsml-xtpipes.tex $(common) $(wd)/bin/xtpipes.jar
 	htlatex $< "xhtml,next,3" "" "" $(tex_1opt)
 
 $(tex4ht_jsml_derived): tex4ht-jsml.tex $(common)
@@ -460,7 +465,7 @@
 #
 update-env:
 	$(mkdir) $(dest_base)/unix $(dest_base)/win32
-	$(update) tex4ht.env-unix $(dest_base)/unix/tex4ht.env
+	$(update) tex4ht.$env-unix $(dest_base)/unix/tex4ht.env
 	$(update) tex4ht.env-win32 $(dest_base)/win32/tex4ht.env
 
 update: all
@@ -555,6 +560,7 @@
 	rm -f *.4ct *.4tc *.aux *.css *.dvi *.idv *.lg *.log *.tmp *.trc *.xref
 	rm -f *.4es *.bat *.unix *.htf *.html *.png tmp
 	rm -f *.fls
+	rm -f tex4ht-dir.tex
 
 clean1:
 	rm -f $(f).[0-s]* $(f).[u-z]* $(f).trc
@@ -712,3 +718,31 @@
 	echo $$f && mkdir -p $(deriveddir)/$${f%.*} \
 	&& awk -v outdir=$(deriveddir)/$${f%.*} '{system("[ -f "$$0" ] &&  mv -f " $$0" "outdir)}' $$f ; \
 done
+
+
+$(wd)/bin/xtpipes.jar: $(xtpipes_derived)
+	mkdir -p $(xtpipesdir)
+	find $(wd)/src -iname '*.java' -print0 \
+		| xargs -0 javac -d $(xtpipesdir) --source-path $(wd)/src
+	mkdir -p $(wd)/bin
+	cd $(xtpipesdir) && jar cf xtpipes.jar *
+	mv $(xtpipesdir)/xtpipes.jar $(wd)/bin
+
+tex4ht-dir.tex: tex4ht-dir.m4
+	m4 $(foreach dir,$(dirs),-D $(dir)="$($(dir))") $< > $@
+
+.PHONY: jar
+jar: $(homedir)/$(texmf_t4ht_bin)/tex4ht.jar
+$(homedir)/$(texmf_t4ht_bin)/tex4ht.jar: $(wd)/bin/xtpipes.jar \
+	$(tex4ht_docbook_xtpipes_derived) \
+	$(tex4ht_fonts_noncjk_derived) \
+	$(tex4ht_html_speech_xtpipes_derived) \
+	$(tex4ht_jsml_xtpipes_derived) \
+	$(tex4ht_oo_xtpipes_derived) \
+	$(tex4ht_xhtml_xtpipes_derived) \
+	$(tex4ht_xhtmml_xtpipes_derived) 
+	find $(wd)/src -iname '*.java' -print0 \
+		| xargs -0 javac -d $(xtpipesdir) --source-path $(wd)/src
+	mkdir -p $(dir $@)
+	cd $(xtpipesdir) && jar cf $(notdir $@) *
+	mv $(xtpipesdir)/$(notdir $@) $(dir $@)
Index: lit/tex4ht-4ht.tex
===================================================================
--- lit/tex4ht-4ht.tex	(revision 689)
+++ lit/tex4ht-4ht.tex	(working copy)
@@ -192,8 +192,7 @@
 \catcode`\:=12
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-\def\HOME{/opt/cvr/gurari/tex4ht.dir/texmf/tex/generic/tex4ht/}
-\def\SOURCE{/opt/cvr/gurari/main.dir/html.dir}
+\input tex4ht-dir
 
 \newcount\tmpcnt  \tmpcnt\time  \divide\tmpcnt  60
 \edef\temp{\the\tmpcnt}
@@ -38323,10 +38322,10 @@
 %-------------------------------------------------------
 \let\OPO=\OutputCodE
 \def\OutputCodE\<#1\>{%
-   \openin15=\HOME/#1
-%   \ifeof15    \Needs{"ln -s #1 \HOME/#1"} 
-    \ifeof15    \Needs{"cp -f #1 \HOME#1"} 
-        \writesixteen{"cd \HOME; ln -s \SOURCE/#1 . ; cd \SOURCE"} \fi
+   \openin15=\TEXMFTEXivHT/#1
+%   \ifeof15    \Needs{"ln -s #1 \TEXMFTEXivHT/#1"} 
+    \ifeof15    \Needs{"cp -f #1 \TEXMFTEXivHT#1"} 
+        \writesixteen{"cd \TEXMFTEXivHT; ln -s \SOURCE/#1 . ; cd \SOURCE"} \fi
    \closein15
    \OPO\<#1\>}
 
Index: lit/tex4ht-dir.tex
===================================================================
--- lit/tex4ht-dir.tex	(revision 689)
+++ lit/tex4ht-dir.tex	(working copy)
@@ -1,4 +1,10 @@
 % public domain.
 \def\HOME{./tex4ht.dir/}
 \def\DTDS{./dtd.dir/}           
+\def\WORK{./work.dir/src/}
+\def\LIB{./work.dir/bin/}
 \def\SOURCE{./html.dir/}
+\def\XTPIPES{./xtpipes.dir/}
+\def\TEXMFTEXivHT{\HOME texmf/tex/generic/tex4ht/}
+\def\TEXMFTEXivBIN{\HOME texmf/tex4ht/bin/}
+\def\TEXMFTEXivXTPIPES{\HOME texmf/tex4ht/xtpipes/}
Index: lit/tex4ht-docbook-xtpipes.tex
===================================================================
--- lit/tex4ht-docbook-xtpipes.tex	(revision 689)
+++ lit/tex4ht-docbook-xtpipes.tex	(working copy)
@@ -12,6 +12,7 @@
 
 \input{common}
 \input{tex4ht-cpright}
+\input{tex4ht-dir}
 
 
 
@@ -49,7 +50,7 @@
 \AtEndDocument{\OutputCodE\<DbUtilities.java\>}
 
 \Needs{"
-    javac DbUtilities.java -d /home/4/gurari/xtpipes.dir/. 
+    javac DbUtilities.java -d \XTPIPES
 "}
 
 \<DbUtilities.java\><<<
@@ -515,14 +516,16 @@
 
 
 \AtEndDocument{\Needs{%
-    "cd /home/4/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;  
      jar cf tex4ht.jar *
      ;
-     mv tex4ht.jar /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/. 
+     popd
      ;
-     cp /home/4/gurari/xtpipes.dir/xtpipes/lib/* 
-        /home/4/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mv \XTPIPES tex4ht.jar \TEXMFTEXivBIN
+     ;
+     cp \XTPIPES xtpipes/lib/* 
+        \TEXMFTEXivXTPIPES
 "}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: lit/tex4ht-html-speech-xtpipes.tex
===================================================================
--- lit/tex4ht-html-speech-xtpipes.tex	(revision 689)
+++ lit/tex4ht-html-speech-xtpipes.tex	(working copy)
@@ -5,12 +5,12 @@
 % Copyright (C) 2006-2009 Eitan M. Gurari
 % Released under LPPL 1.3c+.
 % See tex4ht-cpright.tex for license text.
-
 \documentclass{article}
     \Configure{ProTex}{log,<<<>>>,title,list,`,[[]]}
 \begin{document}
 
 \input{common}
+\input{tex4ht-dir}
 \input{tex4ht-cpright}
 
 %%%%%%%%%%%%%%%%%%
@@ -148,7 +148,7 @@
 \AtEndDocument{\OutputCodE\<HtSpk.java\>}
 
 \Needs{"
-    javac HtSpk.java      -d /home/4/gurari/xtpipes.dir/. 
+    javac HtSpk.java      -d \XTPIPES . 
 "}
 
 \<HtSpk.java\><<<
@@ -2416,14 +2416,18 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \AtEndDocument{\Needs{%
-    "cd /home/4/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;  
      jar cf tex4ht.jar *
      ;
-     mv tex4ht.jar /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/. 
+     popd
      ;
-     cp /home/4/gurari/xtpipes.dir/xtpipes/lib/* 
-        /home/4/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mkdir -p \TEXMFTEXivBIN
+     ;
+     mv \XTPIPES tex4ht.jar \TEXMFTEXivBIN . 
+     ;
+     cp \XTPIPES lib/* 
+        \TEXMFTEXivXTPIPES.
 "}}
 
 
Index: lit/tex4ht-javahelp-xtpipes.tex
===================================================================
--- lit/tex4ht-javahelp-xtpipes.tex	(revision 689)
+++ lit/tex4ht-javahelp-xtpipes.tex	(working copy)
@@ -84,7 +84,7 @@
 %    \OutputCodE\<XhtmlEmails.java\> 
 % } 
 % \Needs{"
-%     javac -classpath /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/tex4ht.jar
+0%     javac -classpath /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/tex4ht.jar
 %           XhtmlEmails.java
 %           -d /home/4/gurari/xtpipes.dir/. 
 % "} 
@@ -626,14 +626,16 @@
 
 
 \AtEndDocument{\Needs{%
-    "cd /home/4/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;  
      jar cf tex4ht.jar *
      ;
-     mv tex4ht.jar /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/. 
+     popd
      ;
-     cp /home/4/gurari/xtpipes.dir/xtpipes/lib/* 
-        /home/4/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mv tex4ht.jar \TEXMFTEXivBIN
+     ;
+     cp \XTPIPES xtpipes/lib/* 
+        \TEXMFTEXivXTPIPES
 "}}
 
 \end{document}
Index: lit/tex4ht-jsml-xtpipes.tex
===================================================================
--- lit/tex4ht-jsml-xtpipes.tex	(revision 689)
+++ lit/tex4ht-jsml-xtpipes.tex	(working copy)
@@ -13,6 +13,7 @@
 
 \input{common}
 \input{tex4ht-cpright}
+\input{tex4ht-dir}
 
 %%%%%%%%%%%%%%%%%%
 \part{Script for xtpipes}
@@ -147,7 +148,7 @@
 \AtEndDocument{\OutputCodE\<HtJsml.java\>}
 
 \Needs{"
-    javac HtJsml.java -d /home/4/gurari/xtpipes.dir/.  
+    javac HtJsml.java -d \XTPIPES
 "}
 
 \<HtJsml.java\><<<
@@ -183,7 +184,7 @@
    \OutputCodE\<GroupMn.java\> 
 } 
 \Needs{"
-    javac GroupMn.java -d /home/4/gurari/xtpipes.dir/. 
+    javac GroupMn.java -d \XTPIPES
 "} 
  
 \<GroupMn.java\><<< 
@@ -792,9 +793,9 @@
    \OutputCodE\<JsmlMathBreak.java\> 
 } 
 \Needs{"
-    javac -classpath /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/tex4ht.jar
+    javac -classpath \LIB xtpipes.jar
           JsmlMathBreak.java
-          -d /home/4/gurari/xtpipes.dir/. 
+          -d \XTPIPES . 
 "} 
  
 \<JsmlMathBreak.java\><<< 
@@ -992,7 +993,7 @@
    \OutputCodE\<JsmlFilter.java\> 
 } 
 \Needs{"
-    javac JsmlFilter.java -d /home/4/gurari/xtpipes.dir/.  
+    javac JsmlFilter.java -d \XTPIPES
 "} 
  
 \<JsmlFilter.java\><<< 
@@ -3807,14 +3808,16 @@
 
 
 \AtEndDocument{\Needs{%
-    "cd /home/4/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;  
      jar cf tex4ht.jar *
      ;
-     mv tex4ht.jar /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/. 
+     popd
      ;
-     cp /home/4/gurari/xtpipes.dir/xtpipes/lib/* 
-        /home/4/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mv \XTPIPES tex4ht.jar \TEXMFTEXivBIN
+     ;
+     cp \XTPIPES xtpipes/lib/* 
+        \TEXMFTEXivXTPIPES
 "}}
 
 
Index: lit/tex4ht-oo-xtpipes.tex
===================================================================
--- lit/tex4ht-oo-xtpipes.tex	(revision 689)
+++ lit/tex4ht-oo-xtpipes.tex	(working copy)
@@ -12,6 +12,7 @@
 
 \input{common}
 \input{tex4ht-cpright}
+\input{tex4ht-dir}
 
 
 %%%%%%%%%%%%%%%%%%
@@ -280,7 +281,7 @@
 \AtEndDocument{\OutputCodE\<OoUtilities.java\>}
 
 \Needs{"
-    javac OoUtilities.java -d /opt/cvr/gurari/xtpipes.dir/. 
+    javac OoUtilities.java -d \XTPIPES
 "}
 
 \<OoUtilities.java\><<<
@@ -1540,7 +1541,7 @@
 \AtEndDocument{\OutputCodE\<OomFilter.java\>}
 
 \Needs{"
-    javac OomFilter.java     -d /opt/cvr/gurari/xtpipes.dir/. 
+    javac OomFilter.java     -d \XTPIPES
 "}
 
 \<OomFilter.java\><<<
@@ -1605,7 +1606,7 @@
 \AtEndDocument{\OutputCodE\<OoFilter.java\>}
 
 \Needs{"
-    javac OoFilter.java      -d /opt/cvr/gurari/xtpipes.dir/. 
+    javac OoFilter.java      -d \XTPIPES
 "}
 
 \<OoFilter.java\><<<
@@ -1955,14 +1956,16 @@
 
 
 \AtEndDocument{\Needs{%
-    "cd /opt/cvr/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;  
      jar cf tex4ht.jar *
      ;
-     mv tex4ht.jar /opt/cvr/gurari/tex4ht.dir/texmf/tex4ht/bin/. 
+     popd
      ;
-     cp /opt/cvr/gurari/xtpipes.dir/xtpipes/lib/* 
-        /opt/cvr/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mv \XTPIPES tex4ht.jar \TEXMFTEXivBIN
+     ;
+     cp \XTPIPES xtpipes/lib/* 
+        \TEXMFTEXivXTPIPES
 "}}
 
 \end{document}
Index: lit/tex4ht-xhtml-xtpipes.tex
===================================================================
--- lit/tex4ht-xhtml-xtpipes.tex	(revision 689)
+++ lit/tex4ht-xhtml-xtpipes.tex	(working copy)
@@ -12,6 +12,7 @@
     \input{common.tex}
 \begin{document}
 \input tex4ht-cpright.tex
+\input tex4ht-dir
 
 
 %%%%%%%%%%%%%%%%%%
@@ -90,9 +91,9 @@
    \OutputCodE\<XhtmlEmails.java\> 
 } 
 \Needs{"
-    javac -classpath /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/tex4ht.jar
+    javac -classpath \TEXMFTEXivBIN tex4ht.jar
           XhtmlEmails.java
-          -d /home/4/gurari/xtpipes.dir/. 
+          -d \XTPIPES
 "} 
  
 \<XhtmlEmails.java\><<< 
@@ -633,14 +634,16 @@
 
 
 \AtEndDocument{\Needs{%
-    "cd /home/4/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;  
      jar cf tex4ht.jar *
      ;
-     mv tex4ht.jar /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/. 
+     popd
      ;
-     cp /home/4/gurari/xtpipes.dir/xtpipes/lib/* 
-        /home/4/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mv \XTPIPES tex4ht.jar \TEXMFTEXivBIN  
+     ;
+     cp \XTPIPES xtpipes/lib/* 
+        \TEXMFTEXivXTPIPES
 "}}
 
 
Index: lit/tex4ht-xhtmml-xtpipes.tex
===================================================================
--- lit/tex4ht-xhtmml-xtpipes.tex	(revision 689)
+++ lit/tex4ht-xhtmml-xtpipes.tex	(working copy)
@@ -12,8 +12,8 @@
     \input{common.tex}
 \begin{document}
 \input tex4ht-cpright.tex
+\input tex4ht-dir
 
-
 %%%%%%%%%%%%%%%%%%
 \part{Post Processing for HTML Output Mode}
 %%%%%%%%%%%%%%%%%%
@@ -52,7 +52,7 @@
 \AtEndDocument{\OutputCodE\<XhtmmlUtilities.java\>}
 
 \Needs{"
-    javac XhtmmlUtilities.java -d /home/4/gurari/xtpipes.dir/. 
+    javac XhtmmlUtilities.java -d \XTPIPES
 "}
 
 \<XhtmmlUtilities.java\><<<
@@ -722,14 +722,17 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \AtEndDocument{\Needs{%
-    "cd /home/4/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;  
      jar cf tex4ht.jar *
      ;
-     mv tex4ht.jar /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/. 
+     popd
      ;
-     cp /home/4/gurari/xtpipes.dir/xtpipes/lib/* 
-        /home/4/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mv \XTPIPES tex4ht.jar \TEXMFTEXivBIN
+     ;
+     cp \XTPIPES  xtpipes/lib/* 
+     \TEXMFTEXivXTPIPES
+     ;
 "}}
 
 
Index: lit/xtpipes.tex
===================================================================
--- lit/xtpipes.tex	(revision 689)
+++ lit/xtpipes.tex	(working copy)
@@ -21,6 +21,7 @@
    \Configure{ProTex}{java,<<<>>>,title,list,`}
 \begin{document}
 \input tex4ht-cpright.tex
+\input tex4ht-dir.tex
 
 \def\CNT{0}
 \bgroup
@@ -69,7 +70,7 @@
    \expandafter\setStartDir \dir #2!%
    \bgroup
      \def\Slash{/}%
-     \xdef\EndDir{\ifx \dir\empty \else \dir\Slash\fi
+     \xdef\EndDir{\dir
                 #2\Slash
              \ifx\ext\empty
                   \if !#1!\else #1\fi
@@ -77,7 +78,7 @@
    \egroup
    \MakeDir
    \if !#1!\else
-      \Needs{"\mv #1\space \dir \Slash#2\Slash
+      \Needs{"\mv #1\space \dir #2\Slash
                     \ifx\ext\empty #1\else \ext\fi"}%
    \fi
 }
@@ -96,14 +97,10 @@
    }
 }{
    \def\MakeDir{\relax
-      \expandafter \ifx  \csname !\StartDir\endcsname\relax
-         \expandafter\let\csname !\StartDir\endcsname=\empty
-         \Needs{"mkdir \StartDir"}%
+      \expandafter \ifx  \csname !\EndDir\endcsname\relax
+         \expandafter\let\csname !\EndDir\endcsname=\empty
+         \Needs{"mkdir -p `dirname '\EndDir'`;"}%
       \fi
-      \ifx \EndDir\empty \else
-          \expandafter\AppendDir \EndDir////*%
-          \expandafter\MakeDir
-      \fi
    }
 }
 
@@ -176,10 +173,10 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+% TODO : make \WORK MSDOS / Linux agnostic.
+\def\MYdir{\WORK}
 
-\def\MYdir{work.dir}
 
-
 \expandafter\let\csname !/\endcsname\empty
 \expandafter\let\csname !/\endcsname\empty
 \expandafter\let\csname !/home\endcsname\empty
@@ -229,16 +226,9 @@
 
 \ifOption{win} {}{
 \AtEndDocument{\Needs{"
-  cd work.dir
-  ;
-  javac -Xlint:unchecked xtpipes/*.java
-        -d /home/4/gurari/xtpipes.dir/.
-  ;
-  javac -Xlint:unchecked xtpipes/*/*.java
-        -d /home/4/gurari/xtpipes.dir/.
-  ;
-  javac -Xlint:unchecked xtpipes.java
-        -d /home/4/gurari/xtpipes.dir/.
+    find \WORK\space -type f -iname '*.java' -print0
+    | xargs -0 javac -Xlint:deprecation -d \XTPIPES\space --source-path \WORK
+    ;
 "}}
 }
 
@@ -246,7 +236,7 @@
 \ifOption{win} {
     \def\BIN{}
 }{
-    \def\BIN{(/home/4/gurari/xtpipes.dir)}
+    \def\BIN{(\XTPIPES)}
 }
 
 % 
@@ -279,7 +269,7 @@
 `<class XtpipesEntityResolver`>
 >>>
 
-\Needs{"\mv xtpipes.java.java \MYdir\Slash xtpipes.java"}
+\Needs{"\mv xtpipes.java.java \MYdir xtpipes.java"}
 
 NOTE: We can not place Xtpipes.class and xtpipes.class at the same
 directory because MS Windows get confused between the two.
@@ -339,6 +329,7 @@
 \<xtpipes imports\><<<
 // import xtpipes.util.InputObject;
 // import xtpipes.util.FileInfo;
+import xtpipes.XtpipesPrintWriter;
 import java.net.URLConnection;
 import java.io.*;
 import java.lang.reflect.*;
@@ -1049,7 +1040,7 @@
 
 \<process script map\><<<
 public void startDocument () {
-   condition.push( new Boolean(true) );
+   condition.push( Boolean.valueOf(true) );
 }
 >>>
 
@@ -1087,7 +1078,7 @@
         condition = null;
         return;
    }  }
-   condition.push( new Boolean(cond) );
+   condition.push( Boolean.valueOf(cond) );
 }
 >>>
 
@@ -4099,11 +4090,11 @@
 
 \<set start element\><<<
 if( flag ){
-   Object [] state = { new Boolean(savemode), code, match };
+   Object [] state = { Boolean.valueOf(savemode), code, match };
    stack.push( state );
    savemode=true; code=""; match= key;
 } else {
-   Object [] state = { new Boolean(savemode), null, null };
+   Object [] state = { Boolean.valueOf(savemode), null, null };
    stack.push( state );
 }
 add( s );
@@ -4293,7 +4284,7 @@
 
 \<save status of xmlns above element\><<<
 int top = nsName.size();
-nsStack.push( new Integer(top) );
+nsStack.push( Integer.valueOf(top) );
 >>>
 
 \<recall status of xmlns above element\><<<
@@ -4478,14 +4469,20 @@
 
 \ifOption{win} {}{
 \AtEndDocument{\Needs{%
-    "cd /home/4/gurari/xtpipes.dir
+    "pushd \XTPIPES
      ;
-     jar cf tex4ht.jar *
+     jar cf xtpipes.jar *
      ;
-     mv tex4ht.jar /home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/.
+     popd
      ;
-     cp /home/4/gurari/xtpipes.dir/xtpipes/lib/*
-        /home/4/gurari/tex4ht.dir/texmf/tex4ht/xtpipes/.
+     mkdir -p \LIB
+     ;
+     mv \XTPIPES xtpipes.jar \LIB
+     ;
+     mkdir -p \HOME texmf/tex4ht/xtpipes/.
+     ;
+     cp \XTPIPES xtpipes/lib/*
+        \HOME texmf/tex4ht/xtpipes/.
 "}}
 }
 
@@ -4492,25 +4489,20 @@
 
 
 \ifOption{win} {}{
-\AtEndDocument{\Needs{"
-cd work.dir ;
-mkdir bin;
- javac -Xlint:unchecked  -d bin  xtpipes/*.java  ;
- javac -Xlint:unchecked  -d bin  xtpipes/util/*.java;
- javac -Xlint:unchecked  -d bin  *.java ;
-cd bin;
- jar cf xtpipes.jar *;
-cd ..;
-cd xtpipes;
-mkdir bin;
- mv ../bin/xtpipes.jar bin/.
-;
-cp -r bin /home/4/gurari/xtpipes.dir/xtpipes/.
-;
-cd ..
-;
-cd ..
-;
+  \AtEndDocument{\Needs{"
+      mkdir -p \LIB
+      ;
+      find \WORK\space -type f -iname '*.java' -print0
+      | xargs -0 javac -Xlint:deprecation -d \XTPIPES\space --source-path \WORK
+      ;
+      pushd \XTPIPES
+      ;
+      jar cf xtpipes.jar *
+      ;
+      popd
+      ;
+      mv \XTPIPES xtpipes.jar \LIB
+      ;
 "}}}
 
 
