Index: release-kits/lirk2/ant-scripts/wrap.xml
===================================================================
--- release-kits/lirk2/ant-scripts/wrap.xml	(revision 16232)
+++ release-kits/lirk2/ant-scripts/wrap.xml	(revision 16233)
@@ -14,7 +14,8 @@
 			<mkdir dir="${basedir}/wrapped-installer/build"/>
 			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/linux/wrapper.cpp"/>
+			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/packages/search4j/libsearch4j.cpp"/>
+			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/packages/search4j/libsearch4j.h"/>
 
 			<!-- copy bundled files -->
-			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/packages/search4j/search4j"/>
 			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/linux/${linux-java.installer}"/>
 			<copy tofile="${basedir}/wrapped-installer/build/greenstone2.jar" file="${basedir}/installer/greenstone-${version}-linux.jar"/>
@@ -41,7 +42,4 @@
 			</exec>
 			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
-				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_search4j_start=search4j --readonly-text search4j search4j.o"/>
-			</exec>
-			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
 				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_${linux-java.installer}_start=java --readonly-text ${linux-java.installer} java.o"/>
 			</exec>
@@ -55,8 +53,4 @@
 			<exec executable="sed" inputstring="${greenstone2-with-java.jar.ls}" outputproperty="greenstone2-with-java.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
 
-			<!-- get size of search4j -->
-			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="search4j.ls"><arg line="-l search4j"/></exec>
-			<exec executable="sed" inputstring="${search4j.ls}" outputproperty="search4j.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
-
 			<!-- get size of java -->
 			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="java.ls"><arg line="-l ${linux-java.installer}"/></exec>
@@ -66,5 +60,4 @@
 			<delete file="wrapper.h"/>
 			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone2jar[${greenstone2.jar.size}];"/></exec>
-			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="extern const char search4j[${search4j.size}];"/></exec>
 
 			<echo level="info">compile the wrapper program</echo>
@@ -73,7 +66,12 @@
 			</exec>
 
+			<echo level="info">compile libsearch4j</echo>
+			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
+				<arg line="-Wall -static -static-libgcc -c -o libsearch4j.o libsearch4j.cpp"/>
+			</exec>
+
 			<echo level="info">link, bundling the files to be bundled</echo>
 			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
-				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux.bin wrapper.o greenstone2.jar.o search4j.o"/>
+				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux.bin wrapper.o libsearch4j.o greenstone2.jar.o"/>
 			</exec>
 
@@ -81,5 +79,4 @@
 			<delete file="wrapper.h"/>
 			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone2jar[${greenstone2-with-java.jar.size}];"/></exec>
-			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="extern const char search4j[${search4j.size}];"/></exec>
 			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec>
 			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec>
@@ -92,5 +89,5 @@
 			<echo level="info">relink, bundling the files to be bundled</echo>
 			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
-				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux-with-java.bin wrapper.o greenstone2-with-java.jar.o search4j.o java.o"/>
+				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux-with-java.bin wrapper.o libsearch4j.o greenstone2-with-java.jar.o java.o"/>
 			</exec>
 
