[commons-daemon] 24/52: Imported Upstream version 1.0.3

Tony Mancill tmancill at moszumanska.debian.org
Wed Nov 12 05:31:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch master
in repository commons-daemon.

commit 934a7a9c1dd8eaf3b776fc5cd30fd57dfbd931a0
Author: tony mancill <tmancill at debian.org>
Date:   Fri Nov 7 07:59:33 2014 -0800

    Imported Upstream version 1.0.3
---
 README                                             |   13 +-
 RELEASE-NOTES.txt                                  |   39 +-
 build.xml                                          |   12 +-
 pom.xml                                            |    8 +-
 src/assembly/native-src.xml                        |   11 +-
 src/assembly/src.xml                               |   22 +
 src/java/org/apache/commons/daemon/Daemon.java     |   18 +-
 .../org/apache/commons/daemon/DaemonContext.java   |    6 +-
 .../apache/commons/daemon/DaemonController.java    |   33 +-
 .../org/apache/commons/daemon/DaemonListener.java  |    7 +-
 .../apache/commons/daemon/DaemonPermission.java    |  209 +-
 .../commons/daemon/support/DaemonLoader.java       |  312 +-
 src/media/logo.xcf                                 |  Bin 22934 -> 0 bytes
 src/native/nt/Makefile                             |    6 -
 src/native/nt/README                               |   68 -
 src/native/nt/executables/vdmoniadm/icon1.ico      |  Bin 766 -> 0 bytes
 src/native/nt/executables/vdmoniadm/resource.h     |   42 -
 src/native/nt/executables/vdmoniadm/vdmoniadm.dsp  |  121 -
 src/native/nt/executables/vdmoniadm/vdmoniadm.dsw  |   29 -
 src/native/nt/executables/vdmoniadm/vdmoniadm.rc   |  344 --
 src/native/nt/executables/vdmonisvc/resource.h     |   29 -
 src/native/nt/executables/vdmonisvc/vdmonisvc.dsp  |  122 -
 src/native/nt/executables/vdmonisvc/vdmonisvc.dsw  |   29 -
 src/native/nt/executables/vdmonisvc/vdmonisvc.rc   |  105 -
 src/native/nt/lib/moni_inst.h                      |   31 -
 src/native/nt/moni/Makefile                        |   17 -
 src/native/nt/moni/vdmoniadm.c                     |  595 ---
 src/native/nt/moni/vdmonisvc.c                     |  708 ----
 src/native/nt/procrun/README.dev                   |   25 +
 src/native/nt/procrun/apps/prunmgr/Makefile        |   87 +
 src/native/nt/procrun/apps/prunmgr/prunmgr.amd64   |  110 -
 src/native/nt/procrun/apps/prunmgr/prunmgr.c       |   19 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.dsp     |  189 -
 src/native/nt/procrun/apps/prunmgr/prunmgr.h       |   11 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.ia64    |  110 -
 src/native/nt/procrun/apps/prunmgr/prunmgr.rc      |   21 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.vcproj  |  402 --
 src/native/nt/procrun/apps/prunmgr/prunmgr.x86     |  110 -
 src/native/nt/procrun/apps/prunsrv/Makefile        |   91 +
 src/native/nt/procrun/apps/prunsrv/prunsrv.amd64   |  109 -
 src/native/nt/procrun/apps/prunsrv/prunsrv.c       |  284 +-
 src/native/nt/procrun/apps/prunsrv/prunsrv.dsp     |  166 -
 src/native/nt/procrun/apps/prunsrv/prunsrv.h       |    2 +-
 src/native/nt/procrun/apps/prunsrv/prunsrv.ia64    |  109 -
 src/native/nt/procrun/apps/prunsrv/prunsrv.rc      |    4 +-
 src/native/nt/procrun/apps/prunsrv/prunsrv.vcproj  |  400 --
 src/native/nt/procrun/apps/prunsrv/prunsrv.x86     |  109 -
 src/native/nt/procrun/include/Makefile.inc         |  346 ++
 src/native/nt/procrun/include/apxwin.h             |    6 +-
 src/native/nt/procrun/include/javajni.h            |    2 +-
 src/native/nt/procrun/include/log.h                |    7 +-
 src/native/nt/procrun/include/rprocess.h           |    3 +-
 src/native/nt/procrun/libprocrun.amd64             |  158 -
 src/native/nt/procrun/libprocrun.dsp               |  234 --
 src/native/nt/procrun/libprocrun.ia64              |  158 -
 src/native/nt/procrun/libprocrun.vcproj            |  388 --
 src/native/nt/procrun/libprocrun.x86               |  158 -
 src/native/nt/procrun/procrun.dsw                  |   74 -
 src/native/nt/procrun/procrun.sln                  |   64 -
 src/native/nt/procrun/src/cmdline.c                |   40 +-
 src/native/nt/procrun/src/javajni.c                |  196 +-
 src/native/nt/procrun/src/log.c                    |  103 +-
 src/native/nt/procrun/src/private.h                |    5 -
 src/native/nt/procrun/src/registry.c               |   20 +-
 src/native/nt/procrun/src/rprocess.c               |  175 +-
 src/native/nt/procrun/src/service.c                |  121 +-
 src/native/nt/procrun/src/utils.c                  |   37 +-
 src/native/nt/service/Makefile                     |    9 -
 src/native/nt/service/instmain.c                   |  437 --
 src/native/nt/service/instsvc.dsp                  |  104 -
 src/native/nt/service/instsvc.dsw                  |   29 -
 src/native/nt/signals/kills.c                      |   48 -
 src/native/nt/supcalls_nt/vdenv.c                  |  179 -
 src/native/unix/CHANGES.txt                        |    8 +-
 src/native/unix/Makedefs                           |   32 -
 src/native/unix/Makefile                           |   40 -
 src/native/unix/config.log                         |  264 --
 src/native/unix/config.status                      |  866 ----
 src/native/unix/configure                          | 4175 ++++++++------------
 src/native/unix/configure.in                       |    6 +-
 src/native/unix/man/fetch.sh                       |    0
 src/native/unix/man/jsvc.1.xml                     |    6 +-
 src/native/unix/native/.indent.pro                 |    7 +
 src/native/unix/native/Makefile                    |   45 -
 src/native/unix/native/arguments.c                 |  609 +--
 src/native/unix/native/arguments.h                 |   42 +-
 src/native/unix/native/arguments.o                 |  Bin 20372 -> 0 bytes
 src/native/unix/native/debug.c                     |   69 +-
 src/native/unix/native/debug.h                     |   42 +-
 src/native/unix/native/debug.o                     |  Bin 6956 -> 0 bytes
 src/native/unix/native/dso-dlfcn.c                 |   70 +-
 src/native/unix/native/dso-dlfcn.o                 |  Bin 5616 -> 0 bytes
 src/native/unix/native/dso-dyld.c                  |  105 +-
 src/native/unix/native/dso-dyld.o                  |  Bin 3388 -> 0 bytes
 src/native/unix/native/dso.h                       |   36 +-
 src/native/unix/native/help.c                      |   84 +-
 src/native/unix/native/help.h                      |   34 +-
 src/native/unix/native/help.o                      |  Bin 8512 -> 0 bytes
 src/native/unix/native/home.c                      |  271 +-
 src/native/unix/native/home.h                      |    8 +-
 src/native/unix/native/home.o                      |  Bin 14068 -> 0 bytes
 src/native/unix/native/java.c                      |  536 +--
 src/native/unix/native/java.h                      |   34 +-
 src/native/unix/native/java.o                      |  Bin 39660 -> 0 bytes
 src/native/unix/native/jsvc-unix.c                 |  876 ++--
 src/native/unix/native/jsvc-unix.o                 |  Bin 30668 -> 0 bytes
 src/native/unix/native/jsvc.h                      |   36 +-
 src/native/unix/native/libservice.a                |  Bin 113450 -> 0 bytes
 src/native/unix/native/location.c                  |  113 +-
 src/native/unix/native/location.h                  |   34 +-
 src/native/unix/native/location.o                  |  Bin 5980 -> 0 bytes
 src/native/unix/native/locks.c                     |   44 +-
 src/native/unix/native/locks.h                     |   35 +-
 src/native/unix/native/locks.o                     |  Bin 857 -> 0 bytes
 src/native/unix/native/replace.c                   |  129 +-
 src/native/unix/native/replace.h                   |   35 +-
 src/native/unix/native/replace.o                   |  Bin 6004 -> 0 bytes
 src/native/unix/native/signals.c                   |  123 +-
 src/native/unix/native/signals.h                   |    2 +-
 src/native/unix/native/signals.o                   |  Bin 859 -> 0 bytes
 src/native/unix/native/version.h                   |   34 +-
 src/samples/AloneService.java                      |   18 +-
 src/samples/Native.sh                              |    0
 src/samples/ProcrunService.java                    |  173 +
 src/samples/ProcrunServiceInstall.cmd              |   65 +
 src/samples/ProcrunServiceRemove.cmd               |   42 +
 src/samples/README.txt                             |   34 +-
 src/samples/ServiceDaemon.java                     |   19 +-
 src/samples/ServiceDaemon.sh                       |    1 -
 src/samples/SimpleDaemon.java                      |   32 +-
 src/samples/build.xml                              |   57 +-
 src/site/resources/images/logo.gif                 |  Bin 4540 -> 0 bytes
 src/site/resources/images/logo.png                 |  Bin 13595 -> 0 bytes
 src/site/site.xml                                  |   45 -
 src/site/xdoc/binaries.xml                         |   65 -
 src/site/xdoc/download_daemon.xml                  |  145 -
 src/site/xdoc/faq.xml                              |  100 -
 src/site/xdoc/index.xml                            |  115 -
 src/site/xdoc/issue-tracking.xml                   |  102 -
 src/site/xdoc/jsvc.xml                             |  269 --
 src/site/xdoc/procrun.xml                          |  374 --
 141 files changed, 5724 insertions(+), 13177 deletions(-)

diff --git a/README b/README
index 70b0f33..c1df51e 100644
--- a/README
+++ b/README
@@ -11,23 +11,22 @@ To build the native part:
   There is a INSTALL.txt src/native/unix - please have a look at it.
 
   On Windows an additional step is needed:
-  cd src/native/nt; make
-  There is a README in src/native/nt - please have a look at it.
+  cd src/native/windows; make
+  There is a README in src/native/windows - please have a look at it.
   The exe files are created in dist.
 2 - procrun:
   procrun is only for windows
-  cd src\native\nt\procrun\apps
+  cd src\native\windows\procrun\apps
   cd prunsrv
   nmake -f prunsrv.x86 (prunsrv.amd64 | prunsrv.ia64)
   cd ..\prunmgr
   nmake -f prunmgs.x86
   (It is also possible to use the MS development tools).
+[Note: the directory in SVN is currently called src/native/nt, not src/native/windows]
 
 To build the documentation: (See http://commons.apache.org/building.html).
-maven site:generate
+mvn site:generate
 (Do not forget to get ../commons-build: (cd ..; svn co http://svn.apache.org/repos/asf/commons/proper/commons-build/trunk/ commons-build))
 
 To deploy the documentation to the apache site:
-maven -Dmaven.username=${user.name} site:deploy
-(Check <siteAddress/> in project.xml).
-
+mvn -Dmaven.username=${user.name} site:deploy
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index c4142e4..5294620 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -1,8 +1,8 @@
-$Id: RELEASE-NOTES.txt 915160 2010-02-23 03:32:02Z billbarker $
+$Id: RELEASE-NOTES.txt 980519 2010-07-29 17:32:38Z mturk $
 
-			Commons Daemon Package
-			   Version 1.0.2
-			    Release Notes
+            Commons Daemon Package
+               Version 1.0.3
+                Release Notes
 
 
 INTRODUCTION:
@@ -15,26 +15,43 @@ follow the release early/release often mentality.
 
 NEW FEATURES:
 
-* Initial import to Commons, including the daemon Java API, and jsvc 
-  for Unix and Windows NT/2K/XP, which allows running a Java program 
-  as a native operating system daemon
+* DAEMON-138: Add --PidFile option to allow storing running process id. (1.0.3)
+* DAEMON-137: Add --LogJniMessages allowing to configure JNI verbose message
+              logging. By default those messages were always logged. (1.0.3)
+* DAEMON-140: Add missing Java6 parameters -ea, da, -esa, -dsa, -showversion
+              and their long name synonyms. (1.0.3)
+* DAEMON-142: Add option to display procrun version.
+* DAEMON-166: Add classpath .jar expansion. If the classpath
+              element ends with asterisk it will evaluate to all .jar files
+              found in the path. (1.0.3)
 
 * Add -wait and -stop parameters. (1.0.1).
-  The -wait parameter is experimental: that a is loop testing for a file in /tmp
-  and waiting n/10 seconds.
+  The -wait parameter is experimental: that a is loop testing for a
+  file in /tmp and waiting n/10 seconds.
 
 * Allow to run as normal user for testing. (1.0.1).
 
+* Initial import to Commons, including the daemon Java API, and jsvc
+  for Unix and Windows NT/2K/XP, which allows running a Java program
+  as a native operating system daemon
+
 * Switch to JIRA bug tracking sytem.
 
+* Add sample ProcrunService Java application for use with Procrun Jvm/Java modes (1.0.3)
+
 BUG FIXES:
 
-1.0.1: 304310,  30177, 27523, 29465, 31614, 33580, 31613, 34851.
+1.0.3: DAEMON-108, DAEMON-128, DAEMON-139, DAEMON-143, DAEMON-148,
+       DAEMON-135, DAEMON-155, DAEMON-159, DAEMON-161, DAEMON-145, DAEMON-146,
+       DAEMON-167, DAEMON-168
+
 1.0.2: DAEMON-16, DAEMON-31, DAEMON-40, DAEMON-45, DAEMON-49, DAEMON-60,
        DAEMON-84, DAEMON-90, DAEMON-91, DAEMON-92, DAEMON-93, DAEMON-94,
        DAEMON-96, DAEMON-97, DAEMON-98, DAEMON-102, DAEMON-105, DAEMON-106,
        DAEMON-110, DAEMON-112, DAEMON-113, DAEMON-114, DAEMON-115, DAEMON-116,
-       DAEMON-117, DAEMON-118, DAEMON-119, DAEMON-120, DAEMON-121, DAEMON-123, 
+       DAEMON-117, DAEMON-118, DAEMON-119, DAEMON-120, DAEMON-121, DAEMON-123,
        DAEMON-124, DAEMON-125, DAEMON-126, DAEMON-129, DAEMON-130, DAEMON-132,
        DAEMON-133
 
+1.0.1: 304310,  30177, 27523, 29465, 31614, 33580, 31613, 34851.
+
diff --git a/build.xml b/build.xml
index 8d0648f..0f667b9 100644
--- a/build.xml
+++ b/build.xml
@@ -19,7 +19,7 @@
 
 <!--
         "Daemon" component of the Apache Commons Subproject
-        $Id: build.xml 911319 2010-02-18 10:44:16Z mturk $
+        $Id: build.xml 980661 2010-07-30 06:47:02Z mturk $
 -->
 
 
@@ -59,7 +59,7 @@
   <property name="component.title"         value="Java Daemons"/>
 
   <!-- The current version number of this component -->
-  <property name="component.version"       value="1.0.2"/>
+  <property name="component.version"       value="1.0.3"/>
 
   <!-- The base directory for compilation targets -->
   <property name="build.home"              value="target"/>
@@ -82,10 +82,10 @@
   <!-- The pattern to be used to grab ant jars (usefull for non standard layout)  -->
   <property name="ant.jars.pattern"        value="*.jar"/>
 
-  <!-- Name of the native arctifacts  -->
+  <!-- Name of the native artifacts  -->
   <property name="native.name"             value="commons-${component.name}-${component.version}-native-src"/>
 
-  <!-- Path of the native arctifacts  -->
+  <!-- Path of the native artifacts  -->
   <property name="native.path"             value="${dist.home}/bin/native/${native.name}"/>
 
 
@@ -177,7 +177,7 @@
     <javac  srcdir="${test.home}"
            destdir="${build.home}/tests"
              debug="${compile.debug}"
-            source="${compile.source}" 
+            source="${compile.source}"
             target="${compile.target}"
        deprecation="${compile.deprecation}"
           optimize="${compile.optimize}">
@@ -290,7 +290,7 @@
             <attribute name="Specification-Version" value="${component.version}"/>
             <attribute name="Specification-Vendor" value="Apache Software Foundation"/>
             <attribute name="Implementation-Title" value="Commons Daemon"/>
-            <attribute name="Implementation-Version" value="${component.version}"/> 
+            <attribute name="Implementation-Version" value="${component.version}"/>
             <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
             <attribute name="Implementation-Vendor-Id" value="org.apache"/>
             <attribute name="X-Compile-Source-JDK" value="${compile.source}"/>
diff --git a/pom.xml b/pom.xml
index 4311ece..906fe6b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,12 +22,12 @@
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
-    <version>12</version>
+    <version>17</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
-  <groupId>commons-daemon</groupId>
+  <groupId>org.apache.commons</groupId>
   <artifactId>commons-daemon</artifactId>
-  <version>1.0.2</version>
+  <version>1.0.3</version>
   <name>Commons Daemon</name>
   <!-- Daemon started in Commons in 2002 with an import of code from Tomcat,
        which is why the NOTICE file has an earlier date than the inceptionYear -->
@@ -92,7 +92,7 @@
     <maven.compile.source>1.3</maven.compile.source>
     <maven.compile.target>1.3</maven.compile.target>
     <commons.componentid>daemon</commons.componentid>
-    <commons.release.version>1.0.2</commons.release.version>
+    <commons.release.version>1.0.3</commons.release.version>
     <commons.jira.id>DAEMON</commons.jira.id>
     <commons.jira.pid>12310468</commons.jira.pid>
   </properties> 
diff --git a/src/assembly/native-src.xml b/src/assembly/native-src.xml
index 1ec9bca..5a5b204 100644
--- a/src/assembly/native-src.xml
+++ b/src/assembly/native-src.xml
@@ -27,6 +27,8 @@
                 <include>LICENSE.txt</include>
                 <include>NOTICE.txt</include>
                 <include>RELEASE-NOTES.txt</include>
+                <!-- Includes build instructions -->
+                <include>README</include>
             </includes>
         </fileSet>
         <fileSet>
@@ -34,8 +36,11 @@
             <outputDirectory>unix</outputDirectory>
             <lineEnding>lf</lineEnding>
             <excludes>
-                <exclude>**/*.sh</exclude>
+                <exclude>**/*.sh</exclude> <!-- Excluded here, because processed below -->
                 <exclude>configure</exclude>
+                <exclude>autom4te.cache/**</exclude>
+                <!-- Bug http://jira.codehaus.org/browse/MASSEMBLY-462 -->
+                <exclude>**/*.formatted</exclude>
             </excludes>
         </fileSet>
         <fileSet>
@@ -55,6 +60,9 @@
             <excludes>
                 <exclude>**/*.ico</exclude>
                 <exclude>**/*.bmp</exclude>
+                <exclude>**/*.rc</exclude>
+                <!-- Bug http://jira.codehaus.org/browse/MASSEMBLY-462 -->
+                <exclude>**/*.formatted</exclude>
             </excludes>
             <fileMode>664</fileMode>
         </fileSet>
@@ -64,6 +72,7 @@
             <includes>
                 <include>**/*.ico</include>
                 <include>**/*.bmp</include>
+                <include>**/*.rc</include>
             </includes>
             <fileMode>664</fileMode>
         </fileSet>
diff --git a/src/assembly/src.xml b/src/assembly/src.xml
index ebb01b6..622c532 100644
--- a/src/assembly/src.xml
+++ b/src/assembly/src.xml
@@ -36,6 +36,28 @@
         </fileSet>
         <fileSet>
             <directory>src</directory>
+            <excludes>
+                <exclude>**/*.sh</exclude>
+                <exclude>native/unix/configure</exclude>
+                <exclude>native/unix/autom4te.cache/**</exclude>
+                <exclude>native/nt/**</exclude>
+                <exclude>media/**</exclude>
+                <exclude>site/**</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>src</directory>
+            <includes>
+                <include>native/nt/procrun/**</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src</directory>
+            <fileMode>775</fileMode>
+            <includes>
+                <include>**/*.sh</include>
+                <include>native/unix/configure</include>
+            </includes>
         </fileSet>
     </fileSets>
 </assembly>
diff --git a/src/java/org/apache/commons/daemon/Daemon.java b/src/java/org/apache/commons/daemon/Daemon.java
index a82ef44..8f40fe4 100644
--- a/src/java/org/apache/commons/daemon/Daemon.java
+++ b/src/java/org/apache/commons/daemon/Daemon.java
@@ -19,9 +19,9 @@ package org.apache.commons.daemon;
 
 /**
  * This interface provides support for native daemon invocation. Using
- * a platform dependant helper program classes that implement the
+ * a platform dependant helper program, classes that implement the
  * <code>Daemon</code> interface can be initialized, started and
- * stopped according to the convensions of the underlying operating
+ * stopped according to the conventions of the underlying operating
  * system.
  * <p>
  * Implementors of this interface must also provide a public constructor
@@ -29,9 +29,10 @@ package org.apache.commons.daemon;
  * fashion.
  * </p>
  * @author Pier Fumagalli
- * @version 1.0 <i>(CVS $Revision: 557416 $)</i>
+ * @version 1.0 <i>(CVS $Revision: 925054 $)</i>
  */
-public interface Daemon {
+public interface Daemon
+{
 
     /**
      * Initialize this <code>Daemon</code> instance.
@@ -62,12 +63,12 @@ public interface Daemon {
      *
      * @param context A <code>DaemonContext</code> object used to
      * communicate with the container.
-     * 
+     *
      * @exception Exception Any exception preventing a successful
      *                      initialization.
      */
     public void init(DaemonContext context)
-    throws Exception;
+        throws Exception;
 
     /**
      * Start the operation of this <code>Daemon</code> instance. This
@@ -79,7 +80,7 @@ public interface Daemon {
      * the stop()-method.
      */
     public void start()
-    throws Exception;
+        throws Exception;
 
     /**
      * Stop the operation of this <code>Daemon</code> instance. Note
@@ -89,7 +90,7 @@ public interface Daemon {
      * stop().
      */
     public void stop()
-    throws Exception;
+        throws Exception;
 
     /**
      * Free any resources allocated by this daemon such as file
@@ -100,3 +101,4 @@ public interface Daemon {
      */
     public void destroy();
 }
+
diff --git a/src/java/org/apache/commons/daemon/DaemonContext.java b/src/java/org/apache/commons/daemon/DaemonContext.java
index ddc1b89..1679a3b 100644
--- a/src/java/org/apache/commons/daemon/DaemonContext.java
+++ b/src/java/org/apache/commons/daemon/DaemonContext.java
@@ -23,9 +23,10 @@ package org.apache.commons.daemon;
  * communicate with the Daemon container.
  *
  * @author Pier Fumagalli
- * @version 1.0 <i>(CVS $Revision: 480475 $)</i>
+ * @version 1.0 <i>(SVN $Revision: 923123 $)</i>
  */
-public interface DaemonContext {
+public interface DaemonContext
+{
 
     /**
      * Returns  <code>DaemonController</code> object that can be used
@@ -43,3 +44,4 @@ public interface DaemonContext {
     public String[] getArguments();
 
 }
+
diff --git a/src/java/org/apache/commons/daemon/DaemonController.java b/src/java/org/apache/commons/daemon/DaemonController.java
index 72b16ba..e6e0ae5 100644
--- a/src/java/org/apache/commons/daemon/DaemonController.java
+++ b/src/java/org/apache/commons/daemon/DaemonController.java
@@ -19,46 +19,49 @@ package org.apache.commons.daemon;
 
 
 /**
- *
+ * Interface which defines methods needed by the DaemonLoader.
+ * 
  * @author Pier Fumagalli
- * @version 1.0 <i>(CVS $Revision: 480475 $)</i>
+ * @version 1.0 <i>(SVN $Revision: 925054 $)</i>
  */
-public interface DaemonController {
+public interface DaemonController
+{
 
     /**
-     *
+     * Shutdown the daemon.     
      */
     public void shutdown()
-    throws IllegalStateException;
+        throws IllegalStateException;
 
     /**
-     *
+     * Reload daemon
      */
     public void reload()
-    throws IllegalStateException;
+        throws IllegalStateException;
 
     /**
-     *
+     * Shudown daemon and log failed message.
      */
     public void fail()
-    throws IllegalStateException;
+        throws IllegalStateException;
 
     /**
-     *
+     * Shudown daemon and log failed message.
      */
     public void fail(String message)
-    throws IllegalStateException;
+        throws IllegalStateException;
 
     /**
-     *
+     * Shudown daemon and log failed message.
      */
     public void fail(Exception exception)
-    throws IllegalStateException;
+        throws IllegalStateException;
 
     /**
-     *
+     * Shudown daemon and log failed message.
      */
     public void fail(String message, Exception exception)
-    throws IllegalStateException;
+        throws IllegalStateException;
 
 }
+
diff --git a/src/java/org/apache/commons/daemon/DaemonListener.java b/src/java/org/apache/commons/daemon/DaemonListener.java
index 2439bac..6fa38de 100644
--- a/src/java/org/apache/commons/daemon/DaemonListener.java
+++ b/src/java/org/apache/commons/daemon/DaemonListener.java
@@ -19,7 +19,12 @@ package org.apache.commons.daemon;
 
 import java.util.EventListener;
 
-public interface DaemonListener extends EventListener {
+/**
+ * EvenListener type wrapper.
+ * @version 1.0 <i>(SVN $Revision: 923123 $)</i>
+ */
+public interface DaemonListener extends EventListener
+{
 
 }
 
diff --git a/src/java/org/apache/commons/daemon/DaemonPermission.java b/src/java/org/apache/commons/daemon/DaemonPermission.java
index 4b27b40..c3531b9 100644
--- a/src/java/org/apache/commons/daemon/DaemonPermission.java
+++ b/src/java/org/apache/commons/daemon/DaemonPermission.java
@@ -83,12 +83,14 @@ import java.util.StringTokenizer;
  * </p>
  *
  * @author Pier Fumagalli
- * @version 1.0 <i>(CVS $Revision: 480475 $)</i>
+ * @version 1.0 <i>(SVN $Revision: 937348 $)</i>
  */
-public final class DaemonPermission extends Permission {
+public final class DaemonPermission extends Permission
+{
 
-    /* ==================================================================== */
-    /* Constants. */
+    /* ====================================================================
+     * Constants.
+     */
 
     /**
      * The target name when associated with control actions
@@ -155,8 +157,9 @@ public final class DaemonPermission extends Permission {
      */
     protected static final String WILDCARD = "*";
 
-    /* ==================================================================== */
-    /* Instance variables */
+    /* ====================================================================
+     * Instance variables
+     */
 
     /** The type of this permission object. */
     private transient int type = 0;
@@ -165,8 +168,9 @@ public final class DaemonPermission extends Permission {
     /** The String representation of this permission object. */
     private transient String desc = null;
 
-    /* ==================================================================== */
-    /* Constructors */
+    /* ====================================================================
+     * Constructors
+     */
 
     /**
      * Create a new <code>DaemonPermission</code> instance with a specified
@@ -179,24 +183,25 @@ public final class DaemonPermission extends Permission {
      * @exception IllegalArgumentException If the specified target name is not
      *                supported.
      */
-    public DaemonPermission (String target)
-    throws IllegalArgumentException {
+    public DaemonPermission(String target)
+        throws IllegalArgumentException
+    {
         // Setup the target name of this permission object.
         super(target);
 
         // Check if the permission target name was specified
-        if (target==null)
+        if (target == null)
             throw new IllegalArgumentException("Null permission name");
 
         // Check if this is a "control" permission and set up accordingly.
         if (CONTROL.equalsIgnoreCase(target)) {
-            type=TYPE_CONTROL;
+            type = TYPE_CONTROL;
             return;
         }
 
         // If we got here, we have an invalid permission name.
-        throw new IllegalArgumentException("Invalid permission name \""+
-                                           target+"\" specified");
+        throw new IllegalArgumentException("Invalid permission name \"" +
+                                           target + "\" specified");
     }
 
     /**
@@ -212,19 +217,21 @@ public final class DaemonPermission extends Permission {
      *                invalid value.
      */
     public DaemonPermission(String target, String actions)
-    throws IllegalArgumentException {
+        throws IllegalArgumentException
+    {
         // Setup this instance's target name.
         this(target);
 
         // Create the appropriate mask if this is a control permission.
-        if (this.type==TYPE_CONTROL) {
-            this.mask=this.createControlMask(actions);
+        if (this.type == TYPE_CONTROL) {
+            this.mask = this.createControlMask(actions);
             return;
         }
     }
 
-    /* ==================================================================== */
-    /* Public methods */
+    /* ====================================================================
+     * Public methods
+     */
 
     /**
      * Return the list of actions permitted by this instance of
@@ -232,11 +239,12 @@ public final class DaemonPermission extends Permission {
      *
      * @return The canonicalized list of actions.
      */
-    public String getActions() {
-        if (this.type==TYPE_CONTROL) {
-            return(this.createControlActions(this.mask));
+    public String getActions()
+    {
+        if (this.type == TYPE_CONTROL) {
+            return this.createControlActions(this.mask);
         }
-        return("");
+        return "";
     }
 
     /**
@@ -244,9 +252,10 @@ public final class DaemonPermission extends Permission {
      *
      * @return An hash code value.
      */
-    public int hashCode() {
+    public int hashCode()
+    {
         this.setupDescription();
-        return(this.desc.hashCode());
+        return this.desc.hashCode();
     }
 
     /**
@@ -255,15 +264,19 @@ public final class DaemonPermission extends Permission {
      * @return <b>true</b> or <b>false</b> wether the specified object equals
      *         this <code>DaemonPermission</code> instance or not.
      */
-    public boolean equals(Object object) {
-        if (object == this) return(true);
+    public boolean equals(Object object)
+    {
+        if (object == this)
+            return true;
 
-        if (!(object instanceof DaemonPermission)) return false;
+        if (!(object instanceof DaemonPermission))
+            return false;
 
-        DaemonPermission that = (DaemonPermission)object;
+        DaemonPermission that = (DaemonPermission) object;
 
-        if (this.type!=that.type) return(false);
-        return(this.mask==that.mask);
+        if (this.type != that.type)
+            return false;
+        return this.mask == that.mask;
     }
 
     /**
@@ -274,15 +287,19 @@ public final class DaemonPermission extends Permission {
      *         is implied by this <code>DaemonPermission</code> instance or
      *         not.
      */
-    public boolean implies(Permission permission) {
-        if (permission == this) return(true);
+    public boolean implies(Permission permission)
+    {
+        if (permission == this)
+            return true;
 
-        if (!(permission instanceof DaemonPermission)) return false;
+        if (!(permission instanceof DaemonPermission))
+            return false;
 
-        DaemonPermission that = (DaemonPermission)permission;
+        DaemonPermission that = (DaemonPermission) permission;
 
-        if (this.type!=that.type) return(false);
-        return((this.mask&that.mask)==that.mask);
+        if (this.type != that.type)
+            return false;
+        return (this.mask & that.mask) == that.mask;
     }
 
     /**
@@ -291,95 +308,115 @@ public final class DaemonPermission extends Permission {
      * @return A <code>String</code> representing this
      *         <code>DaemonPermission</code> instance.
      */
-    public String toString() {
+    public String toString()
+    {
         this.setupDescription();
-        return(new String(this.desc));
+        return this.desc;
     }
 
-    /* ==================================================================== */
-    /* Private methods */
+    /* ====================================================================
+     * Private methods
+     */
 
-    /** Create a String description for this permission instance. */
-    private void setupDescription() {
-        if (this.desc!=null) return;
+    /** Create a String description for this permission instance.
+     */
+    private void setupDescription()
+    {
+        if (this.desc != null)
+            return;
 
-        StringBuffer buf=new StringBuffer();
+        StringBuffer buf = new StringBuffer();
         buf.append(this.getClass().getName());
         buf.append('[');
         switch (this.type) {
-            case (TYPE_CONTROL): {
+            case TYPE_CONTROL:
                 buf.append(CONTROL);
-                break;
-            }
-            default: {
+            break;
+            default:
                 buf.append("UNKNOWN");
-                break;
-            }
+            break;
         }
         buf.append(':');
         buf.append(this.getActions());
         buf.append(']');
 
-        this.desc=buf.toString();
+        this.desc = buf.toString();
     }
 
-    /** Create a permission mask for a given control actions string. */
+    /** Create a permission mask for a given control actions string.
+     */
     private int createControlMask(String actions)
-    throws IllegalArgumentException {
-        if (actions==null) return(0);
+        throws IllegalArgumentException
+    {
+        if (actions == null)
+            return 0;
+
+        int mask = 0;
+        StringTokenizer tok = new StringTokenizer(actions, ",", false);
 
-        int mask=0;
-        StringTokenizer tok=new StringTokenizer(actions,",",false);
         while (tok.hasMoreTokens()) {
-            String val=tok.nextToken().trim();
+            String val = tok.nextToken().trim();
 
             if (WILDCARD.equals(val)) {
-                return(MASK_CONTROL_START|MASK_CONTROL_STOP|
-                       MASK_CONTROL_SHUTDOWN|MASK_CONTROL_RELOAD);
-            } else if (CONTROL_START.equalsIgnoreCase(val)) {
-                mask=mask|MASK_CONTROL_START;
-            } else if (CONTROL_STOP.equalsIgnoreCase(val)) {
-                mask=mask|MASK_CONTROL_STOP;
-            } else if (CONTROL_SHUTDOWN.equalsIgnoreCase(val)) {
-                mask=mask|MASK_CONTROL_SHUTDOWN;
-            } else if (CONTROL_RELOAD.equalsIgnoreCase(val)) {
-                mask=mask|MASK_CONTROL_RELOAD;
-            } else {
-                throw new IllegalArgumentException("Invalid action name \""+
-                                                   val+"\" specified");
+                return MASK_CONTROL_START | MASK_CONTROL_STOP |
+                       MASK_CONTROL_SHUTDOWN | MASK_CONTROL_RELOAD;
+            }
+            else if (CONTROL_START.equalsIgnoreCase(val)) {
+                mask = mask | MASK_CONTROL_START;
+            }
+            else if (CONTROL_STOP.equalsIgnoreCase(val)) {
+                mask = mask | MASK_CONTROL_STOP;
+            }
+            else if (CONTROL_SHUTDOWN.equalsIgnoreCase(val)) {
+                mask = mask | MASK_CONTROL_SHUTDOWN;
+            }
+            else if (CONTROL_RELOAD.equalsIgnoreCase(val)) {
+                mask = mask | MASK_CONTROL_RELOAD;
+            }
+            else {
+                throw new IllegalArgumentException("Invalid action name \"" +
+                                                   val + "\" specified");
             }
         }
-        return(mask);
+        return mask;
     }
 
     /** Create a actions list for a given control permission mask. */
-    private String createControlActions(int mask) {
-        StringBuffer buf=new StringBuffer();
-        boolean sep=false;
+    private String createControlActions(int mask)
+    {
+        StringBuffer buf = new StringBuffer();
+        boolean sep = false;
 
-        if ((mask&MASK_CONTROL_START)==MASK_CONTROL_START) {
-            sep=true;
+        if ((mask & MASK_CONTROL_START) == MASK_CONTROL_START) {
+            sep = true;
             buf.append(CONTROL_START);
         }
 
-        if ((mask&MASK_CONTROL_STOP)==MASK_CONTROL_STOP) {
-            if (sep) buf.append(",");
-            else sep=true;
+        if ((mask & MASK_CONTROL_STOP) == MASK_CONTROL_STOP) {
+            if (sep)
+                buf.append(",");
+            else
+                sep = true;
             buf.append(CONTROL_STOP);
         }
 
-        if ((mask&MASK_CONTROL_SHUTDOWN)==MASK_CONTROL_SHUTDOWN) {
-            if (sep) buf.append(",");
-            else sep=true;
+        if ((mask & MASK_CONTROL_SHUTDOWN) == MASK_CONTROL_SHUTDOWN) {
+            if (sep)
+                buf.append(",");
+            else
+                sep = true;
             buf.append(CONTROL_SHUTDOWN);
         }
 
-        if ((mask&MASK_CONTROL_RELOAD)==MASK_CONTROL_RELOAD) {
-            if (sep) buf.append(",");
-            else sep=true;
+        if ((mask & MASK_CONTROL_RELOAD) == MASK_CONTROL_RELOAD) {
+            if (sep)
+                buf.append(",");
+            else
+                sep = true;
             buf.append(CONTROL_RELOAD);
         }
 
         return buf.toString();
     }
 }
+
diff --git a/src/java/org/apache/commons/daemon/support/DaemonLoader.java b/src/java/org/apache/commons/daemon/support/DaemonLoader.java
index bc9144d..38a491a 100644
--- a/src/java/org/apache/commons/daemon/support/DaemonLoader.java
+++ b/src/java/org/apache/commons/daemon/support/DaemonLoader.java
@@ -15,8 +15,6 @@
  *  limitations under the License.
  */
 
-/* @version $Id: DaemonLoader.java 912665 2010-02-22 17:16:00Z sebb $ */
-
 package org.apache.commons.daemon.support;
 
 import org.apache.commons.daemon.DaemonContext;
@@ -24,252 +22,283 @@ import org.apache.commons.daemon.DaemonController;
 
 import java.lang.reflect.Method;
 
-public final class DaemonLoader {
+/*
+ * Used by jsvc for Daemon management.
+ *
+ * @version 1.0 <i>(SVN $Revision: 925053 $)</i>
+ */
+public final class DaemonLoader
+{
 
-    private static Controller controller = null;
-    private static Context context = null;
-    private static Object daemon = null;
+    // N.B. These static mutable variables need to be accessed using synch.
+    private static Controller controller = null; //@GuardedBy("this")
+    private static Object daemon    = null; //@GuardedBy("this")
     /* Methods to call */
-    private static Method init = null;
-    private static Method start = null;
-    private static Method stop = null;
-    private static Method destroy = null;
-
-    public static void version() {
-        System.err.println("java version \""+
-                           System.getProperty("java.version")+
-                           "\"");
-        System.err.println(System.getProperty("java.runtime.name")+
-                           " (build "+
-                           System.getProperty("java.runtime.version")+
-                           ")");
-        System.err.println(System.getProperty("java.vm.name")+
-                           " (build "+
-                           System.getProperty("java.vm.version")+
-                           ", "+
-                           System.getProperty("java.vm.info")+
-                           ")");
+    private static Method init      = null; //@GuardedBy("this")
+    private static Method start     = null; //@GuardedBy("this")
+    private static Method stop      = null; //@GuardedBy("this")
+    private static Method destroy   = null; //@GuardedBy("this")
+
+    public static void version()
+    {
+        System.err.println("java version \"" +
+                           System.getProperty("java.version") + "\"");
+        System.err.println(System.getProperty("java.runtime.name") +
+                           " (build " +
+                           System.getProperty("java.runtime.version") + ")");
+        System.err.println(System.getProperty("java.vm.name") +
+                           " (build " +
+                           System.getProperty("java.vm.version") +
+                           ", " + System.getProperty("java.vm.info") + ")");
     }
 
-    public static boolean check(String cn) {
+    public static boolean check(String cn)
+    {
         try {
             /* Check the class name */
-            if (cn==null)
+            if (cn == null)
                 throw new NullPointerException("Null class name specified");
 
             /* Get the ClassLoader loading this class */
-            ClassLoader cl=DaemonLoader.class.getClassLoader();
-            if (cl==null) {
+            ClassLoader cl = DaemonLoader.class.getClassLoader();
+            if (cl == null) {
                 System.err.println("Cannot retrieve ClassLoader instance");
-                return(false);
+                return false;
             }
 
             /* Find the required class */
-            Class c=cl.loadClass(cn);
+            Class c = cl.loadClass(cn);
 
             /* This should _never_ happen, but doublechecking doesn't harm */
-            if (c==null) throw new ClassNotFoundException(cn);
+            if (c == null)
+                throw new ClassNotFoundException(cn);
 
             /* Create a new instance of the daemon */
-            Object s=c.newInstance();
+            c.newInstance();
 
         } catch (Throwable t) {
             /* In case we encounter ANY error, we dump the stack trace and
-               return false (load, start and stop won't be called). */
+             * return false (load, start and stop won't be called).
+             */
             t.printStackTrace(System.err);
-            return(false);
+            return false;
         }
-        /* The class was loaded and instantiated correctly, we can return */
-        return(true);
+        /* The class was loaded and instantiated correctly, we can return
+         */
+        return true;
     }
 
-    public static boolean load(String cn, String ar[]) {
+    public static boolean load(String cn, String ar[])
+    {
         try {
             /* Make sure any previous instance is garbage collected */
             System.gc();
 
             /* Check if the underlying libray supplied a valid list of
                arguments */
-            if (ar==null) ar=new String[0];
+            if (ar == null)
+                ar = new String[0];
 
             /* Check the class name */
-            if (cn==null)
+            if (cn == null)
                 throw new NullPointerException("Null class name specified");
 
             /* Get the ClassLoader loading this class */
-            ClassLoader cl=DaemonLoader.class.getClassLoader();
-            if (cl==null) {
+            ClassLoader cl = DaemonLoader.class.getClassLoader();
+            if (cl == null) {
                 System.err.println("Cannot retrieve ClassLoader instance");
-                return(false);
+                return false;
             }
 
             /* Find the required class */
-            Class c=cl.loadClass(cn);
+            Class c = cl.loadClass(cn);
 
             /* This should _never_ happen, but doublechecking doesn't harm */
-            if (c==null) throw new ClassNotFoundException(cn);
+            if (c == null)
+                throw new ClassNotFoundException(cn);
 
             /* Check interface */
             boolean isdaemon = false;
             try {
-              Class dclass = cl.loadClass("org.apache.commons.daemon.Daemon");
-              isdaemon = dclass.isAssignableFrom(c);
-            } catch(Exception cnfex) {
-              // Swallow if Daemon not found.
+                Class dclass =
+                    cl.loadClass("org.apache.commons.daemon.Daemon");
+                isdaemon = dclass.isAssignableFrom(c);
+            } catch (Exception cnfex) {
+                // Swallow if Daemon not found.
             }
 
             /* Check methods */
-            Class[] myclass = new Class[1];
+            Class[]myclass = new Class[1];
             if (isdaemon) {
-              myclass[0] = DaemonContext.class;
-            } else {
-              myclass[0] = ar.getClass();
+                myclass[0] = DaemonContext.class;
+            }
+            else {
+                myclass[0] = ar.getClass();
             }
 
-            init = c.getMethod("init",myclass);
+            init    = c.getMethod("init", myclass);
 
             myclass = null;
-            start = c.getMethod("start",myclass);
-
-            stop = c.getMethod("stop",myclass);
-
-            destroy = c.getMethod("destroy",myclass);
+            start   = c.getMethod("start", myclass);
+            stop    = c.getMethod("stop", myclass);
+            destroy = c.getMethod("destroy", myclass);
 
             /* Create a new instance of the daemon */
-            daemon=c.newInstance();
+            daemon = c.newInstance();
 
             if (isdaemon) {
-              /* Create a new controller instance */
-              controller=new Controller();
-
-              /* Set the availability flag in the controller */
-              controller.setAvailable(false);
-
-              /* Create context */
-              context = new Context();
-              context.setArguments(ar);
-              context.setController(controller);
-
-              /* Now we want to call the init method in the class */
-              Object arg[] = new Object[1];
-              arg[0] = context;
-              init.invoke(daemon,arg);
-            } else {
-              Object arg[] = new Object[1];
-              arg[0] = ar;
-              init.invoke(daemon,arg);
+                /* Create a new controller instance */
+                controller = new Controller();
+
+                /* Set the availability flag in the controller */
+                controller.setAvailable(false);
+
+                /* Create context */
+                Context context = new Context();
+                context.setArguments(ar);
+                context.setController(controller);
+
+                /* Now we want to call the init method in the class */
+                Object arg[] = new Object[1];
+                arg[0] = context;
+                init.invoke(daemon, arg);
+            }
+            else {
+                Object arg[] = new Object[1];
+                arg[0] = ar;
+                init.invoke(daemon, arg);
             }
 
         } catch (Throwable t) {
             /* In case we encounter ANY error, we dump the stack trace and
-               return false (load, start and stop won't be called). */
+             * return false (load, start and stop won't be called).
+             */
             t.printStackTrace(System.err);
-            return(false);
+            return false;
         }
         /* The class was loaded and instantiated correctly, we can return */
-        return(true);
+        return true;
     }
 
-    public static boolean start() {
+    public static boolean start()
+    {
         try {
             /* Attempt to start the daemon */
             Object arg[] = null;
-            start.invoke(daemon,arg);
+            start.invoke(daemon, arg);
 
             /* Set the availability flag in the controller */
             if (controller != null)
-              controller.setAvailable(true);
+                controller.setAvailable(true);
 
         } catch (Throwable t) {
             /* In case we encounter ANY error, we dump the stack trace and
-               return false (load, start and stop won't be called). */
+             * return false (load, start and stop won't be called).
+             */
             t.printStackTrace(System.err);
-            return(false);
+            return false;
         }
-        return(true);
+        return true;
     }
 
-    public static boolean stop() {
+    public static boolean stop()
+    {
         try {
             /* Set the availability flag in the controller */
             if (controller != null)
-              controller.setAvailable(false);
+                controller.setAvailable(false);
 
             /* Attempt to stop the daemon */
             Object arg[] = null;
-            stop.invoke(daemon,arg);
+            stop.invoke(daemon, arg);
 
             /* Run garbage collector */
             System.gc();
 
-        } catch (Throwable t) {
+        }
+        catch (Throwable t) {
             /* In case we encounter ANY error, we dump the stack trace and
-               return false (load, start and stop won't be called). */
+             * return false (load, start and stop won't be called).
+             */
             t.printStackTrace(System.err);
-            return(false);
+            return false;
         }
-        return(true);
+        return true;
     }
 
-    public static boolean destroy() {
+    public static boolean destroy()
+    {
         try {
             /* Attempt to stop the daemon */
             Object arg[] = null;
-            destroy.invoke(daemon,arg);
+            destroy.invoke(daemon, arg);
 
             /* Run garbage collector */
-            daemon=null;
-            controller=null;
+            daemon = null;
+            controller = null;
             System.gc();
 
         } catch (Throwable t) {
             /* In case we encounter ANY error, we dump the stack trace and
-               return false (load, start and stop won't be called). */
+             * return false (load, start and stop won't be called).
+             */
             t.printStackTrace(System.err);
-            return(false);
+            return false;
         }
-        return(true);
+        return true;
     }
 
     private static native void shutdown(boolean reload);
+    private static native void failed(String message);
 
-    public static class Controller implements DaemonController {
+    public static class Controller
+        implements DaemonController
+    {
 
-        boolean available=false;
+        private boolean available = false;
 
-        private Controller() {
+        private Controller()
+        {
             super();
             this.setAvailable(false);
         }
 
-        private boolean isAvailable() {
+        private boolean isAvailable()
+        {
             synchronized (this) {
-                return(this.available);
+                return this.available;
             }
         }
 
-        private void setAvailable(boolean available) {
+        private void setAvailable(boolean available)
+        {
             synchronized (this) {
-                this.available=available;
+                this.available = available;
             }
         }
 
-        public void shutdown() throws IllegalStateException {
+        public void shutdown()
+            throws IllegalStateException
+        {
             synchronized (this) {
                 if (!this.isAvailable()) {
                     throw new IllegalStateException();
-                } else {
+                }
+                else {
                     this.setAvailable(false);
                     DaemonLoader.shutdown(false);
                 }
             }
         }
 
-        public void reload() throws IllegalStateException {
+        public void reload()
+            throws IllegalStateException
+        {
             synchronized (this) {
                 if (!this.isAvailable()) {
                     throw new IllegalStateException();
-                } else {
+                }
+                else {
                     this.setAvailable(false);
                     DaemonLoader.shutdown(true);
                 }
@@ -277,45 +306,74 @@ public final class DaemonLoader {
         }
 
         public void fail()
-            throws IllegalStateException {
+            throws IllegalStateException
+        {
+            fail(null, null);
         }
 
         public void fail(String message)
-            throws IllegalStateException {
+            throws IllegalStateException
+        {
+            fail(message, null);
         }
 
         public void fail(Exception exception)
-            throws IllegalStateException {
+            throws IllegalStateException
+        {
+            fail(null, exception);
         }
 
         public void fail(String message, Exception exception)
-            throws IllegalStateException {
+            throws IllegalStateException
+        {
+            synchronized (this) {
+                if (!this.isAvailable()) {
+                    throw new IllegalStateException();
+                }
+                else {
+                    this.setAvailable(false);
+                    String msg = message;
+                    if (exception != null) {
+                        if (msg != null)
+                            msg = msg + ": " + exception.toString();
+                        else
+                            msg = exception.toString();
+                    }
+                    DaemonLoader.failed(msg);
+                }
+            }
         }
 
     }
 
-    public static class Context implements DaemonContext {
+    public static class Context
+        implements DaemonContext
+    {
 
-        DaemonController controller = null;
+        private DaemonController daemonController = null;
 
-        String[] args = null;
+        private String[] args = null;
 
-        public DaemonController getController() {
-            return controller;
+        public DaemonController getController()
+        {
+            return daemonController;
         }
 
-        public void setController(DaemonController controller) {
-            this.controller = controller;
+        public void setController(DaemonController controller)
+        {
+            this.daemonController = controller;
         }
 
-        public String[] getArguments() {
+        public String[] getArguments()
+        {
             return args;
         }
 
-        public void setArguments(String[] args) {
+        public void setArguments(String[]args)
+        {
             this.args = args;
         }
 
     }
-
 }
+
diff --git a/src/media/logo.xcf b/src/media/logo.xcf
deleted file mode 100644
index a19d1c9..0000000
Binary files a/src/media/logo.xcf and /dev/null differ
diff --git a/src/native/nt/Makefile b/src/native/nt/Makefile
deleted file mode 100644
index cbf7897..0000000
--- a/src/native/nt/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-all:
-	(cd service; make)
-	(cd moni; make)
-clean:
-	(cd service; make clean)
-	(cd moni; make clean)
diff --git a/src/native/nt/README b/src/native/nt/README
deleted file mode 100644
index e7209f9..0000000
--- a/src/native/nt/README
+++ /dev/null
@@ -1,68 +0,0 @@
-(Please have a look to procrun (subdirectory), procrun is
-probably what you have to use).
-
-Note: MAKE SURE you first build the java part (using ant) otherwise the dist
-directory is not created).
-
-To build the service utilities for windows you will need:
-- MS Visual C++ (I have used version 5.0).
-- CYGWIN to build the jsvc.exe.
-- A Java Platform 2 compliant SDK to run the service.
-
-Structure of the utilies:
-- bin: exe files.
-- executables/vdmoniadm: project files for the desktop program.
-- executables/vdmonisvc: project files for the sevice wrapper.
-- lib: contains the common include file.
-- moni: contains sources of the vdmoniadm and vdmonisvc.
-- service: contains the sources and the project for the test installer.
-- signals: contains the kill() emulation logic.
-- supcalls_nt: contains the environment emulation logic.
-
-How to use it:
-1 - Build the jsvc.exe (See jakarta-tomcat-4.0/service).
-  It produces:
-  - service.jar
-  - jsvc.exe
-
-2- Create the following directories:
-  c:\home\jakarta\bin
-  c:\home\jakarta\lib
-
-3 - Copy
-  From jakarta-tomcat-4.0/service:
-  service.jar to lib
-  jsvc.exe to bin
-  From winnt:
-  INSTSVC.exe to bin
-  vdmoniadm.exe to bin
-  vdmonisvc to bin.
-
-4 - In a MSDOS windows run INSTSVC
-  It creates all informations to start the service.
-    The service is not started automaticly use control_panel+service and
-    and make it automatic after testing it starts and stops correctly.
-
-  It creates the registry values needed for the environment to start jsvc.exe
-    JAKARTA_HOME
-    CYGWIN (You have to set it to your cygwin directory home).
-    JAVA_HOME (You have to set it to your JAVA_HOME directory).
-    HOSTNAME (not yet used)
-    HOSTPORT (not yet used)
-  I use regedit to modify these values.
-
-5 - Using the explorer go to profiles/allusers/program/startup and add a link
-  to vdmoniadm.exe.
-
-6 - Reboot the machine and logon.
-  You should see a "nice" icon in the System Task-bar indicating that the 
-  Java service is running. A right click on the icon calls a small menu.
-  Restart: (not yet implemented).
-  Configure: (not yet implemented).
-  Stop: Stops the java service.
-
-It is still a work in progress and blabla...
-
-Have fun...
-
- Jean-Frederic <jfrederic.clere AT fujitsu-siemens.com>
diff --git a/src/native/nt/executables/vdmoniadm/icon1.ico b/src/native/nt/executables/vdmoniadm/icon1.ico
deleted file mode 100644
index a42536d..0000000
Binary files a/src/native/nt/executables/vdmoniadm/icon1.ico and /dev/null differ
diff --git a/src/native/nt/executables/vdmoniadm/resource.h b/src/native/nt/executables/vdmoniadm/resource.h
deleted file mode 100644
index 66e0d56..0000000
--- a/src/native/nt/executables/vdmoniadm/resource.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* @version $Id: resource.h 480469 2006-11-29 08:22:04Z bayard $ */
-/* Used by vdmoniadm.rc */
-#define NO_ACCESS                       1
-#define NO_ACCESS_MONI                  2
-#define ALREADY_STOP                    3
-#define ERROR_STATUS                    4
-#define ALREADY_START                   5
-#define CANNOT_START                    6
-#define ID_TASKICON                     7
-#define CANNOT_START_VDCOM              7
-#define CANNOT_START_VDCONF             8
-#define ID_STOP_VDMONI                  40002
-#define ID_PROPRETY                     40003
-#define ID_START_VDCOM                  40008
-
-/* Next default values for new objects */
-
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        103
-#define _APS_NEXT_COMMAND_VALUE         40009
-#define _APS_NEXT_CONTROL_VALUE         1000
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/src/native/nt/executables/vdmoniadm/vdmoniadm.dsp b/src/native/nt/executables/vdmoniadm/vdmoniadm.dsp
deleted file mode 100644
index 70d8042..0000000
--- a/src/native/nt/executables/vdmoniadm/vdmoniadm.dsp
+++ /dev/null
@@ -1,121 +0,0 @@
-# Microsoft Developer Studio Project File - Name="vdmoniadm" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=vdmoniadm - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "vdmoniadm.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "vdmoniadm.mak" CFG="vdmoniadm - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "vdmoniadm - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "vdmoniadm - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE 
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "vdmoniadm - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "." /I "../../lib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 oldnames.lib msvcrt.lib kernel32.lib advapi32.lib user32.lib gdi32.lib shell32.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib /out:"../../bin/vdmoniadm.exe"
-
-!ELSEIF  "$(CFG)" == "vdmoniadm - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "." /I "../../lib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 oldnames.lib msvcrt.lib kernel32.lib advapi32.lib user32.lib gdi32.lib shell32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib /out:"../../bin/vdmoniadm.exe" /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "vdmoniadm - Win32 Release"
-# Name "vdmoniadm - Win32 Debug"
-# Begin Group "moni"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\moni\vdmoniadm.c
-# End Source File
-# End Group
-# Begin Group "lib"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\lib\moni_inst.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\icon1.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\vdmoniadm.rc
-
-!IF  "$(CFG)" == "vdmoniadm - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "vdmoniadm - Win32 Debug"
-
-!ENDIF 
-
-# End Source File
-# End Target
-# End Project
diff --git a/src/native/nt/executables/vdmoniadm/vdmoniadm.dsw b/src/native/nt/executables/vdmoniadm/vdmoniadm.dsw
deleted file mode 100644
index c0fdb9b..0000000
--- a/src/native/nt/executables/vdmoniadm/vdmoniadm.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "vdmoniadm"=.\vdmoniadm.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/src/native/nt/executables/vdmoniadm/vdmoniadm.rc b/src/native/nt/executables/vdmoniadm/vdmoniadm.rc
deleted file mode 100644
index 5c4ce70..0000000
--- a/src/native/nt/executables/vdmoniadm/vdmoniadm.rc
+++ /dev/null
@@ -1,344 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// German (Germany) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
-#ifdef _WIN32
-LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-STOPYESNO DIALOG DISCARDABLE  0, 0, 186, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "OnServe-Monitor"
-FONT 8, "MS Sans Serif"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,113,55,50,14
-    PUSHBUTTON      "Abbrechen",IDCANCEL,19,56,50,14
-    LTEXT           "Sind Sie sicher, da� Sie den OnServe-Monitor beenden wollen?",
-                    IDC_STATIC,31,17,120,26
-END
-
-STARTYESNO DIALOG DISCARDABLE  0, 0, 186, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "OnServe-Monitor"
-FONT 8, "MS Sans Serif"
-BEGIN
-    PUSHBUTTON      "Abbrechen",IDCANCEL,71,54,50,14
-    LTEXT           "Der OnServe-Monitor wird gestartet. Bitte warten...",
-                    IDC_STATIC,31,17,120,26
-END
-
-PLEASEWAIT DIALOG DISCARDABLE  0, 0, 186, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "OnServe-Monitor"
-FONT 8, "MS Sans Serif"
-BEGIN
-    PUSHBUTTON      "Abbrechen",IDCANCEL,71,54,50,14
-    LTEXT           "Der OnServe Monitor wird beendet. Bitte warten...",
-                    IDC_STATIC,31,17,120,26
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE 
-BEGIN
-    "STOPYESNO", DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 179
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-
-    "STARTYESNO", DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 179
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-
-    "PLEASEWAIT", DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 179
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-MENU MENU DISCARDABLE 
-BEGIN
-    POPUP "no display"
-    BEGIN
-        MENUITEM "Online-Monitor Kommandos.",   ID_START_VDCOM
-        MENUITEM "OnServe Konfigurieren.",      ID_PROPRETY
-        MENUITEM "Online-Monitor stoppen.",     ID_STOP_VDMONI
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    NO_ACCESS               "Mit dieser Kennung d�rfen Sie OnServe nicht beenden."
-    NO_ACCESS_MONI          "Der Dienst kann nicht erreicht werden!"
-    ALREADY_STOP            "Der OnServe-Monitor ist nicht gestartet."
-    ERROR_STATUS            "Der Zustand des Dienstes kann nicht ermittelt werden."
-    ALREADY_START           "Der OnServe-Monitor ist bereits gestartet."
-    CANNOT_START            "Der OnServe-Monitor kann nicht gestartet werden."
-    CANNOT_START_VDCOM      "Das Kommando-Programm des OnServe-Monitors kann nicht gestartet werden."
-    CANNOT_START_VDCONF     "Das OnServe-Konfigurationsprogramm kann nicht gestartet werden."
-END
-
-#endif    // German (Germany) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-STARTYESNO DIALOG DISCARDABLE  0, 0, 186, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "OnServe Monitor"
-FONT 8, "MS Sans Serif"
-BEGIN
-    PUSHBUTTON      "Cancel",IDCANCEL,71,54,50,14
-    LTEXT           "The OnServe Monitor is being started. Please Wait....",
-                    IDC_STATIC,31,17,120,26
-END
-
-STOPYESNO DIALOG DISCARDABLE  0, 0, 186, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "OnServe Monitor"
-FONT 8, "MS Sans Serif"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,113,55,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,19,56,50,14
-    LTEXT           "Are you sure you want to stop the OnServe Monitor?",
-                    IDC_STATIC,31,17,120,26
-END
-
-PLEASEWAIT DIALOG DISCARDABLE  0, 0, 186, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "OnServe Monitor"
-FONT 8, "MS Sans Serif"
-BEGIN
-    PUSHBUTTON      "Cancel",IDCANCEL,71,54,50,14
-    LTEXT           "The OnServe Monitor is being stopped. Please Wait....",
-                    IDC_STATIC,31,17,120,26
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE 
-BEGIN
-    "STARTYESNO", DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 179
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-
-    "STOPYESNO", DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 179
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-
-    "PLEASEWAIT", DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 179
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-MENU MENU DISCARDABLE 
-BEGIN
-    POPUP "no display"
-    BEGIN
-        MENUITEM "Restart Jakarta service",     ID_START_VDCOM
-        MENUITEM "Configure Jakarta service",   ID_PROPRETY
-        MENUITEM "Stop Jakarta service",        ID_STOP_VDMONI
-    END
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-ONSERVE                 ICON    DISCARDABLE     "icon1.ico"
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904b0"
-        BEGIN
-            VALUE "CompanyName", "Siemens AG\0"
-            VALUE "FileDescription", "OnServe Service Administration..\0"
-            VALUE "FileVersion", "3.0.0.1\0"
-            VALUE "InternalName", "vdmoniadm\0"
-            VALUE "LegalCopyright", "Copyright � 1998-2001, Apache Software Foundation \0"
-            VALUE "OriginalFilename", "vdmonisvc.exe\0"
-            VALUE "ProductName", "OnServe\0"
-            VALUE "ProductVersion", "3.0 A00\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    NO_ACCESS               "Your login does not allow you to stop OnServe."
-    NO_ACCESS_MONI          "Cannot access to the service!"
-    ALREADY_STOP            "OnServe Monitor is not running."
-    ERROR_STATUS            "Cannot get the status of the service."
-    ALREADY_START           "OnServe Monitor is already started."
-    CANNOT_START            "Cannot start the OnServe Monitor."
-    CANNOT_START_VDCOM      "Cannot start the OnServe monitor commands program."
-    CANNOT_START_VDCONF     "Cannot start the OnServe Configuration program."
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
diff --git a/src/native/nt/executables/vdmonisvc/resource.h b/src/native/nt/executables/vdmonisvc/resource.h
deleted file mode 100644
index b253a5c..0000000
--- a/src/native/nt/executables/vdmonisvc/resource.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* @version $Id: resource.h 480469 2006-11-29 08:22:04Z bayard $ */
-/* Used by vdmonisvc.rc */
-
-/* Next default values for new objects */
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        105
-#define _APS_NEXT_COMMAND_VALUE         40001
-#define _APS_NEXT_CONTROL_VALUE         1004
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/src/native/nt/executables/vdmonisvc/vdmonisvc.dsp b/src/native/nt/executables/vdmonisvc/vdmonisvc.dsp
deleted file mode 100644
index b023470..0000000
--- a/src/native/nt/executables/vdmonisvc/vdmonisvc.dsp
+++ /dev/null
@@ -1,122 +0,0 @@
-# Microsoft Developer Studio Project File - Name="vdmonisvc" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=vdmonisvc - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "vdmonisvc.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "vdmonisvc.mak" CFG="vdmonisvc - Win32 Release"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "vdmonisvc - Win32 Release" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE "vdmonisvc - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "vdmonisvc - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\vdmonisvc"
-# PROP BASE Intermediate_Dir ".\vdmonisvc"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../lib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "WINPC" /FR /YX /FD /c
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib gdi32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib msvcrt.lib oldnames.lib /nologo /subsystem:console /machine:I386 /nodefaultlib /out:"../../bin/vdmonisvc.exe"
-
-!ELSEIF  "$(CFG)" == "vdmonisvc - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\CleanSv0"
-# PROP BASE Intermediate_Dir ".\CleanSv0"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "../../lib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "WINPC" /FR /YX /FD /c
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
-# ADD LINK32 user32.lib oldnames.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib msvcrt.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib /out:"../../bin/vdmonisvc.exe"
-
-!ENDIF 
-
-# Begin Target
-
-# Name "vdmonisvc - Win32 Release"
-# Name "vdmonisvc - Win32 Debug"
-# Begin Group "supcalls_nt"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\supcalls_nt\vdenv.c
-# End Source File
-# End Group
-# Begin Group "signals"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\signals\kills.c
-# End Source File
-# End Group
-# Begin Group "moni"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\moni\vdmonisvc.c
-# End Source File
-# End Group
-# Begin Group "moni_nt"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\moni_nt\service.c
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\vdmonisvc.rc
-# End Source File
-# End Target
-# End Project
diff --git a/src/native/nt/executables/vdmonisvc/vdmonisvc.dsw b/src/native/nt/executables/vdmonisvc/vdmonisvc.dsw
deleted file mode 100644
index bf30bea..0000000
--- a/src/native/nt/executables/vdmonisvc/vdmonisvc.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "vdmonisvc"=.\vdmonisvc.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/src/native/nt/executables/vdmonisvc/vdmonisvc.rc b/src/native/nt/executables/vdmonisvc/vdmonisvc.rc
deleted file mode 100644
index dec8783..0000000
--- a/src/native/nt/executables/vdmonisvc/vdmonisvc.rc
+++ /dev/null
@@ -1,105 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904b0"
-        BEGIN
-            VALUE "CompanyName", "Siemens AG\0"
-            VALUE "FileDescription", "OnServe Service application.\0"
-            VALUE "FileVersion", "3.0.0.1\0"
-            VALUE "InternalName", "vdmonisvc\0"
-            VALUE "LegalCopyright", "Copyright � 1998-2001, Apache Software Foundation.\0"
-            VALUE "OriginalFilename", "vdmonisvc.exe\0"
-            VALUE "ProductName", "OnServe\0"
-            VALUE "ProductVersion", "3.0 A00\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
diff --git a/src/native/nt/lib/moni_inst.h b/src/native/nt/lib/moni_inst.h
deleted file mode 100644
index 2d0f740..0000000
--- a/src/native/nt/lib/moni_inst.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/*
- * include for the service installation
- */
-#define SZAPPNAME               "JavaService"
-#define SZSERVICENAME           "jsvc" // name of service
-#define SZDEPENDENCIES          ""
-#define SZSERVICEDISPLAYNAME    "Java Service" // name to display
-#define SZKEY_ONSERVE           "SOFTWARE\\apache\\jakarta\\1.0"
-#define SZKEY_ONSERVEARG        "SOFTWARE\\apache\\jakarta\\1.0\\arguments"
-#define SZKEY_F_DIR             "F_DIR"
-#define SZDEFMONISVCPATH        "\\vdmonisvc.exe"
-#define SZCYGWINPATH            "c:\\gnu"
-#define SZJAKARTA_HOME          "c:\\home\\jakarta"
-#define SZJAVA_HOME             "c:\\jdk1.3.1"
diff --git a/src/native/nt/moni/Makefile b/src/native/nt/moni/Makefile
deleted file mode 100644
index a0f65b0..0000000
--- a/src/native/nt/moni/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-INCLUDE=-I../lib
-BIN=../../../../dist
-all: $(BIN)/vdmoniadm $(BIN)/vdmonisvc
-
-$(BIN)/vdmoniadm: vdmoniadm.c
-	gcc $(INCLUDE) -I../executables/vdmoniadm  vdmoniadm.c \
-	-o $(BIN)/vdmoniadm -lgdi32
-$(BIN)/vdmonisvc: vdmonisvc.c vdenv.o kills.o
-	gcc -mno-cygwin -I/usr/include $(INCLUDE) -I../executables/vdmonisvc \
-	-DCYGWIN vdmonisvc.c \
-	-o $(BIN)/vdmonisvc vdenv.o kills.o
-vdenv.o: ../supcalls_nt/vdenv.c
-	gcc $(INCLUDE) -c ../supcalls_nt/vdenv.c
-kills.o: ../signals/kills.c
-	gcc $(INCLUDE) -c ../signals/kills.c
-clean:
-	rm -f vdenv.o kills.o 
diff --git a/src/native/nt/moni/vdmoniadm.c b/src/native/nt/moni/vdmoniadm.c
deleted file mode 100644
index 7ba10f0..0000000
--- a/src/native/nt/moni/vdmoniadm.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* @version $Id: vdmoniadm.c 909069 2010-02-11 16:43:36Z mturk $ */
-
-#include <windows.h>       /* required for all Windows applications */
-#include <stdio.h>         /* for sprintf                           */
-#include <io.h>                                                               
-#include <fcntl.h>
-#include <shellapi.h>
-#include <winuser.h> 
-
-#include "resource.h"
-#include "moni_inst.h"                                                            
-                                                                              
-
-
-#define WINWIDTH  680
-#define WINHEIGHT 460
-
-#define CLASSMAIN
-#define VM_ICON_MESS    WM_USER+1
-#define VM_ID_TIMER     WM_USER+2
-#define VM_START_ICON   WM_USER+3
-#define VM_ID_TIMER1    WM_USER+4
-#define VM_ID_TIMER2    WM_USER+5
-
-BOOL InitApplication(HANDLE hInstance);
-
-HANDLE hInst;        /* current instance */
-SC_HANDLE hManager=NULL;                                     
-SC_HANDLE hService=NULL;
-int optmode;        /* start, stop or check. */
-int flagdown = 0;
-
-#define VDMONISTART 0
-#define VDMONISTOP  1
-#define VDMONICHECK 2
-
-#define NORMALWINDOW WS_OVERLAPPED|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX
-#define ICONWINDOW   WS_CAPTION|WS_POPUPWINDOW|WS_MINIMIZEBOX|WS_MAXIMIZEBOX                                     
-
-
-/* display a message read from resources */
-
-static void DisplayMess(HWND hDlg,int item)                                            
-{                                                                               
-char MessBox[256];                                                              
-                                                                                
-  if (LoadString(hInst,item,MessBox,sizeof(MessBox)))                         
-    MessageBox(hDlg, MessBox,"ERROR" , MB_OK);                                  
-  else {                                                                        
-    sprintf(MessBox,"ERROR %d",item);                                           
-    MessageBox(hDlg, MessBox,"ERROR" , MB_OK);                                  
-    }                                                                           
-}
-/*
- * MyTaskBarAddIcon - adds an icon to the taskbar status area. 
- * Returns TRUE if successful or FALSE otherwise. 
- * hwnd - handle of the window to receive callback messages 
- * uID - identifier of the icon 
- * hicon - handle of the icon to add 
- * lpszTip - ToolTip text 
- */
-BOOL MyTaskBarAddIcon(HWND hWnd)
-{ 
-    BOOL res; 
-    NOTIFYICONDATA  notifyicondata;
-    HICON hicon;
- 
-    notifyicondata.cbSize=sizeof(notifyicondata); 
-    notifyicondata.hWnd=hWnd; 
-    notifyicondata.uID=ID_TASKICON; 
-    notifyicondata.uFlags= NIF_ICON|NIF_MESSAGE|NIF_TIP; 
-    notifyicondata.uCallbackMessage=VM_ICON_MESS;
-    hicon = LoadIcon(hInst,"OnServe");
-    notifyicondata.hIcon = hicon;
-    strcpy(notifyicondata.szTip,"Jakarta Service");
-
-
-    res = Shell_NotifyIcon(NIM_ADD,&notifyicondata);
- 
-    if (hicon) 
-        DestroyIcon(hicon); 
- 
-    return res; 
-} 
-/*  
- * MyTaskBarDeleteIcon - deletes an icon from the taskbar 
- *     status area. 
- * Returns TRUE if successful or FALSE otherwise. 
- * hwnd - handle of the window that added the icon 
- * uID - identifier of the icon to delete 
- */
-BOOL MyTaskBarDeleteIcon(HWND hwnd) 
-{ 
-    BOOL res; 
-    NOTIFYICONDATA tnid; 
- 
-    tnid.cbSize = sizeof(NOTIFYICONDATA); 
-    tnid.hWnd = hwnd; 
-    tnid.uID = ID_TASKICON; 
-         
-    res = Shell_NotifyIcon(NIM_DELETE, &tnid); 
-    return res; 
-}
-
-/* start the vdcom process */
-void StartVdcom(HWND hDlg)
-{
-STARTUPINFO StartupInfo;                                                        
-PROCESS_INFORMATION ProcessInformation;
-                                     
-  memset(&StartupInfo,'\0',sizeof(StartupInfo));                                
-  StartupInfo.cb = sizeof(STARTUPINFO);                                         
-   
-  if (!CreateProcess(NULL,"vdcom.exe",NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,      
-         NULL,NULL, &StartupInfo, &ProcessInformation)) {
-      DisplayMess(hDlg,CANNOT_START_VDCOM);
-      return;
-     }
-  /* the handle to the process */
-  CloseHandle(ProcessInformation.hProcess); 
-  CloseHandle(ProcessInformation.hThread);
-}
-/* start the vdconf process */
-void StartVdconf(HWND hDlg)
-{
-STARTUPINFO StartupInfo;                                                        
-PROCESS_INFORMATION ProcessInformation;
-                                     
-  memset(&StartupInfo,'\0',sizeof(StartupInfo));                                
-  StartupInfo.cb = sizeof(STARTUPINFO);                                         
-   
-  if (!CreateProcess(NULL,"vdconf.exe",NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,      
-         NULL,NULL, &StartupInfo, &ProcessInformation)) {
-      DisplayMess(hDlg,CANNOT_START_VDCONF);
-      return;
-     }
-  /* the handle to the process */
-  CloseHandle(ProcessInformation.hProcess); 
-  CloseHandle(ProcessInformation.hThread);
-}
-
-/* test if service is running */
-BOOL IsRunning(HWND hDlg)
-{
-  SERVICE_STATUS  svcStatus;
-
-    if (!QueryServiceStatus(hService, &svcStatus)) {
-        DisplayMess(hDlg,ERROR_STATUS);
-        PostQuitMessage(0);
-        return(FALSE);
-    }
-    else {
-        if (SERVICE_RUNNING == svcStatus.dwCurrentState)
-            return(TRUE);
-    }
-    return(FALSE);
-
-}
-/* test if service is stoppped */
-BOOL IsStopped(HWND hDlg)
-{
-  SERVICE_STATUS  svcStatus;
-
-    if (!QueryServiceStatus(hService, &svcStatus)) {
-        DisplayMess(hDlg,ERROR_STATUS);
-        PostQuitMessage(0);
-        return(FALSE);
-    }
-    else {
-        if (SERVICE_STOPPED == svcStatus.dwCurrentState)
-            return(TRUE);
-    }
-    return(FALSE);
-
-}
-/* Yes/No dialog box */
-BOOL CALLBACK StopYesNo(
-        HWND hDlg,                /* window handle of the dialog box */
-        UINT message,             /* type of message                 */
-        WPARAM wParam,            /* message-specific information    */
-        LPARAM lParam)
-{
-    SERVICE_STATUS  svcStatus;
-    
-    switch (message) {
-    case WM_COMMAND:                     /* message: received a command */
-        if (LOWORD(wParam) == IDOK) {     /* "OK" box selected */
-            if (!IsStopped(hDlg)) {
-                ControlService(hService, SERVICE_CONTROL_STOP, &svcStatus);
-                EndDialog(hDlg, TRUE);
-            }
-            else
-                EndDialog(hDlg, FALSE);
-        }
-        if (LOWORD(wParam) == IDCANCEL)
-            EndDialog(hDlg, FALSE);
-        return(TRUE);
-    } /* End switch message */
-    return (FALSE);                            /* Didn't process a message    */
-    UNREFERENCED_PARAMETER(lParam);
-}
-/* Please wait stopping dialog box */
-BOOL CALLBACK PleaseWait(
-        HWND hDlg,                /* window handle of the dialog box */
-        UINT message,             /* type of message                 */
-        WPARAM wParam,            /* message-specific information    */
-        LPARAM lParam)
-{
-    
-    switch (message) {
-    case WM_INITDIALOG:
-        SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
-    case WM_COMMAND:                     /* message: received a command */
-        if (LOWORD(wParam) == IDCANCEL)
-            EndDialog(hDlg, FALSE);
-        return(TRUE);
-    case WM_TIMER:
-        if(IsStopped(hDlg))
-            EndDialog(hDlg, TRUE);
-        else
-            SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
-        return(TRUE);
-    } /* End switch message */
-    return (FALSE);                            /* Didn't process a message    */
-    UNREFERENCED_PARAMETER(lParam);
-}
-BOOL CALLBACK StartYesNo(
-        HWND hDlg,                /* window handle of the dialog box */
-        UINT message,             /* type of message                 */
-        WPARAM wParam,            /* message-specific information    */
-        LPARAM lParam)
-{
-
-    switch (message) {
-    case WM_INITDIALOG:
-        if (!StartService(hService,0,NULL)) {
-            DisplayMess(hDlg,CANNOT_START);
-            PostQuitMessage(0);
-        }
-        /* test if running, if not set a timer. */
-        /* wait until service is start */
-        if (IsRunning(hDlg)) 
-            EndDialog(hDlg, TRUE);
-        else
-            SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
-        return(TRUE);
-        
-    case WM_TIMER:
-        if(IsRunning(hDlg))
-            EndDialog(hDlg, TRUE);
-        else
-            SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
-        return(TRUE);
-        
-    case WM_COMMAND:                    /* message: received a command */
-        if (LOWORD(wParam) == IDCANCEL) {
-            if (IsRunning(hDlg)) 
-                EndDialog(hDlg, TRUE);
-            else
-                PostQuitMessage(0);
-        }
-        return(TRUE);
-        
-    } /* End switch message */
-    return (FALSE);                            /* Didn't process a message    */
-    UNREFERENCED_PARAMETER(lParam);
-}
-
-/* Display the menu */
-
-void ShowMenu(HWND hWnd)
-{
-   HMENU hMenu,hMenu1;
-   POINT point;
-
-   hMenu = LoadMenu(hInst,"MENU");
-   SetMenu(hWnd,hMenu);
-   hMenu1 = GetSubMenu(hMenu,0);
-
-   GetCursorPos(&point);
-
-   SetForegroundWindow(hWnd); /* MS bug. */
-   TrackPopupMenuEx(hMenu1,TPM_RIGHTALIGN|TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
-                    point.x,point.y,hWnd,NULL);
-   PostMessage(hWnd, WM_USER, 0, 0); /* MS bug. */
-   DestroyMenu(hMenu);
-
-}                                                                             
-/****************************************************************************\
-*
-*    FUNCTION:  InitInstance(HANDLE, int)
-*
-*    PURPOSE:  Saves instance handle and creates main window
-*
-*\***************************************************************************/
-
-BOOL InitInstance(
-    HANDLE          hInstance,          /* Current instance identifier.       */
-    int             nCmdShow)           /* Param for first ShowWindow() call. */
-{
-    HWND            hWnd;               /* Main window handle.                */
-    DWORD           dwStyle,dwExStyle;
-
-
-    /* Save the instance handle in static variable, which will be used in  */
-    /* many subsequence calls from this application to Windows.            */
-
-    hInst = hInstance;
-
-    /* Create a main window for this application instance.  */
-
-    if (optmode == VDMONISTART || optmode == VDMONICHECK) {
-        dwStyle = ICONWINDOW;
-        dwExStyle = WS_EX_APPWINDOW;
-    }
-    else {
-        dwStyle = NORMALWINDOW;
-        dwExStyle = 0;
-    }
-
-    hWnd = CreateWindowEx(
-        dwExStyle,
-        "OnServe",                      /* See RegisterClass() call.          */
-        "OnServe Monitor Control",      /* Text for window title bar.   */
-        dwStyle,                        /* Window style.*/
-        CW_USEDEFAULT,                  /* Default horizontal position.       */
-        CW_USEDEFAULT,                  /* Default vertical position.         */
-        WINWIDTH,                       /* Windows width.                     */
-        WINHEIGHT,                      /* Windows height.                    */
-        NULL,                           /* Overlapped windows have no parent. */
-        NULL,                           /* Use the window class menu.         */
-        hInstance,                      /* This instance owns this window.    */
-        NULL                            /* Pointer not needed.                */
-    );
-
-
-    /* If window could not be created, return "failure" */
-
-    if (!hWnd) {
-        return (FALSE);
-    }
-
-    return (TRUE);               /* Returns the value from PostQuitMessage */
-
-}
-/****************************************************************************\
-*
-*    FUNCTION: MainWndProc(HWND, unsigned, WORD, LONG)
-*
-*    PURPOSE:  Processes main window messages
-*
-*\***************************************************************************/
-
-LRESULT CALLBACK MainWndProc(
-        HWND hWnd,                /* window handle                   */
-        UINT message,             /* type of message                 */
-        WPARAM wParam,            /* additional information          */
-        LPARAM lParam)            /* additional information          */
-{
-   SERVICE_STATUS  svcStatus;
-
-   switch (message) {
-   case WM_CREATE:
-
-      /* acces to service manager. */
-      hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-      if (hManager==NULL) {
-          DisplayMess(hWnd,NO_ACCESS);
-          PostQuitMessage(0);
-          break;
-      }
-      /* access to monitor service.  */
-      hService = OpenService(hManager, SZSERVICENAME, SERVICE_ALL_ACCESS);
-      if (hService==NULL) {
-          DisplayMess(hWnd,NO_ACCESS_MONI);
-          PostQuitMessage(0);
-          break;
-      }
-      /* check if running. */
-      if (QueryServiceStatus(hService, &svcStatus)) {       
-          /* and see if the service is stopped */
-          if (SERVICE_STOPPED == svcStatus.dwCurrentState &&
-              optmode == VDMONISTOP) {
-              DisplayMess(hWnd,ALREADY_STOP);
-              PostQuitMessage(0);
-              break;
-          }
-          else if (SERVICE_RUNNING == svcStatus.dwCurrentState &&
-              optmode == VDMONISTART) {
-              DisplayMess(hWnd,ALREADY_START);
-              PostQuitMessage(0);
-              break;
-          }
-
-      }
-      else {
-          DisplayMess(hWnd,ERROR_STATUS);
-          PostQuitMessage(0);
-          break;
-      }
-
-      /* DialogBoxes Yes/No */
-      if (optmode == VDMONISTART)
-          DialogBox(hInst,                     /* current instance         */
-                "StartYesNo",                /* resource to use          */
-                hWnd,                        /* parent handle            */
-                StartYesNo);                 /* instance address         */
-      else if (optmode == VDMONISTOP)
-          if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
-              DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
-
-    
-      if (optmode == VDMONISTOP)
-          PostQuitMessage(0);
-      else {
-          SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-          MyTaskBarAddIcon(hWnd);
-      }
-
-      break;   /* WM_CREATE */
-
-   case VM_ICON_MESS:
-       switch ((UINT)lParam) {
-       case WM_LBUTTONDBLCLK:
-           StartVdcom(hWnd);
-           break;
-       case WM_RBUTTONDOWN:
-             flagdown = 1;
-           break;
-       case WM_RBUTTONUP:
-           if (flagdown == 1) {
-           flagdown = 2;
-           /* show a  menu. */
-           ShowMenu(hWnd);
-           }
-           break;
-       }
-       break;
-
-
-   case WM_TIMER:
-       /* check if service is running */
-       if (QueryServiceStatus(hService, &svcStatus)) {       
-          /* and see if the service is stopped */
-           if (SERVICE_STOPPED == svcStatus.dwCurrentState) {
-               MyTaskBarDeleteIcon(hWnd);
-               PostQuitMessage(0);
-           }
-           SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-           return(0);
-       }
-       break;
-
-   case VM_START_ICON:
-       /* add the icon and timer. */
-       MyTaskBarAddIcon(hWnd);
-       SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-       break;
-
-   case WM_COMMAND:
-       /* command for the popup menu. */
-       switch (LOWORD(wParam)) {
-       case ID_START_VDCOM:
-           StartVdcom(hWnd);
-           break;
-       case ID_STOP_VDMONI:
-           if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
-              DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
-           break;
-       case ID_PROPRETY:
-           StartVdconf(hWnd);
-           break;
-
-       }
-       break;
-
-  /*
-   *   Clean up.
-   */
-   case WM_DESTROY:
-       if (hService!=NULL)
-           CloseServiceHandle(hService);
-       if (hManager!=NULL) 
-           CloseServiceHandle(hManager);
-      PostQuitMessage(0);
-      break;
-
-   default:                       /* Passes it on if unproccessed    */
-      return (DefWindowProc(hWnd, message, wParam, lParam));
-
-   }
-   return (0);
-
-}
-
-/****************************************************************************
-*
-*    FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
-*
-*    PURPOSE: calls initialization function, processes message loop
-*
-*\***************************************************************************/
-
-WINAPI WinMain(
-    HINSTANCE hInstance,
-    HINSTANCE hPrevInstance,
-    LPSTR lpCmdLine,
-    int nCmdShow
-    )
-{
-
-    MSG msg;
-
-    UNREFERENCED_PARAMETER( lpCmdLine );
-    if (strcmp(lpCmdLine,"start")==0) 
-        optmode = VDMONISTART;
-    else if (strcmp(lpCmdLine,"stop")==0)
-        optmode = VDMONISTOP;
-    else
-        optmode = VDMONICHECK;
-
-    if (!hPrevInstance)                  /* Other instances of app running? */
-        if (!InitApplication(hInstance)) /* Initialize shared things        */
-            return (FALSE);              /* Exits if unable to initialize   */
-
-    /*
-    *   Perform initializations that apply to a specific instance
-    */
-    if (!InitInstance(hInstance, nCmdShow))
-        return (FALSE);
-
-    /*
-    *   Acquire and dispatch messages until a WM_QUIT message is received.
-    */
-    while (GetMessage(&msg,        /* message structure                      */
-            NULL,                  /* handle of window receiving the message */
-            0,             /* lowest message to examine              */
-            0))            /* highest message to examine             */
-        {
-        TranslateMessage(&msg);    /* Translates virtual key codes           */
-        DispatchMessage(&msg);     /* Dispatches message to window           */
-   }
-    return (msg.wParam);           /* Returns the value from PostQuitMessage */
-}
-
-/****************************************************************************
-*
-*    FUNCTION: InitApplication(HANDLE)
-*
-*    PURPOSE: Initializes window data and registers window class
-*
-*\***************************************************************************/
-
-BOOL InitApplication(HANDLE hInstance)       /* current instance             */
-{
-    WNDCLASS  wc;
-
-    /* Fill in window class structure with parameters that describe the       */
-    /* main window.                                                           */
-
-    wc.style = 0;                       /* Class style(s).                    */
-    wc.lpfnWndProc = MainWndProc;       /* Function to retrieve messages for  */
-                                        /* windows of this class.             */
-    wc.cbClsExtra = 0;                  /* No per-class extra data.           */
-    wc.cbWndExtra = 0;                  /* No per-window extra data.          */
-    wc.hIcon = LoadIcon (hInstance, "onserve"); /* Icon name from .RC        */
-    wc.hInstance = hInstance;          /* Application that owns the class.   */
-    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
-    wc.hbrBackground = GetStockObject(WHITE_BRUSH);
-    wc.lpszMenuName =  "onservemenu";   /* Name of menu resource in .RC file. */
-    wc.lpszClassName = "OnServe"; /* Name used in call to CreateWindow. */
-
-    /* Register the window class and return success/failure code. */
-
-    return (RegisterClass(&wc));
-
-}
-
diff --git a/src/native/nt/moni/vdmonisvc.c b/src/native/nt/moni/vdmonisvc.c
deleted file mode 100644
index 4dc7ecf..0000000
--- a/src/native/nt/moni/vdmonisvc.c
+++ /dev/null
@@ -1,708 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* @version $Id: vdmonisvc.c 909069 2010-02-11 16:43:36Z mturk $ */
-
-/* jsvc monitor service module:
- * Implements the body of the service.
- * It reads the register entry and starts the jsvc.
- */
-
-#include <windows.h>
-#include <winuser.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <process.h>
-#include <time.h>
-#ifdef CYGWIN
-#else
-#include <tchar.h>
-#endif
-#include "moni_inst.h"
-
-/* globals */
-SERVICE_STATUS          ssStatus;
-SERVICE_STATUS_HANDLE   sshStatusHandle;
-DWORD                   dwErr;
-HANDLE                  hServerStopEvent = NULL;
-HANDLE                  hMonitorProcess = NULL;
-
-/*
- * NT/other detection
- * from src/os/win32/service.c (httpd-1.3!).
- */
- 
-BOOL isWindowsNT(void)
-{
-    static BOOL once = FALSE;
-    static BOOL isNT = FALSE;
- 
-    if (!once)
-    {
-        OSVERSIONINFO osver;
-        osver.dwOSVersionInfoSize = sizeof(osver);
-        if (GetVersionEx(&osver))
-            if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT)
-                isNT = TRUE;
-        once = TRUE;
-    }
-    return isNT;
-}
-
-/* Event logger routine */
-
-VOID AddToMessageLog(LPTSTR lpszMsg)
-{
-    TCHAR   szMsg[256];
-    HANDLE  hEventSource;
-    LPCTSTR lpszStrings[2];
-
-
-        dwErr = GetLastError();
-
-        /* Use event logging to log the error. */
-
-    if (isWindowsNT())
-            hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
-    else
-        hEventSource = NULL;
-
-#ifdef CYGWIN
-    sprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
-#else
-        _stprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
-#endif
-        lpszStrings[0] = szMsg;
-        lpszStrings[1] = lpszMsg;
-
-        if (hEventSource != NULL) {
-            ReportEvent(hEventSource, /* handle of event source */
-                EVENTLOG_ERROR_TYPE,  /* event type */
-                0,                    /* event category */
-                0,                    /* event ID */
-                NULL,                 /* current user's SID */
-                2,                    /* strings in lpszStrings */
-                0,                    /* no bytes of raw data */
-                lpszStrings,          /* array of error strings */
-                NULL);                /* no raw data */
-
-            (VOID) DeregisterEventSource(hEventSource);
-        } else {
-        /* Default to a trace file */
-        FILE *log;
-        log = fopen("c:/jakarta-service.log","a+");
-        if (log != NULL) {
-                struct tm *newtime;
-                time_t long_time;
-
-                time( &long_time );
-                newtime = localtime( &long_time );
-
-                if (dwErr)
-            fprintf(log,"%.24s:%s: %s\n",asctime(newtime),szMsg, lpszMsg);
-                else
-            fprintf(log,"%.24s: %s\n",asctime(newtime), lpszMsg);
-        fclose(log);
-        }
-    }
-}
-
-/*
- *
- *  FUNCTION: ServiceStop
- *
- *  PURPOSE: Stops the service
- *
- *  PARAMETERS:
- *    none
- *
- *  RETURN VALUE:
- *    none
- *
- *  COMMENTS:
- *    If a ServiceStop procedure is going to
- *    take longer than 3 seconds to execute,
- *    it should spawn a thread to execute the
- *    stop code, and return.  Otherwise, the
- *    ServiceControlManager will believe that
- *    the service has stopped responding.
- *    
- */
-VOID ServiceStop()
-{
-    if ( hServerStopEvent )
-        SetEvent(hServerStopEvent);
-}
-
-/*
- * Wait for the monitor process to stop
- */
-int WaitForMonitor(int num)
-{
-    DWORD   qreturn;
-    int     i;
-
-    for (i=0;i<num;i++) {
-        if (hMonitorProcess == NULL) break;
-        if (GetExitCodeProcess(hMonitorProcess, &qreturn)) {
-            if (qreturn == STILL_ACTIVE) {
-                Sleep(1000);
-                continue;
-            }
-            hMonitorProcess = NULL;
-            break;
-        }
-        break;
-    }
-    if (i==num)
-        return -1;
-    return 0;
-}
-/*  This group of functions are provided for the service/console app
- *  to register itself a HandlerRoutine to accept tty or service messages
- *  adapted from src/os/win32/Win9xConHook.c (httpd-1.3!).
- */
-
-/* This is the WndProc procedure for our invisible window.
- * When our subclasssed tty window receives the WM_CLOSE, WM_ENDSESSION,
- * or WM_QUERYENDSESSION messages, the message is dispatched to our hidden
- * window (this message process), and we call the installed HandlerRoutine
- * that was registered by the app.
- */
-#ifndef ENDSESSION_LOGOFF
-#define ENDSESSION_LOGOFF    0x80000000
-#endif
-static LRESULT CALLBACK ttyConsoleCtrlWndProc(HWND hwnd, UINT msg,
-                                              WPARAM wParam, LPARAM lParam)
-{
-    int   qreturn;
-    if (msg == WM_CREATE) {
-        AddToMessageLog(TEXT("ttyConsoleCtrlWndProc WM_CREATE"));
-        return 0;
-    } else if (msg == WM_DESTROY) {
-        AddToMessageLog(TEXT("ttyConsoleCtrlWndProc WM_DESTROY"));
-        return 0;
-    } else if (msg == WM_CLOSE) {
-        /* Call StopService?. */
-        AddToMessageLog(TEXT("ttyConsoleCtrlWndProc WM_CLOSE"));
-        return 0; /* May return 1 if StopService failed. */
-    } else if ((msg == WM_QUERYENDSESSION) || (msg == WM_ENDSESSION)) {
-        if (lParam & ENDSESSION_LOGOFF) {
-            /* Here we have nothing to our hidden windows should stay. */
-            AddToMessageLog(TEXT("ttyConsoleCtrlWndProc LOGOFF"));
-            return(1); /* Otherwise it cancels the logoff */
-        } else {
-            /* Stop Service. */
-            AddToMessageLog(TEXT("ttyConsoleCtrlWndProc SHUTDOWN"));
-            ServiceStop();
-
-            /* Wait until it stops. */
-            qreturn = WaitForMonitor(3);
-
-            if (msg == WM_QUERYENDSESSION) {
-                AddToMessageLog(
-                    TEXT("ttyConsoleCtrlWndProc SHUTDOWN (query)"));
-                if (qreturn) {
-                    AddToMessageLog(
-                        TEXT("Cancelling shutdown: cannot stop service"));
-                    return(0);
-                }
-            } else
-                AddToMessageLog(TEXT("ttyConsoleCtrlWndProc SHUTDOWN"));
-            return(1); /* Otherwise it cancels the shutdown. */
-        }
-    }
-    return (DefWindowProc(hwnd, msg, wParam, lParam));
-}                                                                               
-/* ttyConsoleCreateThread is the process that runs within the user app's
- * context.  It creates and pumps the messages of a hidden monitor window,
- * watching for messages from the system, or the associated subclassed tty
- * window.  Things can happen in our context that can't be done from the
- * tty's context, and visa versa, so the subclass procedure and this hidden
- * window work together to make it all happen.
- */
-static DWORD WINAPI ttyConsoleCtrlThread()
-{
-    HWND monitor_hwnd;
-    WNDCLASS wc;
-    MSG msg;
-    wc.style         = CS_GLOBALCLASS;
-    wc.lpfnWndProc   = ttyConsoleCtrlWndProc;
-    wc.cbClsExtra    = 0;
-    wc.cbWndExtra    = 8;
-    wc.hInstance     = NULL;
-    wc.hIcon         = NULL;
-    wc.hCursor       = NULL;
-    wc.hbrBackground = NULL;
-    wc.lpszMenuName  = NULL;
-    wc.lpszClassName = "ApacheJakartaService";
- 
-    if (!RegisterClass(&wc)) {
-        AddToMessageLog(TEXT("RegisterClass failed"));
-        return 0;
-    }
- 
-    /* Create an invisible window */
-    monitor_hwnd = CreateWindow(wc.lpszClassName, 
-                                "ApacheJakartaService",
-                                WS_OVERLAPPED & ~WS_VISIBLE,
-                                CW_USEDEFAULT, CW_USEDEFAULT,
-                                CW_USEDEFAULT, CW_USEDEFAULT,
-                                NULL, NULL,
-                                GetModuleHandle(NULL), NULL);
- 
-    if (!monitor_hwnd) {
-        AddToMessageLog(TEXT("RegisterClass failed"));
-        return 0;
-    }
- 
-    while (GetMessage(&msg, NULL, 0, 0))
-    {
-        TranslateMessage(&msg);
-        DispatchMessage(&msg);
-    }
- 
-    return 0;
-}
-/*
- * Register the process to resist logoff and start the thread that will receive
- * the shutdown via a hidden window.
- */
-BOOL Windows9xServiceCtrlHandler()
-{
-    HANDLE hThread;
-    DWORD tid;
-    HINSTANCE hkernel;
-    DWORD (WINAPI *register_service_process)(DWORD, DWORD) = NULL;
-
-    /* If we have not yet done so */
-    FreeConsole();
-
-    /* Make sure the process will resist logoff */
-    hkernel = LoadLibrary("KERNEL32.DLL");
-    if (!hkernel) {
-        AddToMessageLog(TEXT("LoadLibrary KERNEL32.DLL failed"));
-        return 0;
-    }
-    register_service_process = (DWORD (WINAPI *)(DWORD, DWORD)) 
-        GetProcAddress(hkernel, "RegisterServiceProcess");
-    if (register_service_process == NULL) {
-        AddToMessageLog(TEXT("dlsym RegisterServiceProcess failed"));
-        return 0;
-    }
-    if (!register_service_process(0,TRUE)) {
-        FreeLibrary(hkernel);
-        AddToMessageLog(TEXT("register_service_process failed"));
-        return 0;
-    }
-    AddToMessageLog(TEXT("jsvc registered as a service"));
-
-    /*
-     * To be handle notice the shutdown, we need a thread and window.
-     */
-     hThread = CreateThread(NULL, 0, ttyConsoleCtrlThread,
-                               (LPVOID)NULL, 0, &tid);
-     if (hThread) {
-        CloseHandle(hThread);
-        return TRUE;
-     }
-    AddToMessageLog(TEXT("jsvc shutdown listener start failed"));
-    return TRUE;
-}
-
-/* 
- *
- *  FUNCTION: ReportStatusToSCMgr()
- *
- *  PURPOSE: Sets the current status of the service and
- *           reports it to the Service Control Manager
- *
- *  PARAMETERS:
- *    dwCurrentState - the state of the service
- *    dwWin32ExitCode - error code to report
- *    dwWaitHint - worst case estimate to next checkpoint
- *
- *  RETURN VALUE:
- *    TRUE  - success
- *    FALSE - failure
- *
- *  COMMENTS:
- *
- */
-BOOL ReportStatusToSCMgr(DWORD dwCurrentState,
-                         DWORD dwWin32ExitCode,
-                         DWORD dwWaitHint)
-{
-    static DWORD dwCheckPoint = 1;
-    BOOL fResult = TRUE;
-
-
-        if (dwCurrentState == SERVICE_START_PENDING)
-            ssStatus.dwControlsAccepted = 0;
-        else
-            ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
-
-        ssStatus.dwCurrentState = dwCurrentState;
-        ssStatus.dwWin32ExitCode = dwWin32ExitCode;
-        ssStatus.dwWaitHint = dwWaitHint;
-
-        if ( ( dwCurrentState == SERVICE_RUNNING ) ||
-             ( dwCurrentState == SERVICE_STOPPED ) )
-            ssStatus.dwCheckPoint = 0;
-        else
-            ssStatus.dwCheckPoint = dwCheckPoint++;
-
-
-        /* Report the status of the service to the service control manager. */
-
-        if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus))) {
-            AddToMessageLog(TEXT("SetServiceStatus"));
-        }
-    return fResult;
-}
-
-/*
- * Report event to the Service Manager
- */
-int ReportManager(int event)
-{
-    if (isWindowsNT())
-        return(ReportStatusToSCMgr(
-            event,                 /* service state */
-            NO_ERROR,              /* exit code */
-            3000));                /* wait hint */
-    return(1);
-} 
-
-/*
- *
- *  FUNCTION: ServiceStart
- *
- *  PURPOSE: Actual code of the service
- *           that does the work.
- *
- *  PARAMETERS:
- *    dwArgc   - number of command line arguments
- *    lpszArgv - array of command line arguments
- *
- *  RETURN VALUE:
- *    none
- *
- *  COMMENTS:
- *    The default behavior is to read the registry and start jsvc.
- *    The service stops when hServerStopEvent is signalled, the jsvc
- *    is stopped via TermPid(pid) (see kills.c).
- *
- */
-VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
-{
-char    Data[512];
-DWORD   qreturn;
-STARTUPINFO StartupInfo;
-PROCESS_INFORMATION ProcessInformation;
-char *qptr;
-
-
-    /* Service initialization */
-    ProcessInformation.hProcess = NULL;
-
-    /* report the status to the service control manager. */
-
-    AddToMessageLog(TEXT("ServiceStart: starting"));
-    if (!ReportManager(SERVICE_START_PENDING))
-        goto cleanup;
-
-    /*
-     * create the event object. The control handler function signals
-     * this event when it receives the "stop" control code.
-     *
-     */
-    hServerStopEvent = CreateEvent(
-        NULL,    /* no security attributes */
-        TRUE,    /* manual reset event */
-        FALSE,   /* not-signalled */
-        NULL);   /* no name */
-
-    if ( hServerStopEvent == NULL)
-        goto cleanup;
-
-    /* report the status to the service control manager. */
-    if (!ReportManager(SERVICE_START_PENDING))
-        goto cleanup;
-
-    /* Read the registry and set environment. */
-    if (OnServeSetEnv()) {
-      AddToMessageLog(TEXT("ServiceStart: read environment failed"));
-      goto cleanup;
-      }
-
-    if (!ReportManager(SERVICE_START_PENDING))
-        goto cleanup;
-
-    /* set the start path for jsvc.exe */
-    qptr = getenv("JAKARTA_HOME");
-    if (qptr==NULL || strlen(qptr)==0) {
-        AddToMessageLog(TEXT("ServiceStart: read JAKARTA_HOME failed"));
-        goto cleanup;
-    }
-
-    /* Build the start jsvc command according to the registry information. */
-    strcpy(Data,qptr);
-    BuildCommand(Data);
-    AddToMessageLog(TEXT(Data));
-
-    /* create the jsvc process. */
-    AddToMessageLog(TEXT("ServiceStart: start jsvc"));
-    memset(&StartupInfo,'\0',sizeof(StartupInfo));
-    StartupInfo.cb = sizeof(STARTUPINFO);
-
-    if (!CreateProcess(NULL,Data,NULL,NULL,FALSE,
-         DETACHED_PROCESS|NORMAL_PRIORITY_CLASS,
-         NULL,NULL, &StartupInfo, &ProcessInformation))
-      goto cleanup;
-    AddToMessageLog(TEXT("ServiceStart: jsvc started"));
-    CloseHandle(ProcessInformation.hThread);
-    ProcessInformation.hThread = NULL;
-    hMonitorProcess = ProcessInformation.hProcess;
-
-    if (!ReportManager(SERVICE_START_PENDING))
-        goto cleanup;
-
-    /* wait until the process is completly created. */
-/* With the DETACHED_PROCESS it does not work...
-    if (WaitForInputIdle(ProcessInformation.hProcess , INFINITE)) {
-      AddToMessageLog(TEXT("ServiceStart: jsvc stopped after creation"));
-      goto cleanup;
-      }
- */
-
-    /*
-     * jsvc is now running.
-     * report the status to the service control manager.
-     */
-
-    if (!ReportManager(SERVICE_RUNNING))
-        goto cleanup;
-
-    /* End of initialization */
-
-    /*
-     *
-     * Service is now running, perform work until shutdown:
-     * Check every 60 seconds if the monitor is up.
-     *
-     */
-
-    for (;;) {
-      qreturn = WaitForSingleObject(hServerStopEvent,60000); /* each minutes. */
-
-      if (qreturn == WAIT_FAILED) break;/* something have gone wrong. */
-
-      if (qreturn == WAIT_TIMEOUT) {
-        /* timeout check the monitor. */
-        if (GetExitCodeProcess(ProcessInformation.hProcess, &qreturn)) {
-          if (qreturn == STILL_ACTIVE) continue;
-          }
-        AddToMessageLog(TEXT("ServiceStart: jsvc crashed"));
-        hMonitorProcess = NULL;
-        CloseHandle(hServerStopEvent);
-        CloseHandle(ProcessInformation.hProcess);
-        exit(0); /* exit ungracefully so
-                  * Service Control Manager 
-                  * will attempt a restart. */
-                    
-        break; /*failed. */
-        }
-
-      /* stop the monitor by signal(event) */
-      sprintf(Data,"ServiceStart: stopping jsvc: %d",
-              ProcessInformation.dwProcessId);
-      AddToMessageLog(Data);
-
-      if (TermPid(ProcessInformation.dwProcessId)) {
-        AddToMessageLog(TEXT("ServiceStart: jsvc stop failed"));
-        break;
-        }
-      WaitForMonitor(6);
-      AddToMessageLog(TEXT("ServiceStart: jsvc stopped"));
-      break; /* finished!!! */
-      }
-
-  cleanup:
-
-    AddToMessageLog(TEXT("ServiceStart: stopped"));
-    if (hServerStopEvent)
-        CloseHandle(hServerStopEvent);
-
-    if (ProcessInformation.hProcess)
-        CloseHandle(ProcessInformation.hProcess);
-
-}
-
-/*
- *
- *  FUNCTION: service_ctrl
- *
- *  PURPOSE: This function is called by the SCM whenever
- *           ControlService() is called on this service.
- *
- *  PARAMETERS:
- *    dwCtrlCode - type of control requested
- *
- *  RETURN VALUE:
- *    none
- *
- *  COMMENTS:
- *
- */
-VOID WINAPI service_ctrl(DWORD dwCtrlCode)
-{
-    /* Handle the requested control code. */
-    switch(dwCtrlCode)
-    {
-        /* Stop the service.
-         *
-         * SERVICE_STOP_PENDING should be reported before
-         * setting the Stop Event - hServerStopEvent - in
-         * ServiceStop().  This avoids a race condition
-         * which may result in a 1053 - The Service did not respond...
-         * error.
-         */
-        case SERVICE_CONTROL_STOP:
-            ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 0);
-            ServiceStop();
-            return;
-
-        /* Update the service status. */
-        case SERVICE_CONTROL_INTERROGATE:
-            break;
-
-        /* invalid control code */
-        default:
-            break;
-
-    }
-
-    ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0);
-}
-
-/*
- *
- *  FUNCTION: service_main
- *
- *  PURPOSE: To perform actual initialization of the service
- *
- *  PARAMETERS:
- *    dwArgc   - number of command line arguments
- *    lpszArgv - array of command line arguments
- *
- *  RETURN VALUE:
- *    none
- *
- *  COMMENTS:
- *    This routine performs the service initialization and then calls
- *    the user defined ServiceStart() routine to perform majority
- *    of the work.
- *
- */
-void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
-{
-
-    AddToMessageLog(TEXT("service_main:starting"));
-
-    /* register our service control handler: */
-    sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SZSERVICENAME),
-                                                   service_ctrl);
-
-    if (!sshStatusHandle) {
-    AddToMessageLog(TEXT("service_main:RegisterServiceCtrlHandler failed"));
-        goto cleanup;
-    }
-
-    /* SERVICE_STATUS members that don't change in example */
-    ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
-    ssStatus.dwServiceSpecificExitCode = 0;
-
-
-    /* report the status to the service control manager. */
-    if (!ReportStatusToSCMgr(SERVICE_START_PENDING,NO_ERROR,3000))   {
-    AddToMessageLog(TEXT("service_main:ReportStatusToSCMgr failed"));
-        goto cleanup;
-    }
-
-
-    ServiceStart( dwArgc, lpszArgv );
-
-cleanup:
-    /*
-     * try to report the stopped status to the service control manager.
-     */
-    if (sshStatusHandle)
-        (VOID)ReportStatusToSCMgr(
-                            SERVICE_STOPPED,
-                            dwErr,
-                            0);
-
-    AddToMessageLog(TEXT("service_main:stopped"));
-    return;
-}
-
-/*
- *
- *  FUNCTION: main
- *
- *  PURPOSE: entrypoint for service
- *
- *  PARAMETERS:
- *    argc - number of command line arguments
- *    argv - array of command line arguments
- *
- *  RETURN VALUE:
- *    none
- *
- *  COMMENTS:
- *    main() either performs the command line task, or
- *    call StartServiceCtrlDispatcher to register the
- *    main service thread.  When the this call returns,
- *    the service has stopped, so exit.
- *
- */
-#ifdef CYGWIN
-int main(int argc, char **argv)
-#else
-void _CRTAPI1 main(int argc, char **argv)
-#endif
-{
-    SERVICE_TABLE_ENTRY dispatchTable[] =
-    {
-        { TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main },
-        { NULL, NULL }
-    };
-
-    AddToMessageLog(TEXT("StartService starting"));
-    if (isWindowsNT()) {
-            if (!StartServiceCtrlDispatcher(dispatchTable)) {
-        AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
-        return;
-        }
-        AddToMessageLog(TEXT("StartService started"));
-    } else {
-        Windows9xServiceCtrlHandler();
-        ServiceStart(argc,argv);
-        AddToMessageLog(TEXT("StartService stopped"));
-    }
-}
diff --git a/src/native/nt/procrun/README.dev b/src/native/nt/procrun/README.dev
new file mode 100644
index 0000000..d8a60d0
--- /dev/null
+++ b/src/native/nt/procrun/README.dev
@@ -0,0 +1,25 @@
+Apache Commons Daemon
+=====================
+
+
+Configuring and Building Commons Daemon on Windows
+==================================================
+
+Using Visual Studio, you can build the Commons Daemon.
+The Makefile make file has a bunch of documentation about it's
+options, but a trivial build is simply;
+
+  nmake CPU=X86
+  nmake CPU=X86 PREFIX=c:\desired\path\of\daemon install
+
+
+Needed Tools
+============
+
+Commons Daemon needs the Microsoft Visual C 6/SP5 to
+build the x86 binaries. This is because this compiler
+doesn't create MSVCRTnn.DLL dependecies which will
+be loaded inside running JVM if used.
+For building AMD64/EMT64 binaries use the Platform SDK
+for Windows Server 2003R2.
+
diff --git a/src/native/nt/procrun/apps/prunmgr/Makefile b/src/native/nt/procrun/apps/prunmgr/Makefile
new file mode 100644
index 0000000..0c6e14a
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunmgr/Makefile
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @author Mladen Turk
+#
+#
+TARGET = GUI
+PROJECT = prunmgr
+UNICODE = 1
+!include <..\..\include\Makefile.inc>
+
+!IF !DEFINED(PREFIX) || "$(PREFIX)" == ""
+PREFIX = .\..\..\dist
+!ENDIF
+!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
+SRCDIR = .\..\..
+!ENDIF
+
+LFLAGS = $(LFLAGS) /version:1.0
+LIBS = $(LIBS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib shlwapi.lib netapi32.lib
+INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\src $(JAVA_INCLUDES)
+
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
+OBJECTS = \
+	$(WORKDIR)\cmdline.obj \
+	$(WORKDIR)\console.obj \
+	$(WORKDIR)\gui.obj \
+	$(WORKDIR)\handles.obj \
+	$(WORKDIR)\javajni.obj \
+	$(WORKDIR)\log.obj \
+	$(WORKDIR)\mclib.obj \
+	$(WORKDIR)\registry.obj \
+	$(WORKDIR)\rprocess.obj \
+	$(WORKDIR)\service.obj \
+	$(WORKDIR)\utils.obj \
+	$(WORKDIR)\prunmgr.obj
+
+BUILDEXE = $(WORKDIR)\$(PROJECT).exe
+BUILDLOC = $(PREFIX)
+!IF "$(CPU)" == "X64"
+BUILDLOC = $(PREFIX)\amd64
+!ELSEIF "$(CPU)" == "I64"
+BUILDLOC = $(PREFIX)\ia64
+!ENDIF
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMAN = $(BUILDEXE).manifest
+
+all : $(WORKDIR) $(BUILDEXE)
+
+$(BUILDLOC) :
+	@if not exist "$(BUILDLOC)\$(NULL)" mkdir "$(BUILDLOC)"
+
+$(WORKDIR) :
+	@$(MAKEWORKDIR)
+
+{$(SRCDIR)\src}.c{$(WORKDIR)}.obj:
+	$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\apps\prunmgr}.c{$(WORKDIR)}.obj:
+	$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+$(BUILDRES): $(SRCDIR)/apps/prunmgr/prunmgr.rc
+	$(RC) $(RCFLAGS) /i "$(SRCDIR)\include" /fo $(BUILDRES) $(SRCDIR)/apps/prunmgr/prunmgr.rc
+
+$(BUILDEXE): $(WORKDIR) $(OBJECTS) $(BUILDRES)
+	$(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDEXE)
+	IF EXIST $(BUILDMAN) \
+		mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDEXE);1
+
+clean:
+	@$(CLEANTARGET)
+
+install: $(BUILDLOC) $(WORKDIR) $(BUILDEXE)
+	@xcopy "$(WORKDIR)\*.exe" "$(BUILDLOC)" /Y /Q
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.amd64 b/src/native/nt/procrun/apps/prunmgr/prunmgr.amd64
deleted file mode 100644
index 0a5f5b6..0000000
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.amd64
+++ /dev/null
@@ -1,110 +0,0 @@
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_amd64
-INTDIR=.\Release_amd64
-# Begin Custom Macros
-OutDir=.\Release_amd64
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0" 
-
-ALL : "$(OUTDIR)\prunmgr.exe"
-
-!ELSE 
-
-ALL : "libprocrun MAKE" "$(OUTDIR)\prunmgr.exe"
-
-!ENDIF 
-
-!IF "$(RECURSE)" == "1" 
-CLEAN :"libprocrun CLEAN" 
-!ELSE 
-CLEAN :
-!ENDIF 
-	- at erase "$(INTDIR)\prunmgr.obj"
-	- at erase "$(INTDIR)\prunmgr.res"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\prunmgr.exe"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AMD64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H  /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-MTL=midl.exe
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "USE_MANIFEST"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunmgr.bsc" 
-BSC32_SBRS= \
-	
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib bufferoverflowu.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\prunmgr.pdb" /machine:AMD64 /out:"$(OUTDIR)\prunmgr.exe" 
-LINK32_OBJS= \
-	"$(INTDIR)\prunmgr.obj" \
-	"$(INTDIR)\prunmgr.res" \
-	"..\..\Release_amd64\libprocrun.lib"
-
-"$(OUTDIR)\prunmgr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
-    $(LINK32) @<<
-  $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-	if exist $(OUTDIR)\prunmgr.exe.manifest mt.exe -manifest $(OUTDIR)\prunmgr.exe.manifest -outputresource:$(OUTDIR)\prunmgr.exe;1
-
-SOURCE=.\prunmgr.c
-
-"$(INTDIR)\prunmgr.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\prunmgr.rc
-
-"$(INTDIR)\prunmgr.res" : $(SOURCE) "$(INTDIR)"
-	$(RSC) /l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" /d "USE_MANIFEST" $(SOURCE)
-
-
-"libprocrun MAKE" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.amd64
-   cd ".\APPS\prunmgr"
-
-"libprocrun CLEAN" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.amd64 RECURSE=1 CLEAN 
-   cd ".\APPS\prunmgr"
-
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.c b/src/native/nt/procrun/apps/prunmgr/prunmgr.c
index 54d0158..8957302 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.c
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.c
@@ -15,7 +15,7 @@
  */
 
 /* ====================================================================
- * prunsrv -- Service Runner.
+ * prunmgr -- Service Manager Application.
  * Contributed by Mladen Turk <mturk at apache.org>
  * 05 Aug 2003
  * ====================================================================
@@ -80,7 +80,7 @@ static LPCWSTR  _s_java         = L"Java";
 static LPCWSTR  _s_start        = L"Start";
 static LPCWSTR  _s_stop         = L"Stop";
 
-/* Allowed procrun commands */
+/* Allowed prunmgr commands */
 static LPCWSTR _commands[] = {
     L"ES",      /* 1 Manage Service (default)*/
     L"MS",      /* 2 Monitor Service */
@@ -377,6 +377,8 @@ BOOL __generalLoggingSave(HWND hDlg)
     apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Path", szB);
     GetDlgItemTextW(hDlg, IDC_PPLGPREFIX,  szB, SIZ_DESMAX);
     apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Prefix", szB);
+    GetDlgItemTextW(hDlg, IDC_PPLGPIDFILE,  szB, SIZ_DESMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"PidFile", szB);
     GetDlgItemTextW(hDlg, IDC_PPLGSTDOUT,  szB, SIZ_DESMAX);
     apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"StdOutput", szB);
     GetDlgItemTextW(hDlg, IDC_PPLGSTDERR,  szB, SIZ_DESMAX);
@@ -873,7 +875,12 @@ LRESULT CALLBACK __loggingProperty(HWND hDlg,
                     apxFree(b);
                 }
                 else
-                    SetDlgItemTextW(hDlg, IDC_PPLGPREFIX, L"jakarta_service_");
+                    SetDlgItemTextW(hDlg, IDC_PPLGPREFIX, L"commons-daemon");
+                if ((b = apxRegistryGetStringW(hRegserv, APXREG_PARAMSOFTWARE,
+                                               _s_log, L"PidFile")) != NULL) {
+                    SetDlgItemTextW(hDlg, IDC_PPLGPIDFILE, b);
+                    apxFree(b);
+                }
                 if ((b = apxRegistryGetStringW(hRegserv, APXREG_PARAMSOFTWARE,
                                                _s_log, L"StdOutput")) != NULL) {
                     SetDlgItemTextW(hDlg, IDC_PPLGSTDOUT, b);
@@ -906,6 +913,12 @@ LRESULT CALLBACK __loggingProperty(HWND hDlg,
                         SET_BIT_FLAG(_propertyChanged, 3);
                     }
                 break;
+                case IDC_PPLGPIDFILE:
+                    if (HIWORD(wParam) == EN_CHANGE) {
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
+                        SET_BIT_FLAG(_propertyChanged, 3);
+                    }
+                break;
                 case IDC_PPLGSTDERR:
                     if (HIWORD(wParam) == EN_CHANGE) {
                         PropSheet_Changed(GetParent(hDlg), hDlg);
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.dsp b/src/native/nt/procrun/apps/prunmgr/prunmgr.dsp
deleted file mode 100644
index 122e57b..0000000
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.dsp
+++ /dev/null
@@ -1,189 +0,0 @@
-# Microsoft Developer Studio Project File - Name="prunmgr" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=prunmgr - Win32 Unicode Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "prunmgr.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "prunmgr.mak" CFG="prunmgr - Win32 Unicode Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "prunmgr - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "prunmgr - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE "prunmgr - Win32 Unicode Release" (based on "Win32 (x86) Application")
-!MESSAGE "prunmgr - Win32 Unicode Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "prunmgr - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386
-
-!ELSEIF  "$(CFG)" == "prunmgr - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/prunmgrd.exe" /pdbtype:sept
-# Begin Special Build Tool
-TargetPath=.\Debug\httpd.exe
-SOURCE="$(InputPath)"
-PostBuild_Desc=Embed .manifest
-PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);1
-# End Special Build Tool
-!ELSEIF  "$(CFG)" == "prunmgr - Win32 Unicode Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Unicode Release"
-# PROP BASE Intermediate_Dir "Unicode Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Unicode Release"
-# PROP Intermediate_Dir "Unicode Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386 /out:"Unicode Release/prunmgru.exe"
-# Begin Special Build Tool
-TargetPath=.\Debug\httpd.exe
-SOURCE="$(InputPath)"
-PostBuild_Desc=Embed .manifest
-PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);1
-# End Special Build Tool
-
-!ELSEIF  "$(CFG)" == "prunmgr - Win32 Unicode Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Unicode Debug"
-# PROP BASE Intermediate_Dir "Unicode Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Unicode Debug"
-# PROP Intermediate_Dir "Unicode Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Unicode Debug/prunmgrdu.exe" /pdbtype:sept
-# Begin Special Build Tool
-TargetPath=.\Debug\httpd.exe
-SOURCE="$(InputPath)"
-PostBuild_Desc=Embed .manifest
-PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);1
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "prunmgr - Win32 Release"
-# Name "prunmgr - Win32 Debug"
-# Name "prunmgr - Win32 Unicode Release"
-# Name "prunmgr - Win32 Unicode Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\prunmgr.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\prunmgr.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\prunmgr.rc
-# ADD BASE RSC /l 0x41a
-# ADD RSC /l 0x41a /i "..\..\include" /d "USE_MANIFEST"
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.h b/src/native/nt/procrun/apps/prunmgr/prunmgr.h
index 8677178..1670c13 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.h
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.h
@@ -24,7 +24,7 @@
 #define _PRUNMGR_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "1.0.2.0" 
+#define PRG_VERSION    "1.0.3.0" 
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #define IDM_TM_EXIT                     2000
@@ -73,10 +73,11 @@
 #define IDC_PPLGPATH                    2642
 #define IDC_PPLGBPATH                   2643
 #define IDC_PPLGPREFIX                  2644
-#define IDC_PPLGSTDOUT                  2645
-#define IDC_PPLGBSTDOUT                 2646
-#define IDC_PPLGSTDERR                  2647
-#define IDC_PPLGBSTDERR                 2648
+#define IDC_PPLGPIDFILE                 2645
+#define IDC_PPLGSTDOUT                  2646
+#define IDC_PPLGBSTDOUT                 2647
+#define IDC_PPLGSTDERR                  2648
+#define IDC_PPLGBSTDERR                 2649
 
 #define IDD_PROPPAGE_JVM                2660
 #define IDC_PPJAUTO                     2661
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.ia64 b/src/native/nt/procrun/apps/prunmgr/prunmgr.ia64
deleted file mode 100644
index 0f47bb4..0000000
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.ia64
+++ /dev/null
@@ -1,110 +0,0 @@
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_ia64
-INTDIR=.\Release_ia64
-# Begin Custom Macros
-OutDir=.\Release_ia64
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0" 
-
-ALL : "$(OUTDIR)\prunmgr.exe"
-
-!ELSE 
-
-ALL : "libprocrun MAKE" "$(OUTDIR)\prunmgr.exe"
-
-!ENDIF 
-
-!IF "$(RECURSE)" == "1" 
-CLEAN :"libprocrun CLEAN" 
-!ELSE 
-CLEAN :
-!ENDIF 
-	- at erase "$(INTDIR)\prunmgr.obj"
-	- at erase "$(INTDIR)\prunmgr.res"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\prunmgr.exe"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_IA64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H  /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-MTL=midl.exe
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "USE_MANIFEST"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunmgr.bsc" 
-BSC32_SBRS= \
-	
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib bufferoverflowu.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\prunmgr.pdb" /machine:IA64 /out:"$(OUTDIR)\prunmgr.exe" 
-LINK32_OBJS= \
-	"$(INTDIR)\prunmgr.obj" \
-	"$(INTDIR)\prunmgr.res" \
-	"..\..\Release_ia64\libprocrun.lib"
-
-"$(OUTDIR)\prunmgr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
-    $(LINK32) @<<
-  $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-	if exist $(OUTDIR)\prunmgr.exe.manifest mt.exe -manifest $(OUTDIR)\prunmgr.exe.manifest -outputresource:$(OUTDIR)\prunmgr.exe;1
-
-SOURCE=.\prunmgr.c
-
-"$(INTDIR)\prunmgr.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\prunmgr.rc
-
-"$(INTDIR)\prunmgr.res" : $(SOURCE) "$(INTDIR)"
-	$(RSC) /l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" /d "USE_MANIFEST" $(SOURCE)
-
-
-"libprocrun MAKE" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.ia64
-   cd ".\APPS\prunmgr"
-
-"libprocrun CLEAN" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.ia64 RECURSE=1 CLEAN 
-   cd ".\APPS\prunmgr"
-
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.rc b/src/native/nt/procrun/apps/prunmgr/prunmgr.rc
index 5edd4ca..4c3d5ad 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.rc
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.rc
@@ -138,13 +138,16 @@ BEGIN
     PUSHBUTTON      "...",IDC_PPLGBPATH,232,44,18,14 
     LTEXT           "Log prefix: ",IDC_STATIC,10,63,50,8
     EDITTEXT        IDC_PPLGPREFIX,70,62,158,12,ES_AUTOHSCROLL
+
+    LTEXT           "Pid file: ",IDC_STATIC,10,81,50,8
+    EDITTEXT        IDC_PPLGPIDFILE,70,82,158,12,ES_AUTOHSCROLL
     
-    LTEXT           "Redirect Stdout: ",IDC_STATIC,10,85,80,8
-    EDITTEXT        IDC_PPLGSTDOUT,10,97,218,12,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PPLGBSTDOUT,232,96,18,14 
-    LTEXT           "Redirect Stderror: ",IDC_STATIC,10,115,80,8
-    EDITTEXT        IDC_PPLGSTDERR,10,127,218,12,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PPLGBSTDERR,232,126,18,14 
+    LTEXT           "Redirect Stdout: ",IDC_STATIC,10,105,80,8
+    EDITTEXT        IDC_PPLGSTDOUT,10,117,218,12,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PPLGBSTDOUT,232,116,18,14 
+    LTEXT           "Redirect Stderror: ",IDC_STATIC,10,135,80,8
+    EDITTEXT        IDC_PPLGSTDERR,10,147,218,12,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PPLGBSTDERR,232,146,18,14 
 END
 
 IDD_PROPPAGE_JVM DIALOGEX 0, 0, 260, 186
@@ -225,7 +228,7 @@ END
 STRINGTABLE 
 BEGIN
     IDS_APPLICATION     RSTR_PSM
-    IDS_APPVERSION      "Version 1.0.2"
+    IDS_APPVERSION      "Version 1.0.3"
     IDS_APPFULLNAME     RSTR_PSM " Version " PRG_VERSION
     IDS_APPCOPYRIGHT    "Copyright � 2000-2010 The Apache Software Foundation"
     IDS_APPDESCRIPTION  "Apache Commons Daemon Service Management Tool"
@@ -256,8 +259,8 @@ BEGIN
 END
 
 1 VERSIONINFO
- FILEVERSION 1,0,2,0
- PRODUCTVERSION 1,0,2,0
+ FILEVERSION 1,0,3,0
+ PRODUCTVERSION 1,0,3,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.vcproj b/src/native/nt/procrun/apps/prunmgr/prunmgr.vcproj
deleted file mode 100644
index 365b75f..0000000
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.vcproj
+++ /dev/null
@@ -1,402 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8,00"
-	Name="prunmgr"
-	ProjectGUID="{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}"
-	RootNamespace="prunmgr"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="2"
-				GenerateManifest="true"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="2"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="1"
-				GenerateManifest="false"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-			>
-			<File
-				RelativePath=".\prunmgr.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-			<File
-				RelativePath=".\prunmgr.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-			>
-			<File
-				RelativePath=".\prunmgr.rc"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.x86 b/src/native/nt/procrun/apps/prunmgr/prunmgr.x86
deleted file mode 100644
index a6d57c1..0000000
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.x86
+++ /dev/null
@@ -1,110 +0,0 @@
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_x86
-INTDIR=.\Release_x86
-# Begin Custom Macros
-OutDir=.\Release_x86
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0" 
-
-ALL : "$(OUTDIR)\prunmgr.exe"
-
-!ELSE 
-
-ALL : "libprocrun MAKE" "$(OUTDIR)\prunmgr.exe"
-
-!ENDIF 
-
-!IF "$(RECURSE)" == "1" 
-CLEAN :"libprocrun CLEAN" 
-!ELSE 
-CLEAN :
-!ENDIF 
-	- at erase "$(INTDIR)\prunmgr.obj"
-	- at erase "$(INTDIR)\prunmgr.res"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\prunmgr.exe"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Fp"$(INTDIR)\prunmgr.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-MTL=midl.exe
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "USE_MANIFEST"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunmgr.bsc" 
-BSC32_SBRS= \
-	
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\prunmgr.pdb" /machine:I386 /out:"$(OUTDIR)\prunmgr.exe" 
-LINK32_OBJS= \
-	"$(INTDIR)\prunmgr.obj" \
-	"$(INTDIR)\prunmgr.res" \
-	"..\..\Release_x86\libprocrun.lib"
-
-"$(OUTDIR)\prunmgr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
-    $(LINK32) @<<
-  $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-	if exist $(OUTDIR)\prunmgr.exe.manifest mt.exe -manifest $(OUTDIR)\prunmgr.exe.manifest -outputresource:$(OUTDIR)\prunmgr.exe;1
-
-SOURCE=.\prunmgr.c
-
-"$(INTDIR)\prunmgr.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\prunmgr.rc
-
-"$(INTDIR)\prunmgr.res" : $(SOURCE) "$(INTDIR)"
-	$(RSC) /l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" /d "USE_MANIFEST" $(SOURCE)
-
-
-"libprocrun MAKE" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.x86
-   cd ".\APPS\prunmgr"
-
-"libprocrun CLEAN" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.x86 RECURSE=1 CLEAN 
-   cd ".\APPS\prunmgr"
-
diff --git a/src/native/nt/procrun/apps/prunsrv/Makefile b/src/native/nt/procrun/apps/prunsrv/Makefile
new file mode 100644
index 0000000..4289a4d
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunsrv/Makefile
@@ -0,0 +1,91 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @author Mladen Turk
+#
+#
+TARGET = EXE
+PROJECT = prunsrv
+UNICODE = 1
+!include <..\..\include\Makefile.inc>
+
+!IF !DEFINED(PREFIX) || "$(PREFIX)" == ""
+PREFIX = .\..\..\dist
+!ENDIF
+!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
+SRCDIR = .\..\..
+!ENDIF
+
+!IF "$(CPU)" == "X86"
+LFLAGS = $(LFLAGS) /stack:0x50000
+!ENDIF
+
+LFLAGS = $(LFLAGS) /version:1.0
+LIBS = $(LIBS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib shlwapi.lib netapi32.lib
+INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\src $(JAVA_INCLUDES)
+
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
+OBJECTS = \
+	$(WORKDIR)\cmdline.obj \
+	$(WORKDIR)\console.obj \
+	$(WORKDIR)\gui.obj \
+	$(WORKDIR)\handles.obj \
+	$(WORKDIR)\javajni.obj \
+	$(WORKDIR)\log.obj \
+	$(WORKDIR)\mclib.obj \
+	$(WORKDIR)\registry.obj \
+	$(WORKDIR)\rprocess.obj \
+	$(WORKDIR)\service.obj \
+	$(WORKDIR)\utils.obj \
+	$(WORKDIR)\prunsrv.obj
+
+BUILDEXE = $(WORKDIR)\$(PROJECT).exe
+BUILDLOC = $(PREFIX)
+!IF "$(CPU)" == "X64"
+BUILDLOC = $(PREFIX)\amd64
+!ELSEIF "$(CPU)" == "I64"
+BUILDLOC = $(PREFIX)\ia64
+!ENDIF
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMAN = $(BUILDEXE).manifest
+
+all : $(WORKDIR) $(BUILDEXE)
+
+$(BUILDLOC) :
+	@if not exist "$(BUILDLOC)\$(NULL)" mkdir "$(BUILDLOC)"
+
+$(WORKDIR) :
+	@$(MAKEWORKDIR)
+
+{$(SRCDIR)\src}.c{$(WORKDIR)}.obj:
+	$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\apps\prunsrv}.c{$(WORKDIR)}.obj:
+	$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+$(BUILDRES): $(SRCDIR)/apps/prunsrv/prunsrv.rc
+	$(RC) $(RCFLAGS) /i "$(SRCDIR)\include" /fo $(BUILDRES) $(SRCDIR)/apps/prunsrv/prunsrv.rc
+
+$(BUILDEXE): $(WORKDIR) $(OBJECTS) $(BUILDRES)
+	$(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDEXE)
+	IF EXIST $(BUILDMAN) \
+		mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDEXE);1
+
+clean:
+	@$(CLEANTARGET)
+
+install: $(BUILDLOC) $(WORKDIR) $(BUILDEXE)
+	@xcopy "$(WORKDIR)\*.exe" "$(BUILDLOC)" /Y /Q
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.amd64 b/src/native/nt/procrun/apps/prunsrv/prunsrv.amd64
deleted file mode 100644
index ee8a2be..0000000
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.amd64
+++ /dev/null
@@ -1,109 +0,0 @@
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_amd64
-INTDIR=.\Release_amd64
-# Begin Custom Macros
-OutDir=.\Release_amd64
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0" 
-
-ALL : "$(OUTDIR)\prunsrv.exe"
-
-!ELSE 
-
-ALL : "libprocrun MAKE" "$(OUTDIR)\prunsrv.exe"
-
-!ENDIF 
-
-!IF "$(RECURSE)" == "1" 
-CLEAN :"libprocrun CLEAN" 
-!ELSE 
-CLEAN :
-!ENDIF 
-	- at erase "$(INTDIR)\prunsrv.obj"
-	- at erase "$(INTDIR)\prunsrv.res"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\prunsrv.exe"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32"  /D "_AMD64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" 
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunsrv.bsc" 
-BSC32_SBRS= \
-	
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib bufferoverflowu.lib /nologo /stack:0x40000 /subsystem:console /incremental:no /pdb:"$(OUTDIR)\prunsrv.pdb" /machine:AMD64 /out:"$(OUTDIR)\prunsrv.exe" 
-LINK32_OBJS= \
-	"$(INTDIR)\prunsrv.obj" \
-	"$(INTDIR)\prunsrv.res" \
-	"..\..\Release_amd64\libprocrun.lib"
-
-"$(OUTDIR)\prunsrv.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
-    $(LINK32) @<<
-  $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-	if exist $(OUTDIR)\prunsrv.exe.manifest mt.exe -manifest $(OUTDIR)\prunsrv.exe.manifest -outputresource:$(OUTDIR)\prunsrv.exe;1
-
-SOURCE=.\prunsrv.c
-
-"$(INTDIR)\prunsrv.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\prunsrv.rc
-
-"$(INTDIR)\prunsrv.res" : $(SOURCE) "$(INTDIR)"
-	$(RSC) /l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" $(SOURCE)
-
-
-"libprocrun MAKE" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.amd64
-   cd ".\APPS\prunsrv"
-
-"libprocrun CLEAN" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.amd64 RECURSE=1 CLEAN 
-   cd ".\APPS\prunsrv"
-
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.c b/src/native/nt/procrun/apps/prunsrv/prunsrv.c
index 0ea3dc7..ac0c6e1 100644
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.c
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.c
@@ -51,10 +51,8 @@ typedef struct APX_STDWRAP {
     LPCWSTR szLogPath;
     LPCWSTR szStdOutFilename;
     LPCWSTR szStdErrFilename;
-    HANDLE  hStdOutFile;
-    HANDLE  hStdErrFile;
-    int     fdStdOutFile;
-    int     fdStdErrFile;
+    FILE   *fpStdOutFile;
+    FILE   *fpStdErrFile;
 } APX_STDWRAP;
 
 /* Use static variables instead of #defines */
@@ -76,6 +74,8 @@ static LPCWSTR _commands[] = {
     L"US",      /* 4 Update Service parameters */
     L"IS",      /* 5 Install Service */
     L"DS",      /* 6 Delete Service */
+    L"?",       /* 7 Help */
+    L"VS",      /* 8 Version */
     NULL
 };
 
@@ -123,6 +123,8 @@ static APXCMDLINEOPT _options[] = {
 /* 33 */    { L"LogLevel",          L"Level",           L"Log",         APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
 /* 34 */    { L"StdError",          L"StdError",        L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
 /* 35 */    { L"StdOutput",         L"StdOutput",       L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 36 */    { L"LogJniMessages",    L"LogJniMessages",  L"Log",         APXCMDOPT_INT | APXCMDOPT_REG, NULL, 1},
+/* 37 */    { L"PidFile",           L"PidFile",         L"Log",         APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
             /* NULL terminate the array */
             { NULL }
 };
@@ -182,8 +184,10 @@ static APXCMDLINEOPT _options[] = {
 
 #define SO_STDERROR         GET_OPT_V(34)
 #define SO_STDOUTPUT        GET_OPT_V(35)
+#define SO_JNIVFPRINTF      GET_OPT_I(36)
+#define SO_PIDFILE          GET_OPT_V(37)
 
-/* Main servic table entry
+/* Main service table entry
  * filled at run-time
  */
 static SERVICE_TABLE_ENTRYW _service_table[] = {
@@ -214,14 +218,16 @@ static LPSTR    _jni_jvmoptions           = NULL;   /* Path to jvm options */
 static LPSTR    _jni_classpath            = NULL;
 static LPCWSTR  _jni_rparam               = NULL;    /* Startup  arguments */
 static LPCWSTR  _jni_sparam               = NULL;    /* Shutdown arguments */
-static LPSTR    _jni_rmethod              = NULL;    /* Startup  arguments */
-static LPSTR    _jni_smethod              = NULL;    /* Shutdown arguments */
+static LPSTR    _jni_rmethod              = NULL;    /* Startup  method */
+static LPSTR    _jni_smethod              = NULL;    /* Shutdown method */
 static LPSTR    _jni_rclass               = NULL;    /* Startup  class */
 static LPSTR    _jni_sclass               = NULL;    /* Shutdown class */
 
 static HANDLE gShutdownEvent = NULL;
 static HANDLE gSignalEvent   = NULL;
 static HANDLE gSignalThread  = NULL;
+static HANDLE gPidfileHandle = NULL;
+static LPWSTR gPidfileName   = NULL;
 static BOOL   gSignalValid   = TRUE;
 
 DWORD WINAPI eventThread(LPVOID lpParam)
@@ -250,107 +256,71 @@ static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper)
     BOOL aErr = FALSE;
     BOOL aOut = FALSE;
 
+    if (lpWrapper->szStdOutFilename || lpWrapper->szStdErrFilename)
+        AllocConsole();
     /* redirect to file or console */
     if (lpWrapper->szStdOutFilename) {
         if (lstrcmpiW(lpWrapper->szStdOutFilename, PRSRV_AUTO) == 0) {
             aOut = TRUE;
             lpWrapper->szStdOutFilename = apxLogFile(gPool,
                                                      lpWrapper->szLogPath,
-                                                     L"stdout_",
-                                                     NULL);
+                                                     L"service-stdout",
+                                                     NULL, TRUE);
         }
         /* Delete the file if not in append mode
          * XXX: See if we can use the params instead of that.
          */
         if (!aOut)
             DeleteFileW(lpWrapper->szStdOutFilename);
-        lpWrapper->hStdOutFile = CreateFileW(lpWrapper->szStdOutFilename,
-                                             GENERIC_WRITE,
-                                             FILE_SHARE_READ | FILE_SHARE_WRITE,
-                                             NULL,
-                                             OPEN_ALWAYS,
-                                             FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN,
-                                             NULL);
-        if (IS_INVALID_HANDLE(lpWrapper->hStdOutFile))
-            return FALSE;
-        /* Allways move to the end of file */
-        SetFilePointer(lpWrapper->hStdOutFile, 0, NULL, FILE_END);
-    }
-    else {
-        lpWrapper->hStdOutFile = CreateFileW(L"CONOUT$",
-                                             GENERIC_WRITE,
-                                             FILE_SHARE_READ | FILE_SHARE_WRITE,
-                                             NULL,
-                                             OPEN_EXISTING,
-                                             0,
-                                             NULL);
-        if (IS_INVALID_HANDLE(lpWrapper->hStdOutFile))
-            return FALSE;
+        if ((lpWrapper->fpStdOutFile = _wfopen(lpWrapper->szStdOutFilename,
+                                               L"a"))) {
+            _dup2(_fileno(lpWrapper->fpStdOutFile), 1);
+            *stdout = *lpWrapper->fpStdOutFile;
+            setvbuf(stdout, NULL, _IONBF, 0);
+        }
     }
     if (lpWrapper->szStdErrFilename) {
         if (lstrcmpiW(lpWrapper->szStdErrFilename, PRSRV_AUTO) == 0) {
             aErr = TRUE;
             lpWrapper->szStdErrFilename = apxLogFile(gPool,
                                                      lpWrapper->szLogPath,
-                                                     L"stderr_",
-                                                     NULL);
+                                                     L"service-stderr",
+                                                     NULL, TRUE);
         }
         if (!aErr)
             DeleteFileW(lpWrapper->szStdErrFilename);
-        lpWrapper->hStdErrFile = CreateFileW(lpWrapper->szStdErrFilename,
-                                             GENERIC_WRITE,
-                                             FILE_SHARE_READ | FILE_SHARE_WRITE,
-                                             NULL,
-                                             OPEN_ALWAYS,
-                                             FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN,
-                                             NULL);
-        if (IS_INVALID_HANDLE(lpWrapper->hStdErrFile))
-            return FALSE;
-        SetFilePointer(lpWrapper->hStdErrFile, 0, NULL, FILE_END);
-    }
-    else if (lpWrapper->szStdOutFilename) {
-        /* Use the same file handle for stderr as for stdout */
-        lpWrapper->szStdErrFilename = lpWrapper->szStdOutFilename;
-        lpWrapper->hStdErrFile = lpWrapper->hStdOutFile;
-    }
-    else {
-        lpWrapper->hStdErrFile = lpWrapper->hStdOutFile;
-    }
-    /* Open the stream buffers
-     * This will redirect all printf to go to the redirected files.
-     * It is used for JNI vprintf functionality.
-     */
-    lpWrapper->fdStdOutFile = _open_osfhandle((ptrdiff_t)lpWrapper->hStdOutFile,
-                                              _O_WRONLY | _O_TEXT);
-    if (lpWrapper->fdStdOutFile > 0) {
-        lpWrapper->fdStdOutFile = dup2(lpWrapper->fdStdOutFile, 1);
-        if (lpWrapper->fdStdOutFile > 0)
-            setvbuf(stdout, NULL, _IONBF, 0);
-    }
-    lpWrapper->fdStdErrFile = _open_osfhandle((ptrdiff_t)lpWrapper->hStdErrFile,
-                                              _O_WRONLY | _O_TEXT);
-    if (lpWrapper->fdStdErrFile > 0) {
-        lpWrapper->fdStdErrFile = dup2(lpWrapper->fdStdErrFile, 2);
-        if (lpWrapper->fdStdErrFile > 0)
+        if ((lpWrapper->fpStdErrFile = _wfopen(lpWrapper->szStdErrFilename,
+                                              L"a"))) {
+            _dup2(_fileno(lpWrapper->fpStdErrFile), 2);
+            *stderr = *lpWrapper->fpStdErrFile;
             setvbuf(stderr, NULL, _IONBF, 0);
+        }
+    }
+    else if (lpWrapper->fpStdOutFile) {
+        _dup2(_fileno(lpWrapper->fpStdOutFile), 2);
+        *stderr = *lpWrapper->fpStdOutFile;
+         setvbuf(stderr, NULL, _IONBF, 0);
     }
-
     return TRUE;
 }
 
 /* Debugging functions */
-static void printUsage(LPAPXCMDLINE lpCmdline)
+static void printUsage(LPAPXCMDLINE lpCmdline, BOOL isHelp)
 {
     int i = 0;
-    fwprintf(stderr, L"Usage: %s //CMD//Servce [--options]\n",
+    fwprintf(stderr, L"Usage: %s //CMD//Service [--options]\n",
              lpCmdline->szExecutable);
     fwprintf(stderr, L"  Commands:\n");
-    fwprintf(stderr, L"  //IS//ServiceName  Install Service\n");
-    fwprintf(stderr, L"  //US//ServiceName  Update Service parameters\n");
-    fwprintf(stderr, L"  //DS//ServiceName  Delete Service\n");
-    fwprintf(stderr, L"  //RS//ServiceName  Run Service\n");
-    fwprintf(stderr, L"  //SS//ServiceName  Stop Service\n");
-    fwprintf(stderr, L"  //TS//ServiceName  Run Service as console application\n");
+    if (isHelp)
+        fwprintf(stderr, L"  //?                  This page\n");
+    fwprintf(stderr, L"  //IS[//ServiceName]  Install Service\n");
+    fwprintf(stderr, L"  //US[//ServiceName]  Update Service parameters\n");
+    fwprintf(stderr, L"  //DS[//ServiceName]  Delete Service\n");
+    fwprintf(stderr, L"  //RS[//ServiceName]  Run Service\n");
+    fwprintf(stderr, L"  //SS[//ServiceName]  Stop Service\n");
+    fwprintf(stderr, L"  //TS[//ServiceName]  Run Service as console application\n");
+    fwprintf(stderr, L"  //PP[//Num Seconds]  Sleep for n Seconds (defaults to 60)\n");
+    fwprintf(stderr, L"  //VS                 Display version\n");
     fwprintf(stderr, L"  Options:\n");
     while (_options[i].szName) {
         fwprintf(stderr, L"  --%s\n", _options[i].szName);
@@ -358,6 +328,18 @@ static void printUsage(LPAPXCMDLINE lpCmdline)
     }
 }
 
+static void printVersion(void)
+{
+#ifdef _WIN64
+    int b = 64;
+#else
+    int b = 32;
+#endif
+    fwprintf(stderr, L"Commons Daemon Service Runner version %S/Win%d (%S)\n",
+            PRG_VERSION, b, __DATE__);
+    fwprintf(stderr, L"Copyright (c) 2000-2010 The Apache Software Foundation.\n");
+}
+
 /* Display configuration parameters */
 static void dumpCmdline()
 {
@@ -405,7 +387,11 @@ static BOOL loadConfiguration(LPAPXCMDLINE lpCmdline)
                                    lpCmdline->szApplication,
                                    APXREG_SOFTWARE | APXREG_SERVICE);
     if (IS_INVALID_HANDLE(hRegistry)) {
-        apxLogWrite(APXLOG_MARK_SYSERR);
+        if (GetLastError() == ERROR_FILE_NOT_FOUND)
+            apxLogWrite(APXLOG_MARK_WARN "The system cannot find the Registry key for service '%S'",
+                        lpCmdline->szApplication);
+        else
+            apxLogWrite(APXLOG_MARK_SYSERR);
         return FALSE;
     }
     /* browse through options */
@@ -588,11 +574,11 @@ static BOOL docmdInstallService(LPAPXCMDLINE lpCmdline)
     apxCloseHandle(hService);
     if (rv) {
         saveConfiguration(lpCmdline);
-        apxLogWrite(APXLOG_MARK_INFO "Service %S installed",
+        apxLogWrite(APXLOG_MARK_INFO "Service '%S' installed",
                     lpCmdline->szApplication);
     }
     else
-        apxLogWrite(APXLOG_MARK_ERROR "Failed installing %S service",
+        apxLogWrite(APXLOG_MARK_ERROR "Failed installing '%S' service",
                     lpCmdline->szApplication);
 
     return rv;
@@ -624,11 +610,11 @@ static BOOL docmdDeleteService(LPAPXCMDLINE lpCmdline)
     if (rv) {
         /* Delete all service registry settings */
         apxDeleteRegistryW(PRG_REGROOT, lpCmdline->szApplication, KREG_WOW6432, TRUE);
-        apxLogWrite(APXLOG_MARK_DEBUG "Service %S deleted",
+        apxLogWrite(APXLOG_MARK_DEBUG "Service '%S' deleted",
                     lpCmdline->szApplication);
     }
     else {
-        apxDisplayError(TRUE, NULL, 0, "Unable to delete %S service",
+        apxDisplayError(FALSE, NULL, 0, "Unable to delete '%S' service",
                         lpCmdline->szApplication);
     }
     apxCloseHandle(hService);
@@ -641,7 +627,8 @@ static BOOL docmdStopService(LPAPXCMDLINE lpCmdline)
     APXHANDLE hService;
     BOOL  rv = FALSE;
 
-    apxLogWrite(APXLOG_MARK_INFO "Stopping service...");
+    apxLogWrite(APXLOG_MARK_INFO "Stopping service '%S' ...",
+                lpCmdline->szApplication);
     hService = apxCreateService(gPool, GENERIC_ALL, FALSE);
     if (IS_INVALID_HANDLE(hService)) {
         apxLogWrite(APXLOG_MARK_ERROR "Unable to open the Service Manager");
@@ -658,15 +645,15 @@ static BOOL docmdStopService(LPAPXCMDLINE lpCmdline)
                                NULL,
                                NULL);
         if (rv)
-            apxLogWrite(APXLOG_MARK_INFO "Service %S stopped",
+            apxLogWrite(APXLOG_MARK_INFO "Service '%S' stopped",
                         lpCmdline->szApplication);
         else
-            apxLogWrite(APXLOG_MARK_ERROR "Failed to stop %S service",
+            apxLogWrite(APXLOG_MARK_ERROR "Failed to stop '%S' service",
                         lpCmdline->szApplication);
 
     }
     else
-        apxDisplayError(TRUE, NULL, 0, "Unable to open %S service",
+        apxDisplayError(FALSE, NULL, 0, "Unable to open '%S' service",
                         lpCmdline->szApplication);
     apxCloseHandle(hService);
     apxLogWrite(APXLOG_MARK_INFO "Stop service finished.");
@@ -687,7 +674,17 @@ static BOOL docmdUpdateService(LPAPXCMDLINE lpCmdline)
     }
     SetLastError(0);
     /* Open the service */
-    if (apxServiceOpen(hService, lpCmdline->szApplication, SERVICE_ALL_ACCESS)) {
+    if (!apxServiceOpen(hService, lpCmdline->szApplication, SERVICE_ALL_ACCESS)) {
+        /* Close the existing manager handler.
+         * It will be reopened inside install.
+         */
+        apxCloseHandle(hService);
+        /* In case service doesn't exist try to install it.
+         * Install will fail if there is no minimum parameters required.
+         */
+        return docmdInstallService(lpCmdline);
+    }
+    else {
         DWORD dwStart = SERVICE_NO_CHANGE;
         DWORD dwType  = SERVICE_NO_CHANGE;
         LPCWSTR su = NULL;
@@ -724,18 +721,17 @@ static BOOL docmdUpdateService(LPAPXCMDLINE lpCmdline)
                                          dwStart,
                                          SERVICE_NO_CHANGE));
 
-        apxLogWrite(APXLOG_MARK_INFO "Service %S updated",
+        apxLogWrite(APXLOG_MARK_INFO "Service '%S' updated",
                     lpCmdline->szApplication);
 
         rv = (rv && saveConfiguration(lpCmdline));
     }
-    else {
-        apxDisplayError(TRUE, NULL, 0, "Unable to open %S service",
-                        lpCmdline->szApplication);
-        rv = FALSE;
-    }
     apxCloseHandle(hService);
-    apxLogWrite(APXLOG_MARK_INFO "Update service finished.");
+    if (rv)
+        apxLogWrite(APXLOG_MARK_INFO "Update service finished.");
+    else
+        apxLogWrite(APXLOG_MARK_INFO "Update service '%S' failed.",
+                                     lpCmdline->szApplication);
     return rv;
 }
 
@@ -818,7 +814,7 @@ static DWORD WINAPI serviceStop(LPVOID lpParameter)
             return 1;
         }
         if (!apxJavaInitialize(hWorker, _jni_classpath, _jni_jvmoptions,
-                               SO_JVMMS, SO_JVMMX, SO_JVMSS)) {
+                               SO_JVMMS, SO_JVMMX, SO_JVMSS, SO_JNIVFPRINTF)) {
             rv = 2;
             apxLogWrite(APXLOG_MARK_ERROR "Failed initializing java %s", _jni_classpath);
             goto cleanup;
@@ -894,7 +890,7 @@ static DWORD WINAPI serviceStop(LPVOID lpParameter)
             apxLogWrite(APXLOG_MARK_ERROR "Failed executing process");
             goto cleanup;
         } else {
-            apxLogWrite(APXLOG_MARK_DEBUG "Waiting stop worker to finish...");
+            apxLogWrite(APXLOG_MARK_DEBUG "Waiting for stop worker to finish...");
             apxHandleWait(hWorker, INFINITE, FALSE);
             apxLogWrite(APXLOG_MARK_DEBUG "Stop worker finished.");
         }
@@ -971,6 +967,14 @@ static DWORD serviceStart()
         apxLogWrite(APXLOG_MARK_INFO "Worker is not defined");
         return TRUE;    /* Nothing to do */
     }
+    if (SO_PIDFILE) {
+        gPidfileName = apxLogFile(gPool, SO_LOGPATH, SO_PIDFILE, NULL, FALSE);
+        if (GetFileAttributesW(gPidfileName) !=  INVALID_FILE_ATTRIBUTES) {
+            /* Pid file exists */
+            apxLogWrite(APXLOG_MARK_ERROR "Pid file '%S' exists", gPidfileName);
+            return 1;
+        }
+    }
     GetSystemTimeAsFileTime(&fts);
     if (_jni_startup) {
         if (SO_STARTPATH) {
@@ -986,7 +990,7 @@ static DWORD serviceStart()
             return 1;
         }
         if (!apxJavaInitialize(gWorker, _jni_classpath, _jni_jvmoptions,
-                               SO_JVMMS, SO_JVMMX, SO_JVMSS)) {
+                               SO_JVMMS, SO_JVMMX, SO_JVMSS, SO_JNIVFPRINTF)) {
             rv = 2;
             apxLogWrite(APXLOG_MARK_ERROR "Failed initializing java %s", _jni_classpath);
             goto cleanup;
@@ -1000,7 +1004,7 @@ static DWORD serviceStart()
         apxJavaSetOut(gWorker, FALSE, gStdwrap.szStdOutFilename);
         if (!apxJavaStart(gWorker)) {
             rv = 4;
-            apxLogWrite(APXLOG_MARK_ERROR "Failed starting Java");
+            apxLogWrite(APXLOG_MARK_ERROR "Failed to start Java");
             goto cleanup;
         }
         apxLogWrite(APXLOG_MARK_DEBUG "Java started %s", _jni_rclass);
@@ -1014,7 +1018,7 @@ static DWORD serviceStart()
                                     SO_PASSWORD,
                                     FALSE);
         if (IS_INVALID_HANDLE(gWorker)) {
-            apxLogWrite(APXLOG_MARK_ERROR "Failed creating process");
+            apxLogWrite(APXLOG_MARK_ERROR "Failed to create process");
             return 1;
         }
         if (!apxProcessSetExecutableW(gWorker, SO_STARTIMAGE)) {
@@ -1052,7 +1056,7 @@ static DWORD serviceStart()
          */
         if (!apxProcessExecute(gWorker)) {
             rv = 5;
-            apxLogWrite(APXLOG_MARK_ERROR "Failed executing process");
+            apxLogWrite(APXLOG_MARK_ERROR "Failed to execute process");
             goto cleanup;
         }
     }
@@ -1060,6 +1064,27 @@ static DWORD serviceStart()
         FILETIME fte;
         ULARGE_INTEGER s, e;
         DWORD    nms;
+        /* Create pidfile */
+        if (gPidfileName) {
+            char pids[32];
+            gPidfileHandle = CreateFileW(gPidfileName,
+                                         GENERIC_READ | GENERIC_WRITE,
+                                         FILE_SHARE_READ,
+                                         NULL,
+                                         CREATE_NEW,
+                                         FILE_ATTRIBUTE_NORMAL,
+                                         NULL);
+
+            if (gPidfileHandle != INVALID_HANDLE_VALUE) {
+                DWORD wr = 0;
+                if (_jni_startup)
+                    _snprintf(pids, 32, "%d\r\n", GetCurrentProcessId());
+                else
+                    _snprintf(pids, 32, "%d\r\n", apxProcessGetPid(gWorker));
+                WriteFile(gPidfileHandle, pids, (DWORD)strlen(pids), &wr, NULL);
+                FlushFileBuffers(gPidfileName);
+            }
+        }
         GetSystemTimeAsFileTime(&fte);
         s.LowPart  = fts.dwLowDateTime;
         s.HighPart = fts.dwHighDateTime;
@@ -1269,7 +1294,7 @@ void WINAPI serviceMain(DWORD argc, LPTSTR *argv)
         /* Service is started */
         DWORD rv;
         reportServiceStatus(SERVICE_RUNNING, NO_ERROR, 0);
-        apxLogWrite(APXLOG_MARK_DEBUG "Waiting worker to finish...");
+        apxLogWrite(APXLOG_MARK_DEBUG "Waiting for worker to finish...");
         /* Set console handler to capture CTRL events */
         SetConsoleCtrlHandler((PHANDLER_ROUTINE)console_handler, TRUE);
 
@@ -1319,24 +1344,29 @@ BOOL docmdDebugService(LPAPXCMDLINE lpCmdline)
 
     _service_mode = FALSE;
     _service_name = lpCmdline->szApplication;
-    apxLogWrite(APXLOG_MARK_INFO "Debugging Service...");
+    apxLogWrite(APXLOG_MARK_INFO "Debugging '%S' Service...", _service_name);
     serviceMain(0, NULL);
     apxLogWrite(APXLOG_MARK_INFO "Debug service finished.");
-
+    SAFE_CLOSE_HANDLE(gPidfileHandle);
+    if (gPidfileName)
+        DeleteFileW(gPidfileName);
     return rv;
 }
 
 BOOL docmdRunService(LPAPXCMDLINE lpCmdline)
 {
     BOOL rv = FALSE;
-    _service_mode = TRUE;
 
-    apxLogWrite(APXLOG_MARK_INFO "Running Service...");
+    _service_mode = TRUE;
     _service_name = lpCmdline->szApplication;
+    apxLogWrite(APXLOG_MARK_INFO "Running '%S' Service...", _service_name);
     _service_table[0].lpServiceName = lpCmdline->szApplication;
     _service_table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTIONW)serviceMain;
-    rv = (StartServiceCtrlDispatcherW(_service_table) == FALSE);
+    rv = (StartServiceCtrlDispatcherW(_service_table) != 0);
     apxLogWrite(APXLOG_MARK_INFO "Run service finished.");
+    SAFE_CLOSE_HANDLE(gPidfileHandle);
+    if (gPidfileName)
+        DeleteFileW(gPidfileName);
     return rv;
 }
 
@@ -1346,10 +1376,10 @@ void __cdecl main(int argc, char **argv)
 
     LPAPXCMDLINE lpCmdline;
 
-    if (argc > 1 && strncmp(argv[1], "//PP//", 6) == 0) {
+    if (argc > 1 && strncmp(argv[1], "//PP", 4) == 0) {
         /* Handy sleep routine defaulting to 1 minute */
         DWORD ss = 60;
-        if (argv[1][6]) {
+        if (argv[1][4] && argv[1][5] && argv[1][6]) {
              int us = atoi(argv[1] + 6);
              if (us > 0)
                 ss = (DWORD)us;
@@ -1369,11 +1399,13 @@ void __cdecl main(int argc, char **argv)
         goto cleanup;
     }
     apxCmdlineLoadEnvVars(lpCmdline);
-    if (lpCmdline->dwCmdIndex < 5 &&
-        !loadConfiguration(lpCmdline)) {
-        apxLogWrite(APXLOG_MARK_ERROR "Load configuration failed");
-        rv = 2;
-        goto cleanup;
+    if (lpCmdline->dwCmdIndex < 5) {
+        if (!loadConfiguration(lpCmdline) &&
+            lpCmdline->dwCmdIndex < 4) {
+            apxLogWrite(APXLOG_MARK_ERROR "Load configuration failed");
+            rv = 2;
+            goto cleanup;
+        }
     }
 
     apxLogOpen(gPool, SO_LOGPATH, SO_LOGPREFIX);
@@ -1390,6 +1422,18 @@ void __cdecl main(int argc, char **argv)
         gStdwrap.szStdErrFilename = SO_STDERROR;
     }
     redirectStdStreams(&gStdwrap);
+    if (lpCmdline->dwCmdIndex == 2) {
+        SYSTEMTIME t;
+        GetLocalTime(&t);
+        fprintf(stdout, "\n%d-%02d-%02d %02d:%02d:%02d "
+                        "Commons Daemon procrun stdout initialized\n",
+                        t.wYear, t.wMonth, t.wDay,
+                        t.wHour, t.wMinute, t.wSecond);
+        fprintf(stderr, "\n%d-%02d-%02d %02d:%02d:%02d "
+                        "Commons Daemon procrun stderr initialized\n",
+                        t.wYear, t.wMonth, t.wDay,
+                        t.wHour, t.wMinute, t.wSecond);
+    }
     switch (lpCmdline->dwCmdIndex) {
         case 1: /* Run Service as console application */
             if (!docmdDebugService(lpCmdline))
@@ -1415,16 +1459,26 @@ void __cdecl main(int argc, char **argv)
             if (!docmdDeleteService(lpCmdline))
                 rv = 8;
         break;
+        case 7: /* Print Usage and exit */
+            printUsage(lpCmdline, TRUE);
+        break;
+        case 8: /* Print version and exit */
+            printVersion();
+        break;
         default:
             /* Unknown command option */
             apxLogWrite(APXLOG_MARK_ERROR "Unknown command line option");
-            printUsage(lpCmdline);
+            printUsage(lpCmdline, FALSE);
             rv = 99;
         break;
     }
 
 cleanup:
-    apxLogWrite(APXLOG_MARK_INFO "Commons Daemon procrun finished.");
+    if (rv)
+        apxLogWrite(APXLOG_MARK_ERROR "Commons Daemon procrun failed "
+                                      "with exit value: %d", rv);
+    else
+        apxLogWrite(APXLOG_MARK_INFO "Commons Daemon procrun finished");
     if (lpCmdline)
         apxCmdlineFree(lpCmdline);
     if (_service_status_handle)
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.dsp b/src/native/nt/procrun/apps/prunsrv/prunsrv.dsp
deleted file mode 100644
index 9710271..0000000
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.dsp
+++ /dev/null
@@ -1,166 +0,0 @@
-# Microsoft Developer Studio Project File - Name="prunsrv" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=prunsrv - Win32 Unicode Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "prunsrv.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "prunsrv.mak" CFG="prunsrv - Win32 Unicode Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "prunsrv - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "prunsrv - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "prunsrv - Win32 Unicode Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "prunsrv - Win32 Unicode Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "prunsrv - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x50000 /subsystem:console /machine:I386
-
-!ELSEIF  "$(CFG)" == "prunsrv - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x40000 /subsystem:console /debug /machine:I386 /out:"Debug/prunsrvd.exe" /pdbtype:sept
-
-!ELSEIF  "$(CFG)" == "prunsrv - Win32 Unicode Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Unicode Release"
-# PROP BASE Intermediate_Dir "Unicode Release"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Unicode Release"
-# PROP Intermediate_Dir "Unicode Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /YX /FD /c
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x40000 /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x40000 /subsystem:console /machine:I386 /out:"Unicode Release/prunsrvu.exe"
-
-!ELSEIF  "$(CFG)" == "prunsrv - Win32 Unicode Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Unicode Debug"
-# PROP BASE Intermediate_Dir "Unicode Debug"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Unicode Debug"
-# PROP Intermediate_Dir "Unicode Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x40000 /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x40000 /subsystem:console /debug /machine:I386 /out:"Unicode Debug/prunsrvdu.exe" /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "prunsrv - Win32 Release"
-# Name "prunsrv - Win32 Debug"
-# Name "prunsrv - Win32 Unicode Release"
-# Name "prunsrv - Win32 Unicode Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\prunsrv.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\prunsrv.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\prunsrv.rc
-# ADD BASE RSC /l 0x41a
-# ADD RSC /l 0x41a /i "..\..\include"
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.h b/src/native/nt/procrun/apps/prunsrv/prunsrv.h
index 03141a3..8c3c389 100644
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.h
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.h
@@ -25,7 +25,7 @@
 #define _PRUNSRV_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "1.0.2.0" 
+#define PRG_VERSION    "1.0.3.0" 
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #endif /* _PRUNSRV_H */
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.ia64 b/src/native/nt/procrun/apps/prunsrv/prunsrv.ia64
deleted file mode 100644
index fe8e397..0000000
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.ia64
+++ /dev/null
@@ -1,109 +0,0 @@
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_ia64
-INTDIR=.\Release_ia64
-# Begin Custom Macros
-OutDir=.\Release_ia64
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0" 
-
-ALL : "$(OUTDIR)\prunsrv.exe"
-
-!ELSE 
-
-ALL : "libprocrun MAKE" "$(OUTDIR)\prunsrv.exe"
-
-!ENDIF 
-
-!IF "$(RECURSE)" == "1" 
-CLEAN :"libprocrun CLEAN" 
-!ELSE 
-CLEAN :
-!ENDIF 
-	- at erase "$(INTDIR)\prunsrv.obj"
-	- at erase "$(INTDIR)\prunsrv.res"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\prunsrv.exe"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32"  /D "_IA64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" 
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunsrv.bsc" 
-BSC32_SBRS= \
-	
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib bufferoverflowu.lib /nologo /stack:0x40000 /subsystem:console /incremental:no /pdb:"$(OUTDIR)\prunsrv.pdb" /machine:IA64 /out:"$(OUTDIR)\prunsrv.exe" 
-LINK32_OBJS= \
-	"$(INTDIR)\prunsrv.obj" \
-	"$(INTDIR)\prunsrv.res" \
-	"..\..\Release_ia64\libprocrun.lib"
-
-"$(OUTDIR)\prunsrv.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
-    $(LINK32) @<<
-  $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-	if exist $(OUTDIR)\prunsrv.exe.manifest mt.exe -manifest $(OUTDIR)\prunsrv.exe.manifest -outputresource:$(OUTDIR)\prunsrv.exe;1
-
-SOURCE=.\prunsrv.c
-
-"$(INTDIR)\prunsrv.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\prunsrv.rc
-
-"$(INTDIR)\prunsrv.res" : $(SOURCE) "$(INTDIR)"
-	$(RSC) /l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" $(SOURCE)
-
-
-"libprocrun MAKE" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.ia64
-   cd ".\APPS\prunsrv"
-
-"libprocrun CLEAN" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.ia64 RECURSE=1 CLEAN 
-   cd ".\APPS\prunsrv"
-
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.rc b/src/native/nt/procrun/apps/prunsrv/prunsrv.rc
index 1a650e0..ae02271 100644
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.rc
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.rc
@@ -22,8 +22,8 @@
 IDI_MAINICON         ICON                   "../../resources/procrunw.ico" 
 
 1 VERSIONINFO
- FILEVERSION 1,0,2,0
- PRODUCTVERSION 1,0,2,0
+ FILEVERSION 1,0,3,0
+ PRODUCTVERSION 1,0,3,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.vcproj b/src/native/nt/procrun/apps/prunsrv/prunsrv.vcproj
deleted file mode 100644
index 43a029e..0000000
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.vcproj
+++ /dev/null
@@ -1,400 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8,00"
-	Name="prunsrv"
-	ProjectGUID="{19338164-D7E8-492D-9D4C-F34766964979}"
-	RootNamespace="prunsrv"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib"
-				LinkIncremental="2"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_CONSOLE"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib"
-				LinkIncremental="2"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-			>
-			<File
-				RelativePath=".\prunsrv.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-			<File
-				RelativePath=".\prunsrv.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-			>
-			<File
-				RelativePath=".\prunsrv.rc"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.x86 b/src/native/nt/procrun/apps/prunsrv/prunsrv.x86
deleted file mode 100644
index 5ae161a..0000000
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.x86
+++ /dev/null
@@ -1,109 +0,0 @@
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_x86
-INTDIR=.\Release_x86
-# Begin Custom Macros
-OutDir=.\Release_x86
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0" 
-
-ALL : "$(OUTDIR)\prunsrv.exe"
-
-!ELSE 
-
-ALL : "libprocrun MAKE" "$(OUTDIR)\prunsrv.exe"
-
-!ENDIF 
-
-!IF "$(RECURSE)" == "1" 
-CLEAN :"libprocrun CLEAN" 
-!ELSE 
-CLEAN :
-!ENDIF 
-	- at erase "$(INTDIR)\prunsrv.obj"
-	- at erase "$(INTDIR)\prunsrv.res"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\prunsrv.exe"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Fp"$(INTDIR)\prunsrv.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" 
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunsrv.bsc" 
-BSC32_SBRS= \
-	
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x50000 /subsystem:console /incremental:no /pdb:"$(OUTDIR)\prunsrv.pdb" /machine:I386 /out:"$(OUTDIR)\prunsrv.exe" 
-LINK32_OBJS= \
-	"$(INTDIR)\prunsrv.obj" \
-	"$(INTDIR)\prunsrv.res" \
-	"..\..\Release_x86\libprocrun.lib"
-
-"$(OUTDIR)\prunsrv.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
-    $(LINK32) @<<
-  $(LINK32_FLAGS) $(LINK32_OBJS) commode.obj
-<<
-	if exist $(OUTDIR)\prunsrv.exe.manifest mt.exe -manifest $(OUTDIR)\prunsrv.exe.manifest -outputresource:$(OUTDIR)\prunsrv.exe;1
-
-SOURCE=.\prunsrv.c
-
-"$(INTDIR)\prunsrv.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\prunsrv.rc
-
-"$(INTDIR)\prunsrv.res" : $(SOURCE) "$(INTDIR)"
-	$(RSC) /l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" $(SOURCE)
-
-
-"libprocrun MAKE" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.x86
-   cd ".\APPS\prunsrv"
-
-"libprocrun CLEAN" : 
-   cd "..\.."
-   $(MAKE) /F .\libprocrun.x86 RECURSE=1 CLEAN 
-   cd ".\APPS\prunsrv"
-
diff --git a/src/native/nt/procrun/include/Makefile.inc b/src/native/nt/procrun/include/Makefile.inc
new file mode 100644
index 0000000..00854a5
--- /dev/null
+++ b/src/native/nt/procrun/include/Makefile.inc
@@ -0,0 +1,346 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @author Mladen Turk
+#
+#
+# ====================================================================
+#
+# Makefile.inc Master makefile definitions.
+#                 This file defines CPU architecture and basic compiler
+#                 and linker parameters.
+# Common params:
+#                 CPU       Compile for specified CPU. Supported CPU's are:
+#                           X86 (Common x86 architecture)
+#                           X64 (AMD64/EMT64 architecture)
+#                           I64 (Intel IA64 architecture)
+#                           If not specified it will default to the
+#                           PROCESSOR_ARCHITECTURE environment variable
+#                           or to the X86 if not specified.
+#                 WINVER    Compile for specified Windows version
+#                           WINNT   for Windows 2000 and up(default)
+#                           WINXP   for Windows XP and up
+#                           WIN2003 for Windows 2003 and up
+#                           VSITA   for Windows Vista and up
+#                           Deprecated targets (may not even compile):
+#                               NT4     for Windows NT4 and up
+#                               WIN9X   for Windows 95, 98 and Me
+#                 BUILD     Build version
+#                           RETAIL or RELEASE (default)
+#                           DEBUG
+#                 TARGET    Build application target
+#                           EXE Console executable (default)
+#                           GUI Windows GUI executable
+#                           DLL Dynamic Link Library
+#                           LIB Static library
+#               UNICODE     Build unicode version
+#                           If definded and not empty -D_UNICODE is added
+#                           to CFLAGS; -D_MBCS is added otherwise
+# Environment variables  used:
+#           EXTRA_CFLAGS    Added to the common CFLAGS
+#           EXTRA_CXXFLAGS  Added to the common CXXFLAGS
+#           EXTRA_LIBS      Added to the common LIBS
+#           EXTRA_LFLAGS    Added to the common LFLAGS
+#           EXTRA_RCFLAGS   Added to the common RCFLAGS
+#
+# Compiler tools environment variables:
+#                 CC        C compiler  (defaults to cl.exe)
+#                 CXX       C++ compiler  (defaults to $CC -TP)
+#                 CPP       C preprocessor  (defaults to $CC -EP)
+#                 LINK      Linker (defaults to link.exe)
+#                 RC        Resource compiler (defaults to rc.exe)
+#                 MT        Manifest toolkit (defaults to mt.exe)
+#                 ML        Assembler (defaults to ml.exe or ml64.exe)
+#
+# Originally contributed by Mladen Turk <mturk jboss.com>
+#
+# ====================================================================
+#
+
+# C/C++ compiler
+!IF !DEFINED(CC) || "$(CC)" == ""
+CC = cl.exe
+!ENDIF
+!IF !DEFINED(CXX) || "$(CXX)" == ""
+CXX = $(CC) -TP
+!ENDIF
+!IF !DEFINED(CPP) || "$(CPP)" == ""
+CPP = $(CC) -EP
+!ENDIF
+# Linker
+!IF !DEFINED(LINK) || "$(LINK)" == ""
+LINK = link.exe
+!ENDIF
+# Resource Compiler
+!IF !DEFINED(RC) || "$(RC)" == ""
+RC = rc.exe
+!ENDIF
+# Manifest toolkit
+!IF !DEFINED(MT) || "$(MT)" == ""
+MT = mt.exe
+!ENDIF
+
+# Use BUILD_CPU if CPU was not set
+!IF !DEFINED(CPU) || "$(CPU)" == ""
+!IF "$(BUILD_CPU)" == "i386" || "$(BUILD_CPU)" == "x86" || "$(BUILD_CPU)" == "i686"
+CPU=X86
+!ENDIF
+!IF "$(BUILD_CPU)" == "amd64" || "$(BUILD_CPU)" == "x86_64" || "$(BUILD_CPU)" == "x64"
+CPU=X64
+!ENDIF
+!IF "$(BUILD_CPU)" == "ia64" || "$(BUILD_CPU)" == "i64"
+CPU=I64
+!ENDIF
+!ENDIF
+# Figure out CPU from the current host
+!IF !DEFINED(CPU) || "$(CPU)" == ""
+!IF "$(PROCESSOR_ARCHITECTURE)" == ""
+!IF "$(PROCESSOR_ARCHITEW6432)" == ""
+CPU=X86
+!ELSE
+CPU=$(PROCESSOR_ARCHITEW6432)
+!ENDIF
+!ELSE
+CPU=$(PROCESSOR_ARCHITECTURE)
+!ENDIF
+!ENDIF
+
+!IF "$(CPU)" != "X86"
+!IF "$(CPU)" != "X64"
+!IF "$(CPU)" != "I64"
+!ERROR Must specify CPU environment variable (X86, X64, I64) $(CPU)
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF !DEFINED(TARGET) || "$(TARGET)" == ""
+TARGET=EXE
+!ENDIF
+
+!IF "$(TARGET)" != "EXE"
+!IF "$(TARGET)" != "GUI"
+!IF "$(TARGET)" != "DLL"
+!IF "$(TARGET)" != "LIB"
+!ERROR Must specify TARGET environment variable (EXE, GUI, DLL, LIB)
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF !DEFINED(WINVER) || "$(WINVER)" == ""
+WINVER=WINXP
+!ENDIF
+
+
+!IF "$(WINVER)" != "WINNT"
+!IF "$(WINVER)" != "WINXP"
+!IF "$(WINVER)" != "WIN2003"
+!IF "$(WINVER)" != "VISTA"
+!IF "$(WINVER)" != "WIN7"
+!ERROR Must specify WINVER environment variable (WINNT, WINXP, WIN2003, VISTA, WIN7)
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF "$(WINVER)" == "WINNT"
+NMAKE_WINVER = 0x0500
+_WIN32_IE = 0x0500
+!ELSEIF "$(WINVER)" == "WINXP"
+NMAKE_WINVER = 0x0501
+_WIN32_IE = 0x0600
+!ELSEIF "$(WINVER)" == "WIN2003"
+NMAKE_WINVER = 0x0502
+_WIN32_IE = 0x0600
+!ELSEIF "$(WINVER)" == "VISTA"
+NMAKE_WINVER = 0x0600
+_WIN32_IE = 0x0700
+!ELSEIF "$(WINVER)" == "WIN7"
+NMAKE_WINVER = 0x0700
+_WIN32_IE = 0x0800
+!ELSE
+!ERROR Must specify WINVER environment variable (WINNT, WINXP, WIN2003, VISTA, WIN7)
+!ENDIF
+
+NMAKE_WINNT = -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER) -DWINVER=$(NMAKE_WINVER) -D_WIN32_IE=$(_WIN32_IE)
+
+!IF !DEFINED(BUILD) || "$(BUILD)" == ""
+BUILD=RELEASE
+!ENDIF
+!IFDEF RELEASE
+BUILD=RELEASE
+!ENDIF
+!IFDEF DEBUG
+BUILD=DEBUG
+!ENDIF
+!IFDEF NODEBUG
+BUILD=RELEASE
+!ENDIF
+
+!IF "$(BUILD)" != "RELEASE"
+!IF "$(BUILD)" != "DEBUG"
+!ERROR Must specify BUILD environment variable (RELEASE, DEBUG)
+!ENDIF
+!ENDIF
+
+# Common flags for all platforms
+CMN_CFLAGS = -c -nologo -DWIN32 -D_WIN32 -D_WINDOWS $(NMAKE_WINNT) -W3
+!IF "$(TARGET)" == "EXE"
+CMN_CFLAGS = $(CMN_CFLAGS) -D_CONSOLE
+!ENDIF
+# Mark that extern C newer throws C++ exception
+CMN_CFLAGS = $(CMN_CFLAGS) -EHsc
+
+!IF !DEFINED(UNICODE) || "$(UNICODE)" == ""
+CMN_CFLAGS = $(CMN_CFLAGS) -D_MBCS -DMBCS
+!ELSE
+CMN_CFLAGS = $(CMN_CFLAGS) -D_UNICODE -DUNICODE
+!ENDIF
+
+!IF "$(CPU)" == "X86"
+CPU_CFLAGS = -D_X86_=1
+MACHINE=X86
+MACHINE_LC=i386
+!ELSEIF "$(CPU)" == "X64"
+CPU_CFLAGS = -D_AMD64_=1 -DWIN64 -D_WIN64
+MACHINE=AMD64
+MACHINE_LC=amd64
+!ELSEIF "$(CPU)" == "I64"
+CPU_CFLAGS = -D_IA64_=1 -DWIN64 -D_WIN64
+MACHINE=IA64
+MACHINE_LC=ia64
+!ENDIF
+
+!IF "$(BUILD)" == "RELEASE"
+!IF "$(CPU)" == "X86"
+OPT_CFLAGS = -O2 -Ob2 -Oy- -Zi -DNDEBUG
+!ELSE
+OPT_CFLAGS = -O2 -Ob2 -Zi -DNDEBUG
+!ENDIF
+!ELSE
+OPT_CFLAGS = -Od -Zi -DDEBUG -D_DEBUG
+!ENDIF
+
+!IF DEFINED(STATIC_CRT)
+CRT_CFLAGS = -D_MT -MT
+!ELSE
+CRT_CFLAGS = -D_MT -MD
+!ENDIF
+
+!IF "$(BUILD)" == "DEBUG"
+CRT_CFLAGS = $(CRT_CFLAGS)d
+!ENDIF
+
+CFLAGS = $(CMN_CFLAGS) $(CPU_CFLAGS) $(OPT_CFLAGS) $(CRT_CFLAGS)
+
+!IF DEFINED(EXTRA_CFLAGS)
+CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
+!ENDIF
+
+# Cleanup CXXFLAGS
+CXXFLAGS =
+!IF DEFINED(EXTRA_CXXFLAGS)
+CXXFLAGS = $(EXTRA_CXXFLAGS)
+!ENDIF
+
+# Linker section
+LIBS = kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib
+# Extra libs from command line or env
+!IF DEFINED(EXTRA_LIBS)
+LIBS = $(LIBS) $(EXTRA_LIBS)
+!ENDIF
+
+# Run-Time Error Checks
+!IF "$(BUILD)" == "DEBUG"
+!IF DEFINED(RTC_CHECK)
+LIBS = $(LIBS) RunTmChk.lib
+CFLAGS = $(CFLAGS) -RTC1
+!ENDIF
+!ENDIF
+
+COMMON_LFLAGS = /NOLOGO
+
+# Always add debugging to the linker
+OPT_LFLAGS = /INCREMENTAL:NO /DEBUG
+!IF "$(BUILD)" == "RELEASE"
+OPT_LFLAGS = /OPT:REF
+!ENDIF
+
+!IF "$(TARGET)" == "EXE"
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "GUI"
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "DLL"
+LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "LIB"
+LFLAGS = -lib $(COMMON_LFLAGS)
+!ENDIF
+
+!IF DEFINED(EXTRA_LFLAGS)
+LFLAGS = $(LFLAGS) $(EXTRA_LFLAGS)
+!ENDIF
+
+!IF "$(TARGET)" != "LIB"
+LFLAGS = $(LFLAGS) $(OPT_LFLAGS)
+!ENDIF
+
+# Resource compiler flags
+
+RCFLAGS=/l 0x409
+!IF "$(BUILD)" == "RELEASE"
+RCFLAGS = $(RCFLAGS) /d "NDEBUG"
+!ELSE
+RCFLAGS = $(RCFLAGS) /d "_DEBUG" /d "DEBUG"
+!ENDIF
+RCFLAGS = $(RCFLAGS)
+!IF DEFINED(EXTRA_RCFLAGS)
+RCFLAGS = $(RCFLAGS) $(EXTRA_RCFLAGS)
+!ENDIF
+
+
+# Build Target dir e.g. WINNT_I386_RELEASE_DLL
+!IF !DEFINED(WORKDIR) || "$(WORKDIR)" == ""
+!IF !DEFINED(WORKDIR_EXT) || "$(WORKDIR_EXT)" == ""
+WORKDIR = $(WINVER)_$(CPU)_$(TARGET)_$(BUILD)
+WORKDIR_DLL = $(WINVER)_$(CPU)_DLL_$(BUILD)
+WORKDIR_LIB = $(WINVER)_$(CPU)_LIB_$(BUILD)
+WORKDIR_EXE = $(WINVER)_$(CPU)_EXE_$(BUILD)
+!ELSE
+WORKDIR = $(WINVER)_$(CPU)_$(BUILDIR_EXT)_$(BUILD)
+!ENDIF
+!ENDIF
+
+CLEANTARGET=if exist "$(WORKDIR)\$(NULL)" rd /s /q $(WORKDIR)
+MAKEWORKDIR=if not exist "$(WORKDIR)\$(NULL)" mkdir $(WORKDIR)
+MAKEINSTALL=if not exist "$(INSTALLLOC)\$(NULL)" mkdir $(INSTALLLOC)
+
+!IF DEFINED(JAVA_HOME) && "$(JAVA_HOME)" != ""
+JAVA_INCLUDES=-I "$(JAVA_HOME)\include" -I "$(JAVA_HOME)\include\win32"
+!ENDIF
+
+# Assembler Section
+!IF !DEFINED(ML) || "$(ML)" == ""
+!IF "$(CPU)" == "X86"
+ML = ml.exe
+AFLAGS = /coff /Zi /c
+!ELSEIF "$(CPU)" == "X64"
+ML = ml64.exe
+AFLAGS = /Zi /c
+!ELSEIF "$(CPU)" == "I64"
+ML = ml64.exe
+AFLAGS = /coff /Zi /c
+!ENDIF
+!ENDIF
diff --git a/src/native/nt/procrun/include/apxwin.h b/src/native/nt/procrun/include/apxwin.h
index c2490a6..3659b11 100644
--- a/src/native/nt/procrun/include/apxwin.h
+++ b/src/native/nt/procrun/include/apxwin.h
@@ -21,8 +21,8 @@
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 
 #endif
-#ifndef WIN32_CE
-#define _WIN32_WINNT 0x0400
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
 #endif
 
 #include <windows.h>
@@ -95,6 +95,8 @@ typedef _W64 int            intptr_t;
 #define SIZ_DESMAX         (SIZ_DESLEN -1)
 #define SIZ_HUGLEN         8192
 #define SIZ_HUGMAX         (SIZ_HUGLEN -1)
+#define SIZ_PATHLEN        4096
+#define SIZ_PATHMAX        4095
 
 #include "handles.h"
 #include "log.h"
diff --git a/src/native/nt/procrun/include/javajni.h b/src/native/nt/procrun/include/javajni.h
index 39326aa..1787eda 100644
--- a/src/native/nt/procrun/include/javajni.h
+++ b/src/native/nt/procrun/include/javajni.h
@@ -25,7 +25,7 @@ APXHANDLE   apxCreateJava(APXHANDLE hPool, LPCWSTR szJvmDllPath);
 
 BOOL        apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
                               LPCVOID lpOptions, DWORD dwMs, DWORD dwMx,
-                              DWORD dwSs);
+                              DWORD dwSs, DWORD bJniVfprintf);
 DWORD
 apxJavaCmdInitialize(APXHANDLE hPool, LPCWSTR szClassPath, LPCWSTR szClass,
                      LPCWSTR szOptions, DWORD dwMs, DWORD dwMx,
diff --git a/src/native/nt/procrun/include/log.h b/src/native/nt/procrun/include/log.h
index 50fc1de..64243d4 100644
--- a/src/native/nt/procrun/include/log.h
+++ b/src/native/nt/procrun/include/log.h
@@ -13,8 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
-/* Logfile handling 
+
+/* Logfile handling
  * Use Systemdir/Logfiles/Apache as a default path
  */
 
@@ -54,7 +54,8 @@ LPWSTR apxLogFile(
     APXHANDLE hPool,
     LPCWSTR szPath,
     LPCWSTR szPrefix,
-    LPCWSTR szName
+    LPCWSTR szName,
+    BOOL bTimeStamp
 );
 
 HANDLE apxLogOpen(
diff --git a/src/native/nt/procrun/include/rprocess.h b/src/native/nt/procrun/include/rprocess.h
index f98e652..5a01b04 100644
--- a/src/native/nt/procrun/include/rprocess.h
+++ b/src/native/nt/procrun/include/rprocess.h
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #ifndef _RPROCESS_H_INCLUDED_
 #define _RPROCESS_H_INCLUDED_
 
@@ -69,6 +69,7 @@ DWORD       apxProcessWait(APXHANDLE hProcess, DWORD dwMilliseconds,
                            BOOL bKill);
 
 BOOL        apxProcessRunning(APXHANDLE hProcess);
+DWORD       apxProcessGetPid(APXHANDLE hProcess);
 
 
 __APXEND_DECLS
diff --git a/src/native/nt/procrun/libprocrun.amd64 b/src/native/nt/procrun/libprocrun.amd64
deleted file mode 100644
index 0111773..0000000
--- a/src/native/nt/procrun/libprocrun.amd64
+++ /dev/null
@@ -1,158 +0,0 @@
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_amd64
-INTDIR=.\Release_amd64
-# Begin Custom Macros
-OutDir=.\Release_amd64
-# End Custom Macros
-
-ALL : "$(OUTDIR)\libprocrun.lib"
-
-
-CLEAN :
-	- at erase "$(INTDIR)\cmdline.obj"
-	- at erase "$(INTDIR)\console.obj"
-	- at erase "$(INTDIR)\gui.obj"
-	- at erase "$(INTDIR)\handles.obj"
-	- at erase "$(INTDIR)\javajni.obj"
-	- at erase "$(INTDIR)\log.obj"
-	- at erase "$(INTDIR)\mclib.obj"
-	- at erase "$(INTDIR)\registry.obj"
-	- at erase "$(INTDIR)\rprocess.obj"
-	- at erase "$(INTDIR)\service.obj"
-	- at erase "$(INTDIR)\utils.obj"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\libprocrun.lib"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_AMD64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-RSC=rc.exe
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\libprocrun.bsc" 
-BSC32_SBRS= \
-	
-LIB32=link.exe -lib
-LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libprocrun.lib" 
-LIB32_OBJS= \
-	"$(INTDIR)\cmdline.obj" \
-	"$(INTDIR)\console.obj" \
-	"$(INTDIR)\gui.obj" \
-	"$(INTDIR)\handles.obj" \
-	"$(INTDIR)\javajni.obj" \
-	"$(INTDIR)\log.obj" \
-	"$(INTDIR)\mclib.obj" \
-	"$(INTDIR)\registry.obj" \
-	"$(INTDIR)\rprocess.obj" \
-	"$(INTDIR)\service.obj" \
-	"$(INTDIR)\utils.obj"
-
-"$(OUTDIR)\libprocrun.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
-    $(LIB32) @<<
-  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
-<<
-
-
-SOURCE=.\src\cmdline.c
-
-"$(INTDIR)\cmdline.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\console.c
-
-"$(INTDIR)\console.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\gui.c
-
-"$(INTDIR)\gui.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\handles.c
-
-"$(INTDIR)\handles.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\javajni.c
-
-"$(INTDIR)\javajni.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\log.c
-
-"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\mclib.c
-
-"$(INTDIR)\mclib.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\registry.c
-
-"$(INTDIR)\registry.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\rprocess.c
-
-"$(INTDIR)\rprocess.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\service.c
-
-"$(INTDIR)\service.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\utils.c
-
-"$(INTDIR)\utils.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
diff --git a/src/native/nt/procrun/libprocrun.dsp b/src/native/nt/procrun/libprocrun.dsp
deleted file mode 100644
index e5dd6cd..0000000
--- a/src/native/nt/procrun/libprocrun.dsp
+++ /dev/null
@@ -1,234 +0,0 @@
-# Microsoft Developer Studio Project File - Name="libprocrun" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=libprocrun - Win32 Unicode Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "libprocrun.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "libprocrun.mak" CFG="libprocrun - Win32 Unicode Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "libprocrun - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "libprocrun - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "libprocrun - Win32 Unicode Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "libprocrun - Win32 Unicode Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "libprocrun - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF  "$(CFG)" == "libprocrun - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF  "$(CFG)" == "libprocrun - Win32 Unicode Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Unicode Release"
-# PROP BASE Intermediate_Dir "Unicode Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Unicode Release"
-# PROP Intermediate_Dir "Unicode Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF  "$(CFG)" == "libprocrun - Win32 Unicode Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Unicode Debug"
-# PROP BASE Intermediate_Dir "Unicode Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Unicode Debug"
-# PROP Intermediate_Dir "Unicode Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "_LIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF 
-
-# Begin Target
-
-# Name "libprocrun - Win32 Release"
-# Name "libprocrun - Win32 Debug"
-# Name "libprocrun - Win32 Unicode Release"
-# Name "libprocrun - Win32 Unicode Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\src\cmdline.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\console.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\gui.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\handles.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\javajni.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\log.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\mclib.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\registry.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\rprocess.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\service.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\utils.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\include\apxwin.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\cmdline.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\console.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\gui.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\handles.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\javajni.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\log.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\mclib.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\private.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\registry.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\rprocess.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\service.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/src/native/nt/procrun/libprocrun.ia64 b/src/native/nt/procrun/libprocrun.ia64
deleted file mode 100644
index c865612..0000000
--- a/src/native/nt/procrun/libprocrun.ia64
+++ /dev/null
@@ -1,158 +0,0 @@
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_ia64
-INTDIR=.\Release_ia64
-# Begin Custom Macros
-OutDir=.\Release_ia64
-# End Custom Macros
-
-ALL : "$(OUTDIR)\libprocrun.lib"
-
-
-CLEAN :
-	- at erase "$(INTDIR)\cmdline.obj"
-	- at erase "$(INTDIR)\console.obj"
-	- at erase "$(INTDIR)\gui.obj"
-	- at erase "$(INTDIR)\handles.obj"
-	- at erase "$(INTDIR)\javajni.obj"
-	- at erase "$(INTDIR)\log.obj"
-	- at erase "$(INTDIR)\mclib.obj"
-	- at erase "$(INTDIR)\registry.obj"
-	- at erase "$(INTDIR)\rprocess.obj"
-	- at erase "$(INTDIR)\service.obj"
-	- at erase "$(INTDIR)\utils.obj"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\libprocrun.lib"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_IA64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-RSC=rc.exe
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\libprocrun.bsc" 
-BSC32_SBRS= \
-	
-LIB32=link.exe -lib
-LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libprocrun.lib" 
-LIB32_OBJS= \
-	"$(INTDIR)\cmdline.obj" \
-	"$(INTDIR)\console.obj" \
-	"$(INTDIR)\gui.obj" \
-	"$(INTDIR)\handles.obj" \
-	"$(INTDIR)\javajni.obj" \
-	"$(INTDIR)\log.obj" \
-	"$(INTDIR)\mclib.obj" \
-	"$(INTDIR)\registry.obj" \
-	"$(INTDIR)\rprocess.obj" \
-	"$(INTDIR)\service.obj" \
-	"$(INTDIR)\utils.obj"
-
-"$(OUTDIR)\libprocrun.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
-    $(LIB32) @<<
-  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
-<<
-
-
-SOURCE=.\src\cmdline.c
-
-"$(INTDIR)\cmdline.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\console.c
-
-"$(INTDIR)\console.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\gui.c
-
-"$(INTDIR)\gui.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\handles.c
-
-"$(INTDIR)\handles.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\javajni.c
-
-"$(INTDIR)\javajni.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\log.c
-
-"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\mclib.c
-
-"$(INTDIR)\mclib.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\registry.c
-
-"$(INTDIR)\registry.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\rprocess.c
-
-"$(INTDIR)\rprocess.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\service.c
-
-"$(INTDIR)\service.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\utils.c
-
-"$(INTDIR)\utils.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
diff --git a/src/native/nt/procrun/libprocrun.vcproj b/src/native/nt/procrun/libprocrun.vcproj
deleted file mode 100644
index 9c012bf..0000000
--- a/src/native/nt/procrun/libprocrun.vcproj
+++ /dev/null
@@ -1,388 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8,00"
-	Name="libprocrun"
-	ProjectGUID="{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}"
-	RootNamespace="libprocrun"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_LIB"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".\include;$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
-				PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_LIB"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-			>
-			<File
-				RelativePath=".\src\cmdline.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\console.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\gui.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\handles.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\javajni.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\log.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\mclib.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\registry.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\rprocess.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\service.c"
-				>
-			</File>
-			<File
-				RelativePath=".\src\utils.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-			<File
-				RelativePath=".\include\apxwin.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\cmdline.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\console.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\gui.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\handles.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\javajni.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\log.h"
-				>
-			</File>
-			<File
-				RelativePath=".\src\mclib.h"
-				>
-			</File>
-			<File
-				RelativePath=".\src\private.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\registry.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\rprocess.h"
-				>
-			</File>
-			<File
-				RelativePath=".\include\service.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-			>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/libprocrun.x86 b/src/native/nt/procrun/libprocrun.x86
deleted file mode 100644
index 88a90f0..0000000
--- a/src/native/nt/procrun/libprocrun.x86
+++ /dev/null
@@ -1,158 +0,0 @@
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE 
-NULL=nul
-!ENDIF 
-
-OUTDIR=.\Release_x86
-INTDIR=.\Release_x86
-# Begin Custom Macros
-OutDir=.\Release_x86
-# End Custom Macros
-
-ALL : "$(OUTDIR)\libprocrun.lib"
-
-
-CLEAN :
-	- at erase "$(INTDIR)\cmdline.obj"
-	- at erase "$(INTDIR)\console.obj"
-	- at erase "$(INTDIR)\gui.obj"
-	- at erase "$(INTDIR)\handles.obj"
-	- at erase "$(INTDIR)\javajni.obj"
-	- at erase "$(INTDIR)\log.obj"
-	- at erase "$(INTDIR)\mclib.obj"
-	- at erase "$(INTDIR)\registry.obj"
-	- at erase "$(INTDIR)\rprocess.obj"
-	- at erase "$(INTDIR)\service.obj"
-	- at erase "$(INTDIR)\utils.obj"
-	- at erase "$(INTDIR)\vc60.idb"
-	- at erase "$(OUTDIR)\libprocrun.lib"
-
-"$(OUTDIR)" :
-    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Fp"$(INTDIR)\libprocrun.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
-
-.c{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.c{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cpp{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-.cxx{$(INTDIR)}.sbr::
-   $(CPP) @<<
-   $(CPP_PROJ) $< 
-<<
-
-RSC=rc.exe
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\libprocrun.bsc" 
-BSC32_SBRS= \
-	
-LIB32=link.exe -lib
-LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libprocrun.lib" 
-LIB32_OBJS= \
-	"$(INTDIR)\cmdline.obj" \
-	"$(INTDIR)\console.obj" \
-	"$(INTDIR)\gui.obj" \
-	"$(INTDIR)\handles.obj" \
-	"$(INTDIR)\javajni.obj" \
-	"$(INTDIR)\log.obj" \
-	"$(INTDIR)\mclib.obj" \
-	"$(INTDIR)\registry.obj" \
-	"$(INTDIR)\rprocess.obj" \
-	"$(INTDIR)\service.obj" \
-	"$(INTDIR)\utils.obj"
-
-"$(OUTDIR)\libprocrun.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
-    $(LIB32) @<<
-  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
-<<
-
-
-SOURCE=.\src\cmdline.c
-
-"$(INTDIR)\cmdline.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\console.c
-
-"$(INTDIR)\console.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\gui.c
-
-"$(INTDIR)\gui.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\handles.c
-
-"$(INTDIR)\handles.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\javajni.c
-
-"$(INTDIR)\javajni.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\log.c
-
-"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\mclib.c
-
-"$(INTDIR)\mclib.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\registry.c
-
-"$(INTDIR)\registry.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\rprocess.c
-
-"$(INTDIR)\rprocess.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\service.c
-
-"$(INTDIR)\service.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=.\src\utils.c
-
-"$(INTDIR)\utils.obj" : $(SOURCE) "$(INTDIR)"
-	$(CPP) $(CPP_PROJ) $(SOURCE)
-
diff --git a/src/native/nt/procrun/procrun.dsw b/src/native/nt/procrun/procrun.dsw
deleted file mode 100644
index 2f2915b..0000000
--- a/src/native/nt/procrun/procrun.dsw
+++ /dev/null
@@ -1,74 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "apsvcmgr"=.\APPS\apsvcmgr\apsvcmgr.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name libprocrun
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "libprocrun"=.\libprocrun.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "prunmgr"=.\APPS\prunmgr\prunmgr.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name libprocrun
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "prunsrv"=.\APPS\prunsrv\prunsrv.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name libprocrun
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/src/native/nt/procrun/procrun.sln b/src/native/nt/procrun/procrun.sln
deleted file mode 100644
index 7df78cd..0000000
--- a/src/native/nt/procrun/procrun.sln
+++ /dev/null
@@ -1,64 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libprocrun", "libprocrun.vcproj", "{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "prunsrv", "apps\prunsrv\prunsrv.vcproj", "{19338164-D7E8-492D-9D4C-F34766964979}"
-	ProjectSection(ProjectDependencies) = postProject
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04} = {7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "prunmgr", "apps\prunmgr\prunmgr.vcproj", "{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}"
-	ProjectSection(ProjectDependencies) = postProject
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04} = {7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "apsvcmgr", "apps\apsvcmgr\apsvcmgr.vcproj", "{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}"
-	ProjectSection(ProjectDependencies) = postProject
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04} = {7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Debug|Win32.Build.0 = Debug|Win32
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Debug|x64.ActiveCfg = Release|x64
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Debug|x64.Build.0 = Release|x64
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Release|Win32.ActiveCfg = Release|Win32
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Release|Win32.Build.0 = Release|Win32
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Release|x64.ActiveCfg = Release|x64
-		{7F9C3AC9-0AFA-428D-A4AC-1F1E53422B04}.Release|x64.Build.0 = Release|x64
-		{19338164-D7E8-492D-9D4C-F34766964979}.Debug|Win32.ActiveCfg = Debug|Win32
-		{19338164-D7E8-492D-9D4C-F34766964979}.Debug|Win32.Build.0 = Debug|Win32
-		{19338164-D7E8-492D-9D4C-F34766964979}.Debug|x64.ActiveCfg = Release|x64
-		{19338164-D7E8-492D-9D4C-F34766964979}.Debug|x64.Build.0 = Release|x64
-		{19338164-D7E8-492D-9D4C-F34766964979}.Release|Win32.ActiveCfg = Release|Win32
-		{19338164-D7E8-492D-9D4C-F34766964979}.Release|Win32.Build.0 = Release|Win32
-		{19338164-D7E8-492D-9D4C-F34766964979}.Release|x64.ActiveCfg = Release|x64
-		{19338164-D7E8-492D-9D4C-F34766964979}.Release|x64.Build.0 = Release|x64
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Debug|Win32.Build.0 = Debug|Win32
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Debug|x64.ActiveCfg = Release|x64
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Debug|x64.Build.0 = Release|x64
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Release|Win32.ActiveCfg = Release|Win32
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Release|Win32.Build.0 = Release|Win32
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Release|x64.ActiveCfg = Release|x64
-		{1ABB5DF8-8560-4A20-BEA4-88A7E43C6B28}.Release|x64.Build.0 = Release|x64
-		{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}.Debug|Win32.Build.0 = Debug|Win32
-		{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}.Debug|x64.ActiveCfg = Release|x64
-		{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}.Release|Win32.ActiveCfg = Release|Win32
-		{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}.Release|Win32.Build.0 = Release|Win32
-		{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}.Release|x64.ActiveCfg = Release|x64
-		{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/src/native/nt/procrun/src/cmdline.c b/src/native/nt/procrun/src/cmdline.c
index fb0af39..c431c23 100644
--- a/src/native/nt/procrun/src/cmdline.c
+++ b/src/native/nt/procrun/src/cmdline.c
@@ -102,34 +102,38 @@ LPAPXCMDLINE apxCmdlineParse(
             *p = L'\0';
         }
     }
-    if (lpszCommands && _st_sys_argc > 1 && lstrlenW(_st_sys_argvw[1]) > 5) {
-        if (_st_sys_argvw[1][0] == L'/' &&
-            _st_sys_argvw[1][1] == L'/' &&
-            _st_sys_argvw[1][5] == L'/') { /* allow max tree char command */
-            l = 2;
-            while (_st_sys_argvw[1][l] != L'/') {
-                cmd[l - 2] = _st_sys_argvw[1][l];
+    if (lpszCommands && _st_sys_argc > 1 && lstrlenW(_st_sys_argvw[1]) > 2) {
+        LPWSTR ca = _st_sys_argvw[1];
+        if (ca[0] == L'/' && ca[1] == L'/') {
+            l   = 0;
+            ca += 2;
+            while (*ca && *ca != L'/') {
+                cmd[l] = *ca;
                 if (l++ > 3)
                     break;
+                ca++;
             }
-            cmd[l - 2] = L'\0';
+            cmd[l] = L'\0';
             while (lpszCommands[i]) {
                 if (lstrcmpW(lpszCommands[i++], cmd) == 0) {
                     lpCmdline->dwCmdIndex = i;
-                    s = 2;
                     break;
                 }
             }
             if (lpCmdline->dwCmdIndex) {
-                _st_sys_argvw[1][l+1] = L'\0';
-                lpCmdline->szApplication = &(_st_sys_argvw[1][l+2]);
-                if (!lstrlenW(lpCmdline->szApplication))
+                while (*ca == '/')
+                    *(ca++) = L'\0';
+                if (*ca == '\0')
                     lpCmdline->szApplication = _st_sys_argvw[0];
+                else
+                    lpCmdline->szApplication = ca;
             }
             else {
-                apxLogWrite(APXLOG_MARK_ERROR "Unrecognized cmd option %s", cmd);
-                s = 2;
+                apxLogWrite(APXLOG_MARK_ERROR "Unrecognized cmd option %S",
+                            _st_sys_argvw[1]);
+                return NULL;
             }
+            s = 2;
         }
     }
     else {
@@ -218,6 +222,14 @@ LPAPXCMDLINE apxCmdlineParse(
                 break;
             }
         }
+        if (match == 0) {
+            /* --unknown option
+             *
+             */
+            apxLogWrite(APXLOG_MARK_ERROR "Unrecognized program option %S",
+                        _st_sys_argvw[i]);
+            return NULL;
+        }
     }
     if (i < (DWORD)_st_sys_argc) {
         lpCmdline->dwArgc = _st_sys_argc - i;
diff --git a/src/native/nt/procrun/src/javajni.c b/src/native/nt/procrun/src/javajni.c
index 7fdcf97..93b8ca4 100644
--- a/src/native/nt/procrun/src/javajni.c
+++ b/src/native/nt/procrun/src/javajni.c
@@ -53,9 +53,9 @@ static DYNLOAD_FPTR_DECLARE(SetDllDirectoryW) = NULL;
 
 #define JVM_DELETE_CLAZZ(jvm, cl)                                               \
     APXMACRO_BEGIN                                                              \
-    if ((jvm)->lpEnv && (jvm)->##cl.jClazz) {                                   \
-        (*((jvm)->lpEnv))->DeleteGlobalRef((jvm)->lpEnv, (jvm)->##cl.jClazz);   \
-        (jvm)->##cl.jClazz = NULL;                                              \
+    if ((jvm)->lpEnv && (jvm)->cl.jClazz) {                                   \
+        (*((jvm)->lpEnv))->DeleteGlobalRef((jvm)->lpEnv, (jvm)->cl.jClazz);   \
+        (jvm)->cl.jClazz = NULL;                                              \
     } APXMACRO_END
 
 #define JVM_EXCEPTION_CHECK(jvm) \
@@ -84,19 +84,19 @@ static DYNLOAD_FPTR_DECLARE(SetDllDirectoryW) = NULL;
         (*(lpJava->lpEnv))->DeleteLocalRef(lpJava->lpEnv, obj)
 
 #define JNICALL_0(fName)  \
-        ((*(lpJava->lpEnv))->##fName(lpJava->lpEnv))
+        ((*(lpJava->lpEnv))->fName(lpJava->lpEnv))
 
 #define JNICALL_1(fName, a1)  \
-        ((*(lpJava->lpEnv))->##fName(lpJava->lpEnv, (a1)))
+        ((*(lpJava->lpEnv))->fName(lpJava->lpEnv, (a1)))
 
 #define JNICALL_2(fName, a1, a2)  \
-        ((*(lpJava->lpEnv))->##fName(lpJava->lpEnv, (a1), (a2)))
+        ((*(lpJava->lpEnv))->fName(lpJava->lpEnv, (a1), (a2)))
 
 #define JNICALL_3(fName, a1, a2, a3)  \
-        ((*(lpJava->lpEnv))->##fName(lpJava->lpEnv, (a1), (a2), (a3)))
+        ((*(lpJava->lpEnv))->fName(lpJava->lpEnv, (a1), (a2), (a3)))
 
 #define JNICALL_4(fName, a1, a2, a3, a4)  \
-        ((*(lpJava->lpEnv))->##fName(lpJava->lpEnv, (a1), (a2), (a3), (a4)))
+        ((*(lpJava->lpEnv))->fName(lpJava->lpEnv, (a1), (a2), (a3), (a4)))
 
 typedef struct APXJAVASTDCLAZZ {
     CHAR        sClazz[1024];
@@ -183,10 +183,10 @@ static BOOL __apxLoadJvmDll(LPCWSTR szJvmDllPath)
                                               LOAD_WITH_ALTERED_SEARCH_PATH);
 
     if (IS_INVALID_HANDLE(_st_sys_jvmDllHandle)) {
-        WCHAR  jreBinPath[1024];
+        WCHAR  jreBinPath[SIZ_PATHLEN];
         DWORD  i, l = 0;
 
-        lstrlcpyW(jreBinPath, 1024, dllJvmPath);
+        lstrlcpyW(jreBinPath, SIZ_PATHLEN, dllJvmPath);
         DYNLOAD_FPTR_ADDRESS(SetDllDirectoryW, KERNEL32);
         for (i = lstrlenW(jreBinPath); i > 0, l < 2; i--) {
             if (jreBinPath[i] == L'\\' || jreBinPath[i] == L'/') {
@@ -370,17 +370,152 @@ static jint JNICALL __apxJniVfprintf(FILE *fp, const char *format, va_list args)
     return rv;
 }
 
+static LPSTR __apxStrIndexA(LPCSTR szStr, int nCh)
+{
+    LPSTR pStr;
+
+    for (pStr = (LPSTR)szStr; *pStr; pStr++) {
+        if (*pStr == nCh)
+            return pStr;
+    }
+    return NULL;
+}
+
+static LPSTR __apxStrnCatA(APXHANDLE hPool, LPSTR pOrg, LPCSTR szStr, LPCSTR szAdd)
+{
+    DWORD len = 1;
+    DWORD nas = pOrg == NULL;
+    if (pOrg)
+        len += lstrlenA(pOrg);
+    if (szStr)
+        len += lstrlenA(szStr);
+    if (szAdd)
+        len += lstrlenA(szAdd);
+    pOrg = (LPSTR)apxPoolRealloc(hPool, pOrg, len);
+    if (pOrg) {
+        if (nas)
+            *pOrg = '\0';
+        if (szStr)
+            lstrcatA(pOrg, szStr);
+        if (szAdd)
+            lstrcatA(pOrg, szAdd);
+    }
+    return pOrg;
+}
+
+static LPSTR __apxEvalPathPart(APXHANDLE hPool, LPSTR pStr, LPCSTR szPattern)
+{
+    HANDLE           hFind;
+    WIN32_FIND_DATAA stGlob;
+    char       szJars[MAX_PATH + 1];
+    char       szPath[MAX_PATH + 1];
+
+    if (lstrlenA(szPattern) > (sizeof(szJars) - 5)) {
+        return __apxStrnCatA(hPool, pStr, szPattern, NULL);
+    }
+    lstrcpyA(szJars, szPattern);
+    szPath[0] = ';';
+    szPath[1] = '\0';
+    lstrcatA(szPath, szPattern);
+    lstrcatA(szJars, ".jar");
+    /* Remove the trailing asterisk
+     */
+    szPath[lstrlenA(szPath) - 1] = '\0';
+    if ((hFind = FindFirstFileA(szJars, &stGlob)) == INVALID_HANDLE_VALUE) {
+        /* Find failed
+         */
+        return pStr;
+    }
+    pStr = __apxStrnCatA(hPool, pStr, &szPath[1], stGlob.cFileName);
+    if (pStr == NULL) {
+        FindClose(hFind);
+        return NULL;
+    }
+    while (FindNextFileA(hFind, &stGlob) != 0) {
+        pStr = __apxStrnCatA(hPool, pStr, szPath, stGlob.cFileName);
+        if (pStr == NULL)
+            break;
+    }
+    FindClose(hFind);
+    return pStr;
+}
+
+/**
+ * Call glob on each PATH like string path.
+ * Glob is called only if the part ends with asterisk in which
+ * case asterisk is replaced by *.jar when searching
+ */
+static LPSTR __apxEvalClasspath(APXHANDLE hPool, LPCSTR szCp)
+{
+    LPSTR pCpy = __apxStrnCatA(hPool, NULL, JAVA_CLASSPATH, szCp);
+    LPSTR pGcp = NULL;
+    LPSTR pPos;
+    LPSTR pPtr;
+
+    if (!pCpy)
+        return NULL;
+    pPtr = pCpy + sizeof(JAVA_CLASSPATH) - 1;
+    while ((pPos = __apxStrIndexA(pPtr, ';'))) {
+        *pPos = '\0';
+        if (pGcp)
+            pGcp = __apxStrnCatA(hPool, pGcp, ";", NULL);
+        else
+            pGcp = __apxStrnCatA(hPool, NULL, JAVA_CLASSPATH, NULL);
+        if ((pPos > pPtr) && (*(pPos - 1) == '*')) {
+            if (!(pGcp = __apxEvalPathPart(hPool, pGcp, pPtr))) {
+                /* Error.
+                * Return the original string processed so far.
+                */
+                return pCpy;
+            }
+        }
+        else {
+            /* Standard path element */
+            if (!(pGcp = __apxStrnCatA(hPool, pGcp, pPtr, NULL))) {
+                /* Error.
+                * Return the original string processed so far.
+                */
+                return pCpy;
+            }
+        }
+        pPtr = pPos + 1;
+    }
+    if (*pPtr) {
+        int end = lstrlenA(pPtr);
+        if (pGcp)
+            pGcp = __apxStrnCatA(hPool, pGcp, ";", NULL);
+        else
+            pGcp = __apxStrnCatA(hPool, NULL, JAVA_CLASSPATH, NULL);
+        if (end > 0 && pPtr[end - 1] == '*') {
+            /* Last path elemet ends with star
+             * Do a globbing.
+             */
+            pGcp = __apxEvalPathPart(hPool, pGcp, pPtr);
+        }
+        else {
+            /* Just add the part */
+            pGcp = __apxStrnCatA(hPool, pGcp, pPtr, NULL);
+        }
+    }
+    /* Free the allocated copy */
+    if (pGcp) {
+        apxFree(pCpy);
+        return pGcp;
+    }
+    else
+        return pCpy;
+}
 
 /* ANSI version only */
 BOOL
 apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
                   LPCVOID lpOptions, DWORD dwMs, DWORD dwMx,
-                  DWORD dwSs)
+                  DWORD dwSs, DWORD bJniVfprintf)
 {
     LPAPXJAVAVM     lpJava;
     JavaVMInitArgs  vmArgs;
     JavaVMOption    *lpJvmOptions;
-    DWORD           i, nOptions, sOptions = 2;
+    DWORD           i, nOptions, sOptions = 0;
     BOOL            rv = FALSE;
     if (hJava->dwType != APXHANDLE_TYPE_JVM)
         return FALSE;
@@ -409,7 +544,7 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
     }
     else {
         CHAR  iB[3][64];
-        LPSTR szCp;
+        LPSTR szCp = NULL;
         lpJava->iVersion = JNI_VERSION_DEFAULT;
         if (dwMs)
             ++sOptions;
@@ -417,17 +552,27 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
             ++sOptions;
         if (dwSs)
             ++sOptions;
+        if (bJniVfprintf)
+            ++sOptions;
+        if (szClassPath && *szClassPath)
+            ++sOptions;
         nOptions = __apxMultiSzToJvmOptions(hJava->hPool, lpOptions,
                                             &lpJvmOptions, sOptions);
-        szCp = apxPoolAlloc(hJava->hPool, sizeof(JAVA_CLASSPATH) + lstrlenA(szClassPath));
-        lstrcpyA(szCp, JAVA_CLASSPATH);
-        lstrcatA(szCp, szClassPath);
-        lpJvmOptions[nOptions - sOptions].optionString = szCp;
-        --sOptions;
-        /* default JNI error printer */
-        lpJvmOptions[nOptions - sOptions].optionString = "vfprintf";
-        lpJvmOptions[nOptions - sOptions].extraInfo    = __apxJniVfprintf;
-        --sOptions;
+        if (szClassPath && *szClassPath) {
+            szCp = __apxEvalClasspath(hJava->hPool, szClassPath);
+            if (szCp == NULL) {
+                apxLogWrite(APXLOG_MARK_ERROR "Invalid classpath %s", szClassPath);
+                return FALSE;
+            }
+            lpJvmOptions[nOptions - sOptions].optionString = szCp;
+            --sOptions;
+        }
+        if (bJniVfprintf) {
+            /* default JNI error printer */
+            lpJvmOptions[nOptions - sOptions].optionString = "vfprintf";
+            lpJvmOptions[nOptions - sOptions].extraInfo    = __apxJniVfprintf;
+            --sOptions;
+        }
         if (dwMs) {
             wsprintfA(iB[0], "-Xms%dm", dwMs);
             lpJvmOptions[nOptions - sOptions].optionString = iB[0];
@@ -615,14 +760,15 @@ apxJavaLoadMainClass(APXHANDLE hJava, LPCSTR szClassName,
                                          szMethodName, "([Ljava/lang/String;)V");
     if (!lpJava->clWorker.jMethod) {
         JVM_EXCEPTION_CLEAR(lpJava);
-        apxLogWrite(APXLOG_MARK_ERROR "Static method 'void main(String[])' in Class %s not found", szClassName);
+        apxLogWrite(APXLOG_MARK_ERROR "Method 'static void %s(String[])' not found in Class %s",
+                szMethodName, szClassName);
         return FALSE;
     }
     nArgs = apxMultiSzToArrayW(hJava->hPool, lpArguments, &lpArgs);
+    lpJava->clWorker.jArgs = JNICALL_3(NewObjectArray, nArgs,
+                                       lpJava->clString.jClazz, NULL);
     if (nArgs) {
         DWORD i;
-        lpJava->clWorker.jArgs = JNICALL_3(NewObjectArray, nArgs,
-                                           lpJava->clString.jClazz, NULL);
         for (i = 0; i < nArgs; i++) {
             jstring arg = JNICALL_2(NewString, lpArgs[i], lstrlenW(lpArgs[i]));
             JNICALL_3(SetObjectArrayElement, lpJava->clWorker.jArgs, i, arg);
diff --git a/src/native/nt/procrun/src/log.c b/src/native/nt/procrun/src/log.c
index 2070fc9..e55854d 100644
--- a/src/native/nt/procrun/src/log.c
+++ b/src/native/nt/procrun/src/log.c
@@ -16,8 +16,10 @@
 
 #include "apxwin.h"
 #include "private.h"
+#include <stdio.h>
 
 #define LINE_SEP    "\n"
+#define LOGF_EXT    L".%04d-%02d-%02d.log"
 
 static LPCSTR _log_level[] = {
     "[debug] ",
@@ -32,7 +34,7 @@ typedef struct apx_logfile_st {
     DWORD       dwLogLevel;
     BOOL        bRotate;
     SYSTEMTIME  sysTime;
-    WCHAR       szPath[MAX_PATH + 1];
+    WCHAR       szPath[SIZ_PATHLEN];
     WCHAR       szPrefix[MAX_PATH];
 } apx_logfile_st;
 
@@ -46,11 +48,12 @@ LPWSTR apxLogFile(
     APXHANDLE hPool,
     LPCWSTR szPath,
     LPCWSTR szPrefix,
-    LPCWSTR szName)
+    LPCWSTR szName,
+    BOOL bTimeStamp)
 {
     LPWSTR sRet;
-    WCHAR sPath[MAX_PATH+1];
-    WCHAR sName[MAX_PATH+1];
+    WCHAR sPath[SIZ_PATHLEN];
+    WCHAR sName[SIZ_PATHLEN];
     SYSTEMTIME sysTime;
 
     GetLocalTime(&sysTime);
@@ -66,20 +69,26 @@ LPWSTR apxLogFile(
         szPrefix = L"";
     if (!szName)
         szName   = L"";
-    wsprintfW(sName,
-              L"\\%s%s%04d%02d%02d.log",
-              szPrefix,
-              szName,
-              sysTime.wYear,
-              sysTime.wMonth,
-              sysTime.wDay);
+    if (bTimeStamp)
+        wsprintfW(sName,
+                  L"\\%s%s" LOGF_EXT,
+                  szPrefix,
+                  szName,
+                  sysTime.wYear,
+                  sysTime.wMonth,
+                  sysTime.wDay);
+    else
+        wsprintfW(sName,
+                  L"\\%s%s",
+                  szPrefix,
+                  szName);
 
-    sRet = apxPoolAlloc(hPool, (MAX_PATH + 1) * sizeof(WCHAR));
+    sRet = apxPoolAlloc(hPool, (SIZ_PATHLEN) * sizeof(WCHAR));
     /* Set default level to info */
     CreateDirectoryW(sPath, NULL);
 
-    lstrlcpyW(sRet, MAX_PATH, sPath);
-    lstrlcatW(sRet, MAX_PATH, sName);
+    lstrlcpyW(sRet, SIZ_PATHMAX, sPath);
+    lstrlcatW(sRet, SIZ_PATHMAX, sName);
 
     return sRet;
 }
@@ -94,8 +103,8 @@ HANDLE apxLogOpen(
     LPCWSTR szPrefix)
 {
 
-    WCHAR sPath[MAX_PATH+1];
-    WCHAR sName[MAX_PATH+1];
+    WCHAR sPath[SIZ_PATHLEN];
+    WCHAR sName[SIZ_PATHLEN];
     SYSTEMTIME sysTime;
     apx_logfile_st *h;
 
@@ -109,8 +118,8 @@ HANDLE apxLogOpen(
         lstrlcpyW(sPath, MAX_PATH, szPath);
     }
     if (!szPrefix)
-        szPrefix = L"jakarta_service_";
-    wsprintfW(sName, L"\\%s%04d%02d%02d.log",
+        szPrefix = L"commons-daemon";
+    wsprintfW(sName, L"\\%s"  LOGF_EXT,
               szPrefix,
               sysTime.wYear,
               sysTime.wMonth,
@@ -184,7 +193,7 @@ void apxLogLevelSetW(HANDLE  hFile,
 static BOOL apx_log_rotate(apx_logfile_st *l,
                            LPSYSTEMTIME lpCtime)
 {
-    WCHAR sPath[MAX_PATH+1];
+    WCHAR sPath[SIZ_PATHLEN];
 
     /* rotate on daily basis */
     if (l->sysTime.wDay == lpCtime->wDay)
@@ -193,7 +202,7 @@ static BOOL apx_log_rotate(apx_logfile_st *l,
     CloseHandle(l->hFile);
     l->sysTime = *lpCtime;
 
-    wsprintfW(sPath, L"%s\\%s%04d%02d%02d.log",
+    wsprintfW(sPath, L"%s\\%s"  LOGF_EXT,
               l->szPath,
               l->szPrefix,
               l->sysTime.wYear,
@@ -226,7 +235,7 @@ apxLogWrite(
     LPSTR   szBp;
     int     len = 0;
     LPCSTR  f = szFile;
-    CHAR    sb[MAX_PATH+1];
+    CHAR    sb[SIZ_PATHLEN];
     DWORD   wr;
     DWORD   err;
     BOOL    dolock = TRUE;
@@ -249,10 +258,7 @@ apxLogWrite(
         if(f != szFile)
             f++;
     }
-    lstrlcpyA(buffer, 1056, _log_level[dwLevel]);
-    if (!dolock)
-        lstrlcatA(buffer, 1056, "\n");
-    szBp = &buffer[lstrlenA(buffer)];
+    szBp = &buffer[0];
     if (!szFormat) {
         FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
                        FORMAT_MESSAGE_IGNORE_INSERTS,
@@ -291,12 +297,14 @@ apxLogWrite(
                           t.wHour, t.wMinute, t.wSecond);
                 WriteFile(lf->hFile, sb, lstrlenA(sb), &wr, NULL);
             }
-            if (f) {
-                wsprintfA(sb, "[%-4d %s] ", dwLine, f);
+            WriteFile(lf->hFile, _log_level[dwLevel],
+                          strlen(_log_level[dwLevel]), &wr, NULL);
+            if (f && lf->dwLogLevel == APXLOG_LEVEL_DEBUG) {
+                wsprintfA(sb, "(%10s:%-4d) ", f, dwLine);
                 WriteFile(lf->hFile, sb, lstrlenA(sb), &wr, NULL);
             }
-
             WriteFile(lf->hFile, buffer, len, &wr, NULL);
+            
             /* Terminate the line */
             WriteFile(lf->hFile, LINE_SEP, sizeof(LINE_SEP) - 1, &wr, NULL);
 #ifdef _DEBUG_FULL
@@ -345,8 +353,8 @@ apxDisplayError(
     ...)
 {
     va_list args;
-    CHAR    buffer[1024+32];
-    CHAR    sysbuf[2048];
+    CHAR    buffer[SIZ_HUGLEN];
+    CHAR    sysbuf[SIZ_HUGLEN];
     int     len = 0, nRet;
     LPCSTR  f = szFile;
     DWORD   err = GetLastError(); /* save the last Error code */
@@ -365,30 +373,45 @@ apxDisplayError(
                              err,
                              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                              sysbuf,
-                             1000,
+                             SIZ_DESLEN,
                              NULL);
-        sysbuf[len] = 0;
+        if (len > 0) {
+            sysbuf[len] = '\0';
+            if (sysbuf[len - 1] == '\n') {
+                sysbuf[len - 1] = '\0';
+                --len;
+            }
+        }
+        else
+            sysbuf[0] = '\0';
     }
     if (szFormat) {
         va_start(args, szFormat);
         wvsprintfA(buffer, szFormat, args);
         va_end(args);
         if (f) {
-            CHAR sb[MAX_PATH+1];
-            wsprintfA(sb, "\n%s (%d)", f, dwLine);
+            CHAR sb[SIZ_PATHLEN];
+            wsprintfA(sb, "%s (%d)", f, dwLine);
             lstrcatA(sysbuf, sb);
         }
-        lstrlcatA(sysbuf, 2048, "\n");
-        lstrlcatA(sysbuf, 2048, buffer);
+        lstrlcatA(sysbuf, SIZ_HUGLEN, "\n");
+        lstrlcatA(sysbuf, SIZ_HUGLEN, buffer);
     }
     len = lstrlenA(sysbuf);
 #ifdef _DEBUG_FULL
     OutputDebugStringA(sysbuf);
 #endif
-    if (len > 0 && bDisplay) {
-        nRet = MessageBoxA(NULL, sysbuf,
-                           "Application System Error",
-                           MB_ICONERROR | MB_OK | MB_SYSTEMMODAL);
+    if (len > 0) {
+        if (bDisplay) {
+            nRet = MessageBoxA(NULL, sysbuf,
+                               "Application System Error",
+                               MB_ICONERROR | MB_OK | MB_SYSTEMMODAL);
+        }
+        else {
+            fputs(sysbuf, stderr);
+            fputc('\n', stderr);
+            fflush(stderr);
+        }
     }
     /* Restore the last Error code */
     SetLastError(err);
diff --git a/src/native/nt/procrun/src/private.h b/src/native/nt/procrun/src/private.h
index d95c752..c90f084 100644
--- a/src/native/nt/procrun/src/private.h
+++ b/src/native/nt/procrun/src/private.h
@@ -234,11 +234,6 @@ extern APX_OSLEVEL  _st_apx_oslevel;
 
 #define APX_GET_OSLEVEL()   ((_st_apx_oslevel == APX_WINVER_UNK) ? apxGetOsLevel() : _st_apx_oslevel)
 
-#ifdef _DEBUG
-void    ErrorMessage(LPCTSTR szError, BOOL bFatal);
-#else
-#define ErrorMessage(szError, bFatal) ((void)0)
-#endif
 /* zero separated, double zero terminated string */
 struct APXMULTISZ {
     DWORD   dwAllocated;  /* length including terminators */
diff --git a/src/native/nt/procrun/src/registry.c b/src/native/nt/procrun/src/registry.c
index ab144b6..0936ec3 100644
--- a/src/native/nt/procrun/src/registry.c
+++ b/src/native/nt/procrun/src/registry.c
@@ -454,7 +454,7 @@ apxRegistryGetBinaryA(APXHANDLE hRegistry, DWORD dwFrom,
         DWORD rc, dwType = REG_BINARY;
         rc = RegQueryValueExA(hKey, szValueName, NULL, &dwType, lpData, lpdwLength);
         if (rc != ERROR_SUCCESS || dwType != REG_BINARY) {
-            ErrorMessage(NULL, FALSE);
+            apxLogWrite(APXLOG_MARK_SYSERR);
             return NULL;
         }
         lpReg->pCurrVal = lpData;
@@ -705,7 +705,7 @@ apxRegistrySetStrA(APXHANDLE hRegistry, DWORD dwFrom,
             return FALSE;
     }
     else if (RegSetValueExA(hKey, szValueName, 0, dwType,
-                       (LPBYTE)szValue, lstrlenA(szValue)) != ERROR_SUCCESS)
+                       (LPBYTE)szValue, lstrlenA(szValue) + 1) != ERROR_SUCCESS)
         return FALSE;
 
     return TRUE;
@@ -743,7 +743,7 @@ apxRegistrySetStrW(APXHANDLE hRegistry, DWORD dwFrom,
     }
     else if (RegSetValueExW(hKey, szValueName, 0, dwType,
                        (LPBYTE)szValue,
-                       lstrlenW(szValue) * sizeof(WCHAR)) != ERROR_SUCCESS)
+                       (lstrlenW(szValue) + 1) * sizeof(WCHAR)) != ERROR_SUCCESS)
         return FALSE;
 
     return TRUE;
@@ -821,7 +821,7 @@ LONG apxDeleteRegistryRecursive(HKEY hKeyRoot, LPCWSTR szSubKey) {
     WCHAR szName[SIZ_BUFLEN];
     HKEY hKey = NULL;
 
-    if (ERROR_SUCCESS == RegDeleteKey(hKeyRoot, szSubKey)) {
+    if (ERROR_SUCCESS == RegDeleteKeyW(hKeyRoot, szSubKey)) {
         return ERROR_SUCCESS;
     }
 
@@ -836,8 +836,8 @@ LONG apxDeleteRegistryRecursive(HKEY hKeyRoot, LPCWSTR szSubKey) {
     while (rc == ERROR_SUCCESS) {
         dwSize = SIZ_BUFLEN;
         rc = RegEnumKeyExW(hKey, 0, szName, &dwSize, NULL, NULL, NULL, NULL );
-       
-        if (rc == ERROR_NO_MORE_ITEMS) {           
+
+        if (rc == ERROR_NO_MORE_ITEMS) {
             rc = RegDeleteKeyW(hKeyRoot, szSubKey);
             break;
         } else {
@@ -846,7 +846,7 @@ LONG apxDeleteRegistryRecursive(HKEY hKeyRoot, LPCWSTR szSubKey) {
                 break;   // abort when we start failing
             }
         }
-    }    
+    }
     RegCloseKey(hKey);
     return rc;
 }
@@ -889,12 +889,12 @@ apxDeleteRegistryW(LPCWSTR szRoot,
                 hKey = NULL;
                 rv |= (rc == ERROR_SUCCESS);
             }
-            if (bDeleteEmptyRoot) {  
+            if (bDeleteEmptyRoot) {
                 // will fail if there are subkeys, just like we want
                 RegDeleteKeyW(hkeySoftware, buff);
             }
             RegCloseKey(hkeySoftware);
-        } 
+        }
     }
     return rv;
 }
@@ -1078,7 +1078,7 @@ BOOL apxSetServiceDescriptionW(LPCWSTR szServiceName, LPCWSTR szDescription)
     }
 
     rc = RegSetValueExW(hKey, REGDESCRIPTION, 0, REG_SZ, (CONST BYTE *)szDescription,
-                        lstrlenW(szDescription) * sizeof(WCHAR));
+                        (lstrlenW(szDescription) + 1) * sizeof(WCHAR));
     SAFE_CLOSE_KEY(hKey);
 
     return rc == ERROR_SUCCESS;
diff --git a/src/native/nt/procrun/src/rprocess.c b/src/native/nt/procrun/src/rprocess.c
index ed9cfa3..45d2047 100644
--- a/src/native/nt/procrun/src/rprocess.c
+++ b/src/native/nt/procrun/src/rprocess.c
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include "apxwin.h"
 #include "private.h"
 
@@ -24,7 +24,7 @@
 #define CHILD_TERMINATE_CODE        19640323 /* Could be any value like my birthday ;-)*/
 
 DYNOLAD_TYPE_DECLARE(CreateRemoteThread,
-                     __stdcall, HANDLE)(HANDLE, LPSECURITY_ATTRIBUTES, 
+                     __stdcall, HANDLE)(HANDLE, LPSECURITY_ATTRIBUTES,
                                         DWORD, LPTHREAD_START_ROUTINE,
                                         LPVOID, DWORD, LPDWORD);
 
@@ -83,13 +83,13 @@ typedef struct APXPROCESS {
     HANDLE                  hChildInpWr;
     HANDLE                  hChildOutRd;
     HANDLE                  hChildErrRd;
-    /* Saved console pipes */    
+    /* Saved console pipes */
     HANDLE                  hParentStdSave[3];
     HANDLE                  hWorkerThreads[3];
     HANDLE                  hUserToken;
     HANDLE                  hCurrentProcess;
     BOOL                    bSaveHandles;
-    /** callback function */ 
+    /** callback function */
     LPAPXFNCALLBACK         fnUserCallback;
     LPSECURITY_ATTRIBUTES   lpSA;
     LPVOID                  lpSD;
@@ -135,13 +135,13 @@ static DWORD WINAPI __apxProcStdoutThread(LPVOID lpParameter)
     LPAPXPROCESS lpProc;
     APXCALLHOOK *lpCall;
     INT ch;
-    DWORD dwReaded; 
+    DWORD dwReaded;
     lpProc = APXHANDLE_DATA(hProcess);
     while (lpProc->dwChildStatus & CHILD_RUNNING) {
         ch = 0;
         if (!ReadFile(lpProc->hChildOutRd, &ch, lpProc->chSize,
                       &dwReaded, NULL) || !dwReaded) {
-            
+
             break;
         }
         if (lpProc->fnUserCallback)
@@ -162,7 +162,7 @@ static DWORD WINAPI __apxProcStderrThread(LPVOID lpParameter)
     LPAPXPROCESS lpProc;
     APXCALLHOOK *lpCall;
     INT ch;
-    DWORD dwReaded; 
+    DWORD dwReaded;
     lpProc = APXHANDLE_DATA(hProcess);
     while (lpProc->dwChildStatus & CHILD_RUNNING) {
         if (!ReadFile(lpProc->hChildErrRd, &ch, lpProc->chSize,
@@ -193,7 +193,7 @@ static DWORD __apxProcessPutc(LPAPXPROCESS lpProc, INT ch, DWORD dwSize)
             return 1;
         }
     }
-    
+
     return 0;
 }
 
@@ -221,7 +221,7 @@ static DWORD __apxProcessPuts(LPAPXPROCESS lpProc, LPCTSTR szString)
                 break;
         }
     }
-    
+
     return n;
 }
 
@@ -231,7 +231,7 @@ static DWORD __apxProcessWrite(LPAPXPROCESS lpProc, LPCVOID lpData, DWORD dwLen)
     DWORD  n = 0;
     if (!lpData || !dwLen)
         return 0;
-    
+
     if (lpProc->dwChildStatus & CHILD_RUNNING) {
         DWORD wr = 0;
         while (lpProc->dwChildStatus & CHILD_RUNNING) {
@@ -249,7 +249,7 @@ static DWORD __apxProcessWrite(LPAPXPROCESS lpProc, LPCVOID lpData, DWORD dwLen)
                 break;
         }
     }
-    
+
     return n;
 }
 
@@ -261,38 +261,38 @@ static BOOL __apxProcCreateChildPipes(LPAPXPROCESS lpProc)
     if (!CreatePipe(&(lpProc->hChildStdInp),
                     &(lpProc->hChildInpWr),
                     lpProc->lpSA, 0)) {
-        ErrorMessage(NULL, FALSE);
+        apxLogWrite(APXLOG_MARK_SYSERR);
         goto cleanup;
     }
     if (!SetHandleInformation(lpProc->hChildInpWr,
                               HANDLE_FLAG_INHERIT, 0)) {
-        ErrorMessage(NULL, FALSE);
+        apxLogWrite(APXLOG_MARK_SYSERR);
         goto cleanup;
     }
 
     if (!CreatePipe(&(lpProc->hChildOutRd),
                     &(lpProc->hChildStdOut),
                     lpProc->lpSA, 0)) {
-        ErrorMessage(NULL, FALSE);
+        apxLogWrite(APXLOG_MARK_SYSERR);
         goto cleanup;
     }
 
     if (!SetHandleInformation(lpProc->hChildOutRd,
                               HANDLE_FLAG_INHERIT, 0)) {
-        ErrorMessage(NULL, FALSE);
+        apxLogWrite(APXLOG_MARK_SYSERR);
         goto cleanup;
     }
 
     if (!CreatePipe(&(lpProc->hChildErrRd),
                     &(lpProc->hChildStdErr),
                     lpProc->lpSA, 0)) {
-        ErrorMessage(NULL, FALSE);
+        apxLogWrite(APXLOG_MARK_SYSERR);
         goto cleanup;
     }
 
     if (!SetHandleInformation(lpProc->hChildErrRd,
                               HANDLE_FLAG_INHERIT, 0)) {
-        ErrorMessage(NULL, FALSE);
+        apxLogWrite(APXLOG_MARK_SYSERR);
         goto cleanup;
     }
     rv = TRUE;
@@ -316,33 +316,33 @@ static BOOL __apxProcessClose(APXHANDLE hProcess)
 
     lpProc = APXHANDLE_DATA(hProcess);
     CHECK_IF_ACTIVE(lpProc);
-    
+
     /* Try to close the child's stdin first */
     SAFE_CLOSE_HANDLE(lpProc->hChildInpWr);
-    /* Wait 1 sec for child process to 
+    /* Wait 1 sec for child process to
      * recognize that the stdin has been closed.
      */
     if (WaitForSingleObject(lpProc->stProcInfo.hProcess, 1000) == WAIT_OBJECT_0)
         goto cleanup;
 
     CHECK_IF_ACTIVE(lpProc);
-    
+
     /* Try to create the remote thread in the child address space */
     DYNLOAD_FPTR_ADDRESS(CreateRemoteThread, KERNEL32);
-    if (DuplicateHandle(lpProc->hCurrentProcess, 
-                        lpProc->stProcInfo.hProcess, 
-                        lpProc->hCurrentProcess, 
-                        &hDup, 
-                        PROCESS_ALL_ACCESS, 
+    if (DuplicateHandle(lpProc->hCurrentProcess,
+                        lpProc->stProcInfo.hProcess,
+                        lpProc->hCurrentProcess,
+                        &hDup,
+                        PROCESS_ALL_ACCESS,
                         FALSE, 0)) {
         DYNLOAD_FPTR_ADDRESS(ExitProcess, KERNEL32);
         /* Now call the ExitProcess from inside the client
          * This will safely unload all the dll's.
          */
-        hRemote = DYNLOAD_CALL(CreateRemoteThread)(hDup, 
-                                NULL, 0, 
+        hRemote = DYNLOAD_CALL(CreateRemoteThread)(hDup,
+                                NULL, 0,
                                 (LPTHREAD_START_ROUTINE)DYNLOAD_FPTR(ExitProcess),
-                                (PVOID)&uExitCode, 0, NULL); 
+                                (PVOID)&uExitCode, 0, NULL);
         if (!IS_INVALID_HANDLE(hRemote)) {
             if (WaitForSingleObject(lpProc->stProcInfo.hProcess,
                     2000) == WAIT_OBJECT_0) {
@@ -356,9 +356,9 @@ static BOOL __apxProcessClose(APXHANDLE hProcess)
         CloseHandle(hDup);
         goto cleanup;
     }
-  
+
     TerminateProcess(lpProc->stProcInfo.hProcess, CHILD_TERMINATE_CODE);
-    
+
 cleanup:
      /* Close the process handle */
     SAFE_CLOSE_HANDLE(lpProc->stProcInfo.hProcess);
@@ -384,8 +384,8 @@ static BOOL __apxProcessCallback(APXHANDLE hObject, UINT uMsg,
             }
             SAFE_CLOSE_HANDLE(lpProc->stProcInfo.hProcess);
 
-            /* Close parent side of the pipes */    
-            SAFE_CLOSE_HANDLE(lpProc->hChildInpWr);  
+            /* Close parent side of the pipes */
+            SAFE_CLOSE_HANDLE(lpProc->hChildInpWr);
             SAFE_CLOSE_HANDLE(lpProc->hChildOutRd);
             SAFE_CLOSE_HANDLE(lpProc->hChildErrRd);
 
@@ -401,7 +401,7 @@ static BOOL __apxProcessCallback(APXHANDLE hObject, UINT uMsg,
             if (lpProc->lpEnvironment)
                 FreeEnvironmentStringsW(lpProc->lpEnvironment);
 
-        case WM_QUIT: 
+        case WM_QUIT:
             /* The process has finished
              * This is a WorkerThread message
              */
@@ -414,7 +414,7 @@ static BOOL __apxProcessCallback(APXHANDLE hObject, UINT uMsg,
             if (wParam)
                 __apxProcessWrite(lpProc, (LPCVOID)lParam, (DWORD)wParam);
             else
-                __apxProcessPuts(lpProc, (LPCTSTR)lParam);            
+                __apxProcessPuts(lpProc, (LPCTSTR)lParam);
         break;
         default:
         break;
@@ -439,8 +439,8 @@ apxCreateProcessW(APXHANDLE hPool, DWORD dwOptions,
 #ifndef _UNICODE
         WCHAR wsUsername[256];
         WCHAR wsPassword[256];
-        AsciiToWide(szUsername, wsUsername); 
-        AsciiToWide(szPassword, wsPassword); 
+        AsciiToWide(szUsername, wsUsername);
+        AsciiToWide(szPassword, wsPassword);
 #else
         LPCWSTR wsUsername = szUsername;
         LPCWSTR wsPassword = szPassword;
@@ -459,8 +459,8 @@ apxCreateProcessA(APXHANDLE hPool, DWORD dwOptions,
     if (szUsername && szPassword) {
         WCHAR wsUsername[256];
         WCHAR wsPassword[256];
-        AsciiToWide(szUsername, wsUsername); 
-        AsciiToWide(szPassword, wsPassword); 
+        AsciiToWide(szUsername, wsUsername);
+        AsciiToWide(szPassword, wsPassword);
         return apxCreateProcessW(hPool, dwOptions, fnCallback,
                                  wsUsername, wsPassword, bLogonAsService);
     }
@@ -481,32 +481,32 @@ apxCreateProcessW(APXHANDLE hPool, DWORD dwOptions,
     /* CreateProcessAsUser is supported only on NT */
     if (szUsername && (APX_GET_OSLEVEL() >= APX_WINVER_NT_4)) {
         HANDLE hUser;
-        if (!LogonUserW(szUsername, 
-                        NULL, 
-                        szPassword, 
+        if (!LogonUserW(szUsername,
+                        NULL,
+                        szPassword,
                         bLogonAsService ? LOGON32_LOGON_SERVICE : LOGON32_LOGON_NETWORK,
                         LOGON32_PROVIDER_DEFAULT,
                         &hUser)) {
             /* Logon Failed */
-            ErrorMessage(NULL, TRUE);
+            apxLogWrite(APXLOG_MARK_SYSERR);
             return NULL;
         }
-        if (!DuplicateTokenEx(hUser, 
-                              TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY, 
+        if (!DuplicateTokenEx(hUser,
+                              TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY,
                               NULL,
                               SecurityImpersonation,
                               TokenPrimary,
                               &hUserToken)) {
             CloseHandle(hUser);
             /* Failed to duplicate the user token */
-                ErrorMessage(NULL, TRUE);
+            apxLogWrite(APXLOG_MARK_SYSERR);
             return NULL;
         }
         if (!ImpersonateLoggedOnUser(hUserToken)) {
             CloseHandle(hUser);
             CloseHandle(hUserToken);
             /* failed to impersonate the logged user */
-                ErrorMessage(NULL, TRUE);
+            apxLogWrite(APXLOG_MARK_SYSERR);
             return NULL;
         }
         CloseHandle(hUser);
@@ -534,7 +534,7 @@ apxCreateProcessW(APXHANDLE hPool, DWORD dwOptions,
                     &lpProc->hCurrentProcess,
                     PROCESS_ALL_ACCESS,
                     FALSE,
-                    0); 
+                    0);
 #else
     lpProc->hCurrentProcess = GetCurrentProcess();
 #endif
@@ -551,7 +551,7 @@ apxCreateProcessW(APXHANDLE hPool, DWORD dwOptions,
     return hProcess;
 }
 
-static WCHAR _desktop_name[] = 
+static WCHAR _desktop_name[] =
     {'W', 'i', 'n', 's', 't', 'a', '0', '\\', 'D', 'e', 'f', 'a', 'u', 'l', 't', 0};
 
 BOOL
@@ -564,7 +564,7 @@ apxProcessExecute(APXHANDLE hProcess)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     /* don't allow multiple execute calls on the same object */
     if (lpProc->dwChildStatus & PROC_INITIALIZED)
@@ -582,7 +582,7 @@ apxProcessExecute(APXHANDLE hProcess)
     /* Set the redirected handles */
     si.hStdOutput = lpProc->hChildStdOut;
     si.hStdError  = lpProc->hChildStdErr;
-    si.hStdInput  = lpProc->hChildStdInp;  
+    si.hStdInput  = lpProc->hChildStdInp;
 
     if (lpProc->lpEnvironment)
         FreeEnvironmentStringsW(lpProc->lpEnvironment);
@@ -618,7 +618,7 @@ apxProcessExecute(APXHANDLE hProcess)
                             &(lpProc->stProcInfo));
     }
     /* Close unused sides of pipes */
-    SAFE_CLOSE_HANDLE(lpProc->hChildStdInp);  
+    SAFE_CLOSE_HANDLE(lpProc->hChildStdInp);
     SAFE_CLOSE_HANDLE(lpProc->hChildStdOut);
     SAFE_CLOSE_HANDLE(lpProc->hChildStdErr);
     if (!bS)
@@ -627,10 +627,10 @@ apxProcessExecute(APXHANDLE hProcess)
     lpProc->dwChildStatus |= (CHILD_RUNNING | PROC_INITIALIZED);
 
     lpProc->hWorkerThreads[0] = CreateThread(NULL, 0, __apxProcStdoutThread,
-                                             hProcess, 0, &id);     
+                                             hProcess, 0, &id);
     lpProc->hWorkerThreads[1] = CreateThread(NULL, 0, __apxProcStderrThread,
-                                             hProcess, 0, &id);     
-    ResumeThread(lpProc->stProcInfo.hThread);    
+                                             hProcess, 0, &id);
+    ResumeThread(lpProc->stProcInfo.hThread);
     lpProc->hWorkerThreads[2] = CreateThread(NULL, 0, __apxProcWorkerThread,
                                             hProcess, 0, &id);
 
@@ -638,8 +638,8 @@ apxProcessExecute(APXHANDLE hProcess)
     /* Close child handles first */
     return TRUE;
 cleanup:
-    /* Close parent side of the pipes */    
-    SAFE_CLOSE_HANDLE(lpProc->hChildInpWr);  
+    /* Close parent side of the pipes */
+    SAFE_CLOSE_HANDLE(lpProc->hChildInpWr);
     SAFE_CLOSE_HANDLE(lpProc->hChildOutRd);
     SAFE_CLOSE_HANDLE(lpProc->hChildErrRd);
 
@@ -653,7 +653,7 @@ apxProcessSetExecutableA(APXHANDLE hProcess, LPCSTR szName)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     apxFree(lpProc->szApplicationExec);
     lpProc->szApplicationExec = apxPoolWStrdupA(hProcess->hPool, szName);
@@ -668,7 +668,7 @@ apxProcessSetExecutableW(APXHANDLE hProcess, LPCWSTR szName)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     apxFree(lpProc->szApplicationExec);
     lpProc->szApplicationExec = apxPoolStrdupW(hProcess->hPool, szName);
@@ -683,11 +683,11 @@ apxProcessSetCommandLineA(APXHANDLE hProcess, LPCSTR szCmdline)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     apxFree(lpProc->szCommandLine);
     lpProc->szCommandLine = apxPoolWStrdupA(hProcess->hPool, szCmdline);
-    
+
     return lpProc->szCommandLine != NULL;
 }
 
@@ -698,11 +698,11 @@ apxProcessSetCommandLineW(APXHANDLE hProcess, LPCWSTR szCmdline)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     apxFree(lpProc->szCommandLine);
     lpProc->szCommandLine = apxPoolStrdupW(hProcess->hPool, szCmdline);
-    
+
     return lpProc->szCommandLine != NULL;
 }
 
@@ -713,11 +713,11 @@ apxProcessSetWorkingPathA(APXHANDLE hProcess, LPCSTR szPath)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     apxFree(lpProc->szWorkingPath);
     lpProc->szWorkingPath = apxPoolWStrdupA(hProcess->hPool, szPath);
-    
+
     return lpProc->szWorkingPath != NULL;
 }
 
@@ -728,7 +728,7 @@ apxProcessSetWorkingPathW(APXHANDLE hProcess, LPCWSTR szPath)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     apxFree(lpProc->szWorkingPath);
     if (!szPath) {
@@ -737,7 +737,7 @@ apxProcessSetWorkingPathW(APXHANDLE hProcess, LPCWSTR szPath)
         return TRUE;
     }
     lpProc->szWorkingPath = apxPoolWStrdupW(hProcess->hPool, szPath);
-    
+
     return lpProc->szWorkingPath != NULL;
 }
 
@@ -748,7 +748,7 @@ apxProcessPutcA(APXHANDLE hProcess, INT ch)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return 0;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     return __apxProcessPutc(lpProc, ch, sizeof(CHAR));
 }
@@ -760,7 +760,7 @@ apxProcessPutcW(APXHANDLE hProcess, INT ch)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return 0;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     return __apxProcessPutc(lpProc, ch, sizeof(WCHAR));
 }
@@ -807,7 +807,7 @@ apxProcessWrite(APXHANDLE hProcess, LPCVOID lpData, DWORD dwLen)
     LPAPXPROCESS lpProc;
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return 0;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
 
     return __apxProcessWrite(lpProc, lpData, dwLen);
@@ -820,13 +820,13 @@ apxProcessFlushStdin(APXHANDLE hProcess)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
-    
+
     if (lpProc->dwChildStatus & CHILD_RUNNING) {
         return FlushFileBuffers(lpProc->hChildInpWr);
     }
-    
+
     return FALSE;
 }
 
@@ -847,9 +847,9 @@ apxProcessWait(APXHANDLE hProcess, DWORD dwMilliseconds, BOOL bKill)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return WAIT_ABANDONED;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
-    
+
     if (lpProc->dwChildStatus & CHILD_RUNNING) {
         DWORD rv = WaitForMultipleObjects(3, lpProc->hWorkerThreads,
                                           TRUE, dwMilliseconds);
@@ -869,10 +869,23 @@ apxProcessRunning(APXHANDLE hProcess)
 
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
+    lpProc = APXHANDLE_DATA(hProcess);
+
+    return (lpProc->dwChildStatus & CHILD_RUNNING);
+}
+
+DWORD
+apxProcessGetPid(APXHANDLE hProcess)
+{
+   LPAPXPROCESS lpProc;
+
+    if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
+        return 0;
+
     lpProc = APXHANDLE_DATA(hProcess);
-    
-    return (lpProc->dwChildStatus & CHILD_RUNNING);    
+
+    return lpProc->stProcInfo.dwProcessId;
 }
 
 static LPWSTR __apxStrQuote(LPWSTR lpDest, LPCWSTR szSrc)
@@ -880,7 +893,7 @@ static LPWSTR __apxStrQuote(LPWSTR lpDest, LPCWSTR szSrc)
     LPWSTR p;
     BOOL   space = FALSE, quote = FALSE;
 
-    /* Find if string has embeded spaces, add quotes only if no quotes found 
+    /* Find if string has embeded spaces, add quotes only if no quotes found
      */
     for (p = (LPWSTR)szSrc; *p; p++) {
         if (*p == L' ' || *p == '\t') {
@@ -907,13 +920,13 @@ apxProcessSetCommandArgsW(APXHANDLE hProcess, LPCWSTR szTitle,
     LPWSTR p;
     if (hProcess->dwType != APXHANDLE_TYPE_PROCESS)
         return FALSE;
-    
+
     lpProc = APXHANDLE_DATA(hProcess);
     apxFree(lpProc->szCommandLine);
-    
+
     l = lstrlenW(szTitle) + 3;
     for (i = 0; i < dwArgc; i++) {
-        int x, q = 0;
+        int q = 0;
         l += (lstrlenW(lpArgs[i]) + 3);
         l += q;
     }
diff --git a/src/native/nt/procrun/src/service.c b/src/native/nt/procrun/src/service.c
index 86bb665..4c69f83 100644
--- a/src/native/nt/procrun/src/service.c
+++ b/src/native/nt/procrun/src/service.c
@@ -43,7 +43,7 @@ static BOOL __apxIsValidServiceName(LPCWSTR szServiceName)
 {
     do {
         if (!IsCharAlphaNumericW(*szServiceName)) {
-            apxDisplayError(TRUE, NULL, 0, "NonAlpha %d", *szServiceName);
+            apxDisplayError(FALSE, NULL, 0, "NonAlpha %d", *szServiceName);
             return FALSE;
         }
     } while( *(++szServiceName));
@@ -130,13 +130,13 @@ apxServiceOpen(APXHANDLE hService, LPCWSTR szServiceName, DWORD dwOptions)
     if (!apxGetServiceDescriptionW(szServiceName,
                                    lpService->stServiceEntry.szServiceDescription,
                                    SIZ_DESLEN)) {
-        apxLogWrite(APXLOG_MARK_WARN "Failed obtaing service description");
+        apxLogWrite(APXLOG_MARK_WARN "Failed to obtain service description");
         lpService->stServiceEntry.szServiceDescription[0] = L'\0';
     }
     if (!apxGetServiceUserW(szServiceName,
                             lpService->stServiceEntry.szObjectName,
                             SIZ_RESLEN)) {
-        apxLogWrite(APXLOG_MARK_WARN "Failed obtaing service user name");
+        apxLogWrite(APXLOG_MARK_WARN "Failed to obtain service user name");
         lpService->stServiceEntry.szObjectName[0] = L'\0';
     }
     if (!QueryServiceConfigW(lpService->hService, NULL, 0, &dwNeeded)) {
@@ -235,6 +235,104 @@ apxServiceSetOptions(APXHANDLE hService,
                                NULL, NULL);
 }
 
+static BOOL
+__apxStopDependentServices(LPAPXSERVICE lpService)
+{
+    DWORD i;
+    DWORD dwBytesNeeded;
+    DWORD dwCount;
+
+    LPENUM_SERVICE_STATUS   lpDependencies = NULL;
+    ENUM_SERVICE_STATUS     ess;
+    SC_HANDLE               hDepService;
+    SERVICE_STATUS_PROCESS  ssp;
+
+    DWORD dwStartTime = GetTickCount();
+    /* Use the 30-second time-out */
+    DWORD dwTimeout   = 30000;
+
+    /* Pass a zero-length buffer to get the required buffer size.
+     */
+    if (EnumDependentServices(lpService->hService,
+                              SERVICE_ACTIVE,
+                              lpDependencies, 0,
+                              &dwBytesNeeded,
+                              &dwCount)) {
+         /* If the Enum call succeeds, then there are no dependent
+          * services, so do nothing.
+          */
+         return TRUE;
+    }
+    else  {
+        if (GetLastError() != ERROR_MORE_DATA)
+            return FALSE; // Unexpected error
+
+        /* Allocate a buffer for the dependencies.
+         */
+        lpDependencies = (LPENUM_SERVICE_STATUS) HeapAlloc(GetProcessHeap(),
+                                                           HEAP_ZERO_MEMORY,
+                                                           dwBytesNeeded);
+        if (!lpDependencies)
+            return FALSE;
+
+        __try {
+            /* Enumerate the dependencies. */
+            if (!EnumDependentServices(lpService->hService,
+                                       SERVICE_ACTIVE,
+                                       lpDependencies,
+                                       dwBytesNeeded,
+                                      &dwBytesNeeded,
+                                      &dwCount))
+            return FALSE;
+
+            for (i = 0; i < dwCount; i++)  {
+                ess = *(lpDependencies + i);
+                /* Open the service. */
+                hDepService = OpenService(lpService->hManager,
+                                          ess.lpServiceName,
+                                          SERVICE_STOP | SERVICE_QUERY_STATUS);
+
+                if (!hDepService)
+                   return FALSE;
+
+                __try {
+                    /* Send a stop code. */
+                    if (!ControlService(hDepService,
+                                        SERVICE_CONTROL_STOP,
+                                        (LPSERVICE_STATUS) &ssp))
+                    return FALSE;
+
+                    /* Wait for the service to stop. */
+                    while (ssp.dwCurrentState != SERVICE_STOPPED) {
+                        Sleep(ssp.dwWaitHint);
+                        if (!QueryServiceStatusEx(hDepService,
+                                                  SC_STATUS_PROCESS_INFO,
+                                                 (LPBYTE)&ssp,
+                                                  sizeof(SERVICE_STATUS_PROCESS),
+                                                 &dwBytesNeeded))
+                        return FALSE;
+
+                        if (ssp.dwCurrentState == SERVICE_STOPPED)
+                            break;
+
+                        if (GetTickCount() - dwStartTime > dwTimeout)
+                            return FALSE;
+                    }
+                }
+                __finally {
+                    /* Always release the service handle. */
+                    CloseServiceHandle(hDepService);
+                }
+            }
+        }
+        __finally {
+            /* Always free the enumeration buffer. */
+            HeapFree(GetProcessHeap(), 0, lpDependencies);
+        }
+    }
+    return TRUE;
+}
+
 BOOL
 apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
                   LPAPXFNCALLBACK fnControlCallback,
@@ -255,7 +353,7 @@ apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
     /* Manager mode cannot handle services */
     if (lpService->bManagerMode)
         return FALSE;
-    /* Check if the ServixeOpen has been called */
+    /* Check if the ServiceOpen has been called */
     if (IS_INVALID_HANDLE(lpService->hService))
         return FALSE;
     switch (dwControl) {
@@ -313,8 +411,16 @@ apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
     if (dwControl == SERVICE_CONTROL_CONTINUE &&
         stStatus.dwCurrentState != SERVICE_PAUSED)
         bStatus = StartService(lpService->hService, 0, NULL);
-    else
-        bStatus = ControlService(lpService->hService, dwControl, &stStatus);
+    else {
+        bStatus = TRUE;
+        if (dwControl == SERVICE_CONTROL_STOP) {
+            /* First stop dependent services
+             */
+            bStatus = __apxStopDependentServices(lpService);
+        }
+        if (bStatus)
+            bStatus = ControlService(lpService->hService, dwControl, &stStatus);
+    }
     dwStart = GetTickCount();
     dwCheck = stStatus.dwCheckPoint;
     if (bStatus) {
@@ -418,8 +524,6 @@ apxServiceInstall(APXHANDLE hService, LPCWSTR szServiceName,
 
     if (IS_INVALID_HANDLE(lpService->hService)) {
         apxLogWrite(APXLOG_MARK_SYSERR);
-
-        ErrorMessage(NULL, FALSE);
         return FALSE;
     }
     else {
@@ -485,7 +589,6 @@ apxServiceBrowse(APXHANDLE hService,
     if (IS_INVALID_HANDLE(hLock)) {
         apxLogWrite(APXLOG_MARK_SYSERR);
 
-        ErrorMessage(NULL, FALSE);
         return 0;
     }
     AplZeroMemory(&stEnum, sizeof(APXREGENUM));
diff --git a/src/native/nt/procrun/src/utils.c b/src/native/nt/procrun/src/utils.c
index 5a64474..2bbcb25 100644
--- a/src/native/nt/procrun/src/utils.c
+++ b/src/native/nt/procrun/src/utils.c
@@ -81,8 +81,8 @@ LPWSTR __apxGetEnvironmentVariableW(APXHANDLE hPool, LPCWSTR wsName)
     if (!(wsRet = apxPoolAlloc(hPool, (rc + 1) * sizeof(WCHAR))))
         return NULL;
     if (!GetEnvironmentVariableW(wsName, wsRet, rc)) {
+        apxLogWrite(APXLOG_MARK_SYSERR);
         apxFree(wsRet);
-        ErrorMessage(NULL, FALSE);
         return NULL;
     }
     return wsRet;
@@ -100,8 +100,8 @@ LPSTR __apxGetEnvironmentVariableA(APXHANDLE hPool, LPCSTR szName)
     if (!(szRet = apxPoolAlloc(hPool, rc + 1)))
         return NULL;
     if (!GetEnvironmentVariableA(szName, szRet, rc)) {
+        apxLogWrite(APXLOG_MARK_SYSERR);
         apxFree(szRet);
-        ErrorMessage(NULL, FALSE);
         return NULL;
     }
     return szRet;
@@ -210,39 +210,6 @@ LPSTR MzWideToUTF8(LPCWSTR ws)
     return str;
 }
 
-#ifdef _DEBUG
-
-void ErrorMessage(LPCTSTR szError, BOOL bFatal)
-{
-    LPVOID lpMsgBuf = NULL;
-    UINT   nType;
-    int    nRet;
-    DWORD  dwErr = GetLastError();
-    if (bFatal)
-        nType = MB_ICONERROR | MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL;
-    else
-        nType = MB_ICONEXCLAMATION | MB_OK;
-    if (szError) {
-        nRet = MessageBox(NULL, szError, TEXT("Application Error"), nType);
-    }
-    else {
-        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                      FORMAT_MESSAGE_FROM_SYSTEM |
-                      FORMAT_MESSAGE_IGNORE_INSERTS,
-                      NULL,
-                      dwErr,
-                      MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
-                      (LPTSTR) &lpMsgBuf, 0, NULL);
-        nRet = MessageBox(NULL, (LPCTSTR)lpMsgBuf,
-                          TEXT("Application System Error"), nType);
-        LocalFree(lpMsgBuf);
-    }
-    if (bFatal && (nRet == IDCANCEL || nRet == IDABORT)) {
-        ExitProcess(dwErr);
-    }
-}
-#endif /* _DEBUG */
-
 DWORD __apxGetMultiSzLengthA(LPCSTR lpStr, LPDWORD lpdwCount)
 {
     LPCSTR p = lpStr;
diff --git a/src/native/nt/service/Makefile b/src/native/nt/service/Makefile
deleted file mode 100644
index e6bdaa5..0000000
--- a/src/native/nt/service/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-INCLUDE=-I../lib -I ../../unix/native
-../../../../dist/INSTSVC: instmain.c arguments.o debug.o
-	gcc $(INCLUDE) instmain.c   -o ../../../../dist/INSTSVC arguments.o debug.o
-arguments.o: ../../unix/native/arguments.c
-	gcc -c $(INCLUDE) ../../unix/native/arguments.c
-debug.o: ../../unix/native/debug.c
-	gcc -c $(INCLUDE) ../../unix/native/debug.c
-clean:
-	rm -f arguments.o debug.o
diff --git a/src/native/nt/service/instmain.c b/src/native/nt/service/instmain.c
deleted file mode 100644
index 9693249..0000000
--- a/src/native/nt/service/instmain.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* @version $Id: instmain.c 480469 2006-11-29 08:22:04Z bayard $ */
-
-/*
- * jsvc.exe install program, create the service JavaService
- */
-
-/* includes */
-#include <windows.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "moni_inst.h"
-
-/* Definitions for booleans */
-typedef enum {
-    false,
-    true
-} bool;
-#include "arguments.h"
-
-VOID Usage()
-{
-    printf( "\r\n - Java service installer\r\n\r\n");
-    printf( " - Usage :\r\n");
-
-    printf( "       To install Java service : InstSvc -install ");
-    printf( " [-home JAVA_HOME] [-Dproperty=value]\r\n");
-    printf( "                                 [-cp CLASSPATH] startclass\r\n");
-    printf( " Like:\r\n");
-
-    printf( " InstSvc -install -home c:\\jdk1.3.1_02");
-    printf( " -Dcatalina.home=/home1/jakarta/jakarta-tomcat-4.1/build");
-    printf( " -Djava.io.tmpdir=/var/tmp ");
-    printf( " -cp \"c:\\jdk1.3.1_02\\lib\\tools.jar;");
-    printf( "c:\\home1\\jakarta\\jakarta-tomcat-4.1\\build\\bin\\commons-daemon.jar;");
-    printf( "c:\\home1\\jakarta\\jakarta-tomcat-4.1\\build\\bin\\bootstrap.jar\"");
-    printf( " org.apache.catalina.startup.BootstrapService\r\n");
-
-    printf( "       To remove Java service  : InstSvc -remove\r\n\r\n");
-    printf( "   Use regedit if you want to change something\r\n\r\n");
-    printf( "   Note that the service keys are stored under:\r\n");
-    printf( "   HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\");
-    printf( "%s",SZSERVICENAME);
-    printf( "\r\n");
-    printf( "   The environment keys in:\r\n");
-    printf( "   ");
-    printf( "%s",SZKEY_ONSERVE);
-    printf( "\r\n");
-    return;
-}
-
-/* from src/os/win32/service.c (httpd-1.3!) */
-
-BOOL isWindowsNT(void)
-{
-    static BOOL once = FALSE;
-    static BOOL isNT = FALSE;
-
-    if (!once)
-    {
-        OSVERSIONINFO osver;
-        osver.dwOSVersionInfoSize = sizeof(osver);
-        if (GetVersionEx(&osver))
-            if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT)
-                isNT = TRUE;
-        once = TRUE;
-    }
-    return isNT;
-}
-
-
-/* remove the service (first stop it!) NT version */
-
-BOOL RemoveSvcNT (VOID)
-{
-    BOOL            removed;
-    SC_HANDLE       hManager;
-    SC_HANDLE       hService;
-    SERVICE_STATUS  svcStatus;
-    DWORD           dwCount;
-
-    removed = FALSE;
-    /* open service control manager with full access right */
-    hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-    if (NULL != hManager) {
-        /* open existing service */
-        hService = OpenService(hManager, SZSERVICENAME, SERVICE_ALL_ACCESS);
-        if (NULL != hService) {
-            /* get the status of the service */
-            if (QueryServiceStatus(hService, &svcStatus)) {
-                /* and see if the service is stopped */
-                if (SERVICE_STOPPED != svcStatus.dwCurrentState) {
-                    /* if not stop the service */
-                    ControlService(hService, SERVICE_CONTROL_STOP, &svcStatus);
-                }
-                dwCount = 0;
-                do {
-                    if (SERVICE_STOPPED == svcStatus.dwCurrentState) {
-                        /* delete the service */
-                        if (DeleteService(hService)) {
-                            removed = TRUE;
-                            break;
-                        }
-                    }
-                    /* wait 10 seconds for the service to stop */
-                    Sleep(10000);
-                    if (!QueryServiceStatus(hService, &svcStatus)) {
-                        /* something went wrong */
-                        break;
-                    }
-                    dwCount++;
-                } while (10 > dwCount);
-            }
-            /* close service handle */
-            CloseServiceHandle(hService);
-        }
-        /* close service control manager */
-        CloseServiceHandle(hManager);
-    }
-    return removed;
-} /* RemoveSvc */
-
-/* remove service (non NT) stopping it looks ugly!!! */
-BOOL RemoveSvc (VOID)
-{
-    HKEY hkey;
-    DWORD rv;
-
-    rv = RegOpenKey(HKEY_LOCAL_MACHINE,
-        "Software\\Microsoft\\Windows\\CurrentVersion\\RunServices",
-        &hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not open the RunServices registry key.\r\n");
-        return FALSE;
-    }
-    rv = RegDeleteValue(hkey, SZSERVICENAME);
-    RegCloseKey(hkey);
-    if (rv != ERROR_SUCCESS)
-        printf( "Could not delete the RunServices entry.\r\n");
-
-    rv = RegOpenKey(HKEY_LOCAL_MACHINE,
-        "SYSTEM\\CurrentControlSet\\Services", &hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not open the Services registry key.\r\n");
-        return FALSE;
-    }
-    rv = RegDeleteKey(hkey, SZSERVICENAME);
-    RegCloseKey(hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not delete the Services registry key.\r\n");
-        return FALSE;
-    }
-    return TRUE;
-}
-
-
-/* Install service (NT version) */
-
-BOOL InstallSvcNT (CHAR *svcExePath)
-{
-    BOOL        installed;
-    SC_HANDLE   hManager;
-    SC_HANDLE   hService;
-
-    installed = FALSE;
-    /* open the service control manager with full access right */
-    hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-    if (NULL != hManager) {
-        /* create the service */
-        hService = CreateService(hManager,
-            SZSERVICENAME,             /* name of the service */
-            SZSERVICEDISPLAYNAME,      /* description */
-            SERVICE_ALL_ACCESS,
-            SERVICE_WIN32_OWN_PROCESS,  /* type of service */
-            SERVICE_DEMAND_START,       /* AUTO_START,  startmode */
-            SERVICE_ERROR_NORMAL,       /* error treatment */
-            svcExePath,                 /* path_name */
-            NULL,                       /* no load order enty */
-            NULL,                       /* no tag identifier. */
-            NULL,                       /* dependencies. */
-            NULL,                       /* LocalSystem account */
-            NULL);                      /* dummy user password */
-        if (NULL != hService) {
-            /* close service handle */
-            CloseServiceHandle(hService);
-            installed = TRUE;
-        }
-    } else {
-        printf( "OpenSCManager failed\r\n");
-    }
-    return installed;
-}
-
-/* Install service */
-
-BOOL InstallSvc (CHAR *svcExePath)
-{
-    HKEY        hkey;
-    DWORD rv;
-    char szPath[MAX_PATH];
-
-    printf( "InstallSvc for non-NT\r\n");
-
-    rv = RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows"
-              "\\CurrentVersion\\RunServices", &hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not open the RunServices registry key\r\n");
-        return FALSE;
-    }
-        rv = RegSetValueEx(hkey, SZSERVICENAME, 0, REG_SZ,
-               (unsigned char *) svcExePath,
-               strlen(svcExePath) + 1);
-    RegCloseKey(hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not add %s:%s ",SZSERVICENAME, svcExePath);
-        printf( "to RunServices Registry Key\r\n");
-        return FALSE;
-    }
-
-    strcpy(szPath,
-         "SYSTEM\\CurrentControlSet\\Services\\");
-    strcat(szPath,SZSERVICENAME);
-    rv = RegCreateKey(HKEY_LOCAL_MACHINE, szPath, &hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not create/open the %s registry key\r\n",
-            szPath);
-        return FALSE;
-    }
-    rv = RegSetValueEx(hkey, "ImagePath", 0, REG_SZ,
-               (unsigned char *) svcExePath,
-               strlen(svcExePath) + 1);
-    if (rv != ERROR_SUCCESS) {
-        RegCloseKey(hkey);
-        printf( "Could not add ImagePath to our Registry Key\r\n");
-        return FALSE;
-    }
-    rv = RegSetValueEx(hkey, "DisplayName", 0, REG_SZ,
-               (unsigned char *) SZSERVICEDISPLAYNAME,
-               strlen(SZSERVICEDISPLAYNAME) + 1);
-    RegCloseKey(hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not add DisplayName to our Registry Key\r\n");
-        return FALSE;
-    }
-    return TRUE;
-}
-
-/*
- * Fill the registry with the environment variables
- */
-BOOL InstallEnv (char *var, char *value)
-{
-    BOOL        installed;
-    HKEY        hKey;
-
-    installed = FALSE;
-    /* create the parameters registry tree */
-        log_debug("InstallEnv: %s:%s",var,value);
-    if (ERROR_SUCCESS == RegCreateKeyEx(HKEY_LOCAL_MACHINE, SZKEY_ONSERVE, 0,
-            NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,
-            &hKey, NULL)) {
-            /* key is created or opened */
-            RegSetValueEx(hKey,var,0,REG_SZ,(BYTE *)value,lstrlen(value)+1);
-            RegCloseKey(hKey);
-            installed = TRUE;
-            }
-    return installed;
-} /* InstallEnv */
-
-/*
- * Add the arguments to start jsvc like -Dcatalina.home=/home/jakarta/tomcat.
- */
-BOOL InstallEnvParm(int i,char *value)
-{
-    BOOL        installed;
-    HKEY        hKey;
-    char var[64];
-
-    sprintf(var,"arg%d",i);
-        log_debug("InstallEnvParm: %s:%s",var,value);
-
-    installed = FALSE;
-    /* create the parameters registry tree */
-    if (ERROR_SUCCESS == RegCreateKeyEx(HKEY_LOCAL_MACHINE,
-            SZKEY_ONSERVEARG, 0,
-            NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,
-            &hKey, NULL)) {
-            /* key is created or opened */
-            RegSetValueEx(hKey,var,0,REG_SZ,
-                (BYTE *)value,lstrlen(value)+1);
-            RegCloseKey(hKey);
-            installed = TRUE;
-    }
-    return installed;
-}
-
-/*
- * Remove the created keys
- */
-BOOL RemoveEnv()
-{
-    HKEY hkey;
-    DWORD rv;
-
-        log_debug("RemoveEnv");
-
-    rv = RegOpenKey(HKEY_LOCAL_MACHINE,
-        NULL,
-        &hkey);
-    if (rv != ERROR_SUCCESS) {
-        printf( "Could not open the jsvc registry key.\r\n");
-        return FALSE;
-    }
-    rv = RegDeleteKey(hkey, SZKEY_ONSERVE);
-    RegCloseKey(hkey);
-    if (rv != ERROR_SUCCESS)
-        printf( "Could not delete the jsvc entry.\r\n");
-
-        /* remove the key tree if empty */
-
-    return TRUE;
-}
-
-
-/*
- * Install or remove the OnServe service and Key in the registry.
- * no parameter install the OnServe.
- * -REMOVE: desinstall the OnServe service and Keys.
- */
-
-INT main (INT argc, CHAR *argv[])
-{
-    BOOL done;
-    arg_data *args=NULL;
-    char szPath[512];
-    char szExePath[512];
-    int i;
-
-    printf( "\r\n - Copyright (c) 2001 The Apache Software Foundation. \r\n");
-    printf( "\r\n");
-    if (GetModuleFileName(NULL, szPath, sizeof(szPath))) {
-        printf( "%s\r\n",szPath);
-    }
-
-    args=arguments(argc,argv);
-    if (args==NULL) {
-        Usage();
-        return(1);
-    }
-
-
-    if (args->install==true) {
-        if (args->home==NULL) {
-            printf( "home empty or not defined...\r\n\r\n");
-            Usage();
-            return(1);
-        }
-        if (args->clas==NULL) {
-            printf( "startclass empty or not defined...\r\n\r\n");
-            Usage();
-            return(1);
-        }
-        printf( "\r\ninstalling...\r\n\r\n");
-
-        /* get the patch from the executable name */
-        for(i=strlen(szPath);i>0;i--)
-            if (szPath[i]=='\\') {
-                szPath[i]='\0';
-                break;
-            }
-        strcpy(szExePath,szPath);
-        strcat(szExePath,SZDEFMONISVCPATH);
-        /* install jsvcservice.exe as a service */
-        if (isWindowsNT())
-            done = InstallSvcNT(szExePath);
-        else
-            done = InstallSvc(szExePath);
-
-        if (done)
-            printf( "InstallSvc done\r\n");
-        else
-            printf( "InstallSvc failed\r\n");
-
-        /* install the environment variable in registry */
-
-        /* should get it from szPath */
-        InstallEnv("JAKARTA_HOME",szPath);
-
-        InstallEnv("CYGWIN",SZCYGWINPATH); /* need APR to get ride of it */
-
-        InstallEnv("JAVA_HOME",args->home);
-
-        InstallEnv("STARTCLASS",args->clas);
-
-        if (args->onum==0) return(0);
-
-        for(i=0;i<args->onum;i++)
-            InstallEnvParm(i,args->opts[i]);
-
-        return(0);
-    }
-
-    if (args->remove==true) {
-        /* remove the  service. removing the keys not yet done!!! */
-        printf( "\r\n - removing Java Service...\r\n\r\n");
-        if (isWindowsNT())
-            done = RemoveSvcNT();
-        else
-            done = RemoveSvc();
-        if (!done) {
-            printf( "\r\n - REMOVE FAILED....\r\n\r\n");
-            return(2);
-        }
-        RemoveEnv();
-        return(0);
-    }
-    printf( "\r\nonly -install or -remove supported...\r\n\r\n");
-    Usage();
-    return(1);
-}
diff --git a/src/native/nt/service/instsvc.dsp b/src/native/nt/service/instsvc.dsp
deleted file mode 100644
index dcc2256..0000000
--- a/src/native/nt/service/instsvc.dsp
+++ /dev/null
@@ -1,104 +0,0 @@
-# Microsoft Developer Studio Project File - Name="InstSvc" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=InstSvc - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "INSTSVC.MAK".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "INSTSVC.MAK" CFG="InstSvc - Win32 Release"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "InstSvc - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "InstSvc - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "InstSvc - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\InstSvc.Release"
-# PROP Intermediate_Dir ".\InstSvc.Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../lib" /D "WIN32" /D "_CONSOLE" /YX /FD /D "NDEBUG" /c
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../bin/INSTSVC.exe"
-
-!ELSEIF  "$(CFG)" == "InstSvc - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\InstSvc.Debug"
-# PROP Intermediate_Dir ".\InstSvc.Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /YX /FD /c
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
-
-!ENDIF 
-
-# Begin Target
-
-# Name "InstSvc - Win32 Release"
-# Name "InstSvc - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\instmain.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=..\lib\moni_inst.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/src/native/nt/service/instsvc.dsw b/src/native/nt/service/instsvc.dsw
deleted file mode 100644
index 5ef42f8..0000000
--- a/src/native/nt/service/instsvc.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "InstSvc"=.\INSTSVC.DSP - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/src/native/nt/signals/kills.c b/src/native/nt/signals/kills.c
deleted file mode 100644
index 295ba60..0000000
--- a/src/native/nt/signals/kills.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* @version $Id: kills.c 480469 2006-11-29 08:22:04Z bayard $ */
-
-/*
- * as Windows does not support signal, jsvc uses events to emulate them.
- * The supported signal is SIGTERM.
- * signals.c contains the signal handler logic.
- */
-#include <windows.h>
-#include <stdio.h>
-
-/*
- * Send a clean termination signal to a process
- * it is like kill(pid,SIGTERM);
- */
-int TermPid(long pid)
-{
-char Name[256];
-HANDLE hevint;
-BOOL  rc;
-
-  sprintf(Name,"TERM%ld",pid);
-
-  hevint = OpenEvent(EVENT_MODIFY_STATE,FALSE,Name);
-  if (hevint == NULL) return(-1); /* failed */
-
-  rc = SetEvent(hevint);
-  CloseHandle(hevint);
-  
-  if (rc) return(0);
-  return(-1);
-}
diff --git a/src/native/nt/supcalls_nt/vdenv.c b/src/native/nt/supcalls_nt/vdenv.c
deleted file mode 100644
index 6628da1..0000000
--- a/src/native/nt/supcalls_nt/vdenv.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* @version $Id: vdenv.c 897078 2010-01-08 01:52:47Z sebb $ */
-
-/* Read the Win-NT register and set the jsvc environment variable. */
-/* XXX We should use a property file instead  registry */
-
-/* XXX Set the PATH (for dynamic linking!) what about libapr*.so? */
-
-#include <windows.h>
-#include "moni_inst.h"
-
-#define ENVSIZE 1024
-
-int MySetEnvironmentVariable(char *name, char *data)
-{
-char Variable[ENVSIZE];
-
-  strcpy(Variable,name);
-  strcat(Variable,"=");
-  strcat(Variable,data);
-  if (putenv(Variable)) return(-1);
-  return(0);
-}
-/*
- *  FUNCTION: OnServeSetEnv()
- *
- *  PURPOSE: Actual code of the routine that reads the registry and
- *           set the OnServe environment variables.
- *           The PATH is needed for the dynamic linking.
- *
- *  RETURN VALUE:
- *    0 : All OK.
- *    <0: Something Failed. (Registry cannot be read or one key cannot be read).
- *
-*/
-int OnServeSetEnv ()
-{
-HKEY    hKey=NULL;
-DWORD   Type;
-char    jakarta_home[ENVSIZE]; /* for the path */
-char    cygwin[ENVSIZE]; /* for the path */
-char    Data[ENVSIZE];
-DWORD   LData;
-int     qreturn=0;
-
-
-    /* Read the registry and set environment. */
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, SZKEY_ONSERVE,
-                        0, KEY_READ,&hKey) !=  ERROR_SUCCESS)
-      return(-1);
-
-    /* read key and set environment. */
-
-    /* JAKARTA_HOME */
-    LData = sizeof(Data);
-    if (RegQueryValueEx(hKey,"JAKARTA_HOME",NULL,&Type,Data,&LData)==ERROR_SUCCESS) {
-      strcpy(jakarta_home,Data);
-      MySetEnvironmentVariable("JAKARTA_HOME",Data);
-      }
-    else 
-      qreturn = -2;
-
-    /* CYGWIN */
-    LData = sizeof(Data);
-    if (RegQueryValueEx(hKey,"CYGWIN",NULL,&Type,Data,&LData)==ERROR_SUCCESS) {
-      strcpy(cygwin,Data);
-      MySetEnvironmentVariable("CYGWIN",Data);
-      }
-    else 
-      qreturn = -3;
-
-    /* JAVA_HOME */
-    LData = sizeof(Data);
-    if (RegQueryValueEx(hKey,"JAVA_HOME",NULL,&Type,Data,&LData)
-        ==ERROR_SUCCESS) {
-      MySetEnvironmentVariable("JAVA_HOME",Data);
-      }
-    else 
-      qreturn = -4;
-
-    RegCloseKey(hKey);
-    hKey = NULL;
-
-    /* set the PATH otherwise nothing works!!! */
-    LData = sizeof(Data);                                                       
-    if (!GetEnvironmentVariable("PATH",Data,LData)) {                           
-      strcpy(Data,jakarta_home);
-      }
-    else {
-      strcat(Data,";");
-      strcat(Data,jakarta_home);
-      }
-    strcat(Data,"\\bin");
-
-    strcat(Data,";");
-    strcat(Data,cygwin);
-    strcat(Data,"\\bin");
-
-    MySetEnvironmentVariable("PATH",Data);
-
-    return(qreturn);
-}
-
-/*
- * Build the jsvc.exe command using the registry information.
- */
-int BuildCommand(char *data)
-{
-    int  i;
-    LONG lRet;
-    DWORD dwIndex;
-    char name[128];
-    DWORD lname;
-    char value[256];
-    DWORD lvalue;
-    DWORD nvalue;
-    DWORD   Type;
-    HKEY    hKey=NULL;
-
-
-    strcat(data,"\\jsvc.exe -nodetach ");
-
-    /* Read the registry and set environment. */
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, SZKEY_ONSERVEARG,
-                     0, KEY_READ,&hKey) !=  ERROR_SUCCESS)
-        return(-1);
-    if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL,
-                        &nvalue,NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
-        return(-2);
-
-    /* Read the arguments */
-    for (i=0;i<nvalue;i++) {
-        lname = sizeof(name);
-        lvalue = sizeof(value);
-
-        lRet = RegEnumValue (hKey, i, name, &lname, NULL, NULL,
-                             value, &lvalue);
-        if (lRet != ERROR_SUCCESS) {
-            RegCloseKey(hKey);
-            return(-3);
-        }
-
-        strncat(data,value,lvalue);
-        strcat(data," ");
-    }
-    RegCloseKey(hKey);
-
-    /* Read the start class. */
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, SZKEY_ONSERVE,
-                        0, KEY_READ,&hKey) !=  ERROR_SUCCESS)
-        return(-4);
-    lvalue = sizeof(value);
-    if (RegQueryValueEx(hKey,"STARTCLASS",NULL,&Type,value,&lvalue)
-        !=ERROR_SUCCESS) {
-        RegCloseKey(hKey);
-        return(-5);
-    }
-    RegCloseKey(hKey);
-
-    strncat(data,value,lvalue);
-
-    return(0);
-}
diff --git a/src/native/unix/CHANGES.txt b/src/native/unix/CHANGES.txt
index 6fac876..eaa7603 100644
--- a/src/native/unix/CHANGES.txt
+++ b/src/native/unix/CHANGES.txt
@@ -1,5 +1,9 @@
-JAKARTA COMMONS DAEMON (UNIX) CHANGELOG:
-Last modified at [$Date: 2010-02-18 10:09:07 +0100 (Thu, 18 Feb 2010) $]
+APACHE COMMONS DAEMON (UNIX) CHANGELOG:
+Last modified at [$Date: 2010-03-15 10:50:28 +0100 (Mon, 15 Mar 2010) $]
+
+Changes with 1.0.3
+  * Implement fail() method (DAEMON-128)
+  * Add missing Java6 parameters (DAEMON-140)
 
 Changes with 1.0.2
   * Allow support for OS/X 10.6 (DAEMON-129)
diff --git a/src/native/unix/Makedefs b/src/native/unix/Makedefs
deleted file mode 100644
index effac54..0000000
--- a/src/native/unix/Makedefs
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-# @version $Id: Makedefs.in 480475 2006-11-29 08:31:47Z bayard $
-
-CC = gcc
-JAVAC = /opt/java6/bin/javac
-JAR = /opt/java6/bin/jar
-CFLAGS = -g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=\"i386\" -I/opt/java6/include -I/opt/java6/include/linux -Wall -Wstrict-prototypes
-LDFLAGS = 
-LIBS =  -ldl -lpthread
-JAVACFLAGS = 
-RANLIB = ranlib
-LDCMD = gcc
-
-.c.o:
-	$(CC) $(CFLAGS) -c $< -o $@
diff --git a/src/native/unix/Makefile b/src/native/unix/Makefile
deleted file mode 100644
index c8c48da..0000000
--- a/src/native/unix/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-# @version $Id: Makefile.in 480475 2006-11-29 08:31:47Z bayard $
-
-SUBDIRS = native
-
-all: native/all
-
-native/all:
-	(cd native; $(MAKE)  all)
-
-clean:
-	(cd native; $(MAKE)  clean)
-
-distclean: clean
-	rm -f config.cache
-	rm -f config.log
-	rm -f config.status
-	rm -f native/Makefile
-	rm -f Makefile
-	rm -f Makedefs
-
-realclean: distclean
-	rm -f configure
diff --git a/src/native/unix/config.log b/src/native/unix/config.log
deleted file mode 100644
index 55472f9..0000000
--- a/src/native/unix/config.log
+++ /dev/null
@@ -1,264 +0,0 @@
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by configure, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  $ ./configure --prefix=/home/mturk/Workplace/daemon/src/native/unix/release --with-java=/opt/java6
-
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = fc12x32m0.jboss.hr
-uname -m = i686
-uname -r = 2.6.31.12-174.2.3.fc12.i686.PAE
-uname -s = Linux
-uname -v = #1 SMP Mon Jan 18 20:06:44 UTC 2010
-
-/usr/bin/uname -p = unknown
-/bin/uname -X     = unknown
-
-/bin/arch              = i686
-/usr/bin/arch -k       = unknown
-/usr/convex/getsysinfo = unknown
-/usr/bin/hostinfo      = unknown
-/bin/machine           = unknown
-/usr/bin/oslevel       = unknown
-/bin/universe          = unknown
-
-PATH: /opt/java6/bin
-PATH: /opt/ant/bin
-PATH: /usr/lib/qt-3.3/bin
-PATH: /usr/kerberos/sbin
-PATH: /usr/kerberos/bin
-PATH: /usr/lib/ccache
-PATH: /usr/local/bin
-PATH: /usr/bin
-PATH: /bin
-PATH: /usr/local/sbin
-PATH: /usr/sbin
-PATH: /sbin
-PATH: /home/mturk/local/bin
-PATH: /opt/maven/bin
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-configure:1793: checking build system type
-configure:1811: result: i686-pc-linux-gnu
-configure:1833: checking host system type
-configure:1848: result: i686-pc-linux-gnu
-configure:1871: checking cached host system type
-configure:1882: result: ok
-configure:1941: checking for gcc
-configure:1957: found /usr/lib/ccache/gcc
-configure:1968: result: gcc
-configure:2200: checking for C compiler version
-configure:2208: gcc --version >&5
-gcc (GCC) 4.4.3 20100127 (Red Hat 4.4.3-4)
-Copyright (C) 2010 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-configure:2212: $? = 0
-configure:2219: gcc -v >&5
-Using built-in specs.
-Target: i686-redhat-linux
-Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre  [...]
-Thread model: posix
-gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC) 
-configure:2223: $? = 0
-configure:2230: gcc -V >&5
-gcc: '-V' option must have argument
-configure:2234: $? = 1
-configure:2257: checking for C compiler default output file name
-configure:2279: gcc    conftest.c  >&5
-configure:2283: $? = 0
-configure:2321: result: a.out
-configure:2340: checking whether the C compiler works
-configure:2350: ./a.out
-configure:2354: $? = 0
-configure:2373: result: yes
-configure:2380: checking whether we are cross compiling
-configure:2382: result: no
-configure:2385: checking for suffix of executables
-configure:2392: gcc -o conftest    conftest.c  >&5
-configure:2396: $? = 0
-configure:2422: result: 
-configure:2428: checking for suffix of object files
-configure:2454: gcc -c   conftest.c >&5
-configure:2458: $? = 0
-configure:2483: result: o
-configure:2487: checking whether we are using the GNU C compiler
-configure:2516: gcc -c   conftest.c >&5
-configure:2523: $? = 0
-configure:2540: result: yes
-configure:2549: checking whether gcc accepts -g
-configure:2579: gcc -c -g  conftest.c >&5
-configure:2586: $? = 0
-configure:2687: result: yes
-configure:2704: checking for gcc option to accept ISO C89
-configure:2778: gcc  -c -g -O2  conftest.c >&5
-configure:2785: $? = 0
-configure:2808: result: none needed
-configure:2869: checking for ranlib
-configure:2885: found /usr/bin/ranlib
-configure:2896: result: ranlib
-configure:2924: checking C flags dependant on host system type
-configure:3037: result: ok
-configure:3070: checking JAVA_HOME
-configure:3075: result: /opt/java6
-configure:3100: checking for sablevm
-configure:3131: result: NONE
-configure:3159: checking for kaffe
-configure:3190: result: NONE
-configure:3259: checking for javac
-configure:3277: found /opt/java6/bin/javac
-configure:3290: result: /opt/java6/bin/javac
-configure:3341: result: /opt/java6/bin/javac
-configure:3350: checking wether the Java compiler (/opt/java6/bin/javac) works
-configure:3372: result: yes
-configure:3431: checking for jar
-configure:3449: found /opt/java6/bin/jar
-configure:3462: result: /opt/java6/bin/jar
-configure:3530: result: gcc flags added
-configure:3683: creating ./config.status
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by config.status, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status 
-
-on fc12x32m0.jboss.hr
-
-config.status:660: creating Makefile
-config.status:660: creating Makedefs
-config.status:660: creating native/Makefile
-configure:4662: result: Now you can issue "make"
-
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-
-ac_cv_build=i686-pc-linux-gnu
-ac_cv_c_compiler_gnu=yes
-ac_cv_env_CC_set=
-ac_cv_env_CC_value=
-ac_cv_env_CFLAGS_set=
-ac_cv_env_CFLAGS_value=
-ac_cv_env_CPPFLAGS_set=
-ac_cv_env_CPPFLAGS_value=
-ac_cv_env_LDFLAGS_set=
-ac_cv_env_LDFLAGS_value=
-ac_cv_env_LIBS_set=
-ac_cv_env_LIBS_value=
-ac_cv_env_build_alias_set=
-ac_cv_env_build_alias_value=
-ac_cv_env_host_alias_set=
-ac_cv_env_host_alias_value=
-ac_cv_env_target_alias_set=
-ac_cv_env_target_alias_value=
-ac_cv_host=i686-pc-linux-gnu
-ac_cv_host_system_type=i686-pc-linux-gnu
-ac_cv_objext=o
-ac_cv_path_JAR=/opt/java6/bin/jar
-ac_cv_path_JAVAC=/opt/java6/bin/javac
-ac_cv_path_KAFFEVM=NONE
-ac_cv_path_SABLEVM=NONE
-ac_cv_prog_ac_ct_CC=gcc
-ac_cv_prog_ac_ct_RANLIB=ranlib
-ac_cv_prog_cc_c89=
-ac_cv_prog_cc_g=yes
-ap_cv_prog_javac_works=yes
-
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-
-CC='gcc'
-CFLAGS='-g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=\"i386\" -I/opt/java6/include -I/opt/java6/include/linux -Wall -Wstrict-prototypes'
-CPPFLAGS=''
-DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"'
-ECHO_C=''
-ECHO_N='-n'
-ECHO_T=''
-EXEEXT=''
-JAR='/opt/java6/bin/jar'
-JARSABLE='NONE'
-JAVAC='/opt/java6/bin/javac'
-JAVACFLAGS=''
-JAVACSABLE='NONE'
-JAVA_HOME='/opt/java6'
-KAFFEVM='NONE'
-LDCMD='gcc'
-LDFLAGS=''
-LIBOBJS=''
-LIBS=' -ldl -lpthread'
-LTLIBOBJS=''
-OBJEXT='o'
-PACKAGE_BUGREPORT=''
-PACKAGE_NAME=''
-PACKAGE_STRING=''
-PACKAGE_TARNAME=''
-PACKAGE_VERSION=''
-PATH_SEPARATOR=':'
-RANLIB='ranlib'
-SABLEVM='NONE'
-SHELL='/bin/sh'
-ac_ct_CC='gcc'
-bindir='${exec_prefix}/bin'
-build='i686-pc-linux-gnu'
-build_alias=''
-build_cpu='i686'
-build_os='linux-gnu'
-build_vendor='pc'
-datadir='${datarootdir}'
-datarootdir='${prefix}/share'
-docdir='${datarootdir}/doc/${PACKAGE}'
-dvidir='${docdir}'
-exec_prefix='${prefix}'
-host='i686-pc-linux-gnu'
-host_alias=''
-host_cpu='i686'
-host_os='linux-gnu'
-host_vendor='pc'
-htmldir='${docdir}'
-includedir='${prefix}/include'
-infodir='${datarootdir}/info'
-libdir='${exec_prefix}/lib'
-libexecdir='${exec_prefix}/libexec'
-localedir='${datarootdir}/locale'
-localstatedir='${prefix}/var'
-mandir='${datarootdir}/man'
-oldincludedir='/usr/include'
-pdfdir='${docdir}'
-prefix='/home/mturk/Workplace/daemon/src/native/unix/release'
-program_transform_name='s,x,x,'
-psdir='${docdir}'
-sbindir='${exec_prefix}/sbin'
-sharedstatedir='${prefix}/com'
-sysconfdir='${prefix}/etc'
-target_alias=''
-
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-
-#define PACKAGE_NAME ""
-#define PACKAGE_TARNAME ""
-#define PACKAGE_VERSION ""
-#define PACKAGE_STRING ""
-#define PACKAGE_BUGREPORT ""
-
-configure: exit 0
diff --git a/src/native/unix/config.status b/src/native/unix/config.status
deleted file mode 100755
index 7d0023a..0000000
--- a/src/native/unix/config.status
+++ /dev/null
@@ -1,866 +0,0 @@
-#! /bin/sh
-# Generated by configure.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=${CONFIG_SHELL-/bin/sh}
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
-  case `echo 'x\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -p'
-  fi
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-# Files that config.status was made for.
-config_files=" Makefile Makedefs native/Makefile"
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTION]... [FILE]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number and configuration settings, then exit
-  -q, --quiet, --silent
-                   do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-      --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Report bugs to <bug-autoconf at gnu.org>."
-
-ac_cs_version="\
-config.status
-configured by ./configure, generated by GNU Autoconf 2.63,
-  with options \"'--prefix=/home/mturk/Workplace/daemon/src/native/unix/release' '--with-java=/opt/java6'\"
-
-Copyright (C) 2008 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='/home/mturk/Workplace/daemon/src/native/unix'
-srcdir='.'
-test -n "$AWK" || AWK=awk
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=*)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  *)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
-  --debug | --debu | --deb | --de | --d | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
-    ac_need_defaults=false;;
-  --he | --h |  --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) { $as_echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1"
-     ac_need_defaults=false ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-if $ac_cs_recheck; then
-  set X '/bin/sh' './configure'  '--prefix=/home/mturk/Workplace/daemon/src/native/unix/release' '--with-java=/opt/java6' $ac_configure_extra_args --no-create --no-recursion
-  shift
-  $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6
-  CONFIG_SHELL='/bin/sh'
-  export CONFIG_SHELL
-  exec "$@"
-fi
-
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-  $as_echo "$ac_log"
-} >&5
-
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
-  case $ac_config_target in
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "Makedefs") CONFIG_FILES="$CONFIG_FILES Makedefs" ;;
-    "native/Makefile") CONFIG_FILES="$CONFIG_FILES native/Makefile" ;;
-
-  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
-  tmp=
-  trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=./conf$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
-} ||
-{
-   $as_echo "$as_me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr='
'
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
-else
-  ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
-cat >>"$tmp/subs1.awk" <<\_ACAWK &&
-S["LTLIBOBJS"]=""
-S["LIBOBJS"]=""
-S["LDCMD"]="gcc"
-S["JAR"]="/opt/java6/bin/jar"
-S["JARSABLE"]="NONE"
-S["JAVACFLAGS"]=""
-S["JAVAC"]="/opt/java6/bin/javac"
-S["JAVACSABLE"]="NONE"
-S["KAFFEVM"]="NONE"
-S["SABLEVM"]="NONE"
-S["JAVA_HOME"]="/opt/java6"
-S["RANLIB"]="ranlib"
-S["OBJEXT"]="o"
-S["EXEEXT"]=""
-S["ac_ct_CC"]="gcc"
-S["CPPFLAGS"]=""
-S["LDFLAGS"]=""
-S["CFLAGS"]="-g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=\\\"i386\\\" -I/opt/java6/include -I/opt/java6/include/linux -Wall -Wstrict-prototypes"
-S["CC"]="gcc"
-S["host_os"]="linux-gnu"
-S["host_vendor"]="pc"
-S["host_cpu"]="i686"
-S["host"]="i686-pc-linux-gnu"
-S["build_os"]="linux-gnu"
-S["build_vendor"]="pc"
-S["build_cpu"]="i686"
-S["build"]="i686-pc-linux-gnu"
-S["target_alias"]=""
-S["host_alias"]=""
-S["build_alias"]=""
-S["LIBS"]=" -ldl -lpthread"
-S["ECHO_T"]=""
-S["ECHO_N"]="-n"
-S["ECHO_C"]=""
-S["DEFS"]="-DPACKAGE_NAME=\\\"\\\" -DPACKAGE_TARNAME=\\\"\\\" -DPACKAGE_VERSION=\\\"\\\" -DPACKAGE_STRING=\\\"\\\" -DPACKAGE_BUGREPORT=\\\"\\\""
-S["mandir"]="${datarootdir}/man"
-S["localedir"]="${datarootdir}/locale"
-S["libdir"]="${exec_prefix}/lib"
-S["psdir"]="${docdir}"
-S["pdfdir"]="${docdir}"
-S["dvidir"]="${docdir}"
-S["htmldir"]="${docdir}"
-S["infodir"]="${datarootdir}/info"
-S["docdir"]="${datarootdir}/doc/${PACKAGE}"
-S["oldincludedir"]="/usr/include"
-S["includedir"]="${prefix}/include"
-S["localstatedir"]="${prefix}/var"
-S["sharedstatedir"]="${prefix}/com"
-S["sysconfdir"]="${prefix}/etc"
-S["datadir"]="${datarootdir}"
-S["datarootdir"]="${prefix}/share"
-S["libexecdir"]="${exec_prefix}/libexec"
-S["sbindir"]="${exec_prefix}/sbin"
-S["bindir"]="${exec_prefix}/bin"
-S["program_transform_name"]="s,x,x,"
-S["prefix"]="/home/mturk/Workplace/daemon/src/native/unix/release"
-S["exec_prefix"]="${prefix}"
-S["PACKAGE_BUGREPORT"]=""
-S["PACKAGE_STRING"]=""
-S["PACKAGE_VERSION"]=""
-S["PACKAGE_TARNAME"]=""
-S["PACKAGE_NAME"]=""
-S["PATH_SEPARATOR"]=":"
-S["SHELL"]="/bin/sh"
-_ACAWK
-cat >>"$tmp/subs1.awk" <<_ACAWK &&
-  for (key in S) S_is_set[key] = 1
-  FS = ""
-
-}
-{
-  line = $ 0
-  nfields = split(line, field, "@")
-  substed = 0
-  len = length(field[1])
-  for (i = 2; i < nfields; i++) {
-    key = field[i]
-    keylen = length(key)
-    if (S_is_set[key]) {
-      value = S[key]
-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-      len += length(value) + length(field[++i])
-      substed = 1
-    } else
-      len += 1 + keylen
-  }
-
-  print line
-}
-
-_ACAWK
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
-  cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
-$as_echo "$as_me: error: could not setup config files machinery" >&2;}
-   { (exit 1); exit 1; }; }
-fi # test -n "$CONFIG_FILES"
-
-
-eval set X "  :F $CONFIG_FILES      "
-shift
-for ac_tag
-do
-  case $ac_tag in
-  :[FHLC]) ac_mode=$ac_tag; continue;;
-  esac
-  case $ac_mode$ac_tag in
-  :[FHL]*:*);;
-  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
-$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
-   { (exit 1); exit 1; }; };;
-  :[FH]-) ac_tag=-:-;;
-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-  esac
-  ac_save_IFS=$IFS
-  IFS=:
-  set x $ac_tag
-  IFS=$ac_save_IFS
-  shift
-  ac_file=$1
-  shift
-
-  case $ac_mode in
-  :L) ac_source=$1;;
-  :[FH])
-    ac_file_inputs=
-    for ac_f
-    do
-      case $ac_f in
-      -) ac_f="$tmp/stdin";;
-      *) # Look for the file first in the build tree, then in the source tree
-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
-	 # because $ac_f cannot contain `:'.
-	 test -f "$ac_f" ||
-	   case $ac_f in
-	   [\\/$]*) false;;
-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-	   esac ||
-	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-   { (exit 1); exit 1; }; };;
-      esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      ac_file_inputs="$ac_file_inputs '$ac_f'"
-    done
-
-    # Let's still pretend it is `configure' which instantiates (i.e., don't
-    # use $as_me), people would be surprised to read:
-    #    /* config.h.  Generated by config.status.  */
-    configure_input='Generated from '`
-	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-	`' by configure.'
-    if test x"$ac_file" != x-; then
-      configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
-    fi
-    # Neutralize special characters interpreted by sed in replacement strings.
-    case $configure_input in #(
-    *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
-       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-    *) ac_sed_conf_input=$configure_input;;
-    esac
-
-    case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; } ;;
-    esac
-    ;;
-  esac
-
-  ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  { as_dir="$ac_dir"
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
-   { (exit 1); exit 1; }; }; }
-  ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
-  case $ac_mode in
-  :F)
-  #
-  # CONFIG_FILE
-  #
-
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-
-ac_sed_dataroot='
-/datarootdir/ {
-  p
-  q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-  ac_datarootdir_hack='
-  s&@datadir@&${datarootdir}&g
-  s&@docdir@&${datarootdir}/doc/${PACKAGE}&g
-  s&@infodir@&${datarootdir}/info&g
-  s&@localedir@&${datarootdir}/locale&g
-  s&@mandir@&${datarootdir}/man&g
-    s&\${datarootdir}&${prefix}/share&g' ;;
-esac
-ac_sed_extra="/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[	 ]*$//
-}
-
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
-
-  rm -f "$tmp/stdin"
-  case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
-  esac \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
- ;;
-
-
-
-  esac
-
-done # for ac_tag
-
-
-{ (exit 0); exit 0; }
diff --git a/src/native/unix/configure b/src/native/unix/configure
index 8674972..c486179 100755
--- a/src/native/unix/configure
+++ b/src/native/unix/configure
@@ -1,82 +1,25 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63.
+# Generated by GNU Autoconf 2.59.
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
+# Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -86,60 +29,33 @@ else
 fi
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
-fi
-
 # Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
+$as_unset ENV MAIL MAILPATH
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+if expr a : '\(a\)' >/dev/null 2>&1; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -147,391 +63,157 @@ fi
 
 
 # Name of the executable.
-as_me=`$as_basename -- "$0" ||
+as_me=`$as_basename "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
-  if (eval ":") 2>/dev/null; then
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-
-  if test $as_have_required = yes &&	 (eval ":
-(as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
 
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
 
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
 
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
 
-test \$exitcode = 0) || { (exit 1); exit 1; }
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
 
-(
-  as_lineno_1=\$LINENO
-  as_lineno_2=\$LINENO
-  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
-  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
-  :
-else
-  as_candidate_shells=
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  case $as_dir in
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
 	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
-	   done;;
-       esac
-done
-IFS=$as_save_IFS
-
-
-      for as_shell in $as_candidate_shells $SHELL; do
-	 # Try only shells that exist, to save several forks.
-	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		{ ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
-  CONFIG_SHELL=$as_shell
-	       as_have_required=yes
-	       if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
-  (exit $1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
-  break
-fi
-
-fi
-
-      done
-
-      if test "x$CONFIG_SHELL" != x; then
-  for as_var in BASH_ENV ENV
-	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-	done
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
-    if test $as_have_required = no; then
-  echo This script requires a shell more modern than all the
-      echo shells that I found on your system.  Please install a
-      echo modern shell, or manually run the script under such a
-      echo shell if you do have one.
-      { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
-  echo No shell found that supports shell functions.
-  echo Please tell bug-autoconf at gnu.org about your system,
-  echo including any error possibly output before this message.
-  echo This can help us improve future autoconf versions.
-  echo Configuration will now proceed without shell functions.
-}
-
-
-
+	   if ("$as_dir/$as_base" -c '
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
     sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
       N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
       t loop
-      s/-\n.*//
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
     ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
   # Exit status is that of the last command.
   exit
 }
 
 
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
-  case `echo 'x\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
-  esac;;
-*)
-  ECHO_N='-n';;
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
 esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
     as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
   fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
+rm -f conf$$ conf$$.exe conf$$.file
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -540,28 +222,7 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -570,27 +231,39 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
 
-exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
+exec 6>&1
+
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
-ac_clean_files=
 ac_config_libobj_dir=.
-LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
 # Identity of this package.
 PACKAGE_NAME=
 PACKAGE_TARNAME=
@@ -599,90 +272,12 @@ PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 
 ac_unique_file="configure.in"
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-LDCMD
-JAR
-JARSABLE
-JAVACFLAGS
-JAVAC
-JAVACSABLE
-KAFFEVM
-SABLEVM
-JAVA_HOME
-RANLIB
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB JAVA_H [...]
 ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-with_java
-'
-      ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS'
-
 
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -705,48 +300,34 @@ x_libraries=NONE
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
+datadir='${prefix}/share'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
 
 ac_prev=
-ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval $ac_prev=\$ac_option
+    eval "$ac_prev=\$ac_option"
     ac_prev=
     continue
   fi
 
-  case $ac_option in
-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)	ac_optarg=yes ;;
-  esac
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_dashdash$ac_option in
-  --)
-    ac_dashdash=yes ;;
+  case $ac_option in
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -768,61 +349,33 @@ do
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad)
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
     datadir=$ac_optarg ;;
 
-  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
-  | --dataroo | --dataro | --datar)
-    ac_prev=datarootdir ;;
-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
-    datarootdir=$ac_optarg ;;
-
   -disable-* | --disable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=no ;;
-
-  -docdir | --docdir | --docdi | --doc | --do)
-    ac_prev=docdir ;;
-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
-    docdir=$ac_optarg ;;
-
-  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
-    ac_prev=dvidir ;;
-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
-    dvidir=$ac_optarg ;;
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
 
   -enable-* | --enable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
     esac
-    eval enable_$ac_useropt=\$ac_optarg ;;
+    eval "enable_$ac_feature='$ac_optarg'" ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -849,12 +402,6 @@ do
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
-  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
-    ac_prev=htmldir ;;
-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
-  | --ht=*)
-    htmldir=$ac_optarg ;;
-
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -879,16 +426,13 @@ do
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
-  -localedir | --localedir | --localedi | --localed | --locale)
-    ac_prev=localedir ;;
-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
-    localedir=$ac_optarg ;;
-
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst | --locals)
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -953,16 +497,6 @@ do
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
-  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
-    ac_prev=pdfdir ;;
-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
-    pdfdir=$ac_optarg ;;
-
-  -psdir | --psdir | --psdi | --psd | --ps)
-    ac_prev=psdir ;;
-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
-    psdir=$ac_optarg ;;
-
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -1013,38 +547,26 @@ do
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
     esac
-    eval with_$ac_useropt=\$ac_optarg ;;
+    eval "with_$ac_package='$ac_optarg'" ;;
 
   -without-* | --without-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=no ;;
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -1064,7 +586,7 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; }
     ;;
@@ -1073,16 +595,17 @@ Try \`$0 --help' for more information." >&2
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
-    eval $ac_envvar=\$ac_optarg
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
@@ -1091,39 +614,31 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+  { echo "$as_me: error: missing argument to $ac_option" >&2
    { (exit 1); exit 1; }; }
 fi
 
-if test -n "$ac_unrecognized_opts"; then
-  case $enable_option_checking in
-    no) ;;
-    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
-   { (exit 1); exit 1; }; } ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-  esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
-		datadir sysconfdir sharedstatedir localstatedir includedir \
-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
 do
-  eval ac_val=\$$ac_var
-  # Remove trailing slashes.
+  eval ac_val=$`echo $ac_var`
   case $ac_val in
-    */ )
-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-      eval $ac_var=\$ac_val;;
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
   esac
-  # Be sure to have absolute directory names.
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
   case $ac_val in
-    [\\/$]* | ?:[\\/]* )  continue;;
-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
   esac
-  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; }
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1137,7 +652,7 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
@@ -1150,76 +665,70 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
 test "$silent" = yes && exec 6>/dev/null
 
 
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { $as_echo "$as_me: error: working directory cannot be determined" >&2
-   { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
-   { (exit 1); exit 1; }; }
-
-
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_myself" : 'X\(//\)[^/]' \| \
-	 X"$as_myself" : 'X\(//\)$' \| \
-	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
+  if test ! -r $srcdir/$ac_unique_file; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r "$srcdir/$ac_unique_file"; then
-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
    { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
-	pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
-  srcdir=.
+  fi
 fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
-  eval ac_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_env_${ac_var}_value=\$${ac_var}
-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
 
 #
 # Report the --help message.
@@ -1248,11 +757,14 @@ Configuration:
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-Installation directories:
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
+			  [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
+			  [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1262,25 +774,18 @@ for instance \`--prefix=\$HOME'.
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR            user executables [EPREFIX/bin]
-  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --libdir=DIR            object code libraries [EPREFIX/lib]
-  --includedir=DIR        C header files [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR           info documentation [DATAROOTDIR/info]
-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
-  --htmldir=DIR           html documentation [DOCDIR]
-  --dvidir=DIR            dvi documentation [DOCDIR]
-  --pdfdir=DIR            pdf documentation [DOCDIR]
-  --psdir=DIR             ps documentation [DOCDIR]
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1305,96 +810,125 @@ Some influential environment variables:
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 _ACEOF
-ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" ||
-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-      continue
+    test -d $ac_dir || continue
     ac_builddir=.
 
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
 
 case $srcdir in
-  .)  # We are building in place.
+  .)  # No --srcdir option.  We are building in place.
     ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
 esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
     else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd $ac_popdir
   done
 fi
 
-test -n "$ac_init_help" && exit $ac_status
+test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.63
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit
+  exit 0
 fi
-cat >config.log <<_ACEOF
+exec 5>config.log
+cat >&5 <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
-exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1413,7 +947,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -1425,9 +959,8 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  $as_echo "PATH: $as_dir"
+  echo "PATH: $as_dir"
 done
-IFS=$as_save_IFS
 
 } >&5
 
@@ -1449,6 +982,7 @@ _ACEOF
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
+ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1459,8 +993,8 @@ do
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
@@ -1481,7 +1015,9 @@ do
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
       ;;
     esac
   done
@@ -1492,8 +1028,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
@@ -1506,35 +1042,20 @@ trap 'exit_status=$?
 _ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
-(
-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
-      esac ;;
-    esac
-  done
+{
   (set) 2>&1 |
-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
       sed -n \
-	"s/'\''/'\''\\\\'\'''\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
-      ;; #(
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
     *)
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
-    esac |
-    sort
-)
+    esac;
+}
     echo
 
     cat <<\_ASBOX
@@ -1545,28 +1066,22 @@ _ASBOX
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=\$$ac_var
-      case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-      esac
-      $as_echo "$ac_var='\''$ac_val'\''"
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
+## ------------- ##
+## Output files. ##
+## ------------- ##
 _ASBOX
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=\$$ac_var
-	case $ac_val in
-	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-	esac
-	$as_echo "$ac_var='\''$ac_val'\''"
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
       done | sort
       echo
     fi
@@ -1578,24 +1093,26 @@ _ASBOX
 ## ----------- ##
 _ASBOX
       echo
-      cat confdefs.h
+      sed "/^$/d" confdefs.h | sort
       echo
     fi
     test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core core.conftest.* &&
-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-' 0
+     ' 0
 for ac_signal in 1 2 13 15; do
   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1625,24 +1142,18 @@ _ACEOF
 
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
-elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
-else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
 fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
-  test "x$ac_site_file" = xNONE && continue
+for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
@@ -1652,61 +1163,54 @@ if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . "$cache_file";;
-      *)                      . "./$cache_file";;
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
     esac
   fi
 else
-  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val=\$ac_cv_env_${ac_var}_value
-  eval ac_new_val=\$ac_env_${ac_var}_value
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
   case $ac_old_set,$ac_new_set in
     set,)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	# differences in whitespace do not lead to failure.
-	ac_old_val_w=`echo x $ac_old_val`
-	ac_new_val_w=`echo x $ac_new_val`
-	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	  ac_cache_corrupted=:
-	else
-	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-	  eval $ac_var=\$ac_old_val
-	fi
-	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1716,15 +1220,19 @@ $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
   fi
 done
 if $ac_cache_corrupted; then
-  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
 
 
 
@@ -1741,43 +1249,32 @@ fi
 
 
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 ac_aux_dir=
-for ac_dir in ./support "$srcdir"/./support; do
-  if test -f "$ac_dir/install-sh"; then
+for ac_dir in ./support $srcdir/./support; do
+  if test -f $ac_dir/install-sh; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f "$ac_dir/install.sh"; then
+  elif test -f $ac_dir/install.sh; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f "$ac_dir/shtool"; then
+  elif test -f $ac_dir/shtool; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ./support \"$srcdir\"/./support" >&5
-$as_echo "$as_me: error: cannot find install-sh or install.sh in ./support \"$srcdir\"/./support" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ./support $srcdir/./support" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in ./support $srcdir/./support" >&2;}
    { (exit 1); exit 1; }; }
 fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 
 
@@ -1785,102 +1282,73 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 # Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
    { (exit 1); exit 1; }; }
 
-{ $as_echo "$as_me:$LINENO: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
 if test "${ac_cv_build+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-$as_echo "$as_me: error: invalid value of canonical build" >&2;}
-   { (exit 1); exit 1; }; };;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
 build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:$LINENO: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
 if test "${ac_cv_host+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
-fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-$as_echo "$as_me: error: invalid value of canonical host" >&2;}
-   { (exit 1); exit 1; }; };;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
 host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-
-  { $as_echo "$as_me:$LINENO: checking cached host system type" >&5
-$as_echo_n "checking cached host system type... " >&6; }
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+
+  echo "$as_me:$LINENO: checking cached host system type" >&5
+echo $ECHO_N "checking cached host system type... $ECHO_C" >&6
   if { test x"${ac_cv_host_system_type+set}" = x"set"  &&
        test x"$ac_cv_host_system_type" != x"$host" ; }
   then
-    { $as_echo "$as_me:$LINENO: result: $ac_cv_host_system_type" >&5
-$as_echo "$ac_cv_host_system_type" >&6; }
-    { { $as_echo "$as_me:$LINENO: error: remove the \"$cache_file\" file and re-run configure" >&5
-$as_echo "$as_me: error: remove the \"$cache_file\" file and re-run configure" >&2;}
+    echo "$as_me:$LINENO: result: $ac_cv_host_system_type" >&5
+echo "${ECHO_T}$ac_cv_host_system_type" >&6
+    { { echo "$as_me:$LINENO: error: remove the \"$cache_file\" file and re-run configure" >&5
+echo "$as_me: error: remove the \"$cache_file\" file and re-run configure" >&2;}
    { (exit 1); exit 1; }; }
   else
-    { $as_echo "$as_me:$LINENO: result: ok" >&5
-$as_echo "ok" >&6; }
+    echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
     ac_cv_host_system_type="$host"
   fi
 
@@ -1898,10 +1366,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1912,36 +1380,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1952,49 +1418,38 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
+  CC=$ac_ct_CC
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2005,36 +1460,76 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
 fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2046,18 +1541,17 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -2075,25 +1569,24 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
+  for ac_prog in cl
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2104,40 +1597,38 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl.exe
+  for ac_prog in cl
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2148,90 +1639,58 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
   test -n "$ac_ct_CC" && break
 done
 
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
+  CC=$ac_ct_CC
 fi
 
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+   { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
@@ -2250,150 +1709,111 @@ main ()
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link_default") 2>&5
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
 	break;;
     * )
 	break;;
   esac
 done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
 else
-  ac_file=''
-fi
-
-{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-if test -z "$ac_file"; then
-  $as_echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C compiler cannot create executables
+echo "$as_me: error: C compiler cannot create executables
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }; }
+   { (exit 77); exit 77; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
 
-# Check that the compiler produces executables we can run.  If not, either
+# Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run C compiled programs.
+echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+   { (exit 1); exit 1; }; }
     fi
   fi
 fi
-{ $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run.  If not, either
+# Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -2402,33 +1822,32 @@ $as_echo "$ac_try_echo") >&5
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+   { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
 if test "${ac_cv_objext+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2446,48 +1865,39 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  $as_echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+   { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2508,54 +1918,50 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_compiler_gnu=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_compiler_gnu=no
+ac_compiler_gnu=no
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_g+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2571,121 +1977,38 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cc_g=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	CFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_prog_cc_g=no
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2701,12 +2024,12 @@ else
     CFLAGS=
   fi
 fi
-{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
-  $as_echo_n "(cached) " >&6
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_cc_c89=no
+  ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2740,17 +2063,12 @@ static char *f (char * (*g) (char **, int), char **p, ...)
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
+   as 'x'.  The following induces an error, until -std1 is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
+   that's true only with -std1.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2765,111 +2083,256 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   return 0;
 }
 _ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cc_c89=$ac_arg
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
 else
-  $as_echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
 fi
-
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
+rm -f conftest.err conftest.$ac_objext
 done
-rm -f conftest.$ac_ext
+rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
 
 fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:$LINENO: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
   *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
 
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
 do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$ac_ct_RANLIB"; then
   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
@@ -2880,37 +2343,27 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
+  RANLIB=$ac_ct_RANLIB
 else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
@@ -2921,8 +2374,8 @@ fi
 
 
 
-  { $as_echo "$as_me:$LINENO: checking C flags dependant on host system type" >&5
-$as_echo_n "checking C flags dependant on host system type... " >&6; }
+  echo "$as_me:$LINENO: checking C flags dependant on host system type" >&5
+echo $ECHO_N "checking C flags dependant on host system type... $ECHO_C" >&6
 
   case $host_os in
   darwin*)
@@ -2971,10 +2424,10 @@ $as_echo_n "checking C flags dependant on host system type... " >&6; }
     LDFLAGS="$LDFLAGS -ldl"
     ;;
   *)
-    { $as_echo "$as_me:$LINENO: result: failed" >&5
-$as_echo "failed" >&6; }
-    { { $as_echo "$as_me:$LINENO: error: Unsupported operating system \"$host_os\"" >&5
-$as_echo "$as_me: error: Unsupported operating system \"$host_os\"" >&2;}
+    echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+    { { echo "$as_me:$LINENO: error: Unsupported operating system \"$host_os\"" >&5
+echo "$as_me: error: Unsupported operating system \"$host_os\"" >&2;}
    { (exit 1); exit 1; }; }
     ;;
   esac
@@ -3027,15 +2480,15 @@ $as_echo "$as_me: error: Unsupported operating system \"$host_os\"" >&2;}
     supported_os="s390"
     HOST_CPU=s390;;
   *)
-    { $as_echo "$as_me:$LINENO: result: failed" >&5
-$as_echo "failed" >&6; }
-    { { $as_echo "$as_me:$LINENO: error: Unsupported CPU architecture \"$host_cpu\"" >&5
-$as_echo "$as_me: error: Unsupported CPU architecture \"$host_cpu\"" >&2;}
+    echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+    { { echo "$as_me:$LINENO: error: Unsupported CPU architecture \"$host_cpu\"" >&5
+echo "$as_me: error: Unsupported CPU architecture \"$host_cpu\"" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 
-  { $as_echo "$as_me:$LINENO: result: ok" >&5
-$as_echo "ok" >&6; }
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
 
 
 
@@ -3064,31 +2517,31 @@ fi
 
 
 
-# Check whether --with-java was given.
+# Check whether --with-java or --without-java was given.
 if test "${with_java+set}" = set; then
-  withval=$with_java;
-    { $as_echo "$as_me:$LINENO: checking JAVA_HOME" >&5
-$as_echo_n "checking JAVA_HOME... " >&6; }
+  withval="$with_java"
+
+    echo "$as_me:$LINENO: checking JAVA_HOME" >&5
+echo $ECHO_N "checking JAVA_HOME... $ECHO_C" >&6
     if test -d "$withval"
     then
       JAVA_HOME="$withval"
-      { $as_echo "$as_me:$LINENO: result: $JAVA_HOME" >&5
-$as_echo "$JAVA_HOME" >&6; }
+      echo "$as_me:$LINENO: result: $JAVA_HOME" >&5
+echo "${ECHO_T}$JAVA_HOME" >&6
     else
-      { $as_echo "$as_me:$LINENO: result: failed" >&5
-$as_echo "failed" >&6; }
-      { { $as_echo "$as_me:$LINENO: error: $withval is not a directory" >&5
-$as_echo "$as_me: error: $withval is not a directory" >&2;}
+      echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+      { { echo "$as_me:$LINENO: error: $withval is not a directory" >&5
+echo "$as_me: error: $withval is not a directory" >&2;}
    { (exit 1); exit 1; }; }
     fi
 
 
-fi
-
+fi;
   if test x"$JAVA_HOME" = x
   then
-    { { $as_echo "$as_me:$LINENO: error: Java Home not defined. Rerun with --with-java=... parameter" >&5
-$as_echo "$as_me: error: Java Home not defined. Rerun with --with-java=... parameter" >&2;}
+    { { echo "$as_me:$LINENO: error: Java Home not defined. Rerun with --with-java=... parameter" >&5
+echo "$as_me: error: Java Home not defined. Rerun with --with-java=... parameter" >&2;}
    { (exit 1); exit 1; }; }
   fi
 
@@ -3097,10 +2550,10 @@ $as_echo "$as_me: error: Java Home not defined. Rerun with --with-java=... param
   then
     # Extract the first word of "sablevm", so it can be a program name with args.
 set dummy sablevm; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_SABLEVM+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $SABLEVM in
   [\\/]* | ?:[\\/]*)
@@ -3113,29 +2566,28 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_SABLEVM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_SABLEVM" && ac_cv_path_SABLEVM="NONE"
   ;;
 esac
 fi
 SABLEVM=$ac_cv_path_SABLEVM
+
 if test -n "$SABLEVM"; then
-  { $as_echo "$as_me:$LINENO: result: $SABLEVM" >&5
-$as_echo "$SABLEVM" >&6; }
+  echo "$as_me:$LINENO: result: $SABLEVM" >&5
+echo "${ECHO_T}$SABLEVM" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
     if test "$SABLEVM" = "NONE"
     then
             if $JAVA_HOME/bin/java -version 2> /dev/null | grep SableVM > /dev/null
@@ -3145,8 +2597,8 @@ fi
     fi
     if test "$SABLEVM" != "NONE"
     then
-      { $as_echo "$as_me:$LINENO: result: Using sableVM: $SABLEVM" >&5
-$as_echo "Using sableVM: $SABLEVM" >&6; }
+      echo "$as_me:$LINENO: result: Using sableVM: $SABLEVM" >&5
+echo "${ECHO_T}Using sableVM: $SABLEVM" >&6
       CFLAGS="$CFLAGS -DHAVE_SABLEVM"
     fi
   fi
@@ -3156,10 +2608,10 @@ $as_echo "Using sableVM: $SABLEVM" >&6; }
   then
     # Extract the first word of "kaffe", so it can be a program name with args.
 set dummy kaffe; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_KAFFEVM+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $KAFFEVM in
   [\\/]* | ?:[\\/]*)
@@ -3172,33 +2624,32 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_KAFFEVM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_KAFFEVM" && ac_cv_path_KAFFEVM="NONE"
   ;;
 esac
 fi
 KAFFEVM=$ac_cv_path_KAFFEVM
+
 if test -n "$KAFFEVM"; then
-  { $as_echo "$as_me:$LINENO: result: $KAFFEVM" >&5
-$as_echo "$KAFFEVM" >&6; }
+  echo "$as_me:$LINENO: result: $KAFFEVM" >&5
+echo "${ECHO_T}$KAFFEVM" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
     if test "$KAFFEVM" != "NONE"
     then
-      { $as_echo "$as_me:$LINENO: result: Using kaffe: $KAFFEVM" >&5
-$as_echo "Using kaffe: $KAFFEVM" >&6; }
+      echo "$as_me:$LINENO: result: Using kaffe: $KAFFEVM" >&5
+echo "${ECHO_T}Using kaffe: $KAFFEVM" >&6
       CFLAGS="$CFLAGS -DHAVE_KAFFEVM"
       LDFLAGS="$LDFLAGS -Wl,-rpath $JAVA_HOME/jre/lib/$HOST_CPU -L $JAVA_HOME/jre/lib/$HOST_CPU -lkaffevm"
     fi
@@ -3209,10 +2660,10 @@ $as_echo "Using kaffe: $KAFFEVM" >&6; }
   then
     # Extract the first word of "javac-sablevm", so it can be a program name with args.
 set dummy javac-sablevm; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_JAVACSABLE+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $JAVACSABLE in
   [\\/]* | ?:[\\/]*)
@@ -3225,29 +2676,28 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_JAVACSABLE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_JAVACSABLE" && ac_cv_path_JAVACSABLE="NONE"
   ;;
 esac
 fi
 JAVACSABLE=$ac_cv_path_JAVACSABLE
+
 if test -n "$JAVACSABLE"; then
-  { $as_echo "$as_me:$LINENO: result: $JAVACSABLE" >&5
-$as_echo "$JAVACSABLE" >&6; }
+  echo "$as_me:$LINENO: result: $JAVACSABLE" >&5
+echo "${ECHO_T}$JAVACSABLE" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
   else
     JAVACSABLE="NONE"
   fi
@@ -3256,10 +2706,10 @@ fi
     XPATH="$JAVA_HOME/bin:$JAVA_HOME/Commands:$PATH"
     # Extract the first word of "javac", so it can be a program name with args.
 set dummy javac; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_JAVAC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $JAVAC in
   [\\/]* | ?:[\\/]*)
@@ -3272,36 +2722,35 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_JAVAC" && ac_cv_path_JAVAC="NONE"
   ;;
 esac
 fi
 JAVAC=$ac_cv_path_JAVAC
+
 if test -n "$JAVAC"; then
-  { $as_echo "$as_me:$LINENO: result: $JAVAC" >&5
-$as_echo "$JAVAC" >&6; }
+  echo "$as_me:$LINENO: result: $JAVAC" >&5
+echo "${ECHO_T}$JAVAC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
   else
     # Extract the first word of "javac-sablevm", so it can be a program name with args.
 set dummy javac-sablevm; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_JAVAC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $JAVAC in
   [\\/]* | ?:[\\/]*)
@@ -3314,43 +2763,42 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_JAVAC" && ac_cv_path_JAVAC="NONE"
   ;;
 esac
 fi
 JAVAC=$ac_cv_path_JAVAC
+
 if test -n "$JAVAC"; then
-  { $as_echo "$as_me:$LINENO: result: $JAVAC" >&5
-$as_echo "$JAVAC" >&6; }
+  echo "$as_me:$LINENO: result: $JAVAC" >&5
+echo "${ECHO_T}$JAVAC" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
   fi
-  { $as_echo "$as_me:$LINENO: result: $JAVAC" >&5
-$as_echo "$JAVAC" >&6; }
+  echo "$as_me:$LINENO: result: $JAVAC" >&5
+echo "${ECHO_T}$JAVAC" >&6
   if test "$JAVAC" = "NONE"
   then
-    { { $as_echo "$as_me:$LINENO: error: javac not found" >&5
-$as_echo "$as_me: error: javac not found" >&2;}
+    { { echo "$as_me:$LINENO: error: javac not found" >&5
+echo "$as_me: error: javac not found" >&2;}
    { (exit 1); exit 1; }; }
   fi
 
-  { $as_echo "$as_me:$LINENO: checking wether the Java compiler ($JAVAC) works" >&5
-$as_echo_n "checking wether the Java compiler ($JAVAC) works... " >&6; }
+  echo "$as_me:$LINENO: checking wether the Java compiler ($JAVAC) works" >&5
+echo $ECHO_N "checking wether the Java compiler ($JAVAC) works... $ECHO_C" >&6
 if test "${ap_cv_prog_javac_works+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
     echo "public class Test {}" > Test.java
@@ -3361,16 +2809,16 @@ else
       ap_cv_prog_javac_works=yes
     else
       rm -f Test.java Test.class
-      { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-      { { $as_echo "$as_me:$LINENO: error: installation or configuration problem: javac cannot compile" >&5
-$as_echo "$as_me: error: installation or configuration problem: javac cannot compile" >&2;}
+      echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+      { { echo "$as_me:$LINENO: error: installation or configuration problem: javac cannot compile" >&5
+echo "$as_me: error: installation or configuration problem: javac cannot compile" >&2;}
    { (exit 1); exit 1; }; }
     fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ap_cv_prog_javac_works" >&5
-$as_echo "$ap_cv_prog_javac_works" >&6; }
+echo "$as_me:$LINENO: result: $ap_cv_prog_javac_works" >&5
+echo "${ECHO_T}$ap_cv_prog_javac_works" >&6
 
 
 
@@ -3381,10 +2829,10 @@ $as_echo "$ap_cv_prog_javac_works" >&6; }
   then
     # Extract the first word of "jar-sablevm", so it can be a program name with args.
 set dummy jar-sablevm; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_JARSABLE+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $JARSABLE in
   [\\/]* | ?:[\\/]*)
@@ -3397,29 +2845,28 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_JARSABLE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_JARSABLE" && ac_cv_path_JARSABLE="NONE"
   ;;
 esac
 fi
 JARSABLE=$ac_cv_path_JARSABLE
+
 if test -n "$JARSABLE"; then
-  { $as_echo "$as_me:$LINENO: result: $JARSABLE" >&5
-$as_echo "$JARSABLE" >&6; }
+  echo "$as_me:$LINENO: result: $JARSABLE" >&5
+echo "${ECHO_T}$JARSABLE" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
   else
     JARSABLE="NONE"
   fi
@@ -3428,10 +2875,10 @@ fi
     XPATH="$JAVA_HOME/bin:$JAVA_HOME/Commands:$PATH"
     # Extract the first word of "jar", so it can be a program name with args.
 set dummy jar; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_JAR+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $JAR in
   [\\/]* | ?:[\\/]*)
@@ -3444,36 +2891,35 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_JAR" && ac_cv_path_JAR="NONE"
   ;;
 esac
 fi
 JAR=$ac_cv_path_JAR
+
 if test -n "$JAR"; then
-  { $as_echo "$as_me:$LINENO: result: $JAR" >&5
-$as_echo "$JAR" >&6; }
+  echo "$as_me:$LINENO: result: $JAR" >&5
+echo "${ECHO_T}$JAR" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
   else
     # Extract the first word of "jar-sablevm", so it can be a program name with args.
 set dummy jar-sablevm; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_JAR+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case $JAR in
   [\\/]* | ?:[\\/]*)
@@ -3486,34 +2932,33 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
-IFS=$as_save_IFS
 
   test -z "$ac_cv_path_JAR" && ac_cv_path_JAR="NONE"
   ;;
 esac
 fi
 JAR=$ac_cv_path_JAR
+
 if test -n "$JAR"; then
-  { $as_echo "$as_me:$LINENO: result: $JAR" >&5
-$as_echo "$JAR" >&6; }
+  echo "$as_me:$LINENO: result: $JAR" >&5
+echo "${ECHO_T}$JAR" >&6
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
   fi
   if test "$JAR" = "NONE"
   then
-    { { $as_echo "$as_me:$LINENO: error: jar not found" >&5
-$as_echo "$as_me: error: jar not found" >&2;}
+    { { echo "$as_me:$LINENO: error: jar not found" >&5
+echo "$as_me: error: jar not found" >&2;}
    { (exit 1); exit 1; }; }
   fi
 
@@ -3527,21 +2972,92 @@ fi
 if test "$GCC" = "yes"
 then
    CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
-   { $as_echo "$as_me:$LINENO: result: gcc flags added" >&5
-$as_echo "gcc flags added" >&6; }
+   echo "$as_me:$LINENO: result: gcc flags added" >&5
+echo "${ECHO_T}gcc flags added" >&6
 fi
 if test -z "$LDCMD"
 then
    LDCMD="$CC"
 fi
 
+if test "$supported_os" == "linux"
+then
 
+echo "$as_me:$LINENO: checking for cap_init in -lcap" >&5
+echo $ECHO_N "checking for cap_init in -lcap... $ECHO_C" >&6
+if test "${ac_cv_lib_cap_cap_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcap  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-  printf "*** %s ***\n" "Writing output files" 1>&2
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char cap_init ();
+int
+main ()
+{
+cap_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_cap_cap_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_cap_cap_init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_init" >&5
+echo "${ECHO_T}$ac_cv_lib_cap_cap_init" >&6
+if test $ac_cv_lib_cap_cap_init = yes; then
+  CFLAGS="$CFLAGS -DHAVE_LIBCAP" ; LIBS="$LIBS -lcap"
+fi
 
+fi
 
-ac_config_files="$ac_config_files Makefile Makedefs native/Makefile"
 
+  printf "*** %s ***\n" "Writing output files" 1>&2
+
+
+                              ac_config_files="$ac_config_files Makefile Makedefs native/Makefile"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -3560,59 +3076,39 @@ _ACEOF
 
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
+# So, don't put newlines in cache variables' values.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-(
-  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
-      esac ;;
-    esac
-  done
-
+{
   (set) 2>&1 |
-    case $as_nl`(ac_space=' '; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;; #(
+      ;;
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
-    esac |
-    sort
-) |
+    esac;
+} |
   sed '
-     /^ac_cv_env_/b end
      t clear
-     :clear
+     : clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
-  if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
-      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
     cat confcache >$cache_file
   else
-    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+    echo "not updating unwritable cache $cache_file"
   fi
 fi
 rm -f confcache
@@ -3621,54 +3117,63 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
 #
 # If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section.  Otherwise,
+# take arguments), then we branch to the quote section.  Otherwise,
 # look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
+cat >confdef2opt.sed <<\_ACEOF
 t clear
-:clear
-s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
 t quote
-s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
 t quote
-b any
-:quote
-s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
-	g
-	s/^\n//
-	s/\n/ /g
-	p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
+d
+: quote
+s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
 
 
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-  #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -3677,12 +3182,11 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 : ${CONFIG_STATUS=./config.status}
-ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -3695,78 +3199,22 @@ ac_cs_silent=false
 SHELL=\${CONFIG_SHELL-$SHELL}
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<\_ACEOF
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
+# Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -3776,60 +3224,33 @@ else
 fi
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
-fi
-
 # Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
+$as_unset ENV MAIL MAILPATH
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+if expr a : '\(a\)' >/dev/null 2>&1; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -3837,122 +3258,159 @@ fi
 
 
 # Name of the executable.
-as_me=`$as_basename -- "$0" ||
+as_me=`$as_basename "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
 
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
 
 
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
     sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
       N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
       t loop
-      s/-\n.*//
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
     ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
   # Exit status is that of the last command.
   exit
 }
 
 
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
-  case `echo 'x\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
-  esac;;
-*)
-  ECHO_N='-n';;
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
 esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
     as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
   fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
+rm -f conf$$ conf$$.exe conf$$.file
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -3961,28 +3419,7 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -3991,14 +3428,31 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
 exec 6>&1
 
-# Save the log message, to keep $[0] and so on meaningful, and to
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -4006,106 +3460,124 @@ generated by GNU Autoconf 2.63.  Invocation command line was
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
 _ACEOF
 
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
 
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
 
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
 
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
 
-_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
 
-Usage: $0 [OPTION]... [FILE]...
+Usage: $0 [OPTIONS] [FILE]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number and configuration settings, then exit
-  -q, --quiet, --silent
-                   do not print progress messages
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-      --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
 
 Configuration files:
 $config_files
 
 Report bugs to <bug-autoconf at gnu.org>."
-
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.63,
-  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-test -n "\$AWK" || AWK=awk
+srcdir=$srcdir
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
 ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
   --*=*)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  *)
+  -*)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
-  --debug | --debu | --deb | --de | --d | -d )
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
-  --he | --h |  --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { $as_echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
    { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1"
-     ac_need_defaults=false ;;
+  *) ac_config_targets="$ac_config_targets $1" ;;
 
   esac
   shift
@@ -4119,48 +3591,32 @@ if $ac_cs_silent; then
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-  shift
-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-  CONFIG_SHELL='$SHELL'
-  export CONFIG_SHELL
-  exec "\$@"
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-  $as_echo "$ac_log"
-} >&5
 
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
-# Handling of arguments.
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
 for ac_config_target in $ac_config_targets
 do
-  case $ac_config_target in
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "Makedefs") CONFIG_FILES="$CONFIG_FILES Makedefs" ;;
-    "native/Makefile") CONFIG_FILES="$CONFIG_FILES native/Makefile" ;;
-
-  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "Makedefs" ) CONFIG_FILES="$CONFIG_FILES Makedefs" ;;
+  "native/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/Makefile" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
 
-
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -4170,464 +3626,343 @@ if $ac_need_defaults; then
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
+# simply because there is no reason to put it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
+# Create a temporary directory, and hook for its removal unless debugging.
 $debug ||
 {
-  tmp=
-  trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
   trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
+
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=./conf$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
 } ||
 {
-   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr='
'
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
-else
-  ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
 
-{
-  echo "cat >conf$$subs.awk <<_ACEOF" &&
-  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-  echo "_ACEOF"
-} >conf$$subs.sh ||
-  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  . ./conf$$subs.sh ||
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-
-  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-  if test $ac_delim_n = $ac_delim_num; then
-    break
-  elif $ac_last_try; then
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-rm -f conf$$subs.sh
+#
+# CONFIG_FILES section.
+#
 
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\).*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\).*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
-  N
-  s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
-  for (key in S) S_is_set[key] = 1
-  FS = ""
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at build@,$build,;t t
+s, at build_cpu@,$build_cpu,;t t
+s, at build_vendor@,$build_vendor,;t t
+s, at build_os@,$build_os,;t t
+s, at host@,$host,;t t
+s, at host_cpu@,$host_cpu,;t t
+s, at host_vendor@,$host_vendor,;t t
+s, at host_os@,$host_os,;t t
+s, at CC@,$CC,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at LDFLAGS@,$LDFLAGS,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at JAVA_HOME@,$JAVA_HOME,;t t
+s, at SABLEVM@,$SABLEVM,;t t
+s, at KAFFEVM@,$KAFFEVM,;t t
+s, at JAVACSABLE@,$JAVACSABLE,;t t
+s, at JAVAC@,$JAVAC,;t t
+s, at JAVACFLAGS@,$JAVACFLAGS,;t t
+s, at JARSABLE@,$JARSABLE,;t t
+s, at JAR@,$JAR,;t t
+s, at LDCMD@,$LDCMD,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
 
-}
-{
-  line = $ 0
-  nfields = split(line, field, "@")
-  substed = 0
-  len = length(field[1])
-  for (i = 2; i < nfields; i++) {
-    key = field[i]
-    keylen = length(key)
-    if (S_is_set[key]) {
-      value = S[key]
-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-      len += length(value) + length(field[++i])
-      substed = 1
-    } else
-      len += 1 + keylen
-  }
-
-  print line
-}
-
-_ACAWK
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
-  cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
-$as_echo "$as_me: error: could not setup config files machinery" >&2;}
-   { (exit 1); exit 1; }; }
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[	 ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-
-eval set X "  :F $CONFIG_FILES      "
-shift
-for ac_tag
-do
-  case $ac_tag in
-  :[FHLC]) ac_mode=$ac_tag; continue;;
-  esac
-  case $ac_mode$ac_tag in
-  :[FHL]*:*);;
-  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
-$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
-   { (exit 1); exit 1; }; };;
-  :[FH]-) ac_tag=-:-;;
-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-  esac
-  ac_save_IFS=$IFS
-  IFS=:
-  set x $ac_tag
-  IFS=$ac_save_IFS
-  shift
-  ac_file=$1
-  shift
 
-  case $ac_mode in
-  :L) ac_source=$1;;
-  :[FH])
-    ac_file_inputs=
-    for ac_f
-    do
-      case $ac_f in
-      -) ac_f="$tmp/stdin";;
-      *) # Look for the file first in the build tree, then in the source tree
-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
-	 # because $ac_f cannot contain `:'.
-	 test -f "$ac_f" ||
-	   case $ac_f in
-	   [\\/$]*) false;;
-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-	   esac ||
-	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-   { (exit 1); exit 1; }; };;
-      esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      ac_file_inputs="$ac_file_inputs '$ac_f'"
-    done
-
-    # Let's still pretend it is `configure' which instantiates (i.e., don't
-    # use $as_me), people would be surprised to read:
-    #    /* config.h.  Generated by config.status.  */
-    configure_input='Generated from '`
-	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-	`' by configure.'
-    if test x"$ac_file" != x-; then
-      configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
     fi
-    # Neutralize special characters interpreted by sed in replacement strings.
-    case $configure_input in #(
-    *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
-       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-    *) ac_sed_conf_input=$configure_input;;
-    esac
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
 
-    case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; } ;;
-    esac
-    ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
   esac
 
-  ac_dir=`$as_dirname -- "$ac_file" ||
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  { as_dir="$ac_dir"
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
     as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
     done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
    { (exit 1); exit 1; }; }; }
+
   ac_builddir=.
 
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
 
 case $srcdir in
-  .)  # We are building in place.
+  .)  # No --srcdir option.  We are building in place.
     ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
 
-  case $ac_mode in
-  :F)
-  #
-  # CONFIG_FILE
-  #
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
-_ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
 
-ac_sed_dataroot='
-/datarootdir/ {
-  p
-  q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  ac_datarootdir_hack='
-  s&@datadir@&$datadir&g
-  s&@docdir@&$docdir&g
-  s&@infodir@&$infodir&g
-  s&@localedir@&$localedir&g
-  s&@mandir@&$mandir&g
-    s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
 _ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
-
-  rm -f "$tmp/stdin"
-  case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
-  esac \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
- ;;
-
-
-
-  esac
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
 
-done # for ac_tag
+done
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF
 
 { (exit 0); exit 0; }
 _ACEOF
 chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
-test $ac_write_fail = 0 ||
-  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -4649,15 +3984,11 @@ if test "$no_create" != yes; then
   # would make configure fail if this is the last instruction.
   $ac_cs_success || { (exit 1); exit 1; }
 fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
 
 
 
   printf "*** %s ***\n" "All done" 1>&2
 
 
-{ $as_echo "$as_me:$LINENO: result: Now you can issue \"make\"" >&5
-$as_echo "Now you can issue \"make\"" >&6; }
+echo "$as_me:$LINENO: result: Now you can issue \"make\"" >&5
+echo "${ECHO_T}Now you can issue \"make\"" >&6
diff --git a/src/native/unix/configure.in b/src/native/unix/configure.in
index ee5cf75..78b9694 100644
--- a/src/native/unix/configure.in
+++ b/src/native/unix/configure.in
@@ -17,7 +17,7 @@ dnl
 
 dnl -------------------------------------------------------------------------
 dnl Author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-dnl Version $Id: configure.in 480469 2006-11-29 08:22:04Z bayard $
+dnl Version $Id: configure.in 980496 2010-07-29 16:10:32Z mturk $
 dnl -------------------------------------------------------------------------
 
 dnl -------------------------------------------------------------------------
@@ -101,6 +101,10 @@ then
    LDCMD="$CC"
 fi
 AC_SUBST(LDCMD)
+if test "$supported_os" == "linux"
+then
+AC_CHECK_LIB([cap], [cap_init], [CFLAGS="$CFLAGS -DHAVE_LIBCAP" ; LIBS="$LIBS -lcap"])
+fi
 
 dnl -------------------------------------------------------------------------
 dnl Random programs we need to compile locally
diff --git a/src/native/unix/man/fetch.sh b/src/native/unix/man/fetch.sh
old mode 100644
new mode 100755
diff --git a/src/native/unix/man/jsvc.1.xml b/src/native/unix/man/jsvc.1.xml
index 14ff957..055c603 100644
--- a/src/native/unix/man/jsvc.1.xml
+++ b/src/native/unix/man/jsvc.1.xml
@@ -23,7 +23,7 @@
     <manvolnum>1</manvolnum>
     <refmiscinfo class='date'>May 2005</refmiscinfo>
     <refmiscinfo class='source'>Jsvc version 1.0.1</refmiscinfo>
-    <refmiscinfo class='manual'>Jakarta project</refmiscinfo>
+    <refmiscinfo class='manual'>Apache Commons project</refmiscinfo>
   </refmeta>
   <refnamediv id='name'>
     <refname>jsvc</refname>
@@ -82,7 +82,7 @@
         <term><option>-home</option> directory</term>
         <listitem>
           <para>set the path of your JDK or JRE installation (or set
-        				the JAVA_HOME environment variable)
+                the JAVA_HOME environment variable)
           </para>
         </listitem>
       </varlistentry>
@@ -90,7 +90,7 @@
         <term><option>-version</option></term>
         <listitem>
           <para>show the current Java environment version (to check
-        				correctness of -home and -jvm. Implies -nodetach)</para>
+                correctness of -home and -jvm. Implies -nodetach)</para>
         </listitem>
       </varlistentry>
       <varlistentry>
diff --git a/src/native/unix/native/.indent.pro b/src/native/unix/native/.indent.pro
new file mode 100644
index 0000000..324e89b
--- /dev/null
+++ b/src/native/unix/native/.indent.pro
@@ -0,0 +1,7 @@
+-i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 -nut -ncs
+-Tbool
+-Targ_data
+-Thome_data
+-Thome_jvm
+-Tdso_handle
+
diff --git a/src/native/unix/native/Makefile b/src/native/unix/native/Makefile
deleted file mode 100644
index 346fffb..0000000
--- a/src/native/unix/native/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-# @version $Id: Makefile.in 909069 2010-02-11 16:43:36Z mturk $
-
-include ../Makedefs
-
-OBJS =  arguments.o \
-	debug.o \
-	dso-dlfcn.o \
-	dso-dyld.o \
-	help.o \
-	home.o \
-	java.o \
-	location.o \
-	replace.o \
-	locks.o \
-	signals.o
-
-all: jsvc libservice.a
-
-libservice.a: $(OBJS)
-	ar cr libservice.a $(OBJS)
-	$(RANLIB) libservice.a
-
-jsvc: jsvc-unix.o libservice.a
-	$(LDCMD) $(LDFLAGS) jsvc-unix.o libservice.a $(LIBS) -o ../jsvc
-
-clean:
-	rm -f $(OBJS) ../jsvc jsvc-unix.o libservice.a
-
diff --git a/src/native/unix/native/arguments.c b/src/native/unix/native/arguments.c
index 8ecf039..d38ddc1 100644
--- a/src/native/unix/native/arguments.c
+++ b/src/native/unix/native/arguments.c
@@ -1,310 +1,463 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: arguments.c 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: arguments.c 967041 2010-07-23 10:59:51Z mturk $ */
 #include "jsvc.h"
+#include <limits.h>
+#include <glob.h>
 
 /* Return the argument of a command line option */
-static char *optional(int argc, char *argv[], int argi) {
+static char *optional(int argc, char *argv[], int argi)
+{
 
     argi++;
-    if (argi>=argc) return(NULL);
-    if (argv[argi]==NULL) return(NULL);
-    if (argv[argi][0]=='-') return(NULL);
-    return(strdup(argv[argi]));
+    if (argi >= argc)
+        return NULL;
+    if (argv[argi] == NULL)
+        return NULL;
+    if (argv[argi][0] == '-')
+        return NULL;
+    return strdup(argv[argi]);
+}
+
+static char *memstrcat(char *ptr, const char *str, const char *add)
+{
+    size_t nl = 1;
+    int   nas = ptr == NULL;
+    if (ptr)
+        nl += strlen(ptr);
+    if (str)
+        nl += strlen(str);
+    if (add)
+        nl += strlen(add);
+    ptr = (char *)realloc(ptr, nl);
+    if (ptr) {
+        if (nas)
+            *ptr = '\0';
+        if (str)
+            strcat(ptr, str);
+        if (add)
+            strcat(ptr, add);
+    }
+    return ptr;
+}
+
+static char* eval_ppath(char *strcp, const char *pattern)
+{
+    glob_t globbuf;
+    char   jars[PATH_MAX + 1];
+
+    if (strlen(pattern) > (sizeof(jars) - 5)) {
+        return memstrcat(strcp, pattern, NULL);
+    }
+    strcpy(jars, pattern);
+    strcat(jars, ".jar");
+    memset(&globbuf, 0, sizeof(glob_t));
+    if (glob(jars, GLOB_ERR, NULL, &globbuf) == 0) {
+        size_t n;
+        for (n = 0; n < globbuf.gl_pathc - 1; n++) {
+            strcp = memstrcat(strcp, globbuf.gl_pathv[n], ":");
+            if (strcp == NULL) {
+                globfree(&globbuf);
+                return NULL;
+            }
+        }
+        strcp = memstrcat(strcp, globbuf.gl_pathv[n], NULL);
+        globfree(&globbuf);
+    }
+    return strcp;
+}
+
+#define JAVA_CLASSPATH      "-Djava.class.path="
+/**
+ * Call glob on each PATH like string path.
+ * Glob is called only if the part ends with asterisk in which
+ * case asterisk is replaced by *.jar when searching
+ */
+static char* eval_cpath(const char *cp)
+{
+    char *cpy = memstrcat(NULL, JAVA_CLASSPATH, cp);
+    char *gcp = NULL;
+    char *pos;
+    char *ptr;
+
+    if (!cpy)
+        return NULL;
+    ptr = cpy + sizeof(JAVA_CLASSPATH) - 1;;
+    while ((pos = strchr(ptr, ':'))) {
+        *pos = '\0';
+        if (gcp)
+            gcp = memstrcat(gcp, ":", NULL);
+        else
+            gcp = memstrcat(NULL, JAVA_CLASSPATH, NULL);
+        if ((pos > ptr) && (*(pos - 1) == '*')) {
+            if (!(gcp = eval_ppath(gcp, ptr))) {
+                /* Error.
+                * Return the original string processed so far.
+                */
+                return cpy;
+            }
+        }
+        else
+            gcp = memstrcat(gcp, ptr, NULL);
+        ptr = pos + 1;
+    }
+    if (*ptr) {
+        size_t end = strlen(ptr);
+        if (gcp)
+            gcp = memstrcat(gcp, ":", NULL);
+        else
+            gcp = memstrcat(NULL, JAVA_CLASSPATH, NULL);
+        if (end > 0 && ptr[end - 1] == '*') {
+            /* Last path elemet ends with star
+            * Do a globbing.
+            */
+            gcp = eval_ppath(gcp, ptr);
+        }
+        else {
+            /* Just add the part */
+            gcp = memstrcat(gcp, ptr, NULL);
+        }
+    }
+    /* Free the allocated copy */
+    if (gcp) {
+        free(cpy);
+        return gcp;
+    }
+    else
+        return cpy;
 }
 
 /* Parse command line arguments */
-static arg_data *parse(int argc, char *argv[]) {
-    arg_data *args=NULL;
-    char *temp=NULL;
-    char *cmnd=NULL;
-    int tlen=0;
-    int x=0;
+static arg_data *parse(int argc, char *argv[])
+{
+    arg_data *args = NULL;
+    char *temp     = NULL;
+    char *cmnd     = NULL;
+    int x          = 0;
 
     /* Create the default command line arguments */
-    args=(arg_data *)malloc(sizeof(arg_data));
-    args->pidf="/var/run/jsvc.pid"; /* The default PID file */
-    args->user=NULL;            /* No user switching by default */
-    args->dtch=true;            /* Do detach from parent */
-    args->vers=false;           /* Don't display version */
-    args->help=false;           /* Don't display help */
-    args->chck=false;           /* Don't do a check-only startup */
-    args->stop=false;           /* Stop a running jsvc */
-    args->wait=0;               /* Wait until jsvc has started the JVM */
-    args->install=false;        /* Don't install as a service */
-    args->remove=false;         /* Don't remove the installed service */
-    args->service=false;        /* Don't run as a service */
-    args->name=NULL;            /* No VM version name */
-    args->home=NULL;            /* No default JAVA_HOME */
-    args->onum=0;               /* Zero arguments, but let's have some room */
-    args->opts=(char **)malloc(argc*sizeof(char *));
-    args->clas=NULL;            /* No class predefined */
-    args->anum=0;               /* Zero class specific arguments but make room*/
-    args->outfile="/dev/null";   /* Swallow by default */
-    args->errfile="/dev/null";   /* Swallow by default */
-    args->redirectstdin=true;    /* Redirect stdin to /dev/null by default */
-    args->args=(char **)malloc(argc*sizeof(char *));
+    args = (arg_data *)malloc(sizeof(arg_data));
+    args->pidf = "/var/run/jsvc.pid"; /* The default PID file */
+    args->user    = NULL;         /* No user switching by default */
+    args->dtch    = true;         /* Do detach from parent */
+    args->vers    = false;        /* Don't display version */
+    args->help    = false;        /* Don't display help */
+    args->chck    = false;        /* Don't do a check-only startup */
+    args->stop    = false;        /* Stop a running jsvc */
+    args->wait    = 0;            /* Wait until jsvc has started the JVM */
+    args->install = false;        /* Don't install as a service */
+    args->remove  = false;        /* Don't remove the installed service */
+    args->service = false;        /* Don't run as a service */
+    args->name    = NULL;         /* No VM version name */
+    args->home    = NULL;         /* No default JAVA_HOME */
+    args->onum    = 0;            /* Zero arguments, but let's have some room */
+    args->clas    = NULL;         /* No class predefined */
+    args->anum    = 0;            /* Zero class specific arguments but make room*/
+    args->outfile = "/dev/null";   /* Swallow by default */
+    args->errfile = "/dev/null";   /* Swallow by default */
+    args->redirectstdin = true;    /* Redirect stdin to /dev/null by default */
     args->procname = "jsvc.exec";
+
+    if (!(args->args = (char **)malloc(argc * sizeof(char *))))
+        return NULL;
+    if (!(args->opts = (char **)malloc(argc * sizeof(char *))))
+        return NULL;
+
     /* Set up the command name */
-    cmnd=strrchr(argv[0],'/');
-    if (cmnd==NULL) cmnd=argv[0];
-    else cmnd++;
-    log_prog=strdup(cmnd);
+    cmnd = strrchr(argv[0],'/');
+    if (cmnd == NULL)
+        cmnd = argv[0];
+    else
+        cmnd++;
+    log_prog = strdup(cmnd);
 
     /* Iterate thru command line arguments */
-    for (x=1; x<argc; x++) {
+    for (x = 1; x < argc; x++) {
 
-        if ((strcmp(argv[x],"-cp")==0)||(strcmp(argv[x],"-classpath")==0)) {
-            temp=optional(argc,argv,x++);
-            if (temp==NULL) {
+        if (!strcmp(argv[x], "-cp") ||
+            !strcmp(argv[x], "-classpath")) {
+            temp = optional(argc, argv, x++);
+            if (temp == NULL) {
+                log_error("Invalid classpath specified");
+                return NULL;
+            }
+            args->opts[args->onum] = eval_cpath(temp);
+            if (args->opts[args->onum] == NULL) {
                 log_error("Invalid classpath specified");
-                return(NULL);
+                return NULL;
             }
-            tlen=strlen(temp)+20;
-            args->opts[args->onum]=(char *)malloc(tlen*sizeof(char));
-            sprintf(args->opts[args->onum],"-Djava.class.path=%s",temp);
+            free(temp);
             args->onum++;
 
-        } else if (strcmp(argv[x],"-jvm")==0) {
-            args->name=optional(argc,argv,x++);
-            if (args->name==NULL) {
+        }
+        else if (!strcmp(argv[x], "-jvm")) {
+            args->name = optional(argc, argv, x++);
+            if (args->name == NULL) {
                 log_error("Invalid Java VM name specified");
-                return(NULL);
+                return NULL;
             }
-
-        } else if (strcmp(argv[x],"-home")==0) {
-            args->home=optional(argc,argv,x++);
-            if (args->home==NULL) {
+        }
+        else if (!strcmp(argv[x], "-home")) {
+            args->home = optional(argc, argv, x++);
+            if (args->home == NULL) {
                 log_error("Invalid Java Home specified");
-                return(NULL);
+                return NULL;
             }
-
-        } else if (strcmp(argv[x],"-user")==0) {
-            args->user=optional(argc,argv,x++);
-            if (args->user==NULL) {
+        }
+        else if (!strcmp(argv[x], "-user")) {
+            args->user = optional(argc, argv, x++);
+            if (args->user == NULL) {
                 log_error("Invalid user name specified");
-                return(NULL);
+                return NULL;
             }
-
-        } else if (strcmp(argv[x],"-version")==0) {
-            args->vers=true;
-            args->dtch=false;
-
-        } else if ((strcmp(argv[x],"-?")==0)||(strcmp(argv[x],"-help")==0)
-                   ||(strcmp(argv[x],"--help")==0)) {
-            args->help=true;
-            args->dtch=false;
-            return(args);
-
-        } else if (strcmp(argv[x],"-X")==0) {
+        }
+        else if (!strcmp(argv[x], "-version")) {
+            args->vers = true;
+            args->dtch = false;
+        }
+        else if (!strcmp(argv[x], "-showversion")) {
+            args->vershow = true;
+        }
+        else if (!strcmp(argv[x], "-?") ||
+                 !strcmp(argv[x], "-help") ||
+                 !strcmp(argv[x], "--help")) {
+            args->help = true;
+            args->dtch = false;
+            return args;
+        }
+        else if (!strcmp(argv[x], "-X")) {
             log_error("Option -X currently unsupported");
             log_error("Please use \"java -X\" to see your extra VM options");
-
-        } else if (strcmp(argv[x],"-debug")==0) {
-            log_debug_flag=true;
-
-        } else if (strcmp(argv[x],"-wait")==0) {
-            temp=optional(argc,argv,x++);
-            if (temp!=NULL)
-                args->wait=atoi(temp);
-            if (args->wait<10) {
+        }
+        else if (!strcmp(argv[x], "-debug")) {
+            log_debug_flag = true;
+        }
+        else if (!strcmp(argv[x], "-wait")) {
+            temp = optional(argc, argv, x++);
+            if (temp)
+                args->wait = atoi(temp);
+            if (args->wait < 10) {
                 log_error("Invalid wait time specified (min=10)");
-                return(NULL);
+                return NULL;
             }
-
-        } else if (strcmp(argv[x],"-stop")==0) {
-            args->stop=true;
-
-        } else if (strcmp(argv[x],"-check")==0) {
-            args->chck=true;
-            args->dtch=false;
-
-        } else if (strcmp(argv[x],"-nodetach")==0) {
-            args->dtch=false;
-
-        } else if (strcmp(argv[x], "-keepstdin")==0) {
+        }
+        else if (!strcmp(argv[x], "-stop")) {
+            args->stop = true;
+        }
+        else if (!strcmp(argv[x], "-check")) {
+            args->chck = true;
+            args->dtch = false;
+        }
+        else if (!strcmp(argv[x], "-nodetach")) {
+            args->dtch = false;
+        }
+        else if (!strcmp(argv[x], "-keepstdin")) {
            args->redirectstdin = false;
-
-        } else if (strcmp(argv[x],"-service")==0) {
-            args->service=true;
-
-        } else if (strcmp(argv[x],"-install")==0) {
-            args->install=true;
-
-        } else if (strcmp(argv[x],"-remove")==0) {
-            args->remove=true;
-
-        } else if (strcmp(argv[x],"-pidfile")==0) {
-            args->pidf=optional(argc,argv,x++);
-            if (args->pidf==NULL) {
+        }
+        else if (!strcmp(argv[x], "-service")) {
+            args->service = true;
+        }
+        else if (!strcmp(argv[x], "-install")) {
+            args->install = true;
+        }
+        else if (!strcmp(argv[x], "-remove")) {
+            args->remove = true;
+        }
+        else if (!strcmp(argv[x], "-pidfile")) {
+            args->pidf = optional(argc, argv, x++);
+            if (args->pidf == NULL) {
                 log_error("Invalid PID file specified");
-                return(NULL);
+                return NULL;
             }
-
-        } else if(strcmp(argv[x],"-outfile") == 0) {
-            args->outfile=optional(argc, argv, x++);
+        }
+        else if (!strcmp(argv[x], "-outfile")) {
+            args->outfile = optional(argc, argv, x++);
             if(args->outfile == NULL) {
                 log_error("Invalid Output File specified");
-                return(NULL);
+                return NULL;
             }
-        } else if(strcmp(argv[x],"-errfile") == 0) {
-            args->errfile=optional(argc, argv, x++);
-            if(args->errfile == NULL) {
+        }
+        else if (!strcmp(argv[x], "-errfile")) {
+            args->errfile = optional(argc, argv, x++);
+            if (args->errfile == NULL) {
                 log_error("Invalid Error File specified");
-                return(NULL);
+                return NULL;
             }
-        } else if (strstr(argv[x],"-verbose")==argv[x]) {
-            args->opts[args->onum++]=strdup(argv[x]);
-
+        }
+        else if (!strncmp(argv[x], "-verbose", 8)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
 #ifdef HAVE_KAFFEVM
-        } else if (strstr(argv[x],"-vmdebug")==argv[x]) {
-            args->opts[args->onum++]=strdup(argv[x]);
-            temp=optional(argc,argv,x++);
-            if (temp==NULL) {
+        else if (!strncmp(argv[x], "-vmdebug", 8)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+            temp = optional(argc,argv,x++);
+            if (temp == NULL) {
                 log_error("vmdebug option requires a debug flag.");
-                return(NULL);
+                return NULL;
             }
-            args->opts[args->onum++]=strdup(temp);
+            args->opts[args->onum++] = strdup(temp);
+        }
 #endif
-        } else if (strcmp(argv[x],"-D")==0) {
+        else if (!strcmp(argv[x], "-D")) {
             log_error("Parameter -D must be followed by <name>=<value>");
-            return(NULL);
-
-        } else if (strstr(argv[x],"-D")==argv[x]) {
-            temp=strchr(argv[x],'=');
-            if (temp==argv[x]+2) {
+            return NULL;
+        }
+        else if (!strncmp(argv[x], "-D", 2)) {
+            temp = strchr(argv[x], '=');
+            if (temp == argv[x] + 2) {
                 log_error("A property name must be specified before '='");
-                return(NULL);
+                return NULL;
             }
-            args->opts[args->onum++]=strdup(argv[x]);
-
-        } else if (strstr(argv[x],"-X")==argv[x]) {
-            args->opts[args->onum++]=strdup(argv[x]);
-
-        } else if (strstr(argv[x],"-ea")==argv[x]) {
-            args->opts[args->onum++]=strdup(argv[x]);
-
-        } else if (strcmp(argv[x],"-procname") == 0) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strncmp(argv[x], "-X", 2)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strncmp(argv[x], "-ea", 3)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strncmp(argv[x], "-enableassertions", 17)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strncmp(argv[x], "-da", 3)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strncmp(argv[x], "-disableassertions", 18)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strcmp(argv[x], "-esa")) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strcmp(argv[x], "-enablesystemassertions")) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strcmp(argv[x], "-dsa")) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strcmp(argv[x], "-disablesystemassertions")) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strcmp(argv[x], "-procname")) {
             args->procname = optional(argc, argv, x++);
             if (args->procname == NULL) {
               log_error("Invalid process name specified");
-              return (NULL);
+              return NULL;
             }
-
-    /* -agentlib: -agentpath: -javaagent: 1.5.x JVM */
-        } else if (strstr(argv[x],"-agentlib:")==argv[x]) {
-            args->opts[args->onum++]=strdup(argv[x]);
-
-        } else if (strstr(argv[x],"-agentpath:")==argv[x]) {
-            args->opts[args->onum++]=strdup(argv[x]);
-
-        } else if (strstr(argv[x],"-javaagent:")==argv[x]) {
-            args->opts[args->onum++]=strdup(argv[x]);
-
-        } else if (strstr(argv[x],"-")==argv[x]) {
+        }
+        else if (!strncmp(argv[x], "-agentlib:", 10)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strncmp(argv[x], "-agentpath:", 11)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (!strncmp(argv[x], "-javaagent:", 11)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
+        else if (*argv[x] == '-') {
             log_error("Invalid option %s",argv[x]);
-            return(NULL);
-
-        } else {
+            return NULL;
+        }
+        else {
             args->clas=strdup(argv[x]);
             break;
         }
     }
 
-    if (args->clas==NULL && args->remove==false) {
+    if (args->clas == NULL && args->remove == false) {
         log_error("No class specified");
-        return(NULL);
+        return NULL;
     }
 
     x++;
-    while (x<argc) args->args[args->anum++]=strdup(argv[x++]);
-
-    return(args);
+    while (x < argc) {
+        args->args[args->anum++] = strdup(argv[x++]);
+    }
+    return args;
 }
-static char *IsYesNo(bool par)
+static const char *IsYesNo(bool par)
 {
     switch (par) {
-        case false: return("No");
-        case true:  return("Yes");
+        case false:
+            return "No";
+        case true:
+            return "Yes";
     }
-    return ("[Error]");
+    return "[Error]";
 }
-static char *IsTrueFalse(bool par)
+static const char *IsTrueFalse(bool par)
 {
     switch (par) {
-        case false: return("False");
-        case true:  return("True");
+        case false:
+            return "False";
+        case true:
+             return "True";
     }
-    return ("[Error]");
+    return "[Error]";
 }
-static char *IsEnabledDisabled(bool par)
+
+static const char *IsEnabledDisabled(bool par)
 {
     switch (par) {
-        case true:   return("Enabled");
-        case false:  return("Disabled");
+        case true:
+            return "Enabled";
+        case false:
+            return "Disabled";
     }
-    return ("[Error]");
+    return "[Error]";
 }
 
 /* Main entry point: parse command line arguments and dump them */
-arg_data *arguments(int argc, char *argv[]) {
-    arg_data *args=parse(argc,argv);
-    int x=0;
+arg_data *arguments(int argc, char *argv[])
+{
+    arg_data *args = parse(argc,argv);
+    int x = 0;
 
-    if (args==NULL) {
+    if (args == NULL) {
         log_error("Cannot parse command line arguments");
-        return(NULL);
+        return NULL;
     }
 
-    if (log_debug_flag==true) {
+    if (log_debug_flag == true) {
         log_debug("+-- DUMPING PARSED COMMAND LINE ARGUMENTS --------------");
+        log_debug("| Detach:          %s", IsTrueFalse(args->dtch));
+        log_debug("| Show Version:    %s", IsYesNo(args->vers));
+        log_debug("| Show Help:       %s", IsYesNo(args->help));
+        log_debug("| Check Only:      %s", IsEnabledDisabled(args->chck));
+        log_debug("| Stop:            %s", IsTrueFalse(args->stop));
+        log_debug("| Wait:            %d", args->wait);
+        log_debug("| Run as service:  %s", IsYesNo(args->service));
+        log_debug("| Install service: %s", IsYesNo(args->install));
+        log_debug("| Remove service:  %s", IsYesNo(args->remove));
+        log_debug("| JVM Name:        \"%s\"", PRINT_NULL(args->name));
+        log_debug("| Java Home:       \"%s\"", PRINT_NULL(args->home));
+        log_debug("| PID File:        \"%s\"", PRINT_NULL(args->pidf));
+        log_debug("| User Name:       \"%s\"", PRINT_NULL(args->user));
+        log_debug("| Extra Options:   %d", args->onum);
+        for (x = 0; x < args->onum; x++) {
+            log_debug("|   \"%s\"", args->opts[x]);
+        }
 
-        log_debug("| Detach:          %s",IsTrueFalse(args->dtch));
-
-        log_debug("| Show Version:    %s",IsYesNo(args->vers));
-
-        log_debug("| Show Help:       %s",IsYesNo(args->help));
-
-        log_debug("| Check Only:      %s",IsEnabledDisabled(args->chck));
-
-        log_debug("| Stop:            %s",IsTrueFalse(args->stop));
-
-        log_debug("| Wait:            %d",args->wait);
-
-        log_debug("| Run as service:  %s",IsYesNo(args->service));
-
-        log_debug("| Install service: %s",IsYesNo(args->install));
-
-        log_debug("| Remove service:  %s",IsYesNo(args->remove));
-
-        log_debug("| JVM Name:        \"%s\"",PRINT_NULL(args->name));
-        log_debug("| Java Home:       \"%s\"",PRINT_NULL(args->home));
-        log_debug("| PID File:        \"%s\"",PRINT_NULL(args->pidf));
-        log_debug("| User Name:       \"%s\"",PRINT_NULL(args->user));
-
-        log_debug("| Extra Options:   %d",args->onum);
-        for (x=0; x<args->onum; x++) log_debug("|   \"%s\"",args->opts[x]);
-
-        log_debug("| Class Invoked:   \"%s\"",PRINT_NULL(args->clas));
-
-        log_debug("| Class Arguments: %d",args->anum);
-        for (x=0; x<args->anum; x++)log_debug("|   \"%s\"",args->args[x]);
+        log_debug("| Class Invoked:   \"%s\"", PRINT_NULL(args->clas));
+        log_debug("| Class Arguments: %d", args->anum);
+        for (x = 0; x < args->anum; x++) {
+            log_debug("|   \"%s\"",args->args[x]);
+        }
         log_debug("+-------------------------------------------------------");
     }
-
-    return(args);
+    return args;
 }
+
diff --git a/src/native/unix/native/arguments.h b/src/native/unix/native/arguments.h
index e240382..0f2a8a4 100644
--- a/src/native/unix/native/arguments.h
+++ b/src/native/unix/native/arguments.h
@@ -1,25 +1,26 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: arguments.h 897073 2010-01-08 01:10:29Z sebb $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: arguments.h 923078 2010-03-15 06:35:01Z mturk $ */
 #ifndef __JSVC_ARGUMENTS_H__
 #define __JSVC_ARGUMENTS_H__
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 /**
@@ -48,6 +49,8 @@ typedef struct {
     bool dtch;
     /** Wether to print the VM version number or not. */
     bool vers;
+    /** Show the VM version and continue. */
+    bool vershow;
     /** Wether to display the help page or not. */
     bool help;
     /** Only check environment without running the service. */
@@ -85,4 +88,5 @@ arg_data *arguments(int argc, char *argv[]);
 #ifdef __cplusplus
 }
 #endif
-#endif /* ifndef __JSVC_ARGUMENTS_H__ */
+#endif                          /* ifndef __JSVC_ARGUMENTS_H__ */
+
diff --git a/src/native/unix/native/arguments.o b/src/native/unix/native/arguments.o
deleted file mode 100644
index a331600..0000000
Binary files a/src/native/unix/native/arguments.o and /dev/null differ
diff --git a/src/native/unix/native/debug.c b/src/native/unix/native/debug.c
index 7f19705..7fc4c4b 100644
--- a/src/native/unix/native/debug.c
+++ b/src/native/unix/native/debug.c
@@ -1,24 +1,24 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: debug.c 480469 2006-11-29 08:22:04Z bayard $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: debug.c 921765 2010-03-11 10:03:32Z mturk $ */
 #include "jsvc.h"
 #include <sys/types.h>
 #include <unistd.h>
-#include <time.h> 
+#include <time.h>
 
 /* Wether debug is enabled or not */
 bool log_debug_flag = false;
@@ -27,44 +27,49 @@ bool log_debug_flag = false;
 char *log_prog = "jsvc";
 
 /* Dump a debug message to stderr */
-void log_debug(const char *fmt, ...) {
+void log_debug(const char *fmt, ...)
+{
     va_list ap;
     time_t now;
     struct tm *nowtm;
     char buff[80];
 
-    if (log_debug_flag==false) return;
-    if (fmt==NULL) return;
+    if (log_debug_flag == false)
+        return;
+    if (fmt == NULL)
+        return;
 
-    now = time(NULL);
+    now   = time(NULL);
     nowtm = localtime(&now);
     strftime(buff, sizeof(buff), "%d/%m/%Y %T", nowtm);
 
-    va_start(ap,fmt);
-    fprintf(stderr,"%s %d %s debug: ", buff,  getpid(), log_prog);
-    vfprintf(stderr,fmt,ap);
-    fprintf(stderr,"\n");
+    va_start(ap, fmt);
+    fprintf(stderr, "%s %d %s debug: ", buff, getpid(), log_prog);
+    vfprintf(stderr, fmt, ap);
+    fprintf(stderr, "\n");
     fflush(stderr);
     va_end(ap);
 }
 
 /* Dump an error message to stderr */
-void log_error(const char *fmt, ...) {
+void log_error(const char *fmt, ...)
+{
     va_list ap;
     time_t now;
     struct tm *nowtm;
     char buff[80];
 
-    if (fmt==NULL) return;
+    if (fmt == NULL)
+        return;
 
     now = time(NULL);
     nowtm = localtime(&now);
     strftime(buff, sizeof(buff), "%d/%m/%Y %T", nowtm);
 
-    va_start(ap,fmt);
-    fprintf(stderr,"%s %d %s error: ", buff, getpid(), log_prog);
-    vfprintf(stderr,fmt,ap);
-    fprintf(stderr,"\n");
+    va_start(ap, fmt);
+    fprintf(stderr, "%s %d %s error: ", buff, getpid(), log_prog);
+    vfprintf(stderr, fmt, ap);
+    fprintf(stderr, "\n");
     fflush(stderr);
     va_end(ap);
 }
diff --git a/src/native/unix/native/debug.h b/src/native/unix/native/debug.h
index e450b07..3a1331c 100644
--- a/src/native/unix/native/debug.h
+++ b/src/native/unix/native/debug.h
@@ -1,29 +1,29 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: debug.h 480469 2006-11-29 08:22:04Z bayard $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: debug.h 921765 2010-03-11 10:03:32Z mturk $ */
 #ifndef __JSVC_DEBUG_H__
 #define __JSVC_DEBUG_H__
 
-/**
- * Wether debugging is enabled or not.
- */
 #ifdef __cplusplus
 extern "C" {
 #endif
+/**
+ * Wether debugging is enabled or not.
+ */
 extern bool log_debug_flag;
 
 /**
@@ -55,5 +55,5 @@ void log_error(const char *fmt, ...);
 #ifdef __cplusplus
 }
 #endif
+#endif                          /* ifndef __JSVC_DEBUG_H__ */
 
-#endif /* ifndef __JSVC_DEBUG_H__ */
diff --git a/src/native/unix/native/debug.o b/src/native/unix/native/debug.o
deleted file mode 100644
index 1bd0bfd..0000000
Binary files a/src/native/unix/native/debug.o and /dev/null differ
diff --git a/src/native/unix/native/dso-dlfcn.c b/src/native/unix/native/dso-dlfcn.c
index d6569db..a30d5a4 100644
--- a/src/native/unix/native/dso-dlfcn.c
+++ b/src/native/unix/native/dso-dlfcn.c
@@ -1,56 +1,62 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: dso-dlfcn.c 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: dso-dlfcn.c 921765 2010-03-11 10:03:32Z mturk $ */
 #include "jsvc.h"
 
 #ifdef DSO_DLFCN
-
 #include <dlfcn.h>
-
 #ifdef OS_LINUX
-bool ld_library_path_set=false;
+bool ld_library_path_set = false;
 #endif /* ifdef OS_LINUX */
 
 /* Initialize all DSO stuff */
-bool dso_init(void) {
-    return(true);
+bool dso_init(void)
+{
+    return true;
 }
 
 /* Attempt to link a library from a specified filename */
-dso_handle dso_link(const char *path) {
-    log_debug("Attemtping to load library %s",path);
+dso_handle dso_link(const char *path)
+{
+    log_debug("Attemtping to load library %s", path);
 
-    return((void *)dlopen(path,RTLD_GLOBAL|RTLD_NOW));
+    return ((void *)dlopen(path, RTLD_GLOBAL | RTLD_NOW));
 }
 
 /* Attempt to unload a library */
-bool dso_unlink(dso_handle libr) {
-    if (dlclose(libr)==0) return(true);
-    else return(false);
+bool dso_unlink(dso_handle libr)
+{
+    if (dlclose(libr) == 0)
+        return true;
+    else
+        return false;
 }
 
 /* Get the address for a specifed symbol */
-void *dso_symbol(dso_handle hdl, const char *nam) {
-    return(dlsym(hdl,nam));
+void *dso_symbol(dso_handle hdl, const char *nam)
+{
+    return dlsym(hdl, nam);
 }
 
 /* Return the error message from dlopen */
-char *dso_error(void) {
-    return(dlerror());
+char *dso_error(void)
+{
+    return (dlerror());
 }
 
 #endif /* ifdef DSO_DLFCN */
+
diff --git a/src/native/unix/native/dso-dlfcn.o b/src/native/unix/native/dso-dlfcn.o
deleted file mode 100644
index c58762e..0000000
Binary files a/src/native/unix/native/dso-dlfcn.o and /dev/null differ
diff --git a/src/native/unix/native/dso-dyld.c b/src/native/unix/native/dso-dyld.c
index c697fde..88c5628 100644
--- a/src/native/unix/native/dso-dyld.c
+++ b/src/native/unix/native/dso-dyld.c
@@ -14,14 +14,14 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: dso-dyld.c 480469 2006-11-29 08:22:04Z bayard $ */
+/* @version $Id: dso-dyld.c 921765 2010-03-11 10:03:32Z mturk $ */
 #include "jsvc.h"
 
 #ifdef DSO_DYLD
 
 #include <mach-o/dyld.h>
 
-#ifdef __bool_true_false_are_defined 
+#ifdef __bool_true_false_are_defined
 /* We define these differently than stdbool.h, so ignore the defs there */
 #undef bool
 #undef true
@@ -30,111 +30,124 @@
 
 
 /* Print an error message and abort all if a specified symbol wasn't found */
-static void nosymbol(const char *s) {
-    log_error("Cannot find symbol '%s' in library",s);
+static void nosymbol(const char *s)
+{
+    log_error("Cannot find symbol '%s' in library", s);
     abort();
 }
 
 /* We found two symbols for the same name in two different modules */
-static NSModule multiple(NSSymbol s, NSModule om, NSModule nm) {
-    NSModule ret=nm;
+static NSModule multiple(NSSymbol s, NSModule om, NSModule nm)
+{
+    NSModule ret = nm;
 
     log_debug("Symbol \"%s\" found in modules \"%s\" and \"%s\" (using %s)",
-        NSNameOfSymbol(s), NSNameOfModule(om), NSNameOfModule(nm),
-        NSNameOfModule(ret));
+              NSNameOfSymbol(s), NSNameOfModule(om), NSNameOfModule(nm),
+              NSNameOfModule(ret));
 
-    return(ret);
+    return (ret);
 }
 
 /* We got an error while linking a module, and if it's not a warning we have
    to abort the whole program */
 static void linkedit(NSLinkEditErrors category, int number, const char *file,
-                     const char *message) {
+                     const char *message)
+{
     log_error("Errors during link edit of file \"%s\" (error=%d): %s", file,
-              number,message);
+              number, message);
     /* Check if this error was only a warning */
-    if (category!=NSLinkEditWarningError) {
+    if (category != NSLinkEditWarningError) {
         log_error("Cannot continue");
         abort();
     }
 }
 
 /* Initialize all DSO stuff */
-bool dso_init() {
+bool dso_init()
+{
     NSLinkEditErrorHandlers h;
 
-    h.undefined=nosymbol;
-    h.multiple=multiple;
-    h.linkEdit=linkedit;
+    h.undefined = nosymbol;
+    h.multiple = multiple;
+    h.linkEdit = linkedit;
 
     NSInstallLinkEditErrorHandlers(&h);
-    return(true);
+    return (true);
 }
 
 /* Attempt to link a library from a specified filename */
-dso_handle dso_link(const char *path) {
+dso_handle dso_link(const char *path)
+{
     /* We need to load the library publically as NSModuleFileImage is not
        yet implemented (at least for non MH_BUNDLE libraries */
-    if (NSAddLibrary(path)!=TRUE) return(NULL);
+    if (NSAddLibrary(path) != TRUE)
+        return (NULL);
     /* We need to return a non-null value, even if it has no meaning. One day
        this whole crap will be fixed */
-    return((void *)!NULL);
+    return ((void *)!NULL);
 }
 
 /* Attempt to unload a library */
-bool dso_unlink(dso_handle libr) {
+bool dso_unlink(dso_handle libr)
+{
     /* Check the handle */
-    if (libr==NULL) {
+    if (libr == NULL) {
         log_error("Attempting to unload a module without handle");
-        return(false);
+        return (false);
     }
 
     /* We don't have a module, so, we don't really have to do anything */
-    return(true);
+    return (true);
 }
 
 /* Get the address for a specifed symbol */
-void *dso_symbol(dso_handle hdl, const char *nam) {
-    NSSymbol sym=NULL;
-    NSModule mod=NULL;
-    char *und=NULL;
-    void *add=NULL;
-    int x=0;
+void *dso_symbol(dso_handle hdl, const char *nam)
+{
+    NSSymbol sym = NULL;
+    NSModule mod = NULL;
+    char *und = NULL;
+    void *add = NULL;
+    int x = 0;
 
     /* Check parameters */
-    if (hdl==NULL) {
+    if (hdl == NULL) {
         log_error("Invalid library handler specified");
-        return(NULL);
+        return (NULL);
     }
 
-    if (nam==NULL) {
+    if (nam == NULL) {
         log_error("Invalid symbol name specified");
-        return(NULL);
+        return (NULL);
     }
 
     /* Process the correct name (add a _ before the name) */
-    while (nam[x]!='\0') x++;
-    und=(char*)malloc(sizeof(char)*(x+2));
-    while(x>=0) und[x+1]=nam[x--];
-    und[0]='_';
+    while (nam[x] != '\0')
+        x++;
+    und = (char *)malloc(sizeof(char) * (x + 2));
+    while (x >= 0)
+        und[x + 1] = nam[x--];
+    und[0] = '_';
 
     /* Find the symbol */
-    sym=NSLookupAndBindSymbol(und);
+    sym = NSLookupAndBindSymbol(und);
     free(und);
-    if (sym==NULL) return(NULL);
+    if (sym == NULL)
+        return (NULL);
 
     /* Dump some debugging output since this part is shaky */
-    mod=NSModuleForSymbol(sym);
-    add=NSAddressOfSymbol(sym);
+    mod = NSModuleForSymbol(sym);
+    add = NSAddressOfSymbol(sym);
     log_debug("Symbol \"%s\" found in module \"%s\" at address \"0x%08X\"",
-              NSNameOfSymbol(sym),NSNameOfModule(mod),add);
+              NSNameOfSymbol(sym), NSNameOfModule(mod), add);
 
     /* We want to return the address of the symbol */
-    return(add);
+    return (add);
 }
+
 /* Return the error message from dlopen: Well we already print it */
-char *dso_error() {
-    return("no additional message");
+char *dso_error()
+{
+    return ("no additional message");
 }
 
 #endif /* ifdef DSO_DYLD */
diff --git a/src/native/unix/native/dso-dyld.o b/src/native/unix/native/dso-dyld.o
deleted file mode 100644
index 226898f..0000000
Binary files a/src/native/unix/native/dso-dyld.o and /dev/null differ
diff --git a/src/native/unix/native/dso.h b/src/native/unix/native/dso.h
index ab17f49..6b391c7 100644
--- a/src/native/unix/native/dso.h
+++ b/src/native/unix/native/dso.h
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: dso.h 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: dso.h 921765 2010-03-11 10:03:32Z mturk $ */
 #ifndef __JSVC_DSO_H__
 #define __JSVC_DSO_H__
 
@@ -30,7 +30,7 @@ typedef void *dso_handle;
 
 bool dso_init(void);
 dso_handle dso_link(const char *pth);
-bool dso_unlink(dso_handle lib);
+bool  dso_unlink(dso_handle lib);
 void *dso_symbol(dso_handle lib, const char *nam);
 char *dso_error(void);
 
diff --git a/src/native/unix/native/help.c b/src/native/unix/native/help.c
index 699a812..668b68c 100644
--- a/src/native/unix/native/help.c
+++ b/src/native/unix/native/help.c
@@ -1,41 +1,42 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: help.c 911007 2010-02-17 14:58:48Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: help.c 923087 2010-03-15 07:00:01Z mturk $ */
 #include "jsvc.h"
 
-void help(home_data *data) {
+void help(home_data *data)
+{
     int x;
 
-    printf("Usage: %s [-options] class [args...]\n",log_prog);
+    printf("Usage: %s [-options] class [args...]\n", log_prog);
     printf("\n");
     printf("Where options include:\n");
     printf("\n");
-
+    printf("    -help | --help | -?\n");
+    printf("        show this help page (implies -nodetach)\n");
     printf("    -jvm <JVM name>\n");
     printf("        use a specific Java Virtual Machine. Available JVMs:\n");
     printf("           ");
-    for (x=0; x<data->jnum; x++) {
-      printf(" '%s'",PRINT_NULL(data->jvms[x]->name));
+    for (x = 0; x < data->jnum; x++) {
+        printf(" '%s'", PRINT_NULL(data->jvms[x]->name));
     }
     printf("\n");
 
     printf("    -cp / -classpath <directories and zip/jar files>\n");
     printf("        set search path for service classes and resouces\n");
-
     printf("    -home <directory>\n");
     printf("        set the path of your JDK or JRE installation (or set\n");
     printf("        the JAVA_HOME environment variable)\n");
@@ -43,56 +44,57 @@ void help(home_data *data) {
     printf("    -version\n");
     printf("        show the current Java environment version (to check\n");
     printf("        correctness of -home and -jvm. Implies -nodetach)\n");
-
-    printf("    -help / -?\n");
-    printf("        show this help page (implies -nodetach)\n");
-
+    printf("    -showversion\n");
+    printf("        show the current Java environment version (to check\n");
+    printf("        correctness of -home and -jvm) and continue execution.\n");
     printf("    -nodetach\n");
     printf("        don't detach from parent process and become a daemon\n");
-
     printf("    -debug\n");
     printf("        verbosely print debugging information\n");
-
     printf("    -check\n");
     printf("        only check service (implies -nodetach)\n");
- 
     printf("    -user <user>\n");
     printf("        user used to run the daemon (defaults to current user)\n");
- 
     printf("    -verbose[:class|gc|jni]\n");
     printf("        enable verbose output\n");
- 
     printf("    -outfile </full/path/to/file>\n");
     printf("        Location for output from stdout (defaults to /dev/null)\n");
     printf("        Use the value '&2' to simulate '1>&2'\n");
-
     printf("    -errfile </full/path/to/file>\n");
     printf("        Location for output from stderr (defaults to /dev/null)\n");
     printf("        Use the value '&1' to simulate '2>&1'\n");
-
     printf("    -pidfile </full/path/to/file>\n");
     printf("        Location for output from the file containing the pid of jsvc\n");
     printf("        (defaults to /var/run/jsvc.pid)\n");
-
     printf("    -D<name>=<value>\n");
     printf("        set a Java system property\n");
-
     printf("    -X<option>\n");
     printf("        set Virtual Machine specific option\n");
-
+    printf("    -ea[:<packagename>...|:<classname>]\n");
+    printf("    -enableassertions[:<packagename>...|:<classname>]\n");
+    printf("        enable assertions\n");
+    printf("    -da[:<packagename>...|:<classname>]\n");
+    printf("    -disableassertions[:<packagename>...|:<classname>]\n");
+    printf("        disable assertions\n");
+    printf("    -esa | -enablesystemassertions\n");
+    printf("        enable system assertions\n");
+    printf("    -dsa | -disablesystemassertions\n");
+    printf("        disable system assertions\n");
+    printf("    -agentlib:<libname>[=<options>]\n");
+    printf("        load native agent library <libname>, e.g. -agentlib:hprof\n");
+    printf("    -agentpath:<pathname>[=<options>]\n");
+    printf("        load native agent library by full pathname\n");
+    printf("    -javaagent:<jarpath>[=<options>]\n");
+    printf("        load Java programming language agent, see java.lang.instrument\n");
     printf("    -procname <procname>\n");
     printf("        use the specified process name (works only for Linux)\n");
-
     printf("    -wait <waittime>\n");
     printf("        wait waittime seconds for the service to start\n");
     printf("        waittime should multiple of 10 (min=10)\n");
-
     printf("    -stop\n");
     printf("        stop the service using the file given in the -pidfile option\n");
-
     printf("    -keepstdin\n");
     printf("        does not redirect stdin to /dev/null\n");
-
     printf("\njsvc (Apache Commons Daemon) " JSVC_VERSION_STRING "\n");
     printf("Copyright (c) 1999-2010 Apache Software Foundation.\n");
 
diff --git a/src/native/unix/native/help.h b/src/native/unix/native/help.h
index e71b3e3..eff8f3e 100644
--- a/src/native/unix/native/help.h
+++ b/src/native/unix/native/help.h
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: help.h 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: help.h 921765 2010-03-11 10:03:32Z mturk $ */
 #ifndef __JSVC_HELP_H__
 #define __JSVC_HELP_H__
 
diff --git a/src/native/unix/native/help.o b/src/native/unix/native/help.o
deleted file mode 100644
index ee3c49d..0000000
Binary files a/src/native/unix/native/help.o and /dev/null differ
diff --git a/src/native/unix/native/home.c b/src/native/unix/native/home.c
index 4591a47..bfa66d9 100644
--- a/src/native/unix/native/home.c
+++ b/src/native/unix/native/home.c
@@ -14,231 +14,252 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: home.c 480469 2006-11-29 08:22:04Z bayard $ */
+/* @version $Id: home.c 921765 2010-03-11 10:03:32Z mturk $ */
 #include "jsvc.h"
 
 /* Check if a path is a directory */
-static bool checkdir(char *path) {
+static bool checkdir(char *path)
+{
     struct stat home;
 
-    if (path==NULL) return(false);
-    if (stat(path,&home)!=0) return(false);
-    if (S_ISDIR(home.st_mode)) return(true);
-    return(false);
+    if (path == NULL)
+        return (false);
+    if (stat(path, &home) != 0)
+        return (false);
+    if (S_ISDIR(home.st_mode))
+        return (true);
+    return (false);
 }
 
 /* Check if a path is a file */
-static bool checkfile(char *path) {
+static bool checkfile(char *path)
+{
     struct stat home;
 
-    if (path==NULL) return(false);
-    if (stat(path,&home)!=0) return(false);
-    if (S_ISREG(home.st_mode)) return(true);
-    return(false);
+    if (path == NULL)
+        return (false);
+    if (stat(path, &home) != 0)
+        return (false);
+    if (S_ISREG(home.st_mode))
+        return (true);
+    return (false);
 }
 
 /* Parse a VM configuration file */
-static bool parse(home_data *data) {
-    FILE *cfgf=fopen(data->cfgf,"r");
-    char *ret=NULL, *sp;
+static bool parse(home_data *data)
+{
+    FILE *cfgf = fopen(data->cfgf, "r");
+    char *ret = NULL, *sp;
     char buf[1024];
 
-    if (cfgf==NULL) {
-      log_debug("Can't open %s\n",data->cfgf);
-      return(false);
+    if (cfgf == NULL) {
+        log_debug("Can't open %s\n", data->cfgf);
+        return (false);
     }
 
-    data->jvms=(home_jvm **)malloc(256*sizeof(home_jvm *));
+    data->jvms = (home_jvm **)malloc(256 * sizeof(home_jvm *));
 
-    while((ret=fgets(buf,1024,cfgf))!=NULL) {
-        char *tmp=strchr(ret,'#');
+    while ((ret = fgets(buf, 1024, cfgf)) != NULL) {
+        char *tmp = strchr(ret, '#');
         int pos;
 
         /* Clear the string at the first occurrence of '#' */
-        if (tmp!=NULL) tmp[0]='\0';
+        if (tmp != NULL)
+            tmp[0] = '\0';
 
         /* Trim the string (including leading '-' chars */
-        while((ret[0]==' ')||(ret[0]=='\t')||(ret[0]=='-')) ret++;
-        pos=strlen(ret);
-        while(pos>=0) {
-            if ((ret[pos]=='\r')||(ret[pos]=='\n')||(ret[pos]=='\t')||
-                (ret[pos]=='\0')||(ret[pos]==' ')) {
-                ret[pos--]='\0';
-            } else break;
+        while ((ret[0] == ' ') || (ret[0] == '\t') || (ret[0] == '-'))
+            ret++;
+        pos = strlen(ret);
+        while (pos >= 0) {
+            if ((ret[pos] == '\r') || (ret[pos] == '\n') || (ret[pos] == '\t')
+                || (ret[pos] == '\0') || (ret[pos] == ' ')) {
+                ret[pos--] = '\0';
+            }
+            else
+                break;
         }
         /* Format changed for 1.4 JVMs */
         sp = strchr(ret, ' ');
-        if(sp != NULL)
+        if (sp != NULL)
             *sp = '\0';
 
         /* Did we find something significant? */
-        if (strlen(ret)>0) {
-            char *libf=NULL;
-            int x=0;
+        if (strlen(ret) > 0) {
+            char *libf = NULL;
+            int x = 0;
 
-            log_debug("Found VM %s definition in configuration",ret);
-            while(location_jvm_configured[x]!=NULL) {
-                char *orig=location_jvm_configured[x];
+            log_debug("Found VM %s definition in configuration", ret);
+            while (location_jvm_configured[x] != NULL) {
+                char *orig = location_jvm_configured[x];
                 char temp[1024];
                 char repl[1024];
                 int k;
 
-                k=replace(temp,1024,orig,"$JAVA_HOME",data->path);
-                if (k!=0) {
-                    log_error("Can't replace home in VM library (%d)",k);
-                    return(false);
+                k = replace(temp, 1024, orig, "$JAVA_HOME", data->path);
+                if (k != 0) {
+                    log_error("Can't replace home in VM library (%d)", k);
+                    return (false);
                 }
-                k=replace(repl,1024,temp,"$VM_NAME",ret);
-                if (k!=0) {
-                    log_error("Can't replace name in VM library (%d)",k);
-                    return(false);
+                k = replace(repl, 1024, temp, "$VM_NAME", ret);
+                if (k != 0) {
+                    log_error("Can't replace name in VM library (%d)", k);
+                    return (false);
                 }
 
-                log_debug("Checking library %s",repl);
+                log_debug("Checking library %s", repl);
                 if (checkfile(repl)) {
-                    libf=strdup(repl);
+                    libf = strdup(repl);
                     break;
                 }
                 x++;
             }
 
-            if (libf==NULL) {
-                log_debug("Cannot locate library for VM %s (skipping)",ret);
-            } else {
-                data->jvms[data->jnum]=(home_jvm *)malloc(sizeof(home_jvm));
-                data->jvms[data->jnum]->name=strdup(ret);
-                data->jvms[data->jnum]->libr=libf;
+            if (libf == NULL) {
+                log_debug("Cannot locate library for VM %s (skipping)", ret);
+            }
+            else {
+                data->jvms[data->jnum] = (home_jvm *)malloc(sizeof(home_jvm));
+                data->jvms[data->jnum]->name = strdup(ret);
+                data->jvms[data->jnum]->libr = libf;
                 data->jnum++;
-                data->jvms[data->jnum]=NULL;
+                data->jvms[data->jnum] = NULL;
             }
         }
     }
-    return(true);
+    return (true);
 }
 
 /* Build a Java Home structure for a path */
-static home_data *build(char *path) {
-    home_data *data=NULL;
-    char *cfgf=NULL;
+static home_data *build(char *path)
+{
+    home_data *data = NULL;
+    char *cfgf = NULL;
     char buf[1024];
-    int x=0;
-    int k=0;
+    int x = 0;
+    int k = 0;
 
-    if (path==NULL) return(NULL);
+    if (path == NULL)
+        return (NULL);
 
-    log_debug("Attempting to locate Java Home in %s",path);
-    if (checkdir(path)==false) {
-        log_debug("Path %s is not a directory",path);
-        return(NULL);
+    log_debug("Attempting to locate Java Home in %s", path);
+    if (checkdir(path) == false) {
+        log_debug("Path %s is not a directory", path);
+        return (NULL);
     }
 
-    while(location_jvm_cfg[x]!=NULL) {
-        if ((k=replace(buf,1024,location_jvm_cfg[x],"$JAVA_HOME",path))!=0) {
-            log_error("Error replacing values for jvm.cfg (%d)",k);
-            return(NULL);
+    while (location_jvm_cfg[x] != NULL) {
+        if ((k =
+             replace(buf, 1024, location_jvm_cfg[x], "$JAVA_HOME",
+                     path)) != 0) {
+            log_error("Error replacing values for jvm.cfg (%d)", k);
+            return (NULL);
         }
-        log_debug("Attempting to locate VM configuration file %s",buf);
-        if(checkfile(buf)==true) {
-            log_debug("Found VM configuration file at %s",buf);
-            cfgf=strdup(buf);
+        log_debug("Attempting to locate VM configuration file %s", buf);
+        if (checkfile(buf) == true) {
+            log_debug("Found VM configuration file at %s", buf);
+            cfgf = strdup(buf);
             break;
         }
         x++;
     }
 
-    data=(home_data *)malloc(sizeof(home_data));
-    data->path=strdup(path);
-    data->cfgf=cfgf;
-    data->jvms=NULL;
-    data->jnum=0;
+    data = (home_data *)malloc(sizeof(home_data));
+    data->path = strdup(path);
+    data->cfgf = cfgf;
+    data->jvms = NULL;
+    data->jnum = 0;
 
     /* We don't have a jvm.cfg configuration file, so all we have to do is
        trying to locate the "default" Java Virtual Machine library */
-    if (cfgf==NULL) {
+    if (cfgf == NULL) {
         log_debug("VM configuration file not found");
-        x=0;
-        while(location_jvm_default[x]!=NULL) {
-            char *libr=location_jvm_default[x];
+        x = 0;
+        while (location_jvm_default[x] != NULL) {
+            char *libr = location_jvm_default[x];
 
-            if ((k=replace(buf,1024,libr,"$JAVA_HOME",path))!=0) {
-                log_error("Error replacing values for JVM library (%d)",k);
-                return(NULL);
+            if ((k = replace(buf, 1024, libr, "$JAVA_HOME", path)) != 0) {
+                log_error("Error replacing values for JVM library (%d)", k);
+                return (NULL);
             }
-            log_debug("Attempting to locate VM library %s",buf);
-            if (checkfile(buf)==true) {
-                data->jvms=(home_jvm **)malloc(2*sizeof(home_jvm *));
-                data->jvms[0]=(home_jvm *)malloc(sizeof(home_jvm));
-                data->jvms[0]->name=NULL;
-                data->jvms[0]->libr=strdup(buf);
-                data->jvms[1]=NULL;
-                data->jnum=1;
-                return(data);
+            log_debug("Attempting to locate VM library %s", buf);
+            if (checkfile(buf) == true) {
+                data->jvms = (home_jvm **)malloc(2 * sizeof(home_jvm *));
+                data->jvms[0] = (home_jvm *)malloc(sizeof(home_jvm));
+                data->jvms[0]->name = NULL;
+                data->jvms[0]->libr = strdup(buf);
+                data->jvms[1] = NULL;
+                data->jnum = 1;
+                return (data);
             }
             x++;
         }
 
-        return(data);
+        return (data);
     }
 
     /* If we got here, we most definitely found a jvm.cfg file */
-    if (parse(data)==false) {
-        log_error("Cannot parse VM configuration file %s",data->cfgf);
+    if (parse(data) == false) {
+        log_error("Cannot parse VM configuration file %s", data->cfgf);
     }
 
-    return(data);
+    return (data);
 }
 
 /* Find the Java Home */
-static home_data *find(char *path) {
-    home_data *data=NULL;
-    int x=0;
+static home_data *find(char *path)
+{
+    home_data *data = NULL;
+    int x = 0;
 
-    if (path==NULL) {
+    if (path == NULL) {
         log_debug("Home not specified on command line, using environment");
-        path=getenv("JAVA_HOME");
+        path = getenv("JAVA_HOME");
     }
 
-    if (path==NULL) {
+    if (path == NULL) {
         log_debug("Home not on command line or in environment, searching");
-        while (location_home[x]!=NULL) {
-            if ((data=build(location_home[x]))!=NULL) {
-                log_debug("Java Home located in %s",data->path);
-                return(data);
+        while (location_home[x] != NULL) {
+            if ((data = build(location_home[x])) != NULL) {
+                log_debug("Java Home located in %s", data->path);
+                return (data);
             }
             x++;
         }
-    } else {
-        if ((data=build(path))!=NULL) {
-            log_debug("Java Home located in %s",data->path);
-            return(data);
+    }
+    else {
+        if ((data = build(path)) != NULL) {
+            log_debug("Java Home located in %s", data->path);
+            return (data);
         }
     }
 
-    return(NULL);
+    return (NULL);
 }
 
 /* Main entry point: locate home and dump structure */
-home_data *home(char *path) {
-    home_data *data=find(path);
-    int x=0;
+home_data *home(char *path)
+{
+    home_data *data = find(path);
+    int x = 0;
 
-    if (data==NULL) {
+    if (data == NULL) {
         log_error("Cannot locate Java Home");
-        return(NULL);
+        return (NULL);
     }
 
-    if (log_debug_flag==true) {
+    if (log_debug_flag == true) {
         log_debug("+-- DUMPING JAVA HOME STRUCTURE ------------------------");
-        log_debug("| Java Home:       \"%s\"",PRINT_NULL(data->path));
-        log_debug("| Java VM Config.: \"%s\"",PRINT_NULL(data->cfgf));
-        log_debug("| Found JVMs:      %d",data->jnum);
-        for (x=0; x<data->jnum; x++) {
-            home_jvm *jvm=data->jvms[x];
-            log_debug("| JVM Name:        \"%s\"",PRINT_NULL(jvm->name));
-            log_debug("|                  \"%s\"",PRINT_NULL(jvm->libr));
+        log_debug("| Java Home:       \"%s\"", PRINT_NULL(data->path));
+        log_debug("| Java VM Config.: \"%s\"", PRINT_NULL(data->cfgf));
+        log_debug("| Found JVMs:      %d", data->jnum);
+        for (x = 0; x < data->jnum; x++) {
+            home_jvm *jvm = data->jvms[x];
+            log_debug("| JVM Name:        \"%s\"", PRINT_NULL(jvm->name));
+            log_debug("|                  \"%s\"", PRINT_NULL(jvm->libr));
         }
         log_debug("+-------------------------------------------------------");
     }
 
-    return(data);
+    return (data);
 }
diff --git a/src/native/unix/native/home.h b/src/native/unix/native/home.h
index 131fbf5..d809afb 100644
--- a/src/native/unix/native/home.h
+++ b/src/native/unix/native/home.h
@@ -14,19 +14,21 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: home.h 480469 2006-11-29 08:22:04Z bayard $ */
+/* @version $Id: home.h 921765 2010-03-11 10:03:32Z mturk $ */
 #ifndef __JSVC_HOME_H__
 #define __JSVC_HOME_H__
 
 typedef struct home_jvm home_jvm;
 typedef struct home_data home_data;
 
-struct home_jvm {
+struct home_jvm
+{
     char *name;
     char *libr;
 };
 
-struct home_data {
+struct home_data
+{
     char *path;
     char *cfgf;
     home_jvm **jvms;
diff --git a/src/native/unix/native/home.o b/src/native/unix/native/home.o
deleted file mode 100644
index ffb817c..0000000
Binary files a/src/native/unix/native/home.o and /dev/null differ
diff --git a/src/native/unix/native/java.c b/src/native/unix/native/java.c
index de94312..f6b3738 100644
--- a/src/native/unix/native/java.c
+++ b/src/native/unix/native/java.c
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: java.c 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: java.c 923123 2010-03-15 09:20:00Z mturk $ */
 #include "jsvc.h"
 
 #ifdef OS_CYGWIN
@@ -29,101 +29,124 @@ typedef long long __int64;
 #define jsvc_xlate_from_ascii(b) _a2e(b)
 #endif
 #else
-#define jsvc_xlate_to_ascii(b) /* NOOP */
-#define jsvc_xlate_from_ascii(b) /* NOOP */
+#define jsvc_xlate_to_ascii(b)  /* NOOP */
+#define jsvc_xlate_from_ascii(b)        /* NOOP */
 #endif
 
-static JavaVM *jvm=NULL;
-static JNIEnv *env=NULL;
-static jclass cls=NULL;
+static JavaVM *jvm = NULL;
+static JNIEnv *env = NULL;
+static jclass cls  = NULL;
 
 #define FALSE 0
 #define TRUE !FALSE
 
-static void shutdown(JNIEnv *env, jobject source, jboolean reload) {
-    log_debug("Shutdown requested (reload is %d)",reload);
-    if (reload==TRUE) main_reload();
-    else main_shutdown();
+static void shutdown(JNIEnv *env, jobject source, jboolean reload)
+{
+    log_debug("Shutdown requested (reload is %d)", reload);
+    if (reload == TRUE)
+        main_reload();
+    else
+        main_shutdown();
+}
+
+static void failed(JNIEnv *env, jobject source, jstring message)
+{
+    if (message) {
+        const char *msg = (*env)->GetStringUTFChars(env, message, NULL);
+        log_error("Failed %s", msg ? msg : "(null)");
+        if (msg)
+            (*env)->ReleaseStringUTFChars(env, message, msg);
+    }
+    else
+        log_error("Failed requested");
+    main_shutdown();
 }
+
 /* Automatically restart when the JVM crashes */
 static void java_abort123(void)
 {
     exit(123);
 }
 
-char *java_library(arg_data *args, home_data *data) {
-    char *libf=NULL;
+char *java_library(arg_data *args, home_data *data)
+{
+    char *libf = NULL;
 
     /* Did we find ANY virtual machine? */
-    if (data->jnum==0) {
-        log_error("Cannot find any VM in Java Home %s",data->path);
-        return(NULL);
+    if (data->jnum == 0) {
+        log_error("Cannot find any VM in Java Home %s", data->path);
+        return NULL;
     }
 
     /* Select the VM */
-    if (args->name==NULL) {
-        libf=data->jvms[0]->libr;
-        log_debug("Using default JVM in %s",libf);
-    } else {
+    if (args->name == NULL) {
+        libf = data->jvms[0]->libr;
+        log_debug("Using default JVM in %s", libf);
+    }
+    else {
         int x;
-        for (x=0; x<data->jnum; x++) {
-            if (data->jvms[x]->name==NULL) continue;
-            if (strcmp(args->name,data->jvms[x]->name)==0) {
-                libf=data->jvms[x]->libr;
-                log_debug("Using specific JVM in %s",libf);
+        for (x = 0; x < data->jnum; x++) {
+            if (data->jvms[x]->name == NULL)
+                continue;
+            if (strcmp(args->name, data->jvms[x]->name) == 0) {
+                libf = data->jvms[x]->libr;
+                log_debug("Using specific JVM in %s", libf);
                 break;
             }
         }
-        if (libf==NULL) {
-            log_error("Invalid JVM name specified %s",args->name);
-            return(NULL);
+        if (libf == NULL) {
+            log_error("Invalid JVM name specified %s", args->name);
+            return NULL;
         }
     }
-    return(libf);
+    return libf;
 }
 
 /* Initialize the JVM and its environment, loading libraries and all */
-bool java_init(arg_data *args, home_data *data) {
+bool java_init(arg_data *args, home_data *data)
+{
 #ifdef OS_DARWIN
-    dso_handle apph=NULL;
+    dso_handle apph = NULL;
     char appf[1024];
     struct stat sb;
 #endif /* ifdef OS_DARWIN */
-    jint (*symb)(JavaVM **, JNIEnv **, JavaVMInitArgs *);
-    JNINativeMethod nativemethod;
-    JavaVMOption *opt=NULL;
-    dso_handle libh=NULL;
+    jint(*symb) (JavaVM **, JNIEnv **, JavaVMInitArgs *);
+    JNINativeMethod nativemethods[2];
+    JavaVMOption *opt = NULL;
+    dso_handle libh   = NULL;
     JavaVMInitArgs arg;
-    char *libf=NULL;
+    char *libf = NULL;
     jint ret;
     int x;
-    char loaderclass[]=LOADER;
-    char shutdownclass[]="shutdown";
-    char shutdownparams[]="(Z)V";
+    char loaderclass[]    = LOADER;
+    char shutdownmethod[] = "shutdown";
+    char shutdownparams[] = "(Z)V";
+    char failedmethod[]   = "failed";
+    char failedparams[]   = "(Ljava/lang/String;)V";
 
     /* Decide WHAT virtual machine we need to use */
-    libf=java_library(args,data);
-    if (libf==NULL) {
+    libf = java_library(args, data);
+    if (libf == NULL) {
         log_error("Cannot locate JVM library file");
-        return(false);
+        return false;
     }
 
     /* Initialize the DSO library */
-    if (dso_init()!=true) {
+    if (dso_init() != true) {
         log_error("Cannot initialize the dynamic library loader");
-        return(false);
+        return false;
     }
 
     /* Load the JVM library */
 #if defined(OSD_POSIX) || defined(HAVE_KAFFEVM)
 #else
-    libh=dso_link(libf);
-    if (libh==NULL) {
-        log_error("Cannot dynamically link to %s",libf);
-        log_error("%s",dso_error());
-        return(false);
+    libh = dso_link(libf);
+    if (libh == NULL) {
+        log_error("Cannot dynamically link to %s", libf);
+        log_error("%s", dso_error());
+        return false;
     }
-    log_debug("JVM library %s loaded",libf);
+    log_debug("JVM library %s loaded", libf);
 #endif
 
 #ifdef OS_DARWIN
@@ -133,62 +156,62 @@ bool java_init(arg_data *args, home_data *data) {
        before JVM 1.4.1 The first one (libappshell.dyld) contains CreateVM
        JVM 1.4.1 through 1.5.* The library name is libjvm_compat.dylib
        starting with JVM 1.6 on OS X 10.6 the library name is libverify.dylib.
-    */
-        if (replace(appf,1024,"$JAVA_HOME/../Libraries/libappshell.dylib",
-                 "$JAVA_HOME",data->path)!=0) {
+     */
+    if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libappshell.dylib",
+                "$JAVA_HOME", data->path) != 0) {
         log_error("Cannot replace values in loader library");
-        return(false);
+        return false;
     }
     if (stat(appf, &sb)) {
-        if (replace(appf,1024,"$JAVA_HOME/../Libraries/libjvm_compat.dylib",
-                    "$JAVA_HOME",data->path)!=0) {
+        if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libjvm_compat.dylib",
+                    "$JAVA_HOME", data->path) != 0) {
             log_error("Cannot replace values in loader library");
-            return(false);
+            return false;
         }
     }
     if (stat(appf, &sb)) {
-        if (replace(appf,1024,"$JAVA_HOME/../Libraries/libverify.dylib",
-                    "$JAVA_HOME",data->path)!=0) {
+        if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libverify.dylib",
+                    "$JAVA_HOME", data->path) != 0) {
             log_error("Cannot replace values in loader library");
-            return(false);
+            return false;
         }
     }
-    apph=dso_link(appf);
-    if (apph==NULL) {
-        log_error("Cannot load required shell library %s",appf);
-        return(false);
+    apph = dso_link(appf);
+    if (apph == NULL) {
+        log_error("Cannot load required shell library %s", appf);
+        return false;
     }
-    log_debug("Shell library %s loaded",appf);
+    log_debug("Shell library %s loaded", appf);
 #endif /* ifdef OS_DARWIN */
 #if defined(OSD_POSIX) || defined(HAVE_KAFFEVM)
     /* BS2000 and kaffe does not allow to call JNI_CreateJavaVM indirectly */
 #else
-    symb=dso_symbol(libh,"JNI_CreateJavaVM");
-    if (symb==NULL) {
+    symb = dso_symbol(libh, "JNI_CreateJavaVM");
+    if (symb == NULL) {
 #ifdef OS_DARWIN
-        symb=dso_symbol(apph,"JNI_CreateJavaVM");
-        if (symb==NULL) {
+        symb = dso_symbol(apph, "JNI_CreateJavaVM");
+        if (symb == NULL) {
 #endif /* ifdef OS_DARWIN */
             log_error("Cannot find JVM library entry point");
-            return(false);
+            return false;
 #ifdef OS_DARWIN
         }
 #endif /* ifdef OS_DARWIN */
     }
-    log_debug("JVM library entry point found (0x%08X)",symb);
+    log_debug("JVM library entry point found (0x%08X)", symb);
 #endif
 
     /* Prepare the VM initialization arguments */
-    
+
     /*
-        Mac OS X Java will load JVM 1.3.1 instead of 1.4.2 if JNI_VERSION_1_2
-        is specified. So use JNI_VERSION_1_4 if we can.
-    */
-    #if defined(JNI_VERSION_1_4)
-        arg.version=JNI_VERSION_1_4;
-    #else
-        arg.version=JNI_VERSION_1_2;
-    #endif
+     * Mac OS X Java will load JVM 1.3.1 instead of 1.4.2 if JNI_VERSION_1_2
+     * is specified. So use JNI_VERSION_1_4 if we can.
+     */
+#if defined(JNI_VERSION_1_4)
+    arg.version = JNI_VERSION_1_4;
+#else
+    arg.version = JNI_VERSION_1_2;
+#endif
 #if defined(OSD_POSIX) || defined(HAVE_KAFFEVM)
 
 #if defined(HAVE_KAFFEVM)
@@ -196,36 +219,36 @@ bool java_init(arg_data *args, home_data *data) {
     arg.version = JNI_VERSION_1_4;
 #endif
 
-    if (JNI_GetDefaultJavaVMInitArgs(&arg)<0) {
+    if (JNI_GetDefaultJavaVMInitArgs(&arg) < 0) {
         log_error("Cannot init default JVM default args");
-        return(false);
+        return false;
     }
 #endif
-    arg.ignoreUnrecognized=FALSE;
-    arg.nOptions=args->onum;
-    arg.nOptions++; /* Add abort code */
-    opt=(JavaVMOption *)malloc(arg.nOptions*sizeof(JavaVMOption));
-    for (x=0; x<args->onum; x++) {
-        opt[x].optionString=strdup(args->opts[x]);
+    arg.ignoreUnrecognized = FALSE;
+    arg.nOptions = args->onum;
+    arg.nOptions++;             /* Add abort code */
+    opt = (JavaVMOption *) malloc(arg.nOptions * sizeof(JavaVMOption));
+    for (x = 0; x < args->onum; x++) {
+        opt[x].optionString = strdup(args->opts[x]);
         jsvc_xlate_to_ascii(opt[x].optionString);
-        opt[x].extraInfo=NULL;
+        opt[x].extraInfo = NULL;
     }
-    opt[x].optionString=strdup("abort");
+    opt[x].optionString = strdup("abort");
     jsvc_xlate_to_ascii(opt[x].optionString);
-    opt[x].extraInfo=java_abort123;
-    arg.options=opt;
+    opt[x].extraInfo = java_abort123;
+    arg.options = opt;
 
     /* Do some debugging */
-    if (log_debug_flag==true) {
+    if (log_debug_flag == true) {
         log_debug("+-- DUMPING JAVA VM CREATION ARGUMENTS -----------------");
-        log_debug("| Version:                       %#08x",arg.version);
+        log_debug("| Version:                       %#08x", arg.version);
         log_debug("| Ignore Unrecognized Arguments: %s",
-                  arg.ignoreUnrecognized==TRUE?"True":"False");
-        log_debug("| Extra options:                 %d",arg.nOptions);
+                  arg.ignoreUnrecognized == TRUE ? "True" : "False");
+        log_debug("| Extra options:                 %d", arg.nOptions);
 
-        for (x=0; x<args->onum; x++) {
+        for (x = 0; x < args->onum; x++) {
             jsvc_xlate_from_ascii(opt[x].optionString);
-            log_debug("|   \"%s\" (0x%08x)",opt[x].optionString,
+            log_debug("|   \"%s\" (0x%08x)", opt[x].optionString,
                       opt[x].extraInfo);
             jsvc_xlate_to_ascii(opt[x].optionString);
         }
@@ -234,295 +257,312 @@ bool java_init(arg_data *args, home_data *data) {
 
     /* And finally create the Java VM */
 #if defined(OSD_POSIX) || defined(HAVE_KAFFEVM)
-    ret=JNI_CreateJavaVM(&jvm, &env, &arg);
+    ret = JNI_CreateJavaVM(&jvm, &env, &arg);
 #else
-    ret=(*symb)(&jvm, &env, &arg);
+    ret = (*symb) (&jvm, &env, &arg);
 #endif
-    if (ret<0) {
+    if (ret < 0) {
         log_error("Cannot create Java VM");
-        return(false);
+        return false;
     }
     log_debug("Java VM created successfully");
 
     jsvc_xlate_to_ascii(loaderclass);
-    cls=(*env)->FindClass(env,loaderclass);
+    cls = (*env)->FindClass(env, loaderclass);
     jsvc_xlate_from_ascii(loaderclass);
-    if (cls==NULL) {
-        log_error("Cannot find daemon loader %s",loaderclass);
-        return(false);
+    if (cls == NULL) {
+        log_error("Cannot find daemon loader %s", loaderclass);
+        return false;
     }
-    log_debug("Class %s found",loaderclass);
+    log_debug("Class %s found", loaderclass);
 
 #if defined(HAVE_SABLEVM)
     log_debug("sableVM doesn't support RegisterNatives");
 #else
-    jsvc_xlate_to_ascii(shutdownclass);
-    nativemethod.name=shutdownclass;
+    jsvc_xlate_to_ascii(shutdownmethod);
+    nativemethods[0].name = shutdownmethod;
     jsvc_xlate_to_ascii(shutdownparams);
-    nativemethod.signature=shutdownparams;
-    nativemethod.fnPtr=shutdown;
-    if((*env)->RegisterNatives(env,cls,&nativemethod,1)!=0) {
+    nativemethods[0].signature = shutdownparams;
+    nativemethods[0].fnPtr = shutdown;
+    jsvc_xlate_to_ascii(failedmethod);
+    nativemethods[1].name = failedmethod;
+    jsvc_xlate_to_ascii(failedparams);
+    nativemethods[1].signature = failedparams;
+    nativemethods[1].fnPtr = failed;
+
+    if ((*env)->RegisterNatives(env, cls, nativemethods, 2) != 0) {
         log_error("Cannot register native methods");
-        return(false);
+        return false;
     }
     log_debug("Native methods registered");
 #endif
 
-    return(true);
+    return true;
 }
 
 /* Destroy the Java VM */
-bool JVM_destroy(int exit) {
-    jclass system=NULL;
+bool JVM_destroy(int exit)
+{
+    jclass system = NULL;
     jmethodID method;
-    char System[]="java/lang/System";
-    char exitclass[]="exit";
-    char exitparams[]="(I)V"; 
+    char System[] = "java/lang/System";
+    char exitclass[] = "exit";
+    char exitparams[] = "(I)V";
 
-    jsvc_xlate_to_ascii(System); 
-    system=(*env)->FindClass(env,System);
+    jsvc_xlate_to_ascii(System);
+    system = (*env)->FindClass(env, System);
     jsvc_xlate_from_ascii(System);
-    if (system==NULL) {
-        log_error("Cannot find class %s",System);
-        return(false);
+    if (system == NULL) {
+        log_error("Cannot find class %s", System);
+        return false;
     }
 
     jsvc_xlate_to_ascii(exitclass);
     jsvc_xlate_to_ascii(exitparams);
-    method=(*env)->GetStaticMethodID(env,system,exitclass,exitparams);
-    if (method==NULL) {
+    method = (*env)->GetStaticMethodID(env, system, exitclass, exitparams);
+    if (method == NULL) {
         log_error("Cannot find \"System.exit(int)\" entry point");
-        return(false);
+        return false;
     }
 
-    log_debug("Calling System.exit(%d)",exit);
-    (*env)->CallStaticVoidMethod(env,system,method,(jint)exit);
+    log_debug("Calling System.exit(%d)", exit);
+    (*env)->CallStaticVoidMethod(env, system, method, (jint) exit);
 
     /* We shouldn't get here, but just in case... */
     log_debug("Destroying the Java VM");
-    if ((*jvm)->DestroyJavaVM(jvm)!=0) return(false);
+    if ((*jvm)->DestroyJavaVM(jvm) != 0)
+        return false;
     log_debug("Java VM destroyed");
-    return(true);
+    return true;
 }
 
 /* Call the load method in our DaemonLoader class */
-bool java_load(arg_data *args) {
-    jclass stringClass=NULL;
-    jstring className=NULL;
-    jstring currentArgument=NULL;
-    jobjectArray stringArray=NULL;
-    jmethodID method=NULL;
-    jboolean ret=FALSE;
+bool java_load(arg_data *args)
+{
+    jclass stringClass       = NULL;
+    jstring className        = NULL;
+    jstring currentArgument  = NULL;
+    jobjectArray stringArray = NULL;
+    jmethodID method         = NULL;
+    jboolean ret             = FALSE;
     int x;
-    char lang[]="java/lang/String";
-    char load[]="load";
-    char loadparams[]="(Ljava/lang/String;[Ljava/lang/String;)Z";
+    char lang[] = "java/lang/String";
+    char load[] = "load";
+    char loadparams[] = "(Ljava/lang/String;[Ljava/lang/String;)Z";
 
     jsvc_xlate_to_ascii(args->clas);
-    className=(*env)->NewStringUTF(env,args->clas);
+    className = (*env)->NewStringUTF(env, args->clas);
     jsvc_xlate_from_ascii(args->clas);
-    if (className==NULL) {
+    if (className == NULL) {
         log_error("Cannot create string for class name");
-        return(false);
+        return false;
     }
 
     jsvc_xlate_to_ascii(lang);
-    stringClass=(*env)->FindClass(env,lang);
+    stringClass = (*env)->FindClass(env, lang);
     jsvc_xlate_from_ascii(lang);
-    if (stringClass==NULL) {
+    if (stringClass == NULL) {
         log_error("Cannot find class java/lang/String");
-        return(false);
+        return false;
     }
 
-    stringArray=(*env)->NewObjectArray(env,args->anum,stringClass,NULL);
-    if (stringArray==NULL) {
+    stringArray = (*env)->NewObjectArray(env, args->anum, stringClass, NULL);
+    if (stringArray == NULL) {
         log_error("Cannot create arguments array");
-        return(false);
+        return false;
     }
 
-    for (x=0; x<args->anum; x++) {
+    for (x = 0; x < args->anum; x++) {
         jsvc_xlate_to_ascii(args->args[x]);
-        currentArgument=(*env)->NewStringUTF(env,args->args[x]);
+        currentArgument = (*env)->NewStringUTF(env, args->args[x]);
         jsvc_xlate_from_ascii(args->args[x]);
-        if (currentArgument==NULL) {
-            log_error("Cannot create string for argument %s",args->args[x]);
-            return(false);
+        if (currentArgument == NULL) {
+            log_error("Cannot create string for argument %s", args->args[x]);
+            return false;
         }
-        (*env)->SetObjectArrayElement(env,stringArray,x,currentArgument);
+        (*env)->SetObjectArrayElement(env, stringArray, x, currentArgument);
     }
 
     jsvc_xlate_to_ascii(load);
     jsvc_xlate_to_ascii(loadparams);
-    method=(*env)->GetStaticMethodID(env,cls,load,loadparams);
-    if (method==NULL) {
+    method = (*env)->GetStaticMethodID(env, cls, load, loadparams);
+    if (method == NULL) {
         log_error("Cannot find Daemon Loader \"load\" entry point");
-        return(false);
+        return false;
     }
 
     log_debug("Daemon loading...");
-    ret=(*env)->CallStaticBooleanMethod(env,cls,method,className,stringArray);
-    if (ret==FALSE) {
+    ret = (*env)->CallStaticBooleanMethod(env, cls, method, className,
+                                          stringArray);
+    if (ret == FALSE) {
         log_error("Cannot load daemon");
-        return(false);
+        return false;
     }
 
     log_debug("Daemon loaded successfully");
-    return(true);
+    return true;
 }
 
 /* Call the start method in our daemon loader */
-bool java_start(void) {
+bool java_start(void)
+{
     jmethodID method;
     jboolean ret;
-    char start[]="start";
-    char startparams[]="()Z";
+    char start[] = "start";
+    char startparams[] = "()Z";
 
     jsvc_xlate_to_ascii(start);
-    jsvc_xlate_to_ascii(startparams); 
-    method=(*env)->GetStaticMethodID(env,cls,start,startparams);
-    if (method==NULL) {
+    jsvc_xlate_to_ascii(startparams);
+    method = (*env)->GetStaticMethodID(env, cls, start, startparams);
+    if (method == NULL) {
         log_error("Cannot find Daemon Loader \"start\" entry point");
-        return(false);
+        return false;
     }
 
-    ret=(*env)->CallStaticBooleanMethod(env,cls,method);
-    if (ret==FALSE) {
+    ret = (*env)->CallStaticBooleanMethod(env, cls, method);
+    if (ret == FALSE) {
         log_error("Cannot start daemon");
-        return(false);
+        return false;
     }
 
     log_debug("Daemon started successfully");
-    return(true);
+    return true;
 }
 
 /*
  * call the java sleep to prevent problems with threads
  */
-void java_sleep(int wait) {
+void java_sleep(int wait)
+{
     jclass clsThread;
     jmethodID method;
-    char jsleep[]="sleep";
-    char jsleepparams[]="(J)V";
-    char jthread[]="java/lang/Thread"; 
- 
+    char jsleep[] = "sleep";
+    char jsleepparams[] = "(J)V";
+    char jthread[] = "java/lang/Thread";
+
     jsvc_xlate_to_ascii(jsleep);
     jsvc_xlate_to_ascii(jsleepparams);
     jsvc_xlate_to_ascii(jthread);
 
-    clsThread = (*env)->FindClass(env,jthread);
-    if (clsThread==NULL) {
+    clsThread = (*env)->FindClass(env, jthread);
+    if (clsThread == NULL) {
         log_error("Cannot find java/lang/Thread class");
         return;
     }
-    method=(*env)->GetStaticMethodID(env,clsThread,jsleep,jsleepparams);
-    if (method==NULL) {
+    method = (*env)->GetStaticMethodID(env, clsThread, jsleep, jsleepparams);
+    if (method == NULL) {
         log_error("Cannot found the sleep entry point");
         return;
     }
- 
-    (*env)->CallStaticVoidMethod(env,clsThread,method,(jlong)wait*1000);
+
+    (*env)->CallStaticVoidMethod(env, clsThread, method, (jlong) wait * 1000);
 }
 
 /* Call the stop method in our daemon loader */
-bool java_stop(void) {
+bool java_stop(void)
+{
     jmethodID method;
     jboolean ret;
-    char stop[]="stop";
-    char stopparams[]="()Z";
+    char stop[] = "stop";
+    char stopparams[] = "()Z";
 
     jsvc_xlate_to_ascii(stop);
-    jsvc_xlate_to_ascii(stopparams); 
-    method=(*env)->GetStaticMethodID(env,cls,stop,stopparams);
-    if (method==NULL) {
+    jsvc_xlate_to_ascii(stopparams);
+    method = (*env)->GetStaticMethodID(env, cls, stop, stopparams);
+    if (method == NULL) {
         log_error("Cannot found Daemon Loader \"stop\" entry point");
-        return(false);
+        return false;
     }
 
-    ret=(*env)->CallStaticBooleanMethod(env,cls,method);
-    if (ret==FALSE) {
+    ret = (*env)->CallStaticBooleanMethod(env, cls, method);
+    if (ret == FALSE) {
         log_error("Cannot stop daemon");
-        return(false);
+        return false;
     }
 
     log_debug("Daemon stopped successfully");
-    return(true);
+    return true;
 }
 
 /* Call the version method in our daemon loader */
-bool java_version(void) {
+bool java_version(void)
+{
     jmethodID method;
-    char version[]="version";
-    char versionparams[]="()Z";
+    char version[] = "version";
+    char versionparams[] = "()Z";
 
     jsvc_xlate_to_ascii(version);
-    jsvc_xlate_to_ascii(versionparams); 
-    method=(*env)->GetStaticMethodID(env,cls,version,versionparams);
-    if (method==NULL) {
+    jsvc_xlate_to_ascii(versionparams);
+    method = (*env)->GetStaticMethodID(env, cls, version, versionparams);
+    if (method == NULL) {
         log_error("Cannot found Daemon Loader \"version\" entry point");
-        return(false);
+        return false;
     }
 
-    (*env)->CallStaticVoidMethod(env,cls,method);
-    return(true);
+    (*env)->CallStaticVoidMethod(env, cls, method);
+    return true;
 }
 
 /* Call the check method in our DaemonLoader class */
-bool java_check(arg_data *args) {
-    jstring className=NULL;
-    jmethodID method=NULL;
-    jboolean ret=FALSE;
-    char check[]="check";
-    char checkparams[]="(Ljava/lang/String;)Z";
+bool java_check(arg_data *args)
+{
+    jstring className = NULL;
+    jmethodID method = NULL;
+    jboolean ret = FALSE;
+    char check[] = "check";
+    char checkparams[] = "(Ljava/lang/String;)Z";
 
     log_debug("Checking daemon");
 
     jsvc_xlate_to_ascii(args->clas);
-    className=(*env)->NewStringUTF(env,args->clas);
+    className = (*env)->NewStringUTF(env, args->clas);
     jsvc_xlate_from_ascii(args->clas);
-    if (className==NULL) {
+    if (className == NULL) {
         log_error("Cannot create string for class name");
-        return(false);
+        return false;
     }
 
     jsvc_xlate_to_ascii(check);
     jsvc_xlate_to_ascii(checkparams);
-    method=(*env)->GetStaticMethodID(env,cls,check,checkparams);
-    if (method==NULL) {
+    method = (*env)->GetStaticMethodID(env, cls, check, checkparams);
+    if (method == NULL) {
         log_error("Cannot found Daemon Loader \"check\" entry point");
-        return(false);
+        return false;
     }
 
-    ret=(*env)->CallStaticBooleanMethod(env,cls,method,className);
-    if (ret==FALSE) {
-        log_error("An error was detected checking the %s daemon",args->clas);
-        return(false);
+    ret = (*env)->CallStaticBooleanMethod(env, cls, method, className);
+    if (ret == FALSE) {
+        log_error("An error was detected checking the %s daemon", args->clas);
+        return false;
     }
 
     log_debug("Daemon checked successfully");
-    return(true);
+    return true;
 }
 
 /* Call the destroy method in our daemon loader */
-bool java_destroy(void) {
+bool java_destroy(void)
+{
     jmethodID method;
     jboolean ret;
-    char destroy[]="destroy";
-    char destroyparams[]="()Z";
+    char destroy[] = "destroy";
+    char destroyparams[] = "()Z";
 
     jsvc_xlate_to_ascii(destroy);
-    jsvc_xlate_to_ascii(destroyparams); 
-    method=(*env)->GetStaticMethodID(env,cls,destroy,destroyparams);
-    if (method==NULL) {
+    jsvc_xlate_to_ascii(destroyparams);
+    method = (*env)->GetStaticMethodID(env, cls, destroy, destroyparams);
+    if (method == NULL) {
         log_error("Cannot found Daemon Loader \"destroy\" entry point");
-        return(false);
+        return false;
     }
 
-    ret=(*env)->CallStaticBooleanMethod(env,cls,method);
-    if (ret==FALSE) {
+    ret = (*env)->CallStaticBooleanMethod(env, cls, method);
+    if (ret == FALSE) {
         log_error("Cannot destroy daemon");
-        return(false);
+        return false;
     }
 
     log_debug("Daemon destroyed successfully");
-    return(true);
+    return true;
 }
+
diff --git a/src/native/unix/native/java.h b/src/native/unix/native/java.h
index c2bcb73..c77780b 100644
--- a/src/native/unix/native/java.h
+++ b/src/native/unix/native/java.h
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: java.h 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: java.h 921765 2010-03-11 10:03:32Z mturk $ */
 #ifndef __JSVC_JAVA_H__
 #define __JSVC_JAVA_H__
 
diff --git a/src/native/unix/native/java.o b/src/native/unix/native/java.o
deleted file mode 100644
index 096d3fe..0000000
Binary files a/src/native/unix/native/java.o and /dev/null differ
diff --git a/src/native/unix/native/jsvc-unix.c b/src/native/unix/native/jsvc-unix.c
index 6f39365..efd6648 100644
--- a/src/native/unix/native/jsvc-unix.c
+++ b/src/native/unix/native/jsvc-unix.c
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: jsvc-unix.c 909380 2010-02-12 12:21:15Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: jsvc-unix.c 980512 2010-07-29 17:10:17Z mturk $ */
 #include "jsvc.h"
 
 #include <signal.h>
@@ -29,27 +29,30 @@
 #ifdef OS_LINUX
 #include <sys/prctl.h>
 #include <sys/syscall.h>
-#define _LINUX_FS_H 
+#define _LINUX_FS_H
 #include <linux/capability.h>
+#ifdef HAVE_LIBCAP
+#include <sys/capability.h>
+#endif
 #endif
 #include <time.h>
 
 #ifdef OS_CYGWIN
 #include <sys/fcntl.h>
-#define F_ULOCK 0       /* Unlock a previously locked region */
-#define F_LOCK  1       /* Lock a region for exclusive use */
+#define F_ULOCK 0               /* Unlock a previously locked region */
+#define F_LOCK  1               /* Lock a region for exclusive use */
 #endif
 
 extern char **environ;
 
-static mode_t envmask; /* mask to create the files */
+static mode_t envmask;          /* mask to create the files */
 
-pid_t controlled=0; /* the child process pid */
-static bool stopping=false;
-static bool doreload=false;
-static void (*handler_int)(int)=NULL;
-static void (*handler_hup)(int)=NULL;
-static void (*handler_trm)(int)=NULL;
+pid_t controlled = 0;           /* the child process pid */
+static bool stopping = false;
+static bool doreload = false;
+static void (*handler_int) (int) = NULL;
+static void (*handler_hup) (int) = NULL;
+static void (*handler_trm) (int) = NULL;
 
 #ifdef OS_CYGWIN
 /*
@@ -78,307 +81,381 @@ static int lockf(int fildes, int function, off_t size)
 
 #endif
 
-static void handler(int sig) {
+static void handler(int sig)
+{
     switch (sig) {
-        case SIGTERM: {
+        case SIGTERM:
             log_debug("Caught SIGTERM: Scheduling a shutdown");
-            if (stopping==true) {
+            if (stopping == true) {
                 log_error("Shutdown or reload already scheduled");
-            } else {
-                stopping=true;
             }
-            break;
-        }
-
-        case SIGINT: {
+            else {
+                stopping = true;
+            }
+        break;
+        case SIGINT:
             log_debug("Caught SIGINT: Scheduling a shutdown");
-            if (stopping==true) {
+            if (stopping == true) {
                 log_error("Shutdown or reload already scheduled");
-            } else {
-                stopping=true;
             }
-            break;
-        }
-
-        case SIGHUP: {
+            else {
+                stopping = true;
+            }
+        break;
+        case SIGHUP:
             log_debug("Caught SIGHUP: Scheduling a reload");
-            if (stopping==true) {
+            if (stopping == true) {
                 log_error("Shutdown or reload already scheduled");
-            } else {
-                stopping=true;
-                doreload=true;
             }
-            break;
-        }
-
-        default: {
-            log_debug("Caught unknown signal %d",sig);
-            break;
-        }
+            else {
+                stopping = true;
+                doreload = true;
+            }
+        break;
+        default:
+            log_debug("Caught unknown signal %d", sig);
+        break;
     }
 }
 
 /* user and group */
 static int set_user_group(char *user, int uid, int gid)
 {
-    if (user!=NULL) {
-        if (setgid(gid)!=0) {
-            log_error("Cannot set group id for user '%s'",user);
-            return(-1);
+    if (user != NULL) {
+        if (setgid(gid) != 0) {
+            log_error("Cannot set group id for user '%s'", user);
+            return -1;
         }
-        if (initgroups(user, gid)!=0) {
-            if (getuid()!= uid) {
-                log_error("Cannot set supplement group list for user '%s'",user);
-                return(-1);
-            } else
-                log_debug("Cannot set supplement group list for user '%s'",user);
+        if (initgroups(user, gid) != 0) {
+            if (getuid() != uid) {
+                log_error("Cannot set supplement group list for user '%s'",
+                          user);
+                return -1;
+            }
+            else
+                log_debug("Cannot set supplement group list for user '%s'",
+                          user);
         }
         if (getuid() == uid) {
-            log_debug("No need to change user to '%s'!",user);
-             return(0);
+            log_debug("No need to change user to '%s'!", user);
+            return 0;
         }
-        if (setuid(uid)!=0) {
-            log_error("Cannot set user id for user '%s'",user);
-            return(-1);
+        if (setuid(uid) != 0) {
+            log_error("Cannot set user id for user '%s'", user);
+            return -1;
         }
-        log_debug("user changed to '%s'",user);
+        log_debug("user changed to '%s'", user);
     }
-    return(0);
+    return 0;
 }
+
 /* Set linux capability, user and group */
 #ifdef OS_LINUX
+#ifdef HAVE_LIBCAP
+static cap_value_t caps_std[] = {
+    CAP_NET_BIND_SERVICE,
+    CAP_SETUID,
+    CAP_SETGID,
+    CAP_DAC_READ_SEARCH,
+    CAP_DAC_OVERRIDE
+};
+
+static cap_value_t caps_min[] = {
+    CAP_NET_BIND_SERVICE,
+    CAP_DAC_READ_SEARCH,
+    CAP_DAC_OVERRIDE
+};
+
+#define CAPS     1
+#define CAPSMIN  2
+
+static int set_caps(int cap_type)
+{
+    cap_t c;
+    int ncap;
+    cap_value_t *caps;
+
+    if (cap_type == CAPS) {
+        ncap = sizeof(caps_std)/sizeof(cap_value_t);
+        caps = caps_std;
+    }
+    else {
+        ncap = sizeof(caps_min)/sizeof(cap_value_t);
+        caps = caps_min;
+    }
+    c = cap_init();
+    cap_clear(c);
+    cap_set_flag(c, CAP_EFFECTIVE,   ncap, caps, CAP_SET);
+    cap_set_flag(c, CAP_INHERITABLE, ncap, caps, CAP_SET);
+    cap_set_flag(c, CAP_PERMITTED,   ncap, caps, CAP_SET);
+    if (cap_set_proc(c) != 0) {
+        log_error("failed setting %s capabilities.",
+                  cap_type == CAPS ? "default" : "min");
+        return -1;
+    }
+    cap_free(c);
+    if (cap_type == CAPS)
+        log_debug("increased capability set.");
+    else
+        log_debug("decreased capability set to min required.");
+    return 0;
+}
+
+#else /* !HAVE_LIBCAP */
 /* CAPSALL is to allow to read/write at any location */
-#define CAPSALL (1 << CAP_NET_BIND_SERVICE)+ \
-                (1 << CAP_SETUID)+ \
-                (1 << CAP_SETGID)+ \
-                (1 << CAP_DAC_READ_SEARCH)+ \
+#define CAPSALL (1 << CAP_NET_BIND_SERVICE) +   \
+                (1 << CAP_SETUID) +             \
+                (1 << CAP_SETGID) +             \
+                (1 << CAP_DAC_READ_SEARCH) +    \
                 (1 << CAP_DAC_OVERRIDE)
-#define CAPSMAX (1 << CAP_NET_BIND_SERVICE)+ \
-                (1 << CAP_DAC_READ_SEARCH)+ \
+
+#define CAPSMAX (1 << CAP_NET_BIND_SERVICE) +   \
+                (1 << CAP_DAC_READ_SEARCH) +    \
                 (1 << CAP_DAC_OVERRIDE)
+
 /* That a more reasonable configuration */
-#define CAPS    (1 << CAP_NET_BIND_SERVICE)+ \
-                (1 << CAP_DAC_READ_SEARCH)+ \
-                (1 << CAP_SETUID)+ \
+#define CAPS    (1 << CAP_NET_BIND_SERVICE) +   \
+                (1 << CAP_DAC_READ_SEARCH) +    \
+                (1 << CAP_SETUID) +             \
                 (1 << CAP_SETGID)
+
 /* probably the only one Java could use */
-#define CAPSMIN (1 << CAP_NET_BIND_SERVICE)+ \
+#define CAPSMIN (1 << CAP_NET_BIND_SERVICE) +   \
                 (1 << CAP_DAC_READ_SEARCH)
 
+#define LEGACY_CAP_VERSION  0x19980330
 static int set_caps(int caps)
 {
     struct __user_cap_header_struct caphead;
-    struct __user_cap_data_struct cap;
- 
+    struct __user_cap_data_struct   cap;
+
     memset(&caphead, 0, sizeof caphead);
-    caphead.version = _LINUX_CAPABILITY_VERSION;
+    caphead.version = LEGACY_CAP_VERSION;
     caphead.pid = 0;
     memset(&cap, 0, sizeof cap);
     cap.effective = caps;
     cap.permitted = caps;
     cap.inheritable = caps;
     if (syscall(__NR_capset, &caphead, &cap) < 0) {
-        log_error("syscall failed in set_caps");
-        return(-1);
+        log_error("set_caps: failed to set capabilities");
+        log_error("check that your kernel supports capabilities");
+        return -1;
     }
-    return(0);
+    return 0;
 }
+#endif
+
 static int linuxset_user_group(char *user, int uid, int gid)
 {
     int caps_set = 0;
     /* set capabilities enough for binding port 80 setuid/getuid */
     if (getuid() == 0) {
-        if (set_caps(CAPS)!=0) {
-            if (getuid()!= uid) {
+        if (set_caps(CAPS) != 0) {
+            if (getuid() != uid) {
                 log_error("set_caps(CAPS) failed");
-                return(-1);
+                return -1;
             }
             log_debug("set_caps(CAPS) failed");
         }
-        /* make sure they are kept after setuid */ 
-        if (prctl(PR_SET_KEEPCAPS,1,0,0,0) < 0) {
+        /* make sure they are kept after setuid */
+        if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) {
             log_error("prctl failed in linuxset_user_group");
-            return(-1);
+            return -1;
         }
         caps_set = 1;
     }
 
     /* set setuid/getuid */
-    if (set_user_group(user,uid,gid)!=0) {
+    if (set_user_group(user, uid, gid) != 0) {
         log_error("set_user_group failed in linuxset_user_group");
-        return(-1);
+        return -1;
     }
 
     if (caps_set) {
         /* set capability to binding port 80 read conf */
-        if (set_caps(CAPSMIN)!=0) {
-            if (getuid()!= uid) {
+        if (set_caps(CAPSMIN) != 0) {
+            if (getuid() != uid) {
                 log_error("set_caps(CAPSMIN) failed");
-                return(-1);
+                return -1;
             }
             log_debug("set_caps(CAPSMIN) failed");
         }
     }
 
-    return(0);
+    return 0;
 }
 #endif
 
 
-static bool checkuser(char *user, uid_t *uid, gid_t *gid) {
-    struct passwd *pwds=NULL;
-    int status=0;
-    pid_t pid=0;
+static bool checkuser(char *user, uid_t * uid, gid_t * gid)
+{
+    struct passwd *pwds = NULL;
+    int status = 0;
+    pid_t pid  = 0;
 
     /* Do we actually _have_ to switch user? */
-    if (user==NULL) return(true);
+    if (user == NULL)
+        return true;
 
-    pwds=getpwnam(user);
-    if (pwds==NULL) {
-        log_error("Invalid user name '%s' specified",user);
-        return(false);
+    pwds = getpwnam(user);
+    if (pwds == NULL) {
+        log_error("Invalid user name '%s' specified", user);
+        return false;
     }
 
-    *uid=pwds->pw_uid;
-    *gid=pwds->pw_gid;
+    *uid = pwds->pw_uid;
+    *gid = pwds->pw_gid;
 
     /* Validate the user name in another process */
-    pid=fork();
-    if (pid==-1) {
+    pid = fork();
+    if (pid == -1) {
         log_error("Cannot validate user name");
-        return(false);
+        return false;
     }
 
     /* If we're in the child process, let's validate */
-    if (pid==0) {
-        if (set_user_group(user,*uid,*gid)!=0)
+    if (pid == 0) {
+        if (set_user_group(user, *uid, *gid) != 0)
             exit(1);
         /* If we got here we switched user/group */
         exit(0);
     }
 
-    while (waitpid(pid,&status,0)!=pid);
+    while (waitpid(pid, &status, 0) != pid) {
+        /* Just wait */
+    }
 
     /* The child must have exited cleanly */
     if (WIFEXITED(status)) {
-        status=WEXITSTATUS(status);
+        status = WEXITSTATUS(status);
 
         /* If the child got out with 0 the user is ok */
-        if (status==0) {
-            log_debug("User '%s' validated",user);
-            return(true);
+        if (status == 0) {
+            log_debug("User '%s' validated", user);
+            return true;
         }
     }
 
-    log_error("Error validating user '%s'",user);
-    return(false);
+    log_error("Error validating user '%s'", user);
+    return false;
 }
 
 #ifdef OS_CYGWIN
-static void cygwincontroller(void) {
+static void cygwincontroller(void)
+{
     raise(SIGTERM);
 }
 #endif
-static void controller(int sig) {
+static void controller(int sig)
+{
     switch (sig) {
         case SIGTERM:
         case SIGINT:
         case SIGHUP:
-            log_debug("Forwarding signal %d to process %d",sig,controlled);
-            kill(controlled,sig);
-            signal(sig,controller);
-            break;
+            log_debug("Forwarding signal %d to process %d", sig, controlled);
+            kill(controlled, sig);
+            signal(sig, controller);
+        break;
         default:
-            log_debug("Caught unknown signal %d",sig);
-            break;
+            log_debug("Caught unknown signal %d", sig);
+        break;
     }
 }
+
 /*
  * Return the address of the current signal handler and set the new one.
  */
-static void * signal_set(int sig, void * newHandler) {
+static void *signal_set(int sig, void *newHandler)
+{
     void *hand;
 
-    hand=signal(sig,newHandler);
+    hand = signal(sig, newHandler);
 #ifdef SIG_ERR
-    if (hand==SIG_ERR)
-        hand=NULL;
+    if (hand == SIG_ERR)
+        hand = NULL;
 #endif
-    if (hand==handler || hand==controller)
-        hand=NULL;
-    return(hand);
+    if (hand == handler || hand == controller)
+        hand = NULL;
+    return (hand);
 }
 
 /*
  * Check pid and if still running
  */
 
-static int check_pid(arg_data *args) {
+static int check_pid(arg_data *args)
+{
     int fd;
     FILE *pidf;
     char buff[80];
-    pid_t pidn=getpid();
-    int i,pid;
-
-    fd = open(args->pidf,O_RDWR|O_CREAT,S_IRUSR|S_IWUSR);
-    if (fd<0) {
-        log_error("Cannot open PID file %s, PID is %d",args->pidf,pidn);
-        return(-1);
-    } else {
-        lockf(fd,F_LOCK,0);
-        i = read(fd,buff,sizeof(buff));
-        if (i>0) {
+    pid_t pidn = getpid();
+    int i, pid;
+
+    fd = open(args->pidf, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+    if (fd < 0) {
+        log_error("Cannot open PID file %s, PID is %d", args->pidf, pidn);
+        return -1;
+    }
+    else {
+        lockf(fd, F_LOCK, 0);
+        i = read(fd, buff, sizeof(buff));
+        if (i > 0) {
             buff[i] = '\0';
             pid = atoi(buff);
-            if (kill(pid, 0)==0) {
-                log_error("Still running according to PID file %s, PID is %d",args->pidf,pid);
-                lockf(fd,F_ULOCK,0);
+            if (kill(pid, 0) == 0) {
+                log_error("Still running according to PID file %s, PID is %d",
+                          args->pidf, pid);
+                lockf(fd, F_ULOCK, 0);
                 close(fd);
-                return(122);
+                return 122;
             }
         }
 
         /* skip writing the pid file if version or check */
-        if (args->vers!=true && args->chck!=true) {
+        if (args->vers != true && args->chck != true) {
             lseek(fd, SEEK_SET, 0);
-            pidf = fdopen(fd,"r+");
-            fprintf(pidf,"%d\n",(int)getpid());
+            pidf = fdopen(fd, "r+");
+            fprintf(pidf, "%d\n", (int)getpid());
             fflush(pidf);
-            lockf(fd,F_ULOCK,0);
+            lockf(fd, F_ULOCK, 0);
             fclose(pidf);
             close(fd);
-        } else {
-            lockf(fd,F_ULOCK,0);
+        }
+        else {
+            lockf(fd, F_ULOCK, 0);
             close(fd);
         }
     }
-    return(0);
+    return 0;
 }
 
 /*
  * read the pid from the pidfile
  */
-static int get_pidf(arg_data *args) {
+static int get_pidf(arg_data *args)
+{
     int fd;
     int i;
     char buff[80];
 
     fd = open(args->pidf, O_RDONLY, 0);
     log_debug("get_pidf: %d in %s", fd, args->pidf);
-    if (fd<0)
-        return(-1); /* something has gone wrong the JVM has stopped */
-    lockf(fd,F_LOCK,0);
-    i = read(fd,buff,sizeof(buff));
-    lockf(fd,F_ULOCK,0);
+    if (fd < 0) {
+        /* something has gone wrong the JVM has stopped */
+        return -1;
+    }
+    lockf(fd, F_LOCK, 0);
+    i = read(fd, buff, sizeof(buff));
+    lockf(fd, F_ULOCK, 0);
     close(fd);
-    if (i>0) {
+    if (i > 0) {
         buff[i] = '\0';
         i = atoi(buff);
         log_debug("get_pidf: pid %d", i);
-        if (kill(i, 0)==0)
-            return(i);
+        if (kill(i, 0) == 0)
+            return i;
     }
-    return(-1);
+    return -1;
 }
 
 /*
@@ -389,34 +466,41 @@ static int get_pidf(arg_data *args) {
  * 1 - to be a daemon before the setsid(), the child is the controler process.
  * 2 - to start the JVM in the child process. (whose pid is stored in pidfile).
  */
-static int check_tmp_file(arg_data *args) {
+static int check_tmp_file(arg_data *args)
+{
     int pid;
     char buff[80];
     int fd;
+
     pid = get_pidf(args);
-    if (pid<0)
-        return(-1);
-    sprintf(buff,"/tmp/%d.jsvc_up", pid);
+    if (pid < 0)
+        return -1;
+    sprintf(buff, "/tmp/%d.jsvc_up", pid);
     log_debug("check_tmp_file: %s", buff);
     fd = open(buff, O_RDONLY);
-    if (fd<0)
-        return(-1);
+    if (fd == -1)
+        return -1;
     close(fd);
-    return(0);
+    return 0;
 }
-static void create_tmp_file(arg_data *args) {
+
+static void create_tmp_file(arg_data *args)
+{
     char buff[80];
     int fd;
-    sprintf(buff,"/tmp/%d.jsvc_up", (int) getpid());
+
+    sprintf(buff, "/tmp/%d.jsvc_up", (int)getpid());
     log_debug("create_tmp_file: %s", buff);
-    fd = open(buff, O_RDWR|O_CREAT,S_IRUSR|S_IWUSR);
-    if (fd<0)
-        return;
-    close(fd);
+    fd = open(buff, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+    if (fd != -1)
+        close(fd);
 }
-static void remove_tmp_file(arg_data *args) {
+
+static void remove_tmp_file(arg_data *args)
+{
     char buff[80];
-    sprintf(buff,"/tmp/%d.jsvc_up", (int) getpid());
+
+    sprintf(buff, "/tmp/%d.jsvc_up", (int)getpid());
     log_debug("remove_tmp_file: %s", buff);
     unlink(buff);
 }
@@ -425,160 +509,187 @@ static void remove_tmp_file(arg_data *args) {
  * wait until jsvc create the I am ready file
  * pid is the controller and args->pidf the JVM itself.
  */
-static int wait_child(arg_data *args, int pid) {
-    int count=10;
-    bool havejvm=false;
+static int wait_child(arg_data *args, int pid)
+{
+    int count = 10;
+    bool havejvm = false;
     int fd;
     char buff[80];
     int i, status, waittime;
+
     log_debug("wait_child %d", pid);
-    waittime = args->wait/10;
-    if (waittime>10) {
+    waittime = args->wait / 10;
+    if (waittime > 10) {
         count = waittime;
         waittime = 10;
     }
-    while (count>0) {
+    while (count > 0) {
         sleep(1);
         /* check if the controler is still running */
-        if (waitpid(pid,&status,WNOHANG)==pid) {
+        if (waitpid(pid, &status, WNOHANG) == pid) {
             if (WIFEXITED(status))
-                return(WEXITSTATUS(status));
+                return (WEXITSTATUS(status));
             else
-                return(1);
+                return 1;
         }
 
         /* check if the pid file process exists */
         fd = open(args->pidf, O_RDONLY);
-        if (fd<0 && havejvm)
-            return(1); /* something has gone wrong the JVM has stopped */
-        lockf(fd,F_LOCK,0);
-        i = read(fd,buff,sizeof(buff));
-        lockf(fd,F_ULOCK,0);
+        if (fd < 0 && havejvm) {
+            /* something has gone wrong the JVM has stopped */
+            return 1;
+        }
+        lockf(fd, F_LOCK, 0);
+        i = read(fd, buff, sizeof(buff));
+        lockf(fd, F_ULOCK, 0);
         close(fd);
-        if (i>0) {
+        if (i > 0) {
             buff[i] = '\0';
             i = atoi(buff);
-            if (kill(i, 0)==0) {
+            if (kill(i, 0) == 0) {
                 /* the JVM process has started */
-                havejvm=true;
-                if (check_tmp_file(args)==0) {
+                havejvm = true;
+                if (check_tmp_file(args) == 0) {
                     /* the JVM is started */
-                    if (waitpid(pid,&status,WNOHANG)==pid) {
+                    if (waitpid(pid, &status, WNOHANG) == pid) {
                         if (WIFEXITED(status))
-                            return(WEXITSTATUS(status));
+                            return (WEXITSTATUS(status));
                         else
-                            return(1);
+                            return 1;
                     }
-                    return(0); /* ready JVM started */
+                    return 0; /* ready JVM started */
                 }
             }
         }
         sleep(waittime);
         count--;
     }
-    return(1); /* It takes more than the wait time to start, something must be wrong */
+    /* It takes more than the wait time to start,
+     * something must be wrong
+     */
+    return 1;
 }
 
 /*
  * stop the running jsvc
  */
-static int stop_child(arg_data *args) {
-    int pid=get_pidf(args);
-    int count=10;
-    if (pid>0) {
-        /* kill the process and wait until the pidfile has been removed by the controler */
-        kill(pid,SIGTERM);
-        while (count>0) {
+static int stop_child(arg_data *args)
+{
+    int pid = get_pidf(args);
+    int count = 10;
+
+    if (pid > 0) {
+        /* kill the process and wait until the pidfile has been
+         * removed by the controler
+         */
+        kill(pid, SIGTERM);
+        while (count > 0) {
             sleep(6);
-            pid=get_pidf(args);
-            if (pid<=0)
-                return(0); /* JVM has stopped */
+            pid = get_pidf(args);
+            if (pid <= 0) {
+                /* JVM has stopped */
+                return 0;
+            }
             count--;
         }
     }
-    return(-1);
+    return -1;
 }
 
 /*
  * child process logic.
  */
 
-static int child(arg_data *args, home_data *data, uid_t uid, gid_t gid) {
-    int ret=0;
+static int child(arg_data *args, home_data *data, uid_t uid, gid_t gid)
+{
+    int ret = 0;
 
     /* check the pid file */
-    ret = check_pid(args); 
-    if (args->vers!=true && args->chck!=true) {
-        if (ret==122)
-            return(ret);
-        if (ret<0)
-            return(ret);
+    ret = check_pid(args);
+    if (args->vers != true && args->chck != true) {
+        if (ret == 122)
+            return ret;
+        if (ret < 0)
+            return ret;
     }
 
     /* create a new process group to prevent kill 0 killing the monitor process */
 #if defined(OS_FREEBSD) || defined(OS_DARWIN)
-    setpgid(0,0);
+    setpgid(0, 0);
 #else
     setpgrp();
 #endif
 
 #ifdef OS_LINUX
     /* setuid()/setgid() only apply the current thread so we must do it now */
-    if (linuxset_user_group(args->user,uid,gid)!=0)
-        return(4);
+    if (linuxset_user_group(args->user, uid, gid) != 0)
+        return 4;
 #endif
     /* Initialize the Java VM */
-    if (java_init(args,data)!=true) {
+    if (java_init(args, data) != true) {
         log_debug("java_init failed");
-        return(1);
-    } else
+        return 1;
+    }
+    else
         log_debug("java_init done");
 
     /* Check wether we need to dump the VM version */
-    if (args->vers==true) {
-        if (java_version()!=true) {
-            return(-1);
-        } else return(0);
+    if (args->vers == true) {
+        if (java_version() != true) {
+            return -1;
+        }
+        else
+            return 0;
+    }
+    /* Check wether we need to dump the VM version */
+    else if (args->vershow == true) {
+        if (java_version() != true) {
+            return 7;
+        }
     }
 
     /* Do we have to do a "check-only" initialization? */
-    if (args->chck==true) {
-        if (java_check(args)!=true) return(2);
-        printf("Service \"%s\" checked successfully\n",args->clas);
-        return(0);
+    if (args->chck == true) {
+        if (java_check(args) != true)
+            return 2;
+        printf("Service \"%s\" checked successfully\n", args->clas);
+        return 0;
     }
 
     /* Load the service */
-    if (java_load(args)!=true) {
+    if (java_load(args) != true) {
         log_debug("java_load failed");
-        return(3);
-    } else
+        return 3;
+    }
+    else
         log_debug("java_load done");
 
     /* Downgrade user */
 #ifdef OS_LINUX
-    if (set_caps(0)!=0) {
+    if (set_caps(0) != 0) {
         log_debug("set_caps (0) failed");
-        return(4);
+        return 4;
     }
 #else
-    if (set_user_group(args->user,uid,gid)!=0)
-        return(4);
+    if (set_user_group(args->user, uid, gid) != 0)
+        return 4;
 #endif
 
     /* Start the service */
     umask(envmask);
-    if (java_start()!=true) {
+    if (java_start() != true) {
         log_debug("java_start failed");
-        return(5);
-    } else
+        return 5;
+    }
+    else
         log_debug("java_start done");
 
     /* Install signal handlers */
-    handler_hup=signal_set(SIGHUP,handler);
-    handler_trm=signal_set(SIGTERM,handler);
-    handler_int=signal_set(SIGINT,handler);
+    handler_hup = signal_set(SIGHUP, handler);
+    handler_trm = signal_set(SIGTERM, handler);
+    handler_int = signal_set(SIGINT, handler);
     controlled = getpid();
+
     log_debug("Waiting for a signal to be delivered");
     create_tmp_file(args);
     while (!stopping) {
@@ -586,25 +697,30 @@ static int child(arg_data *args, home_data *data, uid_t uid, gid_t gid) {
         java_sleep(60);
         /* pause(); */
 #else
-        sleep(60); /* pause() not threadsafe */
+        /* pause() is not threadsafe */
+        sleep(60);
 #endif
     }
     remove_tmp_file(args);
     log_debug("Shutdown or reload requested: exiting");
 
     /* Stop the service */
-    if (java_stop()!=true) return(6);
+    if (java_stop() != true)
+        return 6;
 
-    if (doreload==true) ret=123;
-    else ret=0;
+    if (doreload == true)
+        ret = 123;
+    else
+        ret = 0;
 
     /* Destroy the service */
     java_destroy();
 
     /* Destroy the Java VM */
-    if (JVM_destroy(ret)!=true) return(7);
+    if (JVM_destroy(ret) != true)
+        return 7;
 
-    return(ret);
+    return ret;
 }
 
 /*
@@ -612,149 +728,161 @@ static int child(arg_data *args, home_data *data, uid_t uid, gid_t gid) {
  * that is not very good if we are try to trace the output
  * note the code assumes that the errors are configuration errors.
  */
-static FILE *loc_freopen(char *outfile, char *mode, FILE *stream)
+static FILE *loc_freopen(char *outfile, char *mode, FILE * stream)
 {
     FILE *ftest;
-    ftest = fopen(outfile,mode);
+
+    ftest = fopen(outfile, mode);
     if (ftest == NULL) {
-      fprintf(stderr,"Unable to redirect to %s\n", outfile);
-      return(stream);
+        fprintf(stderr, "Unable to redirect to %s\n", outfile);
+        return stream;
     }
     fclose(ftest);
-    return(freopen(outfile,mode,stream));
+    return freopen(outfile, mode, stream);
 }
 
 /**
  *  Redirect stdin, stdout, stderr.
  */
-static void set_output(char *outfile, char *errfile, bool redirectstdin) {
-    if (redirectstdin==true) {
+static void set_output(char *outfile, char *errfile, bool redirectstdin)
+{
+    if (redirectstdin == true) {
         freopen("/dev/null", "r", stdin);
     }
 
-    log_debug("redirecting stdout to %s and stderr to %s",outfile,errfile);
+    log_debug("redirecting stdout to %s and stderr to %s", outfile, errfile);
 
     /* make sure the debug goes out */
-    if (log_debug_flag==true && strcmp(errfile,"/dev/null") == 0)
-      return;
+    if (log_debug_flag == true && strcmp(errfile, "/dev/null") == 0)
+        return;
 
     /* Handle malicious case here */
-    if(strcmp(outfile, "&2") == 0 && strcmp(errfile,"&1") == 0) {
-      outfile="/dev/null";
+    if (strcmp(outfile, "&2") == 0 && strcmp(errfile, "&1") == 0) {
+        outfile = "/dev/null";
     }
-    if(strcmp(outfile, "&2") != 0) {
-      loc_freopen(outfile, "a", stdout);
+    if (strcmp(outfile, "&2") != 0) {
+        loc_freopen(outfile, "a", stdout);
     }
 
-    if(strcmp(errfile,"&1") != 0) {
-      loc_freopen(errfile, "a", stderr);
-    } else {
-      close(2);
-      dup(1);
+    if (strcmp(errfile, "&1") != 0) {
+        loc_freopen(errfile, "a", stderr);
     }
-    if(strcmp(outfile, "&2") == 0) {
-      close(1);
-      dup(2);
+    else {
+        close(2);
+        dup(1);
+    }
+    if (strcmp(outfile, "&2") == 0) {
+        close(1);
+        dup(2);
     }
 }
 
-int main(int argc, char *argv[]) {
-    arg_data *args=NULL;
-    home_data *data=NULL;
-    int status=0;
-    pid_t pid=0;
-    uid_t uid=0;
-    gid_t gid=0;
+int main(int argc, char *argv[])
+{
+    arg_data *args  = NULL;
+    home_data *data = NULL;
+    int status = 0;
+    pid_t pid  = 0;
+    uid_t uid  = 0;
+    gid_t gid  = 0;
     time_t laststart;
 
     /* Parse command line arguments */
-    args=arguments(argc,argv);
-    if (args==NULL) return(1);
+    args = arguments(argc, argv);
+    if (args == NULL)
+        return 1;
 
     /* Stop running jsvc if required */
-    if (args->stop==true)
-        return(stop_child(args));
+    if (args->stop == true)
+        return (stop_child(args));
 
     /* Let's check if we can switch user/group IDs */
-    if (checkuser(args->user, &uid, &gid)==false) return(1);
+    if (checkuser(args->user, &uid, &gid) == false)
+        return 1;
 
     /* Retrieve JAVA_HOME layout */
-    data=home(args->home);
-    if (data==NULL) return(1);
+    data = home(args->home);
+    if (data == NULL)
+        return 1;
 
     /* Check for help */
-    if (args->help==true) {
+    if (args->help == true) {
         help(data);
-        return(0);
+        return 0;
     }
 
 #ifdef OS_LINUX
     /* On some UNIX operating systems, we need to REPLACE this current
        process image with another one (thru execve) to allow the correct
        loading of VMs (notably this is for Linux). Set, replace, and go. */
-    if (strcmp(argv[0],args->procname)!=0) {
-        char *oldpath=getenv("LD_LIBRARY_PATH");
-        char *libf=java_library(args,data);
+    if (strcmp(argv[0], args->procname) != 0) {
+        char *oldpath = getenv("LD_LIBRARY_PATH");
+        char *libf    = java_library(args, data);
         char *filename;
-        char buf[2048];
-        int  ret;
-        char *tmp=NULL;
-        char *p1=NULL;
-        char *p2=NULL;
+        char  buf[2048];
+        int   ret;
+        char *tmp = NULL;
+        char *p1  = NULL;
+        char *p2  = NULL;
 
         /*
          * There is no need to change LD_LIBRARY_PATH
          * if we were not able to find a path to libjvm.so
          * (additionaly a strdup(NULL) cores dump on my machine).
          */
-        if (libf!=NULL) {
-            p1=strdup(libf);
-            tmp=strrchr(p1,'/');
-            if (tmp!=NULL) tmp[0]='\0';
-
-            p2=strdup(p1);
-            tmp=strrchr(p2,'/');
-            if (tmp!=NULL) tmp[0]='\0';
-
-            if (oldpath==NULL) snprintf(buf,2048,"%s:%s",p1,p2);
-            else snprintf(buf,2048,"%s:%s:%s",oldpath,p1,p2);
+        if (libf != NULL) {
+            p1  = strdup(libf);
+            tmp = strrchr(p1, '/');
+            if (tmp != NULL)
+                tmp[0] = '\0';
+
+            p2  = strdup(p1);
+            tmp = strrchr(p2, '/');
+            if (tmp != NULL)
+                tmp[0] = '\0';
+
+            if (oldpath == NULL)
+                snprintf(buf, 2048, "%s:%s", p1, p2);
+            else
+                snprintf(buf, 2048, "%s:%s:%s", oldpath, p1, p2);
 
-            tmp=strdup(buf);
-            setenv("LD_LIBRARY_PATH",tmp,1);
+            tmp = strdup(buf);
+            setenv("LD_LIBRARY_PATH", tmp, 1);
 
-            log_debug("Invoking w/ LD_LIBRARY_PATH=%s",getenv("LD_LIBRARY_PATH"));
+            log_debug("Invoking w/ LD_LIBRARY_PATH=%s",
+                      getenv("LD_LIBRARY_PATH"));
         }
 
         /* execve needs a full path */
-        ret = readlink("/proc/self/exe",buf,sizeof(buf)-1);
-        if (ret<=0)
-          strcpy(buf,argv[0]);
+        ret = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
+        if (ret <= 0)
+            strcpy(buf, argv[0]);
         else
-          buf[ret]='\0';
-  
-        filename=buf;
+            buf[ret] = '\0';
+
+        filename = buf;
 
-        argv[0]=args->procname;
-        execve(filename,argv,environ);
-        log_error("Cannot execute JSVC executor process (%s)",filename);
-        return(1);
+        argv[0] = args->procname;
+        execve(filename, argv, environ);
+        log_error("Cannot execute JSVC executor process (%s)", filename);
+        return 1;
     }
-    log_debug("Running w/ LD_LIBRARY_PATH=%s",getenv("LD_LIBRARY_PATH"));
+    log_debug("Running w/ LD_LIBRARY_PATH=%s", getenv("LD_LIBRARY_PATH"));
 #endif /* ifdef OS_LINUX */
 
     /* If we have to detach, let's do it now */
-    if (args->dtch==true) {
-        pid=fork();
-        if (pid==-1) {
+    if (args->dtch == true) {
+        pid = fork();
+        if (pid == -1) {
             log_error("Cannot detach from parent process");
-            return(1);
+            return 1;
         }
         /* If we're in the parent process */
-        if (pid!=0) {
-            if (args->wait>=10)
-                return(wait_child(args,pid));
+        if (pid != 0) {
+            if (args->wait >= 10)
+                return wait_child(args, pid);
             else
-                return(0);
+                return 0;
         }
 #ifndef NO_SETSID
         setsid();
@@ -766,79 +894,85 @@ int main(int argc, char *argv[]) {
 
     /* We have to fork: this process will become the controller and the other
        will be the child */
-    while ((pid=fork())!=-1) {
+    while ((pid = fork()) != -1) {
         /* We forked (again), if this is the child, we go on normally */
-        if (pid==0) exit(child(args,data,uid,gid));
+        if (pid == 0)
+            exit(child(args, data, uid, gid));
         laststart = time(NULL);
 
         /* We are in the controller, we have to forward all interesting signals
            to the child, and wait for it to die */
-        controlled=pid;
+        controlled = pid;
 #ifdef OS_CYGWIN
-       SetTerm(cygwincontroller);
+        SetTerm(cygwincontroller);
 #endif
-        signal(SIGHUP,controller);
-        signal(SIGTERM,controller);
-        signal(SIGINT,controller);
+        signal(SIGHUP, controller);
+        signal(SIGTERM, controller);
+        signal(SIGINT, controller);
 
-        while (waitpid(pid,&status,0)!=pid);
+        while (waitpid(pid, &status, 0) != pid) {
+            /* Waith for process */
+        }
 
         /* The child must have exited cleanly */
         if (WIFEXITED(status)) {
-            status=WEXITSTATUS(status);
+            status = WEXITSTATUS(status);
 
             /* Delete the pid file */
-            if (args->vers!=true && args->chck!=true && status!=122)
+            if (args->vers != true && args->chck != true && status != 122)
                 unlink(args->pidf);
 
             /* If the child got out with 123 he wants to be restarted */
             /* See java_abort123 (we use this return code to restart when the JVM aborts) */
-            if (status==123) {
+            if (status == 123) {
                 log_debug("Reloading service");
                 /* prevent looping */
-                if (laststart+60>time(NULL)) {
-                  log_debug("Waiting 60 s to prevent looping");
-                  sleep(60);
-                } 
+                if (laststart + 60 > time(NULL)) {
+                    log_debug("Waiting 60 s to prevent looping");
+                    sleep(60);
+                }
                 continue;
             }
             /* If the child got out with 0 he is shutting down */
-            if (status==0) {
+            if (status == 0) {
                 log_debug("Service shut down");
-                return(0);
+                return 0;
             }
             /* Otherwise we don't rerun it */
-            log_error("Service exit with a return value of %d",status);
-            return(1);
+            log_error("Service exit with a return value of %d", status);
+            return 1;
 
-        } else {
+        }
+        else {
             if (WIFSIGNALED(status)) {
-                log_error("Service killed by signal %d",WTERMSIG(status));
+                log_error("Service killed by signal %d", WTERMSIG(status));
                 /* prevent looping */
-                if (laststart+60>time(NULL)) {
-                  log_debug("Waiting 60 s to prevent looping");
-                  sleep(60);
-                } 
+                if (laststart + 60 > time(NULL)) {
+                    log_debug("Waiting 60 s to prevent looping");
+                    sleep(60);
+                }
                 continue;
             }
-            log_error("Service did not exit cleanly",status);
-            return(1);
+            log_error("Service did not exit cleanly", status);
+            return 1;
         }
     }
 
     /* Got out of the loop? A fork() failed then. */
     log_error("Cannot decouple controller/child processes");
-    return(1);
+    return 1;
 
 }
 
-void main_reload(void) {
+void main_reload(void)
+{
     log_debug("Killing self with HUP signal");
-    kill(controlled,SIGHUP);
+    kill(controlled, SIGHUP);
 }
 
-void main_shutdown(void) {
+void main_shutdown(void)
+{
     log_debug("Killing self with TERM signal");
-    kill(controlled,SIGTERM);
+    kill(controlled, SIGTERM);
 }
 
diff --git a/src/native/unix/native/jsvc-unix.o b/src/native/unix/native/jsvc-unix.o
deleted file mode 100644
index ad73d52..0000000
Binary files a/src/native/unix/native/jsvc-unix.o and /dev/null differ
diff --git a/src/native/unix/native/jsvc.h b/src/native/unix/native/jsvc.h
index 696ca98..24e5a7a 100644
--- a/src/native/unix/native/jsvc.h
+++ b/src/native/unix/native/jsvc.h
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: jsvc.h 911007 2010-02-17 14:58:48Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: jsvc.h 921756 2010-03-11 09:38:58Z mturk $ */
 #ifndef __JSVC_H__
 #define __JSVC_H__
 
@@ -47,7 +47,7 @@ typedef enum {
 #include "signals.h"
 #include "locks.h"
 
-int main(int argc, char *argv[]);
+int  main(int argc, char *argv[]);
 void main_reload(void);
 void main_shutdown(void);
 
diff --git a/src/native/unix/native/libservice.a b/src/native/unix/native/libservice.a
deleted file mode 100644
index e58c1fd..0000000
Binary files a/src/native/unix/native/libservice.a and /dev/null differ
diff --git a/src/native/unix/native/location.c b/src/native/unix/native/location.c
index 93ea1c8..8ba2ed2 100644
--- a/src/native/unix/native/location.c
+++ b/src/native/unix/native/location.c
@@ -1,31 +1,33 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: location.c 480469 2006-11-29 08:22:04Z bayard $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: location.c 921765 2010-03-11 10:03:32Z mturk $ */
 #include "jsvc.h"
 
 /* Locations of various JVM files. We have to deal with all this madness since
-   we're not distributed togheter (yet!) with an official VM distribution. All
-   this CRAP needs improvement, and based on the observation of default
-   distributions of VMs and OSes. If it doesn't work for you, please report
-   your VM layout (ls -laR) and system details (build/config.guess) so that we
-   can improve the search algorithms. */
+ * we're not distributed togheter (yet!) with an official VM distribution. All
+ * this CRAP needs improvement, and based on the observation of default
+ * distributions of VMs and OSes. If it doesn't work for you, please report
+ * your VM layout (ls -laR) and system details (build/config.guess) so that we
+ * can improve the search algorithms.
+ */
 
 /* If JAVA_HOME is not defined we search this list of paths (OS-dependant)
-   to find the default location of the JVM. */
+ * to find the default location of the JVM.
+ */
 char *location_home[] = {
 #if defined(OS_DARWIN)
     "/System/Library/Frameworks/JavaVM.framework/Home",
@@ -49,45 +51,48 @@ char *location_home[] = {
 };
 
 /* The jvm.cfg file defines the VMs available for invocation. So far, on all
-   all systems I've seen it's in $JAVA_HOME/lib. If this file is not found,
-   then the "default" VMs (from location_jvm_default) is searched, otherwise,
-   we're going to look thru the "configured" VMs (from lod_cfgvm) lying
-   somewhere around JAVA_HOME. (Only two, I'm happy) */
+ * all systems I've seen it's in $JAVA_HOME/lib. If this file is not found,
+ * then the "default" VMs (from location_jvm_default) is searched, otherwise,
+ * we're going to look thru the "configured" VMs (from lod_cfgvm) lying
+ * somewhere around JAVA_HOME. (Only two, I'm happy)
+ */
 char *location_jvm_cfg[] = {
-    "$JAVA_HOME/jre/lib/jvm.cfg", /* JDK */
-    "$JAVA_HOME/lib/jvm.cfg",     /* JRE */
-    "$JAVA_HOME/jre/lib/" CPU "/jvm.cfg", /* JDK */
-    "$JAVA_HOME/lib/" CPU "/jvm.cfg",     /* JRE */
+    "$JAVA_HOME/jre/lib/jvm.cfg",           /* JDK */
+    "$JAVA_HOME/lib/jvm.cfg",               /* JRE */
+    "$JAVA_HOME/jre/lib/" CPU "/jvm.cfg",   /* JDK */
+    "$JAVA_HOME/lib/" CPU "/jvm.cfg",       /* JRE */
     NULL,
 };
 
 /* This is the list of "defaults" VM (searched when jvm.cfg is not found, as
-   in the case of most JDKs 1.2.2 */
+ * in the case of most JDKs 1.2.2
+ */
 char *location_jvm_default[] = {
 #if defined(OS_DARWIN)
     "$JAVA_HOME/../Libraries/libjvm.dylib",
 #elif defined(OS_CYGWIN)
-    "$JAVA_HOME/jre/bin/classic/jvm.dll",           /* Sun JDK 1.3 */
-    "$JAVA_HOME/jre/bin/client/jvm.dll",            /* Sun JDK 1.4 */
+    "$JAVA_HOME/jre/bin/classic/jvm.dll",               /* Sun JDK 1.3 */
+    "$JAVA_HOME/jre/bin/client/jvm.dll",                /* Sun JDK 1.4 */
 #elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_BSD) || defined(OS_SYSV) || defined(OS_FREEBSD) || defined(OS_TRU64)
 #if defined(HAVE_SABLEVM)
-     "$JAVA_HOME/lib/libsablevm.so",                /* sableVM */
+    "$JAVA_HOME/lib/libsablevm.so",                     /* sableVM */
 #endif
 #if defined(HAVE_KAFFEVM)
-     "$JAVA_HOME/jre/lib/" CPU "/libkaffevm.so",    /* kaffe */
+    "$JAVA_HOME/jre/lib/" CPU "/libkaffevm.so",         /* kaffe */
 #endif
-    "$JAVA_HOME/jre/lib/" CPU "/classic/libjvm.so", /* Sun JDK 1.2 */
-    "$JAVA_HOME/jre/lib/" CPU "/client/libjvm.so",  /* Sun JDK 1.3 */
-    "$JAVA_HOME/jre/lib/" CPU "/libjvm.so",         /* Sun JDK */
-    "$JAVA_HOME/lib/" CPU "/classic/libjvm.so",     /* Sun JRE 1.2 */
-    "$JAVA_HOME/lib/" CPU "/client/libjvm.so",      /* Sun JRE 1.3 */
-    "$JAVA_HOME/lib/" CPU "/libjvm.so",             /* Sun JRE */
-    "$JAVA_HOME/jre/bin/" CPU "/classic/libjvm.so", /* IBM JDK 1.3 */
-    "$JAVA_HOME/jre/bin/" CPU "/libjvm.so",         /* IBM JDK */
-    "$JAVA_HOME/bin/" CPU "/classic/libjvm.so",     /* IBM JRE 1.3 */
-    "$JAVA_HOME/bin/" CPU "/libjvm.so",             /* IBM JRE */
+    "$JAVA_HOME/jre/lib/" CPU "/classic/libjvm.so",     /* Sun JDK 1.2 */
+    "$JAVA_HOME/jre/lib/" CPU "/client/libjvm.so",      /* Sun JDK 1.3 */
+    "$JAVA_HOME/jre/lib/" CPU "/libjvm.so",             /* Sun JDK */
+    "$JAVA_HOME/lib/" CPU "/classic/libjvm.so",         /* Sun JRE 1.2 */
+    "$JAVA_HOME/lib/" CPU "/client/libjvm.so",          /* Sun JRE 1.3 */
+    "$JAVA_HOME/lib/" CPU "/libjvm.so",                 /* Sun JRE */
+    "$JAVA_HOME/jre/bin/" CPU "/classic/libjvm.so",     /* IBM JDK 1.3 */
+    "$JAVA_HOME/jre/bin/" CPU "/libjvm.so",             /* IBM JDK */
+    "$JAVA_HOME/bin/" CPU "/classic/libjvm.so",         /* IBM JRE 1.3 */
+    "$JAVA_HOME/bin/" CPU "/libjvm.so",                 /* IBM JRE */
     /* Those are "weirdos: if we got here, we're probably in troubles and
-       we're not going to find anything, but hope never dies... */
+     *  we're not going to find anything, but hope never dies...
+     */
     "$JAVA_HOME/jre/lib/" CPU "/classic/green_threads/libjvm.so",
 #if defined(OSD_POSIX)
     "$JAVA_HOME/lib/s390/client/green_threads/libjvm.so",
@@ -115,22 +120,23 @@ char *location_jvm_default[] = {
     "$JAVA_HOME/jre/lib/" CPU "/hotspot/libjvm.sl",
     "$JAVA_HOME/jre/lib/" CPU "/classic/libjvm.sl",
 #endif
-    "/usr/lib/libgcj.so.7", /* gcc java libraries */
+    "/usr/lib/libgcj.so.7",     /* gcc java libraries */
     "/usr/lib/libgcj.so.6",
     NULL,
 };
 
 /* This is the list of "configured" VM (searched when jvm.cfg is found, as
-   in the case of most JDKs 1.3 (not IBM, for example), way easier than
-   before, and lovely, indeed... */
+ * in the case of most JDKs 1.3 (not IBM, for example), way easier than
+ * before, and lovely, indeed...
+ */
 char *location_jvm_configured[] = {
 #if defined(OS_DARWIN)
     "$JAVA_HOME/../Libraries/lib$VM_NAME.dylib",
 #elif defined(OS_CYGWIN)
-    "$JAVA_HOME/jre/bin/$VM_NAME/jvm.dll",          /* Sun JDK 1.3 */
+    "$JAVA_HOME/jre/bin/$VM_NAME/jvm.dll",              /* Sun JDK 1.3 */
 #elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_BSD) || defined(OS_FREEBSD) || defined(OS_TRU64)
-    "$JAVA_HOME/jre/lib/" CPU "/$VM_NAME/libjvm.so",/* Sun JDK 1.3 */
-    "$JAVA_HOME/lib/" CPU "/$VM_NAME/libjvm.so",    /* Sun JRE 1.3 */
+    "$JAVA_HOME/jre/lib/" CPU "/$VM_NAME/libjvm.so",    /* Sun JDK 1.3 */
+    "$JAVA_HOME/lib/" CPU "/$VM_NAME/libjvm.so",        /* Sun JRE 1.3 */
 #elif defined(OS_HPUX)
     "$JAVA_HOME/jre/lib/" CPU "/$VM_NAME/libjvm.sl",
     "$JAVA_HOME/lib/" CPU "/$VM_NAME/libjvm.sl",
@@ -142,3 +148,4 @@ char *location_jvm_configured[] = {
 #endif
     NULL,
 };
+
diff --git a/src/native/unix/native/location.h b/src/native/unix/native/location.h
index 77327a4..7a77979 100644
--- a/src/native/unix/native/location.h
+++ b/src/native/unix/native/location.h
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: location.h 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: location.h 921765 2010-03-11 10:03:32Z mturk $ */
 #ifndef __JSVC_LOCATION_H__
 #define __JSVC_LOCATION_H__
 
diff --git a/src/native/unix/native/location.o b/src/native/unix/native/location.o
deleted file mode 100644
index 2208d93..0000000
Binary files a/src/native/unix/native/location.o and /dev/null differ
diff --git a/src/native/unix/native/locks.c b/src/native/unix/native/locks.c
index e123d1a..a007923 100644
--- a/src/native/unix/native/locks.c
+++ b/src/native/unix/native/locks.c
@@ -1,19 +1,20 @@
-/*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id$ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: java.c 909069 2010-02-11 16:43:36Z mturk $ */
 
 /*
  * as Cygwin does not support lockf, jsvc uses fcntl to emulate it.
@@ -30,13 +31,13 @@ int lockf(int fildes, int function, off_t size)
     struct flock buf;
 
     switch (function) {
-    case F_LOCK:
-        buf.l_type = F_WRLCK;
+        case F_LOCK:
+            buf.l_type = F_WRLCK;
         break;
-    case F_ULOCK:
-        buf.l_type = F_UNLCK;
+        case F_ULOCK:
+            buf.l_type = F_UNLCK;
         break;
-    default:
+        default:
         return -1;
     }
     buf.l_whence = 0;
@@ -47,3 +48,4 @@ int lockf(int fildes, int function, off_t size)
 }
 
 #endif
+
diff --git a/src/native/unix/native/locks.h b/src/native/unix/native/locks.h
index 7cbb9cf..89c5ba8 100644
--- a/src/native/unix/native/locks.h
+++ b/src/native/unix/native/locks.h
@@ -1,18 +1,19 @@
-/*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /* @version $Id$ */
 #ifndef __JSVC_LOCKS_H__
 #define __JSVC_LOCKS_H__
@@ -22,8 +23,8 @@
  */
 #ifdef OS_CYGWIN
 
-#define F_ULOCK 0       /* Unlock a previously locked region */
-#define F_LOCK  1       /* Lock a region for exclusive use */
+#define F_ULOCK 0               /* Unlock a previously locked region */
+#define F_LOCK  1               /* Lock a region for exclusive use */
 
 /*
  * allow a file to be locked
diff --git a/src/native/unix/native/locks.o b/src/native/unix/native/locks.o
deleted file mode 100644
index 23a3f05..0000000
Binary files a/src/native/unix/native/locks.o and /dev/null differ
diff --git a/src/native/unix/native/replace.c b/src/native/unix/native/replace.c
index 1ba722d..e1b18b6 100644
--- a/src/native/unix/native/replace.c
+++ b/src/native/unix/native/replace.c
@@ -1,24 +1,25 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: replace.c 480469 2006-11-29 08:22:04Z bayard $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: replace.c 921765 2010-03-11 10:03:32Z mturk $ */
 #include "jsvc.h"
 
 /* Replace all occurrences of a string in another */
-int replace(char *new, int len, char *old, char *mch, char *rpl) {
+int replace(char *new, int len, char *old, char *mch, char *rpl)
+{
     char *tmp;
     int count;
     int shift;
@@ -29,82 +30,92 @@ int replace(char *new, int len, char *old, char *mch, char *rpl) {
     int x;
 
     /* The new buffer is NULL, fail */
-    if (new==NULL) return(-1);
+    if (new == NULL)
+        return -1;
     /* The length of the buffer is less than zero, fail */
-    if (len<0) return(-2);
+    if (len < 0)
+        return -2;
     /* The old buffer is NULL, fail */
-    if (old==NULL) return(-3);
+    if (old == NULL)
+        return -3;
 
     /* The string to be matched is NULL or empty, simply copy */
-    if ((mch==NULL)||(strlen(mch)==0)) {
-        olen=strlen(old);
-        if (len<=olen) return(olen+1);
-        strcpy(new,old);
-        return(0);
+    if ((mch == NULL) || (strlen(mch) == 0)) {
+        olen = strlen(old);
+        if (len <= olen)
+            return (olen + 1);
+        strcpy(new, old);
+        return 0;
     }
 
     /* The string to be replaced is NULL, assume it's an empty string */
-    if (rpl==NULL) rpl="";
+    if (rpl == NULL)
+        rpl = "";
 
     /* Evaluate some lengths */
-    olen=strlen(old);
-    mlen=strlen(mch);
-    rlen=strlen(rpl);
+    olen = strlen(old);
+    mlen = strlen(mch);
+    rlen = strlen(rpl);
 
     /* Calculate how many times the mch string appears in old */
-    tmp=old;
-    count=0;
-    while((tmp=strstr(tmp,mch))!=NULL) {
+    tmp = old;
+    count = 0;
+    while ((tmp = strstr(tmp, mch)) != NULL) {
         count++;
-        tmp+=mlen;
+        tmp += mlen;
     }
 
     /* We have no matches, simply copy */
-    if (count==0) {
-        olen=strlen(old);
-        if (len<=olen) return(olen+1);
-        strcpy(new,old);
-        return(0);
+    if (count == 0) {
+        olen = strlen(old);
+        if (len <= olen)
+            return (olen + 1);
+        strcpy(new, old);
+        return 0;
     }
 
     /* Calculate how big the buffer must be to hold the translation
-       and of how many bytes we need to shift the data */
-    shift=rlen-mlen;
-    nlen=olen+(shift*count);
+     * and of how many bytes we need to shift the data
+     */
+    shift = rlen - mlen;
+    nlen  = olen + (shift * count);
     /* printf("Count=%d Shift= %d OLen=%d NLen=%d\n",count,shift,olen,nlen); */
 
     /* Check if we have enough size in the buffer */
-    if (nlen>=len) return(nlen+1);
+    if (nlen >= len)
+        return (nlen + 1);
 
     /* Copy over the old buffer in the new one (save memory) */
-    strcpy(new,old);
+    strcpy(new, old);
 
     /* Start replacing */
-    tmp=new;
-    while((tmp=strstr(tmp,mch))!=NULL) {
+    tmp = new;
+    while ((tmp = strstr(tmp, mch)) != NULL) {
         /* If shift is > 0 we need to move data from right to left */
-        if (shift>0) {
-            for (x=(strlen(tmp)+shift);x>shift;x--) {
+        if (shift > 0) {
+            for (x = (strlen(tmp) + shift); x > shift; x--) {
                 /*
-                printf("src %c(%d) dst %c(%d)\n",
-                        tmp[x-shift],tmp[x-shift],tmp[x],tmp[x]);
+                   printf("src %c(%d) dst %c(%d)\n",
+                   tmp[x-shift],tmp[x-shift],tmp[x],tmp[x]);
                  */
-                tmp[x]=tmp[x-shift];
+                tmp[x] = tmp[x - shift];
             }
-        /* If shift is < 0 we need to move data from left to right */
-        } else if (shift<0) {
-            for (x=mlen;x<strlen(tmp)-shift;x++) {
+            /* If shift is < 0 we need to move data from left to right */
+        }
+        else if (shift < 0) {
+            for (x = mlen; x < strlen(tmp) - shift; x++) {
                 /*
                    printf("src %c(%d) dst %c(%d)\n",
-                          tmp[x],tmp[x],tmp[x+shift],tmp[x+shift]);
+                   tmp[x],tmp[x],tmp[x+shift],tmp[x+shift]);
                  */
-                tmp[x+shift]=tmp[x];
+                tmp[x + shift] = tmp[x];
             }
         }
         /* If shift is = 0 we don't have to shift data */
-        strncpy(tmp,rpl,rlen);
-        tmp+=rlen;
+        strncpy(tmp, rpl, rlen);
+        tmp += rlen;
         /* printf("\"%s\"\n",tmp); */
     }
-    return(0);
+    return 0;
 }
+
diff --git a/src/native/unix/native/replace.h b/src/native/unix/native/replace.h
index e239e53..146623d 100644
--- a/src/native/unix/native/replace.h
+++ b/src/native/unix/native/replace.h
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: replace.h 480469 2006-11-29 08:22:04Z bayard $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: replace.h 921765 2010-03-11 10:03:32Z mturk $ */
 #ifndef __JSVC_REPLACE_H__
 #define __JSVC_REPLACE_H__
 
@@ -36,3 +36,4 @@
 int replace(char *new, int len, char *old, char *mch, char *rpl);
 
 #endif /* ifndef __JSVC_REPLACE_H__ */
+
diff --git a/src/native/unix/native/replace.o b/src/native/unix/native/replace.o
deleted file mode 100644
index c807036..0000000
Binary files a/src/native/unix/native/replace.o and /dev/null differ
diff --git a/src/native/unix/native/signals.c b/src/native/unix/native/signals.c
index 1c03d32..214a7d8 100644
--- a/src/native/unix/native/signals.c
+++ b/src/native/unix/native/signals.c
@@ -1,20 +1,20 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-/* @version $Id: signals.c 909069 2010-02-11 16:43:36Z mturk $ */
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* @version $Id: signals.c 921765 2010-03-11 10:03:32Z mturk $ */
 
 /*
  * as Windows does not support signal, jsvc uses events to emulate them.
@@ -24,26 +24,27 @@
 #ifdef OS_CYGWIN
 #include <windows.h>
 #include <stdio.h>
-static void (*HandleTerm)(void)=NULL; /* address of the handler routine. */
+static void (*HandleTerm) (void) = NULL;        /* address of the handler routine. */
 
 /*
  * Event handling routine
  */
 void v_difthf(LPVOID par)
 {
-HANDLE hevint; /* make a local copy because the parameter is shared! */
+    HANDLE hevint;              /* make a local copy because the parameter is shared! */
 
-  hevint = (HANDLE) par;
+    hevint = (HANDLE) par;
 
-  for (;;) {
-    if (WaitForSingleObject(hevint,INFINITE) == WAIT_FAILED) {
-      /* something have gone wrong. */
-      return; /* may be something more is needed. */
-      }
+    for (;;) {
+        if (WaitForSingleObject(hevint, INFINITE) == WAIT_FAILED) {
+            /* something have gone wrong. */
+            return;             /* may be something more is needed. */
+        }
 
-    /* call the interrupt handler. */
-    if (HandleTerm==NULL) return;
-    HandleTerm();
+        /* call the interrupt handler. */
+        if (HandleTerm == NULL)
+            return;
+        HandleTerm();
     }
 }
 
@@ -51,50 +52,52 @@ HANDLE hevint; /* make a local copy because the parameter is shared! */
  * set a routine handler for the signal
  * note that it cannot be used to change the signal handler
  */
-int SetTerm(void (*func)(void))
+int SetTerm(void (*func) (void))
 {
-char Name[256];
-HANDLE hevint, hthread;
-DWORD ThreadId; 
-SECURITY_ATTRIBUTES sa;
-SECURITY_DESCRIPTOR sd;
+    char Name[256];
+    HANDLE hevint, hthread;
+    DWORD ThreadId;
+    SECURITY_ATTRIBUTES sa;
+    SECURITY_DESCRIPTOR sd;
 
-  sprintf(Name,"TERM%ld",GetCurrentProcessId());
+    sprintf(Name, "TERM%ld", GetCurrentProcessId());
 
-  /*
-   * event cannot be inherited.
-   * the event is reseted to nonsignaled after the waiting thread is released.
-   * the start state is resetted.
-   */
+    /*
+     * event cannot be inherited.
+     * the event is reseted to nonsignaled after the waiting thread is released.
+     * the start state is resetted.
+     */
 
-  /* Initialize the new security descriptor. */
-  InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
+    /* Initialize the new security descriptor. */
+    InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
 
-  /* Add a NULL descriptor ACL to the security descriptor. */
-  SetSecurityDescriptorDacl (&sd, TRUE, (PACL)NULL, FALSE);
+    /* Add a NULL descriptor ACL to the security descriptor. */
+    SetSecurityDescriptorDacl(&sd, TRUE, (PACL) NULL, FALSE);
 
-  sa.nLength = sizeof(sa);
-  sa.lpSecurityDescriptor = &sd;
-  sa.bInheritHandle = TRUE;
+    sa.nLength = sizeof(sa);
+    sa.lpSecurityDescriptor = &sd;
+    sa.bInheritHandle = TRUE;
 
 
-  /*  It works also with NULL instead &sa!! */
-  hevint = CreateEvent(&sa,FALSE, FALSE,Name);
+    /*  It works also with NULL instead &sa!! */
+    hevint = CreateEvent(&sa, FALSE, FALSE, Name);
 
-  HandleTerm = func;
+    HandleTerm = func;
 
-  if (hevint == NULL) return(-1); /* failed */
+    if (hevint == NULL)
+        return -1;            /* failed */
 
-  /* create the thread to wait for event */
-  hthread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) v_difthf,
-                         (LPVOID) hevint, 0, &ThreadId);
-  if (hthread == NULL) {
-    /* failed remove the event */
-    CloseHandle(hevint); /* windows will remove it. */
-    return(-1);
+    /* create the thread to wait for event */
+    hthread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) v_difthf,
+                           (LPVOID) hevint, 0, &ThreadId);
+    if (hthread == NULL) {
+        /* failed remove the event */
+        CloseHandle(hevint);    /* windows will remove it. */
+        return -1;
     }
 
-  CloseHandle(hthread); /* not needed */
-  return(0);
+    CloseHandle(hthread);       /* not needed */
+    return 0;
 }
 #endif
+
diff --git a/src/native/unix/native/signals.h b/src/native/unix/native/signals.h
index fcf982c..a92c735 100644
--- a/src/native/unix/native/signals.h
+++ b/src/native/unix/native/signals.h
@@ -28,7 +28,7 @@
  * @param func The function to call on termination
  * @return Zero on success, a value less than 0 if an error was encountered
  */
-int SetTerm(void (*func)(void));
+int SetTerm(void (*func) (void));
 
 #endif
 #endif /* ifndef __JSVC_SIGNALS_H__ */
diff --git a/src/native/unix/native/signals.o b/src/native/unix/native/signals.o
deleted file mode 100644
index 1926287..0000000
Binary files a/src/native/unix/native/signals.o and /dev/null differ
diff --git a/src/native/unix/native/version.h b/src/native/unix/native/version.h
index 82540ad..6f0ae06 100644
--- a/src/native/unix/native/version.h
+++ b/src/native/unix/native/version.h
@@ -1,19 +1,19 @@
-/*
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
- 
-       http://www.apache.org/licenses/LICENSE-2.0
- 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #ifndef __VERSION_H__
 #define __VERSION_H__
 
@@ -31,7 +31,7 @@
 #define JSVC_MINOR_VERSION      0
 
 /** patch level */
-#define JSVC_PATCH_VERSION      2
+#define JSVC_PATCH_VERSION      3
 
 /**
  *  This symbol is defined for internal, "development" copies of JSVC.
diff --git a/src/samples/AloneService.java b/src/samples/AloneService.java
index 2d766aa..b2aef12 100644
--- a/src/samples/AloneService.java
+++ b/src/samples/AloneService.java
@@ -15,20 +15,17 @@
  *  limitations under the License.
  */
 
-/* @version $Id: AloneService.java 897078 2010-01-08 01:52:47Z sebb $ */
+/* @version $Id: AloneService.java 941216 2010-05-05 09:21:53Z sebb $ */
 
-import java.io.*;
-import java.net.*;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Enumeration;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.Iterator;
 
 import org.apache.commons.collections.ExtendedProperties;
-import java.io.IOException;
-import java.util.Iterator;
 
 /*
- * That is like the ServiceDaemon but it does used the interface.
+ * That is like the ServiceDaemon but it does not use the Daemon interface.
  */
 public class AloneService {
 
@@ -100,8 +97,7 @@ public class AloneService {
         }
     }
 
-    public void stop()
-    throws IOException, InterruptedException {
+    public void stop() {
         /* Dump a message */
         System.err.println("ServiceDaemon: stopping");
 
diff --git a/src/samples/Native.sh b/src/samples/Native.sh
old mode 100644
new mode 100755
diff --git a/src/samples/ProcrunService.java b/src/samples/ProcrunService.java
new file mode 100644
index 0000000..c8a4db2
--- /dev/null
+++ b/src/samples/ProcrunService.java
@@ -0,0 +1,173 @@
+import java.io.File;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+/**
+ * Sample service implementation for use with Windows Procrun.
+ * <p>
+ * Use the main() method for running as a Java (external) service.
+ * Use the start() and stop() methods for running as a jvm (in-process) service 
+ */
+public class ProcrunService implements Runnable {
+
+    private static final int DEFAULT_PAUSE = 60; // Wait 1 minute
+    private static final long MS_PER_SEC = 1000L; // Milliseconds in a second
+
+    private static volatile Thread thrd; // start and stop are called from different threads
+    
+    private final long pause; // How long to pause in service loop
+
+    private final File stopFile;
+    
+    /**
+     * 
+     * @param wait seconds to wait in loop
+     * @param filename optional filename - if non-null, run loop will stop when it disappears
+     * @throws IOException 
+     */
+    private ProcrunService(long wait, File file) {
+        pause=wait;
+        stopFile = file;
+    }
+
+    private static File tmpFile(String filename) {
+        return new File(System.getProperty("java.io.tmpdir"),
+                filename != null ? filename : "ProcrunService.tmp");
+    }
+
+    private static void usage(){
+        System.err.println("Must supply the argument 'start' or 'stop'");        
+    }
+
+    /**
+     * Helper method for process args with defaults.
+     * 
+     * @param args array of string arguments, may be empty
+     * @param argnum which argument to extract
+     * @return the argument or null
+     */
+    private static String getArg(String[] args, int argnum){
+        if (args.length > argnum) {
+            return args[argnum];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Common entry point for start and stop service functions.
+     * To allow for use with Java mode, a temporary file is created
+     * by the start service, and a deleted by the stop service.
+     * 
+     * @param args [start [pause time] | stop]
+     * @throws IOException if there are problems creating or deleting the temporary file 
+     */
+    public static void main(String[] args) throws IOException {
+        final int argc = args.length;
+        log("ProcrunService called with "+argc+" arguments from thread: "+Thread.currentThread());
+        for(int i=0; i < argc; i++) {
+            System.out.println("["+i+"] "+args[i]);
+        }
+        String mode=getArg(args, 0);
+        if ("start".equals(mode)){
+            File f = tmpFile(getArg(args, 2));
+            log("Creating file: "+f.getPath());
+            f.createNewFile();
+            startThread(getArg(args, 1), f);
+        } else if ("stop".equals(mode)) {
+            final File tmpFile = tmpFile(getArg(args, 1));
+            log("Deleting file: "+tmpFile.getPath());
+            tmpFile.delete();
+        } else {
+            usage();
+        }
+    }
+
+    /**
+     * Start the jvm version of the service, and waits for it to complete.
+     * 
+     * @param args optional, arg[0] = timeout (seconds)
+     */
+    public static void start(String [] args) {
+        startThread(getArg(args, 0), null);
+        while(thrd.isAlive()){
+            try {
+                thrd.join();
+            } catch (InterruptedException ie){
+                // Ignored
+            }
+        }
+    }
+
+    private static void startThread(String waitParam, File file) {
+        long wait = DEFAULT_PAUSE;
+        if (waitParam != null) {
+            wait = Integer.valueOf(waitParam).intValue();
+        }
+        log("Starting the thread, wait(seconds): "+wait);
+        thrd = new Thread(new ProcrunService(wait*MS_PER_SEC,file));
+        thrd.start();
+    }
+
+    /**
+     * Stop the JVM version of the service.
+     *
+     * @param args ignored
+     */
+    public static void stop(String [] args){
+        if (thrd != null) {
+            log("Interrupting the thread");
+            thrd.interrupt();
+        } else {
+            log("No thread to interrupt");
+        }        
+    }
+
+    /**
+     * This method performs the work of the service.
+     * In this case, it just logs a message every so often.
+     */
+    public void run() {
+        log("Started thread in "+System.getProperty("user.dir"));
+        log("user.name="+System.getProperty("user.name"));
+        log("user.home="+System.getProperty("user.home"));
+        while(stopFile == null || stopFile.exists()){
+            try {
+                log("pausing...");
+                Thread.sleep(pause);
+            } catch (InterruptedException e) {
+                log("Exitting");
+                break;
+            }
+        }
+    }
+
+    private static void log(String msg){
+        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
+        System.out.println(df.format(new Date())+msg);
+    }
+    
+    protected void finalize(){
+        log("Finalize called from thread "+Thread.currentThread());
+    }
+}
diff --git a/src/samples/ProcrunServiceInstall.cmd b/src/samples/ProcrunServiceInstall.cmd
new file mode 100644
index 0000000..21677f7
--- /dev/null
+++ b/src/samples/ProcrunServiceInstall.cmd
@@ -0,0 +1,65 @@
+ at echo off
+rem 
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem Batch script for defining the ProcrunService (JVM and Java versions)
+
+rem Copy this file and ProcrunService.jar into the same directory as prunsrv (or adjust the paths below)
+
+setlocal
+
+rem The service names (make sure they does not clash with an existing service)
+set SERVICE_JVM=ProcrunServiceJvm
+set SERVICE_JAVA=ProcrunServiceJava
+
+rem my location
+set MYPATH=%~dp0
+
+rem location of Prunsrv
+set PATH_PRUNSRV=%MYPATH%
+set PR_LOGPATH=%PATH_PRUNSRV%
+rem location of jarfile
+set PATH_JAR=%MYPATH%
+
+rem Allow prunsrv to be overridden
+if "%PRUNSRV%" == "" set PRUNSRV=%PATH_PRUNSRV%prunsrv
+
+rem Install the 2 services
+
+echo Installing %SERVICE_JVM%
+%PRUNSRV% //DS//%SERVICE_JVM%
+%PRUNSRV% //IS//%SERVICE_JVM%
+
+echo Setting the parameters for %SERVICE_JVM%
+%PRUNSRV% //US//%SERVICE_JVM% --Jvm=auto --StdOutput auto --StdError auto ^
+--Classpath=%PATH_JAR%ProcrunService.jar ^
+--StartMode=jvm --StartClass=ProcrunService --StartMethod=start ^
+ --StopMode=jvm  --StopClass=ProcrunService  --StopMethod=stop
+
+echo Installation of %SERVICE_JVM% is complete
+
+echo Installing %SERVICE_JAVA%
+%PRUNSRV% //DS//%SERVICE_JAVA%
+%PRUNSRV% //IS//%SERVICE_JAVA%
+
+echo Setting the parameters for %SERVICE_JAVA%
+%PRUNSRV% //US//%SERVICE_JAVA% --Jvm=auto --StdOutput auto --StdError auto ^
+--Classpath=%PATH_JAR%ProcrunService.jar ^
+--StartMode=java --StartClass=ProcrunService --StartParams=start ^
+ --StopMode=java  --StopClass=ProcrunService  --StopParams=stop
+
+echo Installation of %SERVICE_JAVA% is complete
+echo Finished
diff --git a/src/samples/ProcrunServiceRemove.cmd b/src/samples/ProcrunServiceRemove.cmd
new file mode 100644
index 0000000..dfc1b74
--- /dev/null
+++ b/src/samples/ProcrunServiceRemove.cmd
@@ -0,0 +1,42 @@
+ at echo off
+rem 
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem Batch script for removing the ProcrunService (JVM and Java versions)
+
+setlocal
+
+rem The service names (make sure they does not clash with an existing service)
+set SERVICE_JVM=ProcrunServiceJvm
+set SERVICE_JAVA=ProcrunServiceJava
+
+rem my location
+set MYPATH=%~dp0
+
+rem location of Prunsrv
+set PATH_PRUNSRV=%MYPATH%
+set PR_LOGPATH=%PATH_PRUNSRV%
+rem Allow prunsrv to be overridden
+if "%PRUNSRV%" == "" set PRUNSRV=%PATH_PRUNSRV%prunsrv
+
+echo Removing %SERVICE_JVM%
+%PRUNSRV% //DS//%SERVICE_JVM%
+
+echo Removing %SERVICE_JAVA%
+%PRUNSRV% //DS//%SERVICE_JAVA%
+%PRUNSRV% //IS//%SERVICE_JAVA%
+
+echo Finished
diff --git a/src/samples/README.txt b/src/samples/README.txt
index 1cf23ac..11e4239 100644
--- a/src/samples/README.txt
+++ b/src/samples/README.txt
@@ -1,23 +1,26 @@
-The directory contains examples of java daemons.
-The examples are compiled using ant (just type ant). Each example creates a
+The directory contains examples of Java daemons.
+The examples are compiled using Ant (just type ant). Each example creates a
 jar file in ../../dist
 
-SimpleDaemon:
+SimpleDaemon
+------------
 
-SimpleDaemon demonstrates the feature of the daemon ofered by
-jakarta-commons/daemon.
+SimpleDaemon demonstrates the feature of the daemon offered by
+Apache Commons Daemon.
 To run it adapt the SimpleDaemon.sh file and connect to it using:
 telnet localhost 1200
 Additional information in ../native/unix/INSTALL.txt
 
-ServiceDaemon:
+ServiceDaemon
+-------------
 
-ServiceDaemon allows to start programs using the jakarta daemon.
-That could be usefull when using cygwin under win9x because cygwin only offers
-services support under win NT/2000/XP.
-(See in ../native/nt/README how to install jsvc as a service in win32).
+ServiceDaemon allows to start programs using the Commons Daemon.
 
-It uses jakarta Commons Collections:
+That could be useful when using Cygwin under Win9x because Cygwin only offers
+services support under Win NT/2000/XP.
+(See in ../native/nt/README how to install jsvc as a service in Win32).
+
+It uses Apache Commons Collections:
 http://commons.apache.org/collections/
 To use it you need at least commons-collections-1.0
 Check in build.xml that the property commons-collections.jar correspond to thei
@@ -34,6 +37,13 @@ socks5=/usr/local/bin/socks5 -f
 
 To run it adapt the ServiceDaemon.sh file.
 
-AloneService:
+AloneService
+------------
 
 AloneService is like ServiceDaemon except it does not use the Daemon interface.
+
+ProcrunService
+--------------
+This is a simple Windows Service application.
+It can be run either in Jvm or Java modes.
+See ProcrunServiceInstall.cmd for a sample installation script.
\ No newline at end of file
diff --git a/src/samples/ServiceDaemon.java b/src/samples/ServiceDaemon.java
index 3a3ebf1..3eb6b92 100644
--- a/src/samples/ServiceDaemon.java
+++ b/src/samples/ServiceDaemon.java
@@ -15,21 +15,18 @@
  *  limitations under the License.
  */
 
-/* @version $Id: ServiceDaemon.java 897078 2010-01-08 01:52:47Z sebb $ */
+/* @version $Id: ServiceDaemon.java 937350 2010-04-23 16:03:39Z sebb $ */
 
-import java.io.*;
-import java.net.*;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Enumeration;
-import org.apache.commons.daemon.Daemon;
-import org.apache.commons.daemon.DaemonController;
-import org.apache.commons.daemon.DaemonContext;
-
-import org.apache.commons.collections.ExtendedProperties;
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.PrintStream;
 import java.util.Iterator;
 
+import org.apache.commons.collections.ExtendedProperties;
+import org.apache.commons.daemon.Daemon;
+import org.apache.commons.daemon.DaemonContext;
+
 public class ServiceDaemon implements Daemon {
 
     private ExtendedProperties prop = null;
diff --git a/src/samples/ServiceDaemon.sh b/src/samples/ServiceDaemon.sh
index 0576955..47e5cb9 100755
--- a/src/samples/ServiceDaemon.sh
+++ b/src/samples/ServiceDaemon.sh
@@ -37,4 +37,3 @@ $DAEMON_HOME_SH/dist/jsvc \
 #-verbose \
 # To get a debug of jsvc.
 #-debug \
-#    -user $TOMCAT_USER \
diff --git a/src/samples/SimpleDaemon.java b/src/samples/SimpleDaemon.java
index d902951..640523b 100644
--- a/src/samples/SimpleDaemon.java
+++ b/src/samples/SimpleDaemon.java
@@ -15,26 +15,34 @@
  *  limitations under the License.
  */
 
-/* @version $Id: SimpleDaemon.java 480469 2006-11-29 08:22:04Z bayard $ */
-
-import java.io.*;
-import java.net.*;
+/* @version $Id: SimpleDaemon.java 937350 2010-04-23 16:03:39Z sebb $ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.net.ServerSocket;
+import java.net.Socket;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Enumeration;
 import java.util.Vector;
+
 import org.apache.commons.daemon.Daemon;
-import org.apache.commons.daemon.DaemonController;
 import org.apache.commons.daemon.DaemonContext;
+import org.apache.commons.daemon.DaemonController;
 
 public class SimpleDaemon implements Daemon, Runnable {
 
     private ServerSocket server=null;
     private Thread thread=null;
     private DaemonController controller=null;
-    private boolean stopping=false;
+    private volatile boolean stopping=false;
     private String directory=null;
-    private Vector handlers=null;
+    private final Vector handlers;
 
     public static native void toto();
 
@@ -146,11 +154,11 @@ public class SimpleDaemon implements Daemon, Runnable {
 
     public static class Handler implements Runnable {
 
-        private DaemonController controller=null;
-        private SimpleDaemon parent=null;
-        private String directory=null;
-        private Socket socket=null;
-        private int number=0;
+        private final DaemonController controller;
+        private final SimpleDaemon parent;
+        private String directory=null; // Only set before thread is started
+        private final Socket socket;
+        private int number=0; // Only set before thread is started
 
         public Handler(Socket s, SimpleDaemon p, DaemonController c) {
             super();
diff --git a/src/samples/build.xml b/src/samples/build.xml
index eb2eb20..ab2b646 100644
--- a/src/samples/build.xml
+++ b/src/samples/build.xml
@@ -19,21 +19,30 @@
 
 <!-- ========== Initialize Properties ===================================== -->
   <property file="build.properties"/>
-  <property name="commons-daemon.jar"   value="../../dist/commons-daemon.jar"/>
   <property name="dist.home"   value="../../dist"/>
   <property name="build.home"  value="./build"/>
   <property name="source.home" value="."/>
-  <property name="commons-collections.jar" value="${user.home}/java/commons-collections-3.1/commons-collections-3.1.jar"/>
 
-  <target name="jars" depends="SimpleDaemon,ServiceDaemon,AloneService"/>
+  <property name="maven.repo.local" value="${user.home}/.m2/repository"/>
+  <property name="commons-collections.jar" value="${maven.repo.local}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/>
 
+  <target name="jars" depends="SimpleDaemon,ServiceDaemon,AloneService,ProcrunService"/>
+
+  <target name="clean" description="Remove output files">
+    <delete quiet="true">
+      <fileset dir="${build.home}"/>
+      <fileset dir="${dist.home}" includes="SimpleDaemon.jar service.jar aloneservice.jar ProcrunService.jar"/>
+    </delete>
+  </target>
+  
   <target name="SimpleDaemon" depends="compile"
    description="Create SimpleDaemon.jar">
     <mkdir      dir="${dist.home}"/>
-    <mkdir      dir="${build.home}/classes/META-INF"/>
-    <copy      file="../../LICENSE"
-               tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
     <jar    jarfile="${dist.home}/SimpleDaemon.jar">
+      <metainf dir="../..">
+        <include name="NOTICE.txt"/>
+        <include name="LICENSE.txt"/>
+      </metainf>
       <fileset dir="${build.home}/classes">
         <include name="SimpleDaemon*.class" />
       </fileset>
@@ -43,10 +52,11 @@
   <target name="ServiceDaemon" depends="compile"
    description="Create ServiceDaemon.jar">
     <mkdir      dir="${dist.home}"/>
-    <mkdir      dir="${build.home}/classes/META-INF"/>
-    <copy      file="../../LICENSE"
-               tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
     <jar    jarfile="${dist.home}/service.jar">
+      <metainf dir="../..">
+        <include name="NOTICE.txt"/>
+        <include name="LICENSE.txt"/>
+      </metainf>
       <fileset dir="${build.home}/classes">
         <include name="ServiceDaemon*.class" />
       </fileset>
@@ -56,10 +66,11 @@
   <target name="AloneService" depends="compile"
    description="Create aloneservice.jar">
     <mkdir      dir="${dist.home}"/>
-    <mkdir      dir="${build.home}/classes/META-INF"/>
-    <copy      file="../../LICENSE"
-               tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
     <jar    jarfile="${dist.home}/aloneservice.jar">
+      <metainf dir="../..">
+        <include name="NOTICE.txt"/>
+        <include name="LICENSE.txt"/>
+      </metainf>
       <fileset dir="${build.home}/classes">
         <include name="AloneService*.class" />
         <include name="ServiceDaemonReadThread*.class" />
@@ -67,9 +78,28 @@
     </jar>
   </target>
 
+  <target name="ProcrunService" depends="compile"
+   description="Create ProcrunService.jar">
+    <mkdir      dir="${dist.home}"/>
+    <jar    jarfile="${dist.home}/ProcrunService.jar">
+      <metainf dir="../..">
+        <include name="NOTICE.txt"/>
+        <include name="LICENSE.txt"/>
+      </metainf>
+      <manifest>
+         <attribute name="Main-Class" value="ProcrunService"/>
+      </manifest>
+      <fileset dir="${build.home}/classes">
+        <include name="ProcrunService.class" />
+      </fileset>
+    </jar>
+  </target>
+
   <target name="compile" depends="prepare"
    description="Create class files">
        <javac  srcdir="${source.home}"
+            source="1.3"
+            target="1.3"
            destdir="${build.home}/classes"
              debug="${compile.debug}"
        deprecation="${compile.deprecation}"
@@ -85,7 +115,8 @@
 
   <!-- Construct compile classpath -->
   <path id="compile.classpath">
-    <pathelement location="${commons-daemon.jar}"/>
+    <!-- output jar filename may vary between releases -->
+    <fileset dir="../../dist" includes="commons-daemon-*.jar"/>
     <pathelement location="${commons-collections.jar}"/>
   </path>
 
diff --git a/src/site/resources/images/logo.gif b/src/site/resources/images/logo.gif
deleted file mode 100644
index 115dbe5..0000000
Binary files a/src/site/resources/images/logo.gif and /dev/null differ
diff --git a/src/site/resources/images/logo.png b/src/site/resources/images/logo.png
deleted file mode 100644
index e71253a..0000000
Binary files a/src/site/resources/images/logo.png and /dev/null differ
diff --git a/src/site/site.xml b/src/site/site.xml
deleted file mode 100644
index b506693..0000000
--- a/src/site/site.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<project name="Daemon">
-    <bannerRight>
-        <name>Commons Daemon</name>
-        <src>/images/logo.png</src>
-        <href>/index.html</href>
-    </bannerRight>
-
-    <body>
-        <menu name="Daemon">
-            <item name="Overview"                href="/index.html"/>
-            <item name="Download"                href="http://commons.apache.org/downloads/download_daemon.cgi"/>
-            <item name="Procrun"                 href="/procrun.html"/>
-            <item name="Jsvc"                    href="/jsvc.html"/>
-            <item name="Native binaries"         href="/binaries.html"/>
-            <item name="FAQ"                     href="/faq.html"/>
-            <item name="Wiki"                    href="http://wiki.apache.org/commons/Daemon"/>
-        </menu>
-
-        <menu name="Development">
-            <item name="Mailing Lists"           href="/mail-lists.html"/>
-            <item name="Issue Tracking"          href="/issue-tracking.html"/>
-            <item name="Source Repository"       href="/source-repository.html"/>
-            <item name="Javadoc (SVN latest)"    href="apidocs/index.html"/>
-        </menu>
-
-    </body>
-
-</project>
diff --git a/src/site/xdoc/binaries.xml b/src/site/xdoc/binaries.xml
deleted file mode 100644
index 9954de6..0000000
--- a/src/site/xdoc/binaries.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<document>
-
- <properties>
-  <title>Daemon : binaries</title>
-  <author email="jfrederic.clere at fujitsu-siemens.con">Jean-Frederic Clere</author>
- </properties>
-
-<body>
-<section name="What to download?">
-<p>
-In the directory
-<a href="http://www.apache.org/dist/commons/daemon/binaries/">binaries</a>
-you will find subdirectories containing executables
-corresponding to your operating system. If your machine is not in the list,
-please mail us and we will try to make it available, or you can try to build it on your own.
-The files are compressed tar files. They are named <code>jvm_name-os_name</code>.
-For example: In the directory <code>freebsd</code> we have <code>jdk1.4.1-FreeBSD_4.9.tar.gz</code>
-That is a file built on FreeBSD 4.9 using the FreeBSD JVM 1.4.1.
-</p>
-</section>
-
-<section name="How do I get the executable?">
-<subsection name="jsvc">
-<p>
-Do the following:
-<ul>
-  <li>Find the tar file corresponding to your configuration.</li>
-  <li>Download it.</li>
-  <li>Uncompress the tar file and extract it (better with gnu tar).</li>
-  <li>Copy the executable to the location where you want to run it.</li>
-  <li>Write an rc shell
-     (see in <code>src/samples</code> and <code>src/native/unix/native/Tomcat.sh</code>)
-     to get your java application started as a daemon.
-  </li>
-</ul>
-</p>
-</subsection>
-<subsection name="procrun">
-<p>
-The <code>procrun.exe</code> has to be installed as a service
-(see <a href="procrun.html">procrun</a> for more information).
-</p>
-</subsection>
-</section>
-
-</body>
-</document>
diff --git a/src/site/xdoc/download_daemon.xml b/src/site/xdoc/download_daemon.xml
deleted file mode 100644
index 11f03f6..0000000
--- a/src/site/xdoc/download_daemon.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<!--
- +======================================================================+
- |****                                                              ****|
- |****      THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN      ****|
- |****                    DO NOT EDIT DIRECTLY                      ****|
- |****                                                              ****|
- +======================================================================+
- | TEMPLATE FILE: download-page-template.xml                            |
- | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
- +======================================================================+
- |                                                                      |
- | 1) Re-generate using: mvn commons:download-page                      |
- |                                                                      |
- | 2) Set the following properties in the component's pom:              |
- |    - commons.componentid (required, alphabetic, lower case)          |
- |    - commons.release.version (required)                              |
- |    - commons.binary.suffix (optional)                                |
- |      (defaults to "-bin", set to "" for pre-maven2 releases)         |
- |                                                                      |
- | 3) Example Properties                                                |
- |                                                                      |
- |  <properties>                                                        |
- |    <commons.componentid>math</commons.componentid>                   |
- |    <commons.release.version>1.2</commons.release.version>            |
- |  </properties>                                                       |
- |                                                                      |
- +======================================================================+
--->
-<document>
-  <properties>
-    <title>Download Commons Daemon</title>
-    <author email="dev at commons.apache.org">Commons Documentation Team</author>
-  </properties>
-  <body>
-    <section name="Download Commons Daemon">
-      <p>
-        We recommend you use a mirror to download our release
-        builds, but you <strong>must</strong> verify the integrity of
-        the downloaded files using signatures downloaded from our main 
-        distribution directories. Recent releases (48 hours) may not yet
-        be available from the mirrors.
-      </p>
-
-      <p>
-        You are currently using <b>[preferred]</b>.  If you
-        encounter a problem with this mirror, please select another
-        mirror.  If all mirrors are failing, there are <i>backup</i>
-        mirrors (at the end of the mirrors list) that should be
-        available.
-        <br></br>
-        [if-any logo]<a href="[link]"><img align="right" src="[logo]" border="0"></img></a>[end]
-      </p>
-
-      <form action="[location]" method="get" id="SelectMirror">
-        <p>
-          Other mirrors: 
-          <select name="Preferred">
-          [if-any http]
-            [for http]<option value="[http]">[http]</option>[end]
-          [end]
-          [if-any ftp]
-            [for ftp]<option value="[ftp]">[ftp]</option>[end]
-          [end]
-          [if-any backup]
-            [for backup]<option value="[backup]">[backup] (backup)</option>[end]
-          [end]
-          </select>
-          <input type="submit" value="Change"></input>
-        </p>
-      </form>
-
-      <p>
-        The <code>KEYS</code> link links to the code signing keys used to sign the product.
-        The <code>PGP</code> link downloads the OpenPGP compatible signature from our main site. 
-        The <code>MD5</code> link downloads the checksum from the main site.
-      </p>
-
-      <p>
-        For more information concerning Commons Daemon, see the 
-        <a href="index.html" class="name">Commons Daemon</a> web site.
-      </p>
-
-      <p>
-        <div class="links"><span class="link"><a href="http://www.apache.org/dist/commons/KEYS">KEYS</a></span></div>
-        <ul class="downloads">
-          <li class="group"><div class="links"><span class="label">Binary</span></div>
-            <ul>
-              <li class="download"><a href="[preferred]/commons/daemon/binaries/commons-daemon-1.0.2-bin.tar.gz">1.0.2.tar.gz</a>
-                <ul class="attributes">
-                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.tar.gz.md5">md5</a>]</span>
-                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.tar.gz.asc">pgp</a>]</span>
-                  </li>
-                </ul>
-              </li>
-              <li class="download"><a href="[preferred]/commons/daemon/binaries/commons-daemon-1.0.2-bin.zip">1.0.2.zip</a>
-                <ul class="attributes">
-                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.zip.md5">md5</a>]</span>
-                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.zip.asc">pgp</a>]</span>
-                  </li>
-                </ul>
-              </li>
-            </ul>
-          </li>
-          <li class="group"><div class="links"><span class="label">Source</span></div>
-            <ul>
-              <li class="download"><a href="[preferred]/commons/daemon/source/commons-daemon-1.0.2-src.tar.gz">1.0.2.tar.gz</a>
-                <ul class="attributes">
-                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.tar.gz.md5">md5</a>]</span>
-                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.tar.gz.asc">pgp</a>]</span>
-                  </li>
-                </ul>
-              </li>
-              <li class="download"><a href="[preferred]/commons/daemon/source/commons-daemon-1.0.2-src.zip">1.0.2.zip</a>
-                <ul class="attributes">
-                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.zip.md5">md5</a>]</span>
-                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.zip.asc">pgp</a>]</span>
-                  </li>
-                </ul>
-              </li>
-            </ul>
-          </li>
-          <li class="download"><a href="[preferred]/commons/daemon/">browse download area</a></li>
-          <li><a href="http://archive.apache.org/dist/commons/daemon/">archives...</a></li>
-        </ul>
-      </p>
-    </section>
-  </body>
-</document>
diff --git a/src/site/xdoc/faq.xml b/src/site/xdoc/faq.xml
deleted file mode 100644
index c1f2f2d..0000000
--- a/src/site/xdoc/faq.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
- 
-<document>
- 
- <properties>
-  <title>Daemon : FAQ</title>
-  <author email="jfrederic.clere at fujitsu-siemens.con">Jean-Frederic Clere</author>
- </properties>
-
-<body>
-<section name="Buildconf problems">
-<p>
-<source>
-$ sh support/buildconf.sh
-autoconf: Undefined macros:
-***BUG in Autoconf--please report*** AC_PATH
-***BUG in Autoconf--please report*** AC_PATH
-***BUG in Autoconf--please report*** AC_PATH
-</source>
-Your version of autoconf is to old, upgrade your autoconf and retry.
-Or run support/buildconf.sh in another machine and copy the daemon tree in
-the machine where you want to compile jsvc.
-</p>
-</section>
-
-<section name="Configure problems">
-<p>
-<source>
-configure: creating ./config.status
-config.status: creating Makefile
-mv: Makefile: set owner/group (was: 1670/0): Operation not permitted
-config.status: creating Makedefs
-mv: Makedefs: set owner/group (was: 1670/0): Operation not permitted
-config.status: creating native/Makefile
-mv: native/Makefile: set owner/group (was: 1670/0): Operation not permitted
-*** All done ***
-Now you can issue "make"
-</source>
-You should ignore those error messages they are normal in FreeBSD.
-config.status creates files in /tmp and move them in the current directory.
-When FreeBSD creates files it sets the group of the files to
-the group of the directory where the files are created.
-So if /tmp is group "wheel" the files are "wheel". When moving the files in
-the current directory (if you are not member of group "wheel")
-the group "wheel" cannot be set on the moved files.
-</p>
-</section>
-<section name="Runtime problems">
-<p>
-On linux 2.6.x jsvc does not start and write the following error:
-<source>
-jsvc.exec error: syscall failed in set_caps
-jsvc.exec error: Service exit with a return value of 4
-</source>
-CONFIG_SECURITY_CAPABILITIES in missing in your kernel try the following in the kernel sources:
-<ul>
-<li>
-Configure the kernel with "Default Linux Capabilities" and reboot
-  (by make gconfig or make xconfig under "security options" and "Enable different security models")
-</li>
-<li>
-Insert the module "capability":
-<source>
-modprobe capability
-</source>
-</li>
-</ul>
-</p>
-</section>
-
-<section name="Cygwin configuration problems">
-<p>
-The configure of jsvc does not like spaces in directory name.
-To configure with java installed in directory whose name contains a space,
-use the 8 characters name of the directory.
-For example for java in installed in <code>c:\Archivos de programa\java\jdk1.5.0_06</code>:
-<source>
-./configure --with-java=/cygdrive/c/Archiv~1/java/jdk1.5.0_06
-</source>
-</p>
-</section>
-
-</body>
-</document>
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
deleted file mode 100644
index 409dca3..0000000
--- a/src/site/xdoc/index.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
- 
-<document>
- 
- <properties>
-  <title>Daemon : Java based daemons or services</title>
-  <author email="jfrederic.clere at fujitsu-siemens.con">Jean-Frederic Clere</author>
- </properties>
-
-<body>
-<section name="Introduction">
-<p>
-      Since 1994, the Java programming language evolved and became a
-      valid tool to develop reliable and performant server applications as 
-      opposed to just applets and client applications. The major disadvantage of
-      the Java platform is that still today the only portable way to
-      start a Java application relies on a single point of entry: the
-      <CODE><EM CLASS="key">public static void</EM>
-      main(<EM CLASS="ref">String</EM>[])</CODE> method.
-</p>
-<p>
-      Having a single-point of entry is a valid solution for client
-      applications, where interactively a user can command to the application
-      to quit (which can terminate the Virtual Machine process at calling the
-      <CODE><EM CLASS="ref">System</EM>.exit(<EM CLASS="key">int</EM>)</CODE>
-      method), but in those cases where the application is not interactive
-      (server applications) there is currently no portable way to notify
-      the Virtual Machine of its imminent shutdown.
-</p>
-<p>
-      A server application written in Java might have to perform several tasks
-      before being able to shutdown the Virtual Machine process. For example
-      in the case of a Servlet container, before the VM process is shut down,
-      sessions might need to be serialized to disk, and web applications need
-      to be destroyed.
-</p>
-<p>
-      One common solution to this problem is to create (for example) a
-      <CODE><EM CLASS="ref">ServerSocket</EM></CODE> and wait for a particular
-      message to be issued. When the message is received, all operations
-      required to shut down the server applications are performed and at the
-      end the <CODE><EM CLASS="ref">System</EM>.exit</CODE> method is called
-      to terminate the Virtual Machine process. This method however, has
-      several disadvantages and risks:
-      <ul>
-      <li>
-      In case of a system-wide shutdown, the Virtual Machine process may be
-      shut down directly by the operating system without notifying the running
-      server application.
-      </li>
-      <li>
-      If an attacker finds out the shutdown message to send to the server 
-      and discovers a way to send this message, he can easily interrupt
-      the server's operation, bypassing all the security restrictions
-      implemented in the operating system.
-      </li>
-      </ul>
-</p>
-<p>
-      Most multi-user operating systems already have a way in which server
-      applications are started and stopped. Under Unix based operating systems
-      non interactive server applications are called <em>daemons</em> and are
-      controlled by the operating system with a set of specified
-      <em>signals</em>. Under Windows such programs are called <em>services</em>
-      and are controlled by appropriate calls to specific functions defined in
-      the application binary, but although the ways of dealing with the problem
-      are different, in both cases the operating system can notify a server
-      application of its imminent shutdown, and the application has the
-      ability to perform certain tasks before its process of execution is
-      destroyed.
-</p>
-</section>
-
-<section name="Structure">
-<p>
-      Daemon is made of 2 parts. One written in C that makes the interface to
-      the operating system and the other in Java that provides the 
-      Daemon API.
-</p>
-</section>
-
-<section name="Platforms">
-<p>
-      Both win32 and UNIX like platforms are supported.
-      For win32 platforms use <a href="procrun.html">procrun</a>.
-      For UNIX like platforms use <a href="jsvc.html">jsvc</a>.
-</p>
-</section>
-<section name="Initial Source of the Package">
-
-<p>The original Java classes came from the Jakarta Tomcat 4.0 project.</p>
-
-<p>The package name for the Daemon component is
-<code>org.apache.commons.daemon</code>.
-</p>
-</section>
-
-</body>
-</document>
diff --git a/src/site/xdoc/issue-tracking.xml b/src/site/xdoc/issue-tracking.xml
deleted file mode 100644
index 2ad9465..0000000
--- a/src/site/xdoc/issue-tracking.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<!--
- +======================================================================+
- |****                                                              ****|
- |****      THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN      ****|
- |****                    DO NOT EDIT DIRECTLY                      ****|
- |****                                                              ****|
- +======================================================================+
- | TEMPLATE FILE: issue-tracking-template.xml                           |
- | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
- +======================================================================+
- |                                                                      |
- | 1) Re-generate using: mvn commons:jira-page                          |
- |                                                                      |
- | 2) Set the following properties in the component's pom:              |
- |    - commons.jira.id  (required, alphabetic, upper case)             |
- |    - commons.jira.pid (required, numeric)                            |
- |                                                                      |
- | 3) Example Properties                                                |
- |                                                                      |
- |  <properties>                                                        |
- |    <commons.jira.id>MATH</commons.jira.id>                           |
- |    <commons.jira.pid>12310485</commons.jira.pid>                     |
- |  </properties>                                                       |
- |                                                                      |
- +======================================================================+
--->
-<document>
-  <properties>
-    <title>Commons Daemon Issue tracking</title>
-    <author email="dev at commons.apache.org">Commons Documentation Team</author>
-  </properties>
-  <body>
-
-    <section name="Commons Daemon Issue tracking">
-      <p>
-      Commons Daemon uses <a href="http://issues.apache.org/jira/">ASF JIRA</a> for tracking issues.
-      See the <a href="http://issues.apache.org/jira/browse/DAEMON">Commons Daemon JIRA project page</a>.
-      </p>
-
-      <p>
-      To use JIRA you may need to <a href="http://issues.apache.org/jira/secure/Signup!default.jspa">create an account</a>
-      (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically
-      created and you can use the <a href="http://issues.apache.org/jira/secure/ForgotPassword!default.jspa">Forgot Password</a>
-      page to get a new password).
-      </p>
-
-      <p>
-      If you would like to report a bug, or raise an enhancement request with
-      Commons Daemon please do the following:
-      <ol>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">Search existing open bugs</a>.
-            If you find your issue listed then please add a comment with your details.</li>
-        <li><a href="mail-lists.html">Search the mailing list archive(s)</a>.
-            You may find your issue or idea has already been discussed.</li>
-        <li>Decide if your issue is a bug or an enhancement.</li>
-        <li>Submit either a <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310468&issuetype=1&priority=4&assignee=-1">bug report</a>
-            or <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310468&issuetype=4&priority=4&assignee=-1">enhancement request</a>.</li>
-      </ol>
-      </p>
-
-      <p>
-      Please also remember these points:
-      <ul>
-        <li>the more information you provide, the better we can help you</li>
-        <li>test cases are vital, particularly for any proposed enhancements</li>
-        <li>the developers of Commons Daemon are all unpaid volunteers</li>
-      </ul>
-      </p>
-
-      <p>
-      For more information on subversion and creating patches see the
-      <a href="http://www.apache.org/dev/contributors.html">Apache Contributors Guide</a>.
-      </p>
-
-      <p>
-      You may also find these links useful:
-      <ul>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">All Open Commons Daemon bugs</a></li>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC&status=5&status=6">All Resolved Commons Daemon bugs</a></li>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC">All Commons Daemon bugs</a></li>
-      </ul>
-      </p>
-    </section>
-  </body>
-</document>
diff --git a/src/site/xdoc/jsvc.xml b/src/site/xdoc/jsvc.xml
deleted file mode 100644
index 7383935..0000000
--- a/src/site/xdoc/jsvc.xml
+++ /dev/null
@@ -1,269 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<document>
-
- <properties>
-  <title>Daemon : Java Service</title>
-  <author email="jfrederic.clere at fujitsu-siemens.con">Jean-Frederic Clere</author>
- </properties>
-
-<body>
-<section name="Introduction">
-<p>
-      Jsvc is a set of libraries and applications for making Java
-      applications run on UNIX more easily. It can run on win32 via
-      the cygwin emulation layer (see 
-      <a href="http://www.cygwin.com/"> cygwin</a> for more information),
-      however win32 users may prefer to use <a href="procrun.html"> procrun</a>
-      instead.
-</p>
-<p>
-      The sources are located in the src/native/unix subdirectory.
-</p>
-<p>
-      In the future <a href="http://apr.apache.org/"> APR </a> may be used
-      to provide more portable platform support.
-</p>
-</section>
-
-<section name="Building from source">
-<p>
-To build under a UNIX operating system you will need:
-<ul>
-  <li>GNU AutoConf (at least version 2.53)</li>
-  <li>An ANSI-C compliant compiler (GCC is good)</li>
-  <li>GNU Make</li>
-  <li>A Java Platform 2 compliant SDK</li>
-</ul>
-
-
-You need to build the "configure" program with:
-
-<source>
-sh support/buildconf.sh
-</source>
-
-(Note it is possible to replace sh by any compatible shell like bash, ksh).
-
-The result should be something like:
-<source>
-support/buildconf.sh
-support/buildconf.sh: configure script generated successfully
-</source>
-Once the configure script is generated, follow the next section.
-</p>
-</section>
-
-<section name="Building from a release tarball">
-<p>
-To build the binary under a UNIX operating system you will need:
-<ul>
-  <li>An ANSI-C compliant compiler (GCC is good)</li>
-  <li>GNU Make</li>
-  <li>A Java Platform 2 compliant SDK</li>
-</ul>
-
-You have to specify the <code>JAVA_HOME</code> of the SDK
-either with the <code>--with-java=<dir></code> parameter or set the <code>JAVA_HOME</code> environment
-to point to your SDK installation. For example:
-<source>
-./configure --with-java=/usr/java
-</source>
-or
-<source>
-export JAVA_HOME
-./configure
-</source>
-
-If your operating system is supported, configure will go through cleanly,
-otherwise it will report an error (please send us the details of your
-OS/JDK, or a patch against the sources). To build the binaries and
-libraries simply do:
-<source>
-make
-</source>
-This will generate the executable file <code>jsvc</code>.
-</p>
-</section>
-
-<section name="Starting jsvc">
-<p>
-To check the allowed parameters for the jsvc binary simply do:
-<source>
-./jsvc -help
-Usage: jsvc [-options] class [args...]
-
-Where options include:
-
-    -jvm <JVM name>
-        use a specific Java Virtual Machine. Available JVMs:
-            'client' 'server'
-    -cp / -classpath <directories and zip/jar files>
-        set search path for service classes and resouces
-    -home <directory>
-        set the path of your JDK or JRE installation (or set
-        the JAVA_HOME environment variable)
-    -version
-        show the current Java environment version (to check
-        correctness of -home and -jvm. Implies -nodetach)
-    -help / -?
-        show this help page (implies -nodetach)
-    -nodetach
-        don't detach from parent process and become a daemon
-    -debug
-        verbosely print debugging information
-    -check
-        only check service (implies -nodetach)
-    -user <user>
-        user used to run the daemon (defaults to current user)
-    -verbose[:class|gc|jni]
-        enable verbose output
-    -outfile </full/path/to/file>
-        Location for output from stdout (defaults to /dev/null)
-        Use the value '&2' to simulate '1>&2'
-    -errfile </full/path/to/file>
-        Location for output from stderr (defaults to /dev/null)
-        Use the value '&1' to simulate '2>&1'
-    -pidfile </full/path/to/file>
-        Location for output from the file containing the pid of jsvc
-        (defaults to /var/run/jsvc.pid)
-    -D<name>=<value>
-        set a Java system property
-    -X<option>
-        set Virtual Machine specific option
-    -procname <process name>
-        Allows the process name to be configured on Linux
-    -wait <waittime>
-        wait waittime seconds for the service to start
-        waittime should multiple of 10 (min=10)
-    -stop
-        stop the service using the file given in the -pidfile option
-
-</source>
-</p>
-
-</section>
-<section name="Using jsvc">
-<p>
-There two ways to use jsvc: via a Class that implements the Daemon interface or
-via calling a Class that has the required methods.
-For example Tomcat-4.1.x uses the Daemon interface
-whereas Tomcat-5.0.x provides a Class whose methods are called by jsvc directly.
-</p>
-<subsection name="Via Daemon interface">
-<p>
-Do the following:
-<ul>
-  <li>Write a Class that implements the Daemon interface (MyClass).</li>
-  <li>Put it in a jarfile (my.jar).</li>
-  <li>Call jsvc like:
-  <source>
-./jsvc -cp commons-daemon.jar:my.jar MyClass
-  </source>
-  </li>
-</ul>
-</p>
-</subsection>
-<subsection name="Directly">
-<p>
-Write a Class (MyClass) that implements the following methods:
-<ul>
-  <li>void init(String[] arguments): Here open configuration files, create a trace file, create
-      ServerSockets, Threads</li>
-  <li>void start(): Start the Thread, accept incoming connections</li>
-  <li>void stop(): Inform the Thread to terminate the run(), close the ServerSockets</li>
-  <li><code>void destroy()</code>: Destroy any object created in init()</li>
-</ul>
-Store it in a jarfile and use as above:
-<source>
-./jsvc -cp commons-daemon.jar:my.jar MyClass
-</source>
-</p>
-</subsection>
-</section>
-<section name="How jsvc works">
-<p>
-Jsvc uses 3 processes: a launcher process, a controller process and a controlled process.
-The controlled process is also the main java thread, if the JVM crashes
-the controller will restart it in the next minute.
-Jsvc is a daemon process so it should be started as root and the <code>-user</code> parameter
-allows to downgrade to an unprivilegded user.
-When the <code>-wait</code> parameter is used, the launcher process waits until the controller says
-"I am ready", otherwise it returns after creating the controller process.
-</p>
-
-<subsection name="Forks in commons-daemon">
-<p>
-Launcher process:
-<source>
-main()
-{
-  fork()
-  parent: wait_child(), wait until JAVA service started when the child says "I am ready".
-  child: controller process.
-}
-</source>
-
-Controller process:
-<source>
-  while (fork()) {
-    parent: wait_for_child.
-      if exited and restart needed continue
-      else exit.
-    child: exit(child()). controlled process.
-  }
-</source>
-
-Controlled process:
-<source>
-In child(): controlled process.
-  init_JVM().
-  load_service().
-  start_service().
-  say "I am ready"
-  wait for signal or pool for stop
-  stop_service().
-  destroy_service().
-  destroy_JVM().
-  exit (with different codes so that parent knows if it has to restart us).
-</source>
-Note: The controller process uses signals to stop the controlled process.
-</p>
-</subsection>
-
-<subsection name="Downgrading user">
-<p>
-On linux <code>setuid()</code>/<code>setgid()</code> + capabilities are used. On other unix <code>setgid</code>/<code>initgroups</code> are used.
-
-We have something like:
-<source>
-/* as root */
-init_JVM().
-load_service. /*  java_load() calls the load method */
-downgrade user (set_caps() or set_user_group())
-/* as the user $USER (from -user $USER parameter) */
-umask()
-start_service. /* java_start() calls the start method */
-</source>
-</p>
-</subsection>
-</section>
-
-</body>
-</document>
diff --git a/src/site/xdoc/procrun.xml b/src/site/xdoc/procrun.xml
deleted file mode 100644
index 1727fc2..0000000
--- a/src/site/xdoc/procrun.xml
+++ /dev/null
@@ -1,374 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<document>
- <properties>
-  <title>Daemon : Procrun</title>
-  <author email="mturk at apache.org">Mladen Turk</author>
- </properties>
-
-<body>
-<section name="Introduction">
-<p>
-    Procrun is a set of libraries and applications for making Java
-    applications run on WIN32 more easily.
-</p> 
-<subsection name="Procrun service application">
-<p>
-    <b>Prunsrv</b> is a service application for running applications as services.
-    It can convert any application to run as a service.
-</p>
-</subsection>
-<subsection name="Procrun monitor application">
-<p>
-    <b>Prunmgr</b> is a GUI application for monitoring and configuring procrun
-    services.
-</p>    
-    <p>The available command line options are:</p>
-<p> 
-    <table>
-    <tr><th>//ES//</th>
-        <td>Edit service configuration</td>
-        <td>This is the default operation. It is called if the no option is
-            provided but the executable is renamed to <b>servicenameW.exe</b></td>
-    </tr>
-    <tr><th>//MS//</th>
-        <td>Monitor service</td>
-        <td>Put the icon in the system try</td>
-    </tr>
-    </table>
-</p>
-</subsection>
-</section>
-<section name="Command line arguments">
-<p>
-    Each command line directive is in the form of <b>//XX//ServiceName</b>
-</p>
-    <p>The available command line options are:</p>
-<p> 
-    <table>
-    <tr><th>//TS//</th>
-        <td>Run the service as console application</td>
-        <td>This is the default operation. It is called if the no option is
-            provided but the executable is renamed to <b>servicename.exe</b></td>
-    </tr>
-    <tr><th>//RS//</th>
-        <td>Run the service</td>
-        <td>Called only from ServiceManager</td>
-    </tr>
-    <tr><th>//SS//</th>
-        <td>Stop the service</td>
-        <td></td>
-    </tr>
-    <tr><th>//US//</th>
-        <td>Update service parameters</td>
-        <td></td>
-    </tr>
-    <tr><th>//IS//</th>
-        <td>Install service</td>
-        <td></td>
-    </tr>
-    <tr><th>//DS//</th>
-        <td>Delete service</td>
-        <td>Stops the service if running</td>
-    </tr>        
-    </table>
-</p> 
-</section>
-<section name="Command line parameters">
-<p>
-    Each command parameter is prefixed with <b>--</b>.
-    If the command line is prefixed with <b>++</b> then it's value will
-    be appended to the existing option.
-    If the environment variable with the same name as command line parameter but
-    prefixed with <code>PR_</code> exists it will take precedence.
-    For example:
-<source>set PR_CLASSPATH=xx.jar</source>
-</p>    
-<p>is equivalent to providing
-<source>--Classpath=xx.jar</source>
-</p>
-<p> as command line parameter.</p>
-<p> 
-    <table>
-    <tr>
-    <th>ParameterName</th>
-	<th>Default</th>
-	<th>Description</th>
-	</tr> 
-    <tr>
-    <td>--Description</td>
-    <td></td>
-    <td>Service name description (maximum 1024 characters)</td>
-    </tr>
-    <tr>
-    <td>--DisplayName</td>
-    <td>ServiceName</td>
-    <td>Service display name</td>
-    </tr>
-    <tr>
-    <td>--Install</td>
-    <td>procrun.exe //RS//ServiceName</td>
-    <td>Install image</td>
-    </tr>
-    <tr>
-    <td>--Startup</td>
-    <td>manual</td>
-    <td>Service startup mode can be either <b>auto</b> or <b>manual</b></td>
-    </tr>
-    <tr>
-    <td>--Type</td>
-    <td></td>
-    <td>Service type can be <b>interactive</b> to Allow service to interact with desktop.
-    Use this option only with Local system accounts.</td>
-    </tr>
-    <tr>
-    <td>--DependsOn</td>
-    <td></td>
-    <td>List of services that this service depend on. Dependent services
-        are separated using either <b>#</b> or <b>;</b> characters</td>
-    </tr>
-    <tr>
-    <td>--Environment</td>
-    <td></td>
-    <td>List of environment variables that will be provided to the service
-        in the form <b>key=value</b>. They are separated using either
-        <b>#</b> or <b>;</b> characters</td>
-    </tr>
-    <tr>
-    <td>--User</td>
-    <td></td>
-    <td>User account used for running executable. It is used only for
-    	StartMode <b>java</b> or <b>exe</b> and enables running applications
-    	as service under account without LogonAsService privilege.</td>
-    </tr>
-    <tr>
-    <td>--Password</td>
-    <td></td>
-    <td>Password for user account set by --User parameter</td>
-    </tr>
-    <tr>
-    <td>--ServiceUser</td>
-    <td></td>
-    <td>Specifies the name of the account under which the service should run.
-        Use an account name in the form <i>DomainName\UserName</i>.
-        The service process will be logged on as this user.
-        if the account belongs to the built-in domain, you can specify <i>.\UserName</i> 
-    </td>
-    </tr>
-    <tr>
-    <td>--ServicePassword</td>
-    <td></td>
-    <td>Password for user account set by --ServiceUser parameter</td>
-    </tr>
-    <tr>
-    <td>--JavaHome</td>
-    <td>JAVA_HOME</td>
-    <td>Set a different JAVA_HOME then defined by JAVA_HOME environment
-        variable</td>
-    </tr>
-    <tr>
-    <td>--Jvm</td>
-    <td>auto</td>
-    <td>Use either <b>auto</b> or specify the full path to the <b>jvm.dll</b>.
-        You can use the environment variable expansion here.</td>
-    </tr>
-    <tr>
-    <td>--JvmOptions</td>
-    <td>-Xrs</td>
-    <td>List of options in the form of <b>-D</b> or <b>-X</b> that will be
-        passed to the JVM. The options are separated using either
-        <b>#</b> or <b>;</b> characters. if you need to embed either # or ;
-        character put them inside single quotes.</td>
-    </tr>
-    <tr>
-    <td>--Classpath</td>
-    <td></td>
-    <td>Set the Java classpath</td>
-    </tr>
-    <tr>
-    <td>--JvmMs</td>
-    <td></td>
-    <td>Initial memory pool size in MB</td>
-    </tr>
-    <tr>
-    <td>--JvmMx</td>
-    <td></td>
-    <td>Maximum memory pool size in MB</td>
-    </tr>
-    <tr>
-    <td>--JvmSs</td>
-    <td></td>
-    <td>Thread stack size in KB</td>
-    </tr>
-    <tr>
-    <tr>
-    <td>--StartImage</td>
-    <td></td>
-    <td>Executable that will be run.</td>
-    </tr>
-    <tr>
-    <td>--StartPath</td>
-    <td></td>
-    <td>Working path for the start image executable.</td>
-    </tr>
-    <tr>
-    <td>--StartClass</td>
-    <td></td>
-    <td>Class that will be used for startup.</td>
-    </tr>
-    <tr>
-    <td>--StartParams</td>
-    <td></td>
-    <td>List of parameters that will be passed to either StartImage or
-        StartClass. Parameters are separated using either <b>#</b> or
-        <b>;</b> character.</td>
-    </tr>
-    <tr>
-    <td>--StartMethod</td>
-    <td>Main</td>
-    <td>Method name if differs then main</td>
-    </tr>
-    <tr>
-    <td>--StartMode</td>
-    <td>executable</td>
-    <td>Can one of <b>jvm</b> <b>java</b> or <b>exe</b></td>
-    </tr>
-    <td>--StopImage</td>
-    <td></td>
-    <td>Executable that will be run on Stop service signal.</td>
-    </tr>
-    <tr>
-    <td>--StopPath</td>
-    <td></td>
-    <td>Working path for the stop image executable.</td>
-    </tr>
-    <tr>
-    <td>--StopClass</td>
-    <td></td>
-    <td>Class that will be used on Stop service signal.</td>
-    </tr>
-    <tr>
-    <td>--StopParams</td>
-    <td></td>
-    <td>List of parameters that will be passed to either StopImage or
-        StopClass. Parameters are separated using either <b>#</b> or
-        <b>;</b> character.</td>
-    </tr>
-    <tr>
-    <td>--StopMethod</td>
-    <td>Main</td>
-    <td>Method name if differs then main</td>
-    </tr>
-    <tr>
-    <td>--StopMode</td>
-    <td>executable</td>
-    <td>Can one of <b>jvm</b> <b>java</b> or <b>exe</b></td>
-    </tr>
-    <tr>
-    <td>--StopTimeout</td>
-    <td>No Timeout</td>
-    <td>Defines the timeout in seconds that procrun waits for service to
-        exit gracefully.</td>
-    </tr>
-    <tr>
-    <td>--LogPath</td>
-    <td>%SystemRoot%\System\LogFiles\Apache</td>
-    <td>Defines the path for logging</td>
-    </tr>
-    <tr>
-    <td>--LogPrefix</td>
-    <td>jakarta_service_</td>
-    <td>Defines the service log filename</td>
-    </tr>
-    <tr>
-    <td>--LogLevel</td>
-    <td>INFO</td>
-    <td>Defines the logging level and can be either <b>error</b>,
-        <b>info</b>, <b>warn</b> or <b>debug</b></td>
-    </tr>
-    <tr>
-    <td>--StdOutput</td>
-    <td></td>
-    <td>Redirected stdout filename</td>
-    </tr>
-    <tr>
-    <td>--StdError</td>
-    <td></td>
-    <td>Redirected stderr filename</td>
-    </tr>    
-    </table>
-</p> 
-</section>
-<section name="Installing services">
-<p>
-To install the service, you need to use the <b>//IS//</b> parameter.
-</p>
-<p>
-<screen>
-<note>Install the service named 'TestService'</note>
-<type>prunsrv //IS//TestService --DisplayName="Test Service" \</type>
-<type>--Install=prunsrv.exe --Jvm=auto --StartMode=jvm --StopMode=jvm \</type>
-<type>--StartClass=org.apache.SomeStartClass --StartParams=arg1;arg2;arg3 \</type>
-<type>--StopClass=org.apache.SomeStopClass --StopParams=arg1#arg2 \</type>
-</screen>
-</p>
-</section>
-<section name="Updating services">
-<p>
-To update the service parameters, you need to use the <b>//US//</b> parameter.
-</p>
-<p>
-<screen>
-<note>Update the service named 'TestService'</note>
-<type>prunsrv //US//TestService --Description="Some Dummy Test Service" \</type>
-<type>--Startup=auto --Classpath=%CLASSPATH%;test.jar</type>
-</screen>
-</p>
-</section>
-<section name="Removing services">
-<p>
-To remove the service, you need to use the <b>//DS//</b> parameter.
-If the service is running it will be stopped and then deleted.
-</p>
-<p>
-<screen>
-<note>Remove the service named 'TestService'</note>
-<type>prunsrv //DS//TestService</type>
-</screen>
-</p>
-</section>
-
-<section name="Debugging services">
-<p>
-To run the service in console mode, you need to use the <b>//TS//</b> parameter.
-The service shutdown can be initiated by pressing <b>CTRL+C</b> or
-<b>CTRL+BREAK</b>.
-If you rename the prunsrv.exe to testservice.exe then you can just execute the
-testservice.exe and this command mode will be executed by default.
-</p>
-<p>
-<screen>
-<note>Run the service named 'TestService' in console mode</note>
-<type>prunsrv //TS//TestService [additional arguments]</type>
-</screen>
-</p>
-</section>
-
-</body>
-</document> 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/commons-daemon.git



More information about the pkg-java-commits mailing list