Index: lucene/contrib/misc/src/java/overview.html
===================================================================
--- lucene/contrib/misc/src/java/overview.html	(revision 1100496)
+++ lucene/contrib/misc/src/java/overview.html	(working copy)
@@ -51,9 +51,11 @@
 
 Steps to build:
 <ul>
-  <li> <tt>cd lucene/contrib/misc/src/java/org/apache/lucene/store</tt>
+  <li> <tt>cd lucene/contrib/misc/</tt>
 
-  <li> Compile NativePosixUtil.cpp -> libNativePosixUtil.so.  On linux, something like <tt>gcc -fPIC -o libNativePosixUtil.so -shared -Wl,-soname,libNativePosixUtil.so  -I$JAVA_HOME/include -I$JAVA_HOME/include/linux NativePosixUtil.cpp -lc -lstdc++</tt>.  Add <tt>-m64</tt> if you want to compile 64bit (and java must be run with -d64 so it knows to load a 64bit dynamic lib).
+  <li> To compile NativePosixUtil.cpp -> libNativePosixUtil.so on Linux run<tt> ant build-native-unix</tt>.
+  
+  <li><tt>libNativePosixUtil.so</tt> will be located in the <tt>lucene/build/native/</tt> folder
 
   <li> Make sure libNativePosixUtil.so is on your LD_LIBRARY_PATH so java can find it (something like <tt>export LD_LIBRARY_PATH=/path/to/dir:$LD_LIBRARY_PATH</tt>, where /path/to/dir contains libNativePosixUtil.so)
 
Index: lucene/contrib/misc/build.xml
===================================================================
--- lucene/contrib/misc/build.xml	(revision 1100496)
+++ lucene/contrib/misc/build.xml	(working copy)
@@ -42,4 +42,26 @@
       <fileset dir="${common.dir}/../modules/analysis/common" includes="build.xml"/>
     </subant>
   </target>
+
+  <target name="build-native-unix" >
+    <mkdir dir="${common.build.dir}/native"/>
+
+    <taskdef resource="cpptasks.tasks">
+      <classpath>
+        <pathelement location="ant_lib/cpptasks-1.0b5.jar"/>
+      </classpath>
+    </taskdef>
+
+    <cc outtype="shared" subsystem="console" outfile="${common.build.dir}/native/NativePosixUtil" >
+      <fileset file="${src.dir}/org/apache/lucene/store/NativePosixUtil.cpp" />  
+      <includepath>
+        <pathelement location="${java.home}/../include"/>
+        <pathelement location="${java.home}/../include/linux"/>
+        <pathelement location="${java.home}/../include/solaris"/>
+      </includepath>
+
+      <compilerarg value="-fPIC" />
+    </cc>
+  </target>
+
 </project>
