Index: branches/eam_branches/ipp-20120905/dvodist/src/generate
===================================================================
--- branches/eam_branches/ipp-20120905/dvodist/src/generate	(revision 34554)
+++ branches/eam_branches/ipp-20120905/dvodist/src/generate	(revision 34609)
@@ -5,4 +5,5 @@
 
 set htdocs  = ""
+set rootdir  = ""
 set args    = ""
 set VERBOSE = 0
@@ -16,4 +17,12 @@
    else
      set htdocs = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --rootdir*
+   if ("$1" == "--rootdir") then
+     shift
+     set rootdir = $1
+   else
+     set rootdir = `echo $1 | tr = ' ' | awk '{print $2}'`
    endif
    breaksw;
@@ -36,12 +45,14 @@
 if ($VERBOSE) then
   echo
-  echo "htdocs: $htdocs"
-  echo "input : $args[1]"
-  echo "output: $args[2]"
+  echo "htdocs : $htdocs"
+  echo "rootdir: $rootdir"
+  echo "input  : $args[1]"
+  echo "output : $args[2]"
 endif
 
 if ("$htdocs" == "") goto usage
+if ("$rootdir" == "") goto usage
 
-cat $args[1] | sed "s|@HTDOCS@|$htdocs|" > $args[2]
+cat $args[1] | sed "s|@HTDOCS@|$htdocs|" | sed "s|@ROOTDIR@|$rootdir|" > $args[2]
 exit 0
 
@@ -59,9 +70,11 @@
   replace install-time options in scripts
   
-  set the WWW installation directory root with --htdocs
-  
+  set the WWW installation directory root with --htdocs (top on server)
+  set the WWW top-level directory with --rootdir (top seen by client)
+    
   switches:
     -h, --help              display this help and exit
-    --htdocs (required)     set the top-level directory
+    --htdocs (required)     set the top-level directory (internal)
+    --rootdir (required)    set the top-level directory (external)
 
 EOF
