forked from hyphanet/fred
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_binary.xml
156 lines (141 loc) · 5.63 KB
/
build_binary.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?xml version="1.0"?>
<project name="Freenet_binary" default="dist_gcj" basedir=".">
<description>
This file builds freenet... as a binary :p
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name="bin" location="bin"/>
<property name="freenet-cvs-snapshot.location" location="${lib}/freenet-cvs-snapshot.jar"/>
<property name="freenet-ext.location" location="${lib}/freenet-ext.jar"/>
<property name="gnu-crypto.location" location="${lib}/gnu-crypto.jar"/>
<property name="javax-crypto.location" location="${lib}/javax-crypto.jar"/>
<property name="javax-security.location" location="${lib}/javax-security.jar"/>
<target name="env_gcj" description="Learn about the environment">
<mkdir dir="${bin}"/>
<mkdir dir="${build}"/>
<mkdir dir="${lib}"/>
<mkdir dir="misc"/>
<available file="${lib}/gnu-crypto.jar" property="gnu-crypto.present"/>
<available file="${lib}/javax-crypto.jar" property="javax-crypto.present"/>
<available file="${lib}/javax-security.jar" property="javax-security.present"/>
<available file="${lib}/freenet-cvs-snapshot.jar" property="freenet.present"/>
<available file="${lib}/freenet-ext.jar" property="freenet-ext.present"/>
</target>
<target name="get-gnu-crypto" depends="env_gcj" unless="gnu-crypto.present">
<get src="ftp://ftp.gnu.org/gnu/gnu-crypto/binaries/gnu-crypto-2.0.1-bin-r1.zip"
dest="misc/gnu-crypto-2.0.1-bin-r1.zip"
verbose="true"
usetimestamp="true"/>
<unzip src="misc/gnu-crypto-2.0.1-bin-r1.zip" dest="misc"/>
<move todir="lib">
<fileset dir="misc/gnu-crypto-2.0.1-bin/lib/">
<include name="*.jar"/>
</fileset>
</move>
<property name="gnu-crypto.present" value="true"/>
<property name="javax-crypto.present" value="true"/>
<property name="javax-security.present" value="true"/>
</target>
<target name="get-release" depends="env_gcj" unless="freenet.present"
description="Download FRED">
<exec executable="ant" failonerror="true"/>
<property name="freenet.present" value="true"/>
</target>
<target name="get-extjar" depends="env_gcj" unless="freenet-ext.present"
description="Download some external libraries which Freenet relies on">
<get src="http://downloads.freenetproject.org/alpha/freenet-ext.jar"
dest="${freenet-ext.location}"
verbose="true"
usetimestamp="true"/>
<property name="freenet-ext.present" value="true"/>
</target>
<!-- ================================================== -->
<target name="compile_gcj" depends="get-release,get-extjar,get-gnu-crypto">
<!-- Create the time stamp -->
<tstamp/>
<echo message="Compiling freenet-ext.jar"/>
<exec executable="gcj" failonerror="true">
<arg value="-c"/>
<arg value="-O3"/>
<arg value="-fno-bounds-check"/>
<arg value="-fno-store-check"/>
<arg value="-fjni"/>
<arg value="-o"/>
<arg value="${build}/freenet-ext.o"/>
<arg value="-I${lib}/freenet-cvs-snapshot.jar"/>
<arg value="-I${lib}/freenet-ext.jar"/>
<arg value="-I${gnu-crypto.location}"/>
<arg value="-I${javax-crypto.location}"/>
<arg value="-I${javax-security.location}"/>
<arg value="${lib}/freenet-ext.jar"/>
</exec>
<echo message="Compiling freenet-cvs-snapshot.jar"/>
<exec executable="gcj" failonerror="true">
<arg value="-c"/>
<arg value="-O3"/>
<arg value="-fno-bounds-check"/>
<arg value="-fno-store-check"/>
<arg value="-fjni"/>
<arg value="-o"/>
<arg value="${build}/freenet-cvs-snapshot.o"/>
<arg value="-I${lib}/freenet-cvs-snapshot.jar"/>
<arg value="-I${lib}/freenet-ext.jar"/>
<arg value="-I${gnu-crypto.location}"/>
<arg value="-I${javax-crypto.location}"/>
<arg value="-I${javax-security.location}"/>
<arg value="${lib}/freenet-cvs-snapshot.jar"/>
</exec>
</target>
<!-- ================================================== -->
<target name="link_gcj" depends="compile_gcj"
description="generate the distribution" >
<echo message="Extracting libs from freenet-ext.jar"/>
<unzip src="${lib}/freenet-ext.jar" dest="${bin}"/>
<echo message="Linking"/>
<exec executable="gcj" failonerror="true">
<arg value="-combine"/>
<arg value="-O3"/>
<arg value="-fno-bounds-check"/>
<arg value="-fno-store-check"/>
<arg value="-fjni"/>
<arg value="-o"/>
<arg value="freenet"/>
<arg value="--main=net.i2p.util.NativeBigInteger"/>
<arg value="-I${lib}/freenet-cvs-snapshot.jar"/>
<arg value="-I${lib}/freenet-ext.jar"/>
<arg value="-I${gnu-crypto.location}"/>
<arg value="-I${javax-crypto.location}"/>
<arg value="-I${javax-security.location}"/>
<arg value="-L${bin}/lib/linux/x86/"/>
<arg value="-L${bin}/net/i2p/util/"/>
<arg value="-lfec16"/>
<arg value="-lfec8"/>
<arg value="-ljbigi-linux-athlon"/>
<arg value="-l-javax-security"/>
<arg value="-l-javax-crypto"/>
<arg value="-l-gnu-crypto"/>
<arg value="${build}/freenet-ext.o"/>
<arg value="${build}/freenet-cvs-snapshot.o"/>
</exec>
</target>
<target name="dist_gcj" depends="link_gcj"
description="generate the distribution" />
<!-- ================================================== -->
<target name="clean" description="Delete class files and docs dir.">
<delete dir="${build}"/>
<delete dir="${bin}"/>
<delete file="freenet"/>
<delete file="*.o"/>
</target>
<target name="distclean" description="Delete class files, lib dir and docs dir.">
<delete dir="${build}"/>
<delete dir="${bin}"/>
<delete dir="${lib}"/>
<delete dir="misc"/>
<delete file="freenet"/>
<delete file="*.o"/>
</target>
</project>