-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathjni.xml
258 lines (231 loc) · 9.24 KB
/
jni.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyrights : CNRS
* Author : Oleg Lodygensky
* Acknowledgment : XtremWeb-HEP is based on XtremWeb 1.8.0 by inria : http://www.xtremweb.net/
* Web : http://www.xtremweb-hep.org
*
* This file is part of XtremWeb-HEP.
*
* XtremWeb-HEP is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XtremWeb-HEP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XtremWeb-HEP. If not, see <http://www.gnu.org/licenses/>.
*
-->
<!-- <!DOCTYPE project SYSTEM "ant.dtd" > -->
<!-- build.xml - Ant build file for the XWHEP sources
created Mon Mar 25 2002 by Samuel Heriard
-->
<project
basedir="."
default="all"
name="xtremweb" >
<property name="src.c.dir" value="${basedir}/src/main/natif/xtremweb/archdep" />
<property name="build.dir" value="${basedir}/build" />
<property name="src.dir" value="${basedir}/src" />
<property name="src.test.dir" value="${src.dir}/test/" />
<property name="lib.dir" value="${basedir}/libXtremWeb" />
<property name="build.classes" value="${basedir}/build/classes/java/main/" />
<property name="misc.dir" value="${basedir}/src/main/resources/misc" />
<target name="getversion" >
<property file="${basedir}/gradle.properties" />
<property name="xwversion" value="${version}" />
</target>
<target name="configure" depends="getversion">
<property environment="localEnv" />
<property name="target.os" value="${os.name}" />
<condition property="version.changed">
<or>
<not><available file="${build.dir}/.build" /></not>
<not>
<uptodate targetfile="${build.dir}/.build">
<srcfiles dir="${build.dir}" includes="VERSION" />
<srcfiles dir="${src.java.dir}/common" includes="*" />
<srcfiles dir="${src.java.test.dir}/" includes="**" />
<srcfiles dir="${src.java.dir}/communications" includes="*" />
<srcfiles dir="${src.java.dir}/dispatcher" includes="*" />
<srcfiles dir="${src.java.dir}/archdep" includes="*" />
<srcfiles dir="${src.java.dir}/exec" includes="*" />
<srcfiles dir="${src.java.dir}/worker" includes="*" />
<srcfiles dir="${src.java.dir}/services" includes="*" />
<srcfiles dir="${src.java.dir}/dispatcher" includes="*" />
</uptodate>
</not>
</or>
</condition>
<!-- else parameter needs ant 1.6.3 minimum -->
<condition property="compiler" value="classic" else="modern">
<or>
<equals arg1="${ant.java.version}" arg2="1.1" />
<equals arg1="${ant.java.version}" arg2="1.2" />
</or>
</condition>
<condition property="xwarch" value="ix86">
<or>
<equals arg1="${os.arch}" arg2="i86" />
<equals arg1="${os.arch}" arg2="x86" />
<equals arg1="${os.arch}" arg2="ix86" />
<equals arg1="${os.arch}" arg2="i386" />
<equals arg1="${os.arch}" arg2="x386" />
<equals arg1="${os.arch}" arg2="ix386" />
<equals arg1="${os.arch}" arg2="i486" />
<equals arg1="${os.arch}" arg2="x486" />
<equals arg1="${os.arch}" arg2="ix486" />
<equals arg1="${os.arch}" arg2="i586" />
<equals arg1="${os.arch}" arg2="x586" />
<equals arg1="${os.arch}" arg2="ix586" />
<equals arg1="${os.arch}" arg2="i686" />
<equals arg1="${os.arch}" arg2="x686" />
<equals arg1="${os.arch}" arg2="ix686" />
</or>
</condition>
<condition property="xwarch" value="amd64">
<equals arg1="${os.arch}" arg2="amd64" />
</condition>
<condition property="xwarch" value="x86_64">
<equals arg1="${os.arch}" arg2="x86_64" />
</condition>
<condition property="xwsuffix" value="linux-${xwarch}">
<equals arg1="${target.os}" arg2="Linux" />
</condition>
<condition property="xwsuffix" value="solaris-sparc">
<equals arg1="${target.os}" arg2="SunOS" />
</condition>
<condition property="xwsuffix" value="FreeBSD-${xwarch}">
<equals arg1="${target.os}" arg2="FreeBSD" />
</condition>
<condition property="xwsuffix" value="macosx-${xwarch}">
<equals arg1="${target.os}" arg2="Mac OS X" />
</condition>
<condition property="xwsuffix" value="win32-${xwarch}">
<or>
<equals arg1="${target.os}" arg2="Windows NT" />
<equals arg1="${target.os}" arg2="Windows 2000" />
<equals arg1="${target.os}" arg2="Windows XP" />
</or>
</condition>
<property name="dist.dir" value="${build.dir}/dist/${ant.project.name}-${xwversion}" />
<property name="dist.bin.dir" value="${dist.dir}/bin" />
<property name="dist.lib" value="${dist.dir}/lib" />
<property name="dist.doc" value="${dist.dir}/doc" />
<echo>
ant version = ${ant.version}
os = ${os.name}
os.arch = ${os.arch}
target = ${target.os}
xwarch = ${xwarch}
xwsuffix = ${xwsuffix}
debug = ${debug}
debuglevel = ${debuglevel}
cross = ${cross.prefix}
target java home = ${cross.java.home}
target = ${target.os}
xwversion = ${xwversion}
</echo>
</target>
<target name="prepare" depends="configure">
<!-- MAKE THE DIRECTORIES IF NEEDED -->
<mkdir dir="${basedir}/build" />
<mkdir dir="${basedir}/build/dist" />
<mkdir dir="${basedir}/build/bin" />
<mkdir dir="${basedir}/build/obj" />
<mkdir dir="${basedir}/build/obj/${xwsuffix}" />
<mkdir dir="${basedir}/build/jni" />
<mkdir dir="${basedir}/build/xwclasses" />
<!-- CLASSPATH FOR COMPILATION -->
<path id="project.classpath">
<pathelement path="${src.dir}" />
<pathelement path="${src.test.dir}" />
<pathelement path="${build.classes}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<property name="classpath" refid="project.classpath" />
<echo>
classpath=${classpath}
</echo>
</target>
<!-- It should probably be removed -->
<target name="common" depends="prepare">
<javac compiler="${compiler}"
classpath="${classpath}"
debug="${debug}"
debuglevel="${debuglevel}"
includeAntRuntime="false"
destdir="${build.classes}"
srcdir="${src.java.dir}"
source="1.8"
deprecation="on">
<patternset>
<include name="**/*.java" />
<exclude name="chkpt/*.java" />
<exclude name="mpi/*.java" />
<exclude name="rpcv/*.java" />
<exclude name="wctrl/*.java" />
</patternset>
</javac>
</target>
<target name="archdep" depends="configure">
<javac compiler="${compiler}"
classpath="${classpath}"
debug="${debug}"
debuglevel="${debuglevel}"
includeAntRuntime="false"
destdir="${build.classes}"
srcdir="src/main/java/xtremweb"
source="1.8"
deprecation="on">
<patternset><include name="archdep/**" /></patternset>
</javac>
</target>
<!-- generate jni headers -->
<target name="jni" depends="prepare">
<!--
use exec task, because javah task does not with openjdk...
-->
<exec dir="${src.c.dir}" executable="javah" failonerror="true">
<arg line="-classpath ${classpath} -o ${src.c.dir}/PortMapper.h xtremweb.archdep.PortMapper" />
</exec>
<exec dir="${src.c.dir}" executable="javah" failonerror="true">
<arg line="-classpath ${classpath} -o ${src.c.dir}/XWUtilImpl.h xtremweb.archdep.XWUtilImpl" />
</exec>
<exec dir="${src.c.dir}" executable="javah" failonerror="true">
<arg line="-classpath ${classpath} -o ${src.c.dir}/XWTracerImpl.h xtremweb.archdep.XWTracerImpl" />
</exec>
<exec dir="${src.c.dir}" executable="javah" failonerror="true">
<arg line="-classpath ${classpath} -o ${src.c.dir}/XWInterruptsImpl.h xtremweb.archdep.XWInterruptsWin32" />
</exec>
<exec dir="${src.c.dir}" executable="javah" failonerror="true">
<arg line="-classpath ${classpath} -o ${src.c.dir}/WinSaver.h xtremweb.archdep.WinSaver" />
</exec>
<exec dir="${src.c.dir}" executable="javah" failonerror="true">
<arg line="-classpath ${classpath} -o ${src.c.dir}/MacSaver.h xtremweb.archdep.MacSaver" />
</exec>
<copy todir="${src.c.dir}"
filtering="no" overwrite="yes">
<fileset dir="${misc.dir}">
<include name="**/*.ico" />
</fileset>
</copy>
<!-- make install must copy the files (jni shared libraries) in ${dist.lib} -->
<exec dir="${src.c.dir}" executable="make" failonerror="true">
<arg line="-f '${basedir}/src/main/resources/natif.mk' install" />
<env key="XWSUFFIX" value="${xwsuffix}" />
<env key="XWARCH" value="${xwarch}" />
<env key="TARGET" value="${target.os}" />
<env key="CROSS" value="${cross.prefix}" />
<env key="TARGET_JAVA_HOME" value="${cross.java.home}" />
<env key="XWVERSION" value="${xwversion}" />
</exec>
</target>
</project>