root/release-kits/lirk3/ant-scripts/wrap.xml @ 15104

Revision 15104, 2.7 KB (checked in by oranfry, 11 years ago)

have lirk3 use search4j

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2
3<!--
4        ..........................................................
5        September 2007
6        Greenstone3 'release maker' script
7        Oran Fry
8        ..........................................................
9-->
10
11<project name="lirk3-wrap" default="wrap">
12
13
14    <target name="wrap">
15        <addressedcall target="setup-for-wrapping"/>
16        <addressedcall target="compile-wrapper"/>
17        <addressedcall target="clean-up-after-wrapping"/>
18    </target>
19
20
21    <target name="setup-for-wrapping">
22        <if><bool><istrue value="${execute}"/></bool>
23
24            <!-- create and setup the build directory -->
25            <mkdir dir="${basedir}/wrapped-installer/build"/>
26            <copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/wrapper/mywrapper.c"/>
27            <copy todir="${basedir}/wrapped-installer/build" file="${basedir}/installer/greenstone3.jar"/>
28
29        </if>
30    </target>
31
32    <target name="compile-wrapper">
33        <if><bool><istrue value="${execute}"/></bool>
34
35            <echo level="info">create an object file (extension .o) for each file to bundle</echo>
36            <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
37                <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone3_jar_start=greenstone3jar --readonly-text greenstone3.jar greenstone3.jar.o"/>
38            </exec>
39
40            <echo level="info">create a header file declaring the bundled files and their sizes</echo>
41            <delete file="mywrapper.h"/>
42
43            <!-- greenstone.jar -->
44            <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone3.jar.ls">
45                <arg line="-l greenstone3.jar"/>
46            </exec>
47            <!--<echo level="info">ls: ${greenstone3.jar.ls}</echo>-->
48            <exec executable="sed" inputstring="${greenstone3.jar.ls}" outputproperty="greenstone3.jar.size">
49                <arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/>
50            </exec>
51            <!--<echo level="info">size: ${greenstone3.jar.size}</echo>-->
52            <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h">
53                <arg line="extern const char greenstone3jar[${greenstone3.jar.size}];"/>
54            </exec>
55
56            <echo level="info">compile the wrapper program</echo>
57            <exec executable="g++" dir="${basedir}/wrapped-installer/build">
58                <arg line="-Wall -static -static-libgcc -c -o mywrapper.o mywrapper.c"/>
59            </exec>
60
61            <echo level="info">link, bundling the files to be bundled</echo>
62            <exec executable="g++" dir="${basedir}/wrapped-installer/build">
63                <arg line="-static -static-libgcc -o  ../greenstone-${version}-linux.bin mywrapper.o greenstone3.jar.o"/>
64            </exec>
65
66        </if>
67    </target>
68
69    <target name="clean-up-after-wrapping">
70        <if><bool><istrue value="${execute}"/></bool>
71            <delete dir="${basedir}/wrapped-installer/build"/>
72        </if>
73    </target>
74
75
76
77</project>
Note: See TracBrowser for help on using the browser.