source: release-kits/lirk3/ant-scripts/wrap.xml@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 14 years ago

initial import of LiRK3

File size: 2.5 KB
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 <mkdir dir="${basedir}/wrapped-installer/build"/>
25 <copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/wrapper/mywrapper.c"/>
26 <copy todir="${basedir}/wrapped-installer/build" file="${basedir}/installer/greenstone3.jar"/>
27
28 </if>
29 </target>
30
31 <target name="compile-wrapper">
32 <if><bool><istrue value="${execute}"/></bool>
33
34 <echo level="info">create an object file (extension .o) for each file to bundle</echo>
35 <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
36 <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone3_jar_start=greenstone3jar --readonly-text greenstone3.jar greenstone3.jar.o"/>
37 </exec>
38
39 <echo level="info">create a header file declaring the bundled files and their sizes</echo>
40 <delete file="mywrapper.h"/>
41
42 <!-- greenstone.jar -->
43 <exec executable="du" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone3.jar.du">
44 <arg line="-b greenstone3.jar"/>
45 </exec>
46 <exec executable="sed" inputstring="${greenstone3.jar.du}" outputproperty="greenstone3.jar.size">
47 <arg line="s/[^0-9].*//g"/>
48 </exec>
49 <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h">
50 <arg line="extern const char greenstone3jar[${greenstone3.jar.size}];"/>
51 </exec>
52
53
54 <echo level="info">compile the wrapper program</echo>
55 <exec executable="g++" dir="${basedir}/wrapped-installer/build">
56 <arg line="-Wall -static -static-libgcc -c -o mywrapper.o mywrapper.c"/>
57 </exec>
58
59 <echo level="info">link, bundling the files to be bundled</echo>
60 <exec executable="g++" dir="${basedir}/wrapped-installer/build">
61 <arg line="-static -static-libgcc -o ../greenstone-${version}-linux.bin mywrapper.o greenstone3.jar.o"/>
62 </exec>
63
64 </if>
65 </target>
66
67 <target name="clean-up-after-wrapping">
68 <if><bool><istrue value="${execute}"/></bool>
69 <delete dir="${basedir}/wrapped-installer/build"/>
70 </if>
71 </target>
72
73
74
75</project>
Note: See TracBrowser for help on using the repository browser.