forked from java-native-access/jna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
1752 lines (1633 loc) · 78.1 KB
/
build.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<project name="JNA" default="default" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant"
xmlns:as="antlib:org.codehaus.mojo.animal_sniffer"
xmlns:if="ant:if"
xmlns:unless="ant:unless">
<description>Builds and tests JNA</description>
<!-- Default build compiles all platform-independent stuff as well
as the JNI bits for the current platform, using the arch model
of the current Java VM to determine whether 32- or 64-bit
binaries are built (ANT_OPTS=-d32/-d64 to switch on platforms that
support it).
Cross-compile by specifying -Dos.prefix={name-arch} to ant
(cross-compile currently only configured/tested on w32ce-arm and
android targets)
Use ANT_OPTS=-D-native=true to build native parts, or directly
invoke the native or test targets
Use ANT_OPTS=-Dheadless to run tests headless
Use ANT_OPTS=-Drelease to stage a final, non-snapshot version
-->
<!--
Conventions (since ant can't easily specify arbitrary file dependencies):
The uptodate property for a given target TARGET is "-TARGET"; the actual
target to generate the uptodate property is named ":TARGET".
Properties (except for uptodate properties) separate words by dots, targets
by dashes.
-->
<!-- global properties -->
<!-- (all build-related props should go in -dynamic-properties) -->
<property name="name" value="jna"/>
<property name="jar" value="${name}.jar"/>
<property name="aar" value="${name}.aar"/>
<property name="minjar" value="${name}-min.jar"/>
<property name="testjar" value="${name}-test.jar"/>
<property name="testjar2" value="${name}-test2.jar"/>
<property name="testjar3" value="${name}-test3.jar"/>
<property name="jar-jpms" value="${name}-jpms.jar"/>
<property name="debug" value="true"/>
<property name="debug.native" value="false"/>
<property name="cflags_extra.native" value=""/>
<property name="dynlink.native" value="false"/>
<property name="native" location="native"/>
<property name="src" location="src"/>
<property name="platform.src" location="contrib/platform/src"/>
<property name="contrib" location="contrib"/>
<property name="dist" location="dist"/>
<property name="lib.native" location="lib/native"/>
<property name="test.src" location="test"/>
<property name="doc" location="doc"/>
<property name="javadoc" location="${doc}/javadoc"/>
<property name="stylesheet" location="${javadoc}/doc/css/javadoc.css"/>
<property name="vendor" value="JNA Development Team"/>
<property name="year" value="2018"/>
<property name="copyright"
value="Copyright &copy; 2007-${year} Timothy Wall. All Rights Reserved."/>
<buildnumber/>
<!-- JNA library release version - android versionCode is derived from mjar/minor/revision -->
<property name="jna.major" value="5"/>
<property name="jna.minor" value="14"/>
<property name="jna.revision" value="0"/>
<property name="jna.build" value="0"/> <!--${build.number}-->
<condition property="version.suffix" value="" else="-SNAPSHOT">
<or>
<isset property="release"/>
<isset property="maven-release"/>
</or>
</condition>
<property name="jna.version" value="${jna.major}.${jna.minor}.${jna.revision}${version.suffix}"/>
<property name="osgi.version" value="${jna.major}.${jna.minor}.${jna.revision}"/>
<!-- jnidispatch library release version -->
<property name="jni.major" value="7"/>
<property name="jni.minor" value="0"/>
<property name="jni.revision" value="0"/>
<property name="jni.build" value="0"/> <!--${build.number}-->
<property name="jni.version" value="${jni.major}.${jni.minor}.${jni.revision}"/>
<property name="jni.md5" value="5fb98531302accd485c534c452dd952a"/>
<property name="spec.title" value="Java Native Access (JNA)"/>
<property name="spec.vendor" value="${vendor}"/>
<property name="spec.version" value="${jna.major}"/>
<property name="impl.title" value="com.sun.jna"/>
<property name="impl.vendor" value="${spec.vendor}"/>
<property name="impl.version" value="${jna.version} (b${jna.build})"/>
<!-- Set up restrictions for w32ce, based on JavaME/CDC -->
<condition property="compatibility" value="1.4">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<condition property="test.compatibility" value="1.4">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<!--
Default compatibility, 1.6, or whatever version is running
Release builds of JNA target 1.6 and should be build on JDK 8, as JDK 9
introduced changes in the ByteBuffer class, which result in classes, that
can't be loaded on Java 6.
JDK 11 is the last JDK, that supports creation of Java 6 compatible class
files.
-->
<condition property="compatibility" value="1.6" else="9">
<matches pattern="^1\.\d+$" string="${ant.java.version}"/>
</condition>
<condition property="compatibility-check" value="true">
<equals arg1="${compatibility}" arg2="1.6" />
</condition>
<property name="platform.compatibility" value="${compatibility}" />
<!-- JNA tests require at least 1.8 compatiblity -->
<condition property="test.compatibility" value="1.8" else="${compatibility}">
<or>
<equals arg1="${compatibility}" arg2="1.6"/>
<equals arg1="${compatibility}" arg2="1.7"/>
</or>
</condition>
<condition property="tests.exclude-patterns" value="**/VarArgsTest.java,**/AnnotatedLibraryTest.java,**/WebStartTest.java,**/PointerBufferTest.java,**/HeadlessLoadLibraryTest.java,**/StructureBufferFieldTest.java,**/PerformanceTest.java,**/*BufferArgumentsMarshalTest.java" else="**/wince/*.java,**/WebStartTest.java">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<property name="dist-jar" value="${dist}/${jar}"/>
<property name="dist-aar" value="${dist}/${aar}"/>
<property name="dist-jar-jpms" value="${dist}/${jar-jpms}"/>
<!-- Maven -->
<!-- define Maven coordinates -->
<property name="groupId" value="net.java.dev.jna" />
<property name="artifactId" value="jna" />
<property name="maven-javadoc-jar" value="${dist}/${artifactId}-${jna.version}-javadoc.jar" />
<property name="maven-sources-jar" value="${dist}/${artifactId}-${jna.version}-sources.jar" />
<property name="platform-jar" value="${dist}/jna-platform.jar"/>
<property name="platform-javadoc-jar" value="${dist}/platform-${jna.version}-javadoc.jar" />
<property name="platform-sources-jar" value="${dist}/platform-${jna.version}-sources.jar" />
<property name="platform-jpms-jar" value="${dist}/jna-platform-jpms.jar" />
<!-- defined maven snapshots and staging repository id and url -->
<property name="maven-snapshots-repository-id" value="oss.sonatype.org" />
<property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" />
<property name="maven-staging-repository-id" value="oss.sonatype.org" />
<property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<!-- Miscellaneous -->
<property name="build" value="build"/>
<property name="build.compiler.emacs" value="true"/>
<property name="pom-base" value="pom-jna.xml" />
<property name="pom-platform-base" value="pom-jna-platform.xml" />
<property name="pom-jpms-base" value="pom-jna-jpms.xml" />
<property name="pom-platform-jpms-base" value="pom-jna-platform-jpms.xml" />
<property name="pom" value="${build}/pom-jna.xml" />
<property name="pom-platform" value="${build}/pom-jna-platform.xml" />
<property name="pom-jpms" value="${build}/pom-jna-jpms.xml" />
<property name="pom-platform-jpms" value="${build}/pom-jna-platform-jpms.xml" />
<target name="default" depends="test" description="Build and Test."/>
<target name="init" depends="-setup"/>
<target name="compile-test-single" depends="compile-tests"/>
<target name="compile-single" depends="compile"/>
<!-- Prepare additional ant task -->
<path id="maven-ant-tasks.classpath">
<pathelement location="lib/animal-sniffer-ant-tasks-1.17.jar" />
<pathelement location="lib/maven-ant-tasks-2.1.3.jar" />
</path>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
<typedef resource="org/codehaus/mojo/animal_sniffer/antlib.xml"
uri="antlib:org.codehaus.mojo.animal_sniffer"
classpathref="maven-ant-tasks.classpath" />
<target name="-prepare-anttools">
<subant antfile="build-ant-tools.xml" buildpath="${basedir}"></subant>
<taskdef name="BuildArmSoftFloatDetector" classname="com.sun.jna.BuildArmSoftFloatDetector" classpath="${build}/ant-tools:$lib/asm-8.0.1.jar" />
<taskdef name="CalcAndroidVersion" classname="com.sun.jna.ant.CalcAndroidVersion" classpath="${build}/ant-tools:lib/asm-8.0.1.jar" />
<taskdef name="ModuleGenerator" classname="com.sun.jna.ant.ModuleGenerator" classpath="${build}/ant-tools:lib/asm-8.0.1.jar" />
</target>
<target name="-dynamic-properties" depends="-prepare-anttools">
<property name="build.os.name" value="${os.name}"/>
<condition property="build.os.family" value="windows">
<contains string="${build.os.name}" substring="windows" casesensitive="false"/>
</condition>
<condition property="build.os.family" value="mac">
<or>
<contains string="${build.os.name}" substring="darwin" casesensitive="false"/>
<contains string="${build.os.name}" substring="mac" casesensitive="false" />
</or>
</condition>
<property name="build.os.family" value="other"/>
<property name="build.os.arch" value="${os.arch}" />
<property name="build.os.endianess" value="${sun.cpu.endian}" />
<condition property="-native" value="true">
<not><isset property="build-native"/></not>
</condition>
<condition property="jni.valid" value="true">
<isset property="-native"/>
</condition>
<copy file="${pom-base}" tofile="${pom}" />
<copy file="${pom-platform-base}" tofile="${pom-platform}" />
<copy file="${pom-jpms-base}" tofile="${pom-jpms}" />
<copy file="${pom-platform-jpms-base}" tofile="${pom-platform-jpms}" />
<replaceregexp match="(<version>).*(</version>)"
replace="\1${jna.version}\2"
flags="g"
file="${pom}"/>
<replaceregexp match="(<version>).*(</version>)"
replace="\1${jna.version}\2"
flags="g"
file="${pom-platform}"/>
<replaceregexp match="(<version>).*(</version>)"
replace="\1${jna.version}\2"
flags="g"
file="${pom-jpms}"/>
<replaceregexp match="(<version>).*(</version>)"
replace="\1${jna.version}\2"
flags="g"
file="${pom-platform-jpms}"/>
<condition property="jar.omitted" value="**/*jnidispatch*" else="jnilib-included">
<isset property="omit-jnilib"/>
</condition>
<condition property="cross-compile" value="true">
<isset property="os.prefix"/>
</condition>
<property name="classes" location="${build}/classes"/>
<property name="eclipse.classes" location="build.eclipse/classes"/>
<property name="test.classes" location="${build}/test-classes"/>
<property name="reports" value="${build}/reports"/>
<CalcAndroidVersion
major="${jna.major}"
minor="${jna.minor}"
revision="${jna.revision}"
releaseProperty="release"
targetProperty="android.versionCode"
/>
<BuildArmSoftFloatDetector targetProperty="build.isArmSoftFloat"/>
<!-- Add other supported platforms here -->
<condition property="jre.arch" value="x86">
<matches pattern="(i[3456]86|pentium)" string="${build.os.arch}"/>
</condition>
<condition property="jre.arch" value="x86-64">
<matches pattern="(x86_64|amd64|em64t)" string="${build.os.arch}"/>
</condition>
<condition property="jre.arch" value="ppc">
<matches pattern="(powerpc|power)" string="${build.os.arch}"/>
</condition>
<condition property="jre.arch" value="ppc64le">
<or>
<matches pattern="(powerpc64le|power64le|ppc64le)" string="${build.os.arch}"/>
<and>
<matches pattern="(powerpc64|power64|ppc64)" string="${build.os.arch}"/>
<matches pattern="little" string="${build.os.endianess}"/>
</and>
</or>
</condition>
<condition property="jre.arch" value="ppc64">
<matches pattern="(powerpc64|power64)" string="${build.os.arch}"/>
</condition>
<condition property="jre.arch" value="armel">
<and>
<matches pattern="arm" string="${build.os.arch}"/>
<matches pattern="true" string="${build.isArmSoftFloat}"/>
</and>
</condition>
<property name="jre.arch" value="${build.os.arch}"/>
<condition property="os.prefix" value="linux-${jre.arch}">
<equals arg1="${build.os.name}" arg2="Linux"/>
</condition>
<condition property="os.prefix" value="aix-${jre.arch}">
<equals arg1="${build.os.name}" arg2="AIX"/>
</condition>
<condition property="os.prefix" value="win32-${jre.arch}">
<equals arg1="${build.os.family}" arg2="windows"/>
</condition>
<condition property="os.prefix" value="darwin-${jre.arch}">
<equals arg1="${build.os.family}" arg2="mac"/>
</condition>
<condition property="os.prefix" value="sunos-${jre.arch}">
<equals arg1="${build.os.name}" arg2="SunOS"/>
</condition>
<condition property="os.prefix" value="freebsd-${jre.arch}">
<equals arg1="${build.os.name}" arg2="FreeBSD"/>
</condition>
<condition property="os.prefix" value="openbsd-${jre.arch}">
<equals arg1="${build.os.name}" arg2="OpenBSD"/>
</condition>
<condition property="os.prefix" value="netbsd-${jre.arch}">
<equals arg1="${build.os.name}" arg2="NetBSD"/>
</condition>
<condition property="os.prefix" value="kfreebsd-${jre.arch}">
<equals arg1="${build.os.name}" arg2="GNU/kFreeBSD"/>
</condition>
<property name="resource.prefix" value="${os.prefix}" description="fallback"/>
<fail unless="os.prefix" message="OS/arch not supported (${os.name}/${jre.arch}), edit build.xml and native/Makefile to add it."/>
<!-- Keep all natives separate -->
<property name="native.subdir" value="native-${os.prefix}"/>
<condition property="jdk.home" value="${java.home}">
<available file="${java.home}/include"/>
</condition>
<condition property="jdk.home" value="${java.home}/..">
<available file="${java.home}/../include"/>
</condition>
<condition property="jdk.home" value="/System/Library/Frameworks/JavaVM.framework/Home">
<available file="/System/Library/Frameworks/JavaVM.framework/Headers"/>
</condition>
<fail unless="jdk.home" message="Can't find JNI headers (java.home=${java.home})"/>
<property name="libarch" value="${os.arch}"/>
<condition property="libjsig"
value="${java.home}/lib/${libarch}/libjsig.so" else="">
<available file="${java.home}/lib/${libarch}/libjsig.so"/>
</condition>
<condition property="ld.preload.name" value="LD_PRELOAD" else="IGNORE">
<not><equals arg1="${libjsig}" arg2=""/></not>
</condition>
<property name="native.jar" value="${os.prefix}.jar"/>
<property name="build.native" location="${build}/${native.subdir}"/>
<property name="build.headers" location="${build}/headers"/>
<property name="build.aar" location="${build}/aar"/>
<property name="md5.file" location="${build.headers}/jni.checksum"/>
<property name="jni.info" location="${build.headers}/jni.properties"/>
<mkdir dir="${build}"/>
<mkdir dir="${build.native}"/>
<mkdir dir="${build.headers}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${test.classes}"/>
<mkdir dir="${reports}"/>
<mkdir dir="${doc}"/>
<mkdir dir="${build.aar}"/>
<echo>Java version ${java.version}, compatibility: ${compatibility}, ant: ${ant.java.version}</echo>
<echo>JNA version ${jna.version}, native ${jni.version}, android ${android.versionCode}</echo>
<echo>${java.vm.name} (${java.vm.vendor}, ${java.vm.version})</echo>
<echo>java.home=${java.home}</echo>
<echo>java.library.path=${java.library.path}</echo>
<echo>os.prefix=${os.prefix}</echo>
<echo>os.name=${build.os.name}</echo>
<echo>os.arch=${build.os.arch} (${build.os.endianess})</echo>
<echo>build=${build}</echo>
<echo>build.native=${build.native}</echo>
<echo>build.headers=${build.headers}</echo>
<echo>build.aar=${build.aar}</echo>
</target>
<target name="-setup" depends="-dynamic-properties">
<path id="compile-test.path">
<path id="test.libs">
<fileset dir="lib">
<include name="junit.jar"/>
<include name="hamcrest-core-1.3.jar"/>
</fileset>
<fileset dir="lib/test"/>
<pathelement path="${classes}"/>
</path>
</path>
<path id="compile.path"/>
<path id="src.path">
<pathelement location="${src}"/>
</path>
<path id="test.runpath">
<pathelement path="${build}/${jar}"/>
<pathelement path="${test.classes}"/>
<pathelement path="${build}/${testjar}"/>
<pathelement path="lib/clover.jar"/>
<path refid="test.libs"/>
</path>
</target>
<target name="compile" depends="-setup"
description="Compile all Java source">
<delete dir="${build}/jna-src" />
<mkdir dir="${build}/jna-src/com/sun/jna" />
<copy file="src/com/sun/jna/Version.java" todir="${build}/jna-src/com/sun/jna" />
<replaceregexp match='VERSION = ".*";'
replace='VERSION = "${jna.version}";'
file="${build}/jna-src/com/sun/jna/Version.java"/>
<replaceregexp match='VERSION_NATIVE = ".*";'
replace='VERSION_NATIVE = "${jni.version}";'
file="${build}/jna-src/com/sun/jna/Version.java"/>
<javac source="${compatibility}"
target="${compatibility}"
destdir="${classes}"
includeantruntime="false"
deprecation="on"
debug="${debug}"
encoding="UTF-8"
nativeheaderdir="${build.headers}">
<src location="${build}/jna-src/com/sun/jna" />
</javac>
<javac classpath="${compatibility}"
source="${compatibility}"
target="${compatibility}"
destdir="${classes}"
includeantruntime="false"
deprecation="on"
debug="${debug}"
encoding="UTF-8"
nativeheaderdir="${build.headers}">
<src refid="src.path"/>
<exclude name="com/sun/jna/Version.java" />
</javac>
</target>
<target name=":jar">
<uptodate property="-jar" targetfile="${build}/${jar}">
<srcfiles dir="${classes}">
<patternset id="jar-compiled">
<include name="com/sun/jna/*"/>
<include name="com/sun/jna/**/*"/>
</patternset>
</srcfiles>
</uptodate>
</target>
<target name="jar" depends="-setup,native,:jar" unless="-jar"
description="Build primary jar">
<!-- Bundle native components with primary jar to facilitate
easy distribution to common platforms.
-->
<macrodef name="build-manifest">
<attribute name="target" />
<attribute name="module-info" default="false" />
<sequential>
<manifest file="@{target}" mode="replace">
<attribute name="Main-Class" value="com.sun.jna.Native"/>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Implementation-Title" value="${impl.title}"/>
<attribute name="Implementation-Vendor" value="${vendor}"/>
<attribute name="Implementation-Version" value="${impl.version}"/>
<attribute name="Specification-Title" value="${spec.title}"/>
<attribute name="Specification-Vendor" value="${spec.vendor}"/>
<attribute name="Specification-Version" value="${spec.version}"/>
<!--
OSGi Bundle attributes
See http://www.osgi.org/Specifications/Reference
-->
<attribute name="Bundle-Category" value="jni"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="jna"/>
<attribute name="Bundle-Description" value="JNA Library"/>
<attribute name="Bundle-SymbolicName" value="com.sun.jna"/>
<attribute name="Bundle-Version" value="${jna.major}.${jna.minor}.${jna.revision}"/>
<attribute name="Bundle-RequiredExecutionEnvironment" value="JavaSE-1.6"/>
<attribute name="Bundle-Vendor" value="${vendor}"/>
<attribute name="Bundle-ActivationPolicy" value="lazy"/>
<!--
The full "Export-Package" statement can be generated by invoking
create-export-package-metadata-pom.sh in the main folder. This is
necessary if the exported packages change. Then the list in the
shell script needs to be updated as well.
-->
<attribute name="Export-Package" value="
com.sun.jna;version="${osgi.version}",
com.sun.jna.ptr;version="${osgi.version}";uses:="com.sun.jna",
com.sun.jna.win32;version="${osgi.version}";uses:="com.sun.jna"
"/>
<!-- Note that no terminal "*" is included in this list,
which will force failure on unsupported platforms.
-->
<attribute name="Bundle-NativeCode"
value="
com/sun/jna/win32-x86/jnidispatch.dll;
processor=x86;osname=win32,
com/sun/jna/win32-x86-64/jnidispatch.dll;
processor=x86-64;osname=win32,
com/sun/jna/win32-aarch64/jnidispatch.dll;
processor=aarch64;osname=win32,
com/sun/jna/win32-x86/jnidispatch.dll;
processor=x86;osname=win,
com/sun/jna/win32-x86-64/jnidispatch.dll;
processor=x86-64;osname=win,
com/sun/jna/win32-aarch64/jnidispatch.dll;
processor=aarch64;osname=win,
com/sun/jna/w32ce-arm/jnidispatch.dll;
processor=arm;osname=wince,
com/sun/jna/sunos-x86/libjnidispatch.so;
processor=x86;osname=sunos,
com/sun/jna/sunos-x86-64/libjnidispatch.so;
processor=x86-64;osname=sunos,
com/sun/jna/sunos-sparc/libjnidispatch.so;
processor=sparc;osname=sunos,
com/sun/jna/sunos-sparcv9/libjnidispatch.so;
processor=sparcv9;osname=sunos,
com/sun/jna/aix-ppc/libjnidispatch.a;
processor=ppc;osname=aix,
com/sun/jna/aix-ppc64/libjnidispatch.a;
processor=ppc64;osname=aix,
com/sun/jna/linux-ppc/libjnidispatch.so;
processor=ppc;osname=linux,
com/sun/jna/linux-ppc64/libjnidispatch.so;
processor=ppc64;osname=linux,
com/sun/jna/linux-ppc64le/libjnidispatch.so;
processor=ppc64le;osname=linux,
com/sun/jna/linux-x86/libjnidispatch.so;
processor=x86;osname=linux,
com/sun/jna/linux-x86-64/libjnidispatch.so;
processor=x86-64;osname=linux,
com/sun/jna/linux-arm/libjnidispatch.so;
processor=arm;osname=linux,
com/sun/jna/linux-arm/libjnidispatch.so;
processor=arm_le;osname=linux,
com/sun/jna/linux-armel/libjnidispatch.so;
processor=armel;osname=linux,
com/sun/jna/linux-aarch64/libjnidispatch.so;
processor=aarch64;osname=linux,
com/sun/jna/linux-ia64/libjnidispatch.so;
processor=ia64;osname=linux,
com/sun/jna/linux-sparcv9/libjnidispatch.so;
processor=sparcv9;osname=linux,
com/sun/jna/linux-mips64el/libjnidispatch.so;
processor=mips64el;osname=linux,
com/sun/jna/linux-s390x/libjnidispatch.so;
processor=S390x;osname=linux,
com/sun/jna/linux-loongarch64/libjnidispatch.so;
processor=loongarch64;osname=linux,
com/sun/jna/freebsd-x86/libjnidispatch.so;
processor=x86;osname=freebsd,
com/sun/jna/freebsd-x86-64/libjnidispatch.so;
processor=x86-64;osname=freebsd,
com/sun/jna/openbsd-x86/libjnidispatch.so;
processor=x86;osname=openbsd,
com/sun/jna/openbsd-x86-64/libjnidispatch.so;
processor=x86-64;osname=openbsd,
com/sun/jna/darwin-ppc/libjnidispatch.jnilib;
osname=macosx;processor=ppc,
com/sun/jna/darwin-ppc64/libjnidispatch.jnilib;
osname=macosx;processor=ppc64,
com/sun/jna/darwin-x86/libjnidispatch.jnilib;
osname=macosx;processor=x86,
com/sun/jna/darwin-x86-64/libjnidispatch.jnilib;
osname=macosx;processor=x86-64,
com/sun/jna/darwin-aarch64/libjnidispatch.jnilib;
osname=macosx;processor=aarch64
"/>
</manifest>
<manifest file="@{target}" mode="update" if:true="@{module-info}">
<attribute name="Multi-Release" value="true"/>
</manifest>
<manifest file="@{target}" mode="update" unless:true="@{module-info}">
<attribute name="Automatic-Module-Name" value="com.sun.jna"/>
</manifest>
</sequential>
</macrodef>
<delete dir="${build}/manifest"/>
<mkdir dir="${build}/manifest"/>
<build-manifest target="${build}/manifest/module.mf" module-info="true"/>
<build-manifest target="${build}/manifest/automatic.mf" module-info="false"/>
<ModuleGenerator
targetFile="${build}/manifest/module-info.class"
name="com.sun.jna"
version="${jna.major}.${jna.minor}.${jna.revision}"
open="false"
>
<exports package="com.sun.jna" />
<exports package="com.sun.jna.ptr" />
<exports package="com.sun.jna.win32" />
<exports package="com.sun.jna.internal" to="com.sun.jna.platform"/>
<requires module="java.logging" />
<requires module="java.desktop" />
</ModuleGenerator>
<jar jarfile="${build}/${jar}" duplicate="preserve" createUnicodeExtraFields="never" encoding="UTF-8" manifest="${build}/manifest/automatic.mf">
<fileset dir="${classes}" excludes="${jar.omitted}">
<patternset refid="jar-compiled"/>
</fileset>
<zipfileset src="${lib.native}/win32-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/win32-x86"/>
<zipfileset src="${lib.native}/aix-ppc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/aix-ppc"/>
<zipfileset src="${lib.native}/aix-ppc64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/aix-ppc64"/>
<zipfileset src="${lib.native}/darwin-ppc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/darwin-ppc"/>
<zipfileset src="${lib.native}/darwin-ppc64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/darwin-ppc64"/>
<zipfileset src="${lib.native}/darwin-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/darwin-x86"/>
<zipfileset src="${lib.native}/darwin-x86-64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/darwin-x86-64"/>
<zipfileset src="${lib.native}/darwin-aarch64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/darwin-aarch64"/>
<zipfileset src="${lib.native}/linux-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-x86"/>
<zipfileset src="${lib.native}/linux-x86-64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-x86-64"/>
<zipfileset src="${lib.native}/linux-arm.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-arm"/>
<zipfileset src="${lib.native}/linux-armel.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-armel"/>
<zipfileset src="${lib.native}/linux-aarch64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-aarch64"/>
<zipfileset src="${lib.native}/linux-ia64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ia64"/>
<zipfileset src="${lib.native}/linux-ppc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ppc"/>
<zipfileset src="${lib.native}/linux-ppc64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ppc64"/>
<zipfileset src="${lib.native}/linux-ppc64le.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ppc64le"/>
<zipfileset src="${lib.native}/linux-sparcv9.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-sparcv9"/>
<zipfileset src="${lib.native}/linux-mips64el.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-mips64el"/>
<zipfileset src="${lib.native}/linux-loongarch64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-loongarch64"/>
<zipfileset src="${lib.native}/linux-s390x.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-s390x"/>
<zipfileset src="${lib.native}/linux-riscv64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-riscv64"/>
<zipfileset src="${lib.native}/sunos-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-x86"/>
<zipfileset src="${lib.native}/sunos-x86-64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-x86-64"/>
<zipfileset src="${lib.native}/sunos-sparc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-sparc"/>
<zipfileset src="${lib.native}/sunos-sparcv9.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-sparcv9"/>
<zipfileset src="${lib.native}/freebsd-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/freebsd-x86"/>
<zipfileset src="${lib.native}/freebsd-x86-64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/freebsd-x86-64"/>
<zipfileset src="${lib.native}/openbsd-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/openbsd-x86"/>
<zipfileset src="${lib.native}/openbsd-x86-64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/openbsd-x86-64"/>
<zipfileset src="${lib.native}/win32-x86-64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/win32-x86-64"/>
<zipfileset src="${lib.native}/win32-aarch64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/win32-aarch64"/>
<zipfileset src="${lib.native}/w32ce-arm.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/w32ce-arm"/>
<zipfileset dir="."
includes="LICENSE,LGPL2.1,AL2.0"
prefix="META-INF"/>
</jar>
<zip zipfile="${build}/${minjar}">
<zipfileset src="${build}/${jar}" excludes="**/*jnidispatch*"/>
</zip>
<jar jarfile="${build}/jna-jpms.jar" duplicate="preserve" createUnicodeExtraFields="never" encoding="UTF-8" manifest="${build}/manifest/module.mf">
<zipfileset src="${build}/${jar}" excludes="META-INF/MANIFEST.mf"/>
<zipfileset dir="${build}/manifest/" includes="module-info.class" prefix="META-INF/versions/9"/>
</jar>
</target>
<target name="aar" depends="jar" description="Build Android Archive">
<!-- Dummy entries in R.txt and the string resources are needed or a grails
build using this library will fail (tested with Android Studio 2.2.3 -->
<mkdir dir="${build.aar}/res/values" />
<echo file="${build.aar}/res/values/values.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="jna_library_appname">JNA bindings</string>
</resources>
]]></echo>
<echo file="${build.aar}/R.txt">int string jna_library_appname 0x7f050021
</echo>
<echo file="${build.aar}/AndroidManifest.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sun.jna"
android:versionCode="]]>${android.versionCode}<![CDATA["
android:versionName="]]>${jna.version}<![CDATA[" >
<uses-sdk android:targetSdkVersion="25" />
</manifest>
]]></echo>
<zip zipfile="${build}/${aar}">
<mappedresources>
<fileset file="${build}/${minjar}"/>
<globmapper from="*" to="classes.jar"/>
</mappedresources>
<zipfileset src="${lib.native}/android-aarch64.jar"
includes="*jnidispatch*"
prefix="jni/arm64-v8a"/>
<zipfileset src="${lib.native}/android-arm.jar"
includes="*jnidispatch*"
prefix="jni/armeabi"/>
<zipfileset src="${lib.native}/android-armv7.jar"
includes="*jnidispatch*"
prefix="jni/armeabi-v7a"/>
<zipfileset src="${lib.native}/android-mips.jar"
includes="*jnidispatch*"
prefix="jni/mips"/>
<zipfileset src="${lib.native}/android-mips64.jar"
includes="*jnidispatch*"
prefix="jni/mips64"/>
<zipfileset src="${lib.native}/android-x86-64.jar"
includes="*jnidispatch*"
prefix="jni/x86_64"/>
<zipfileset src="${lib.native}/android-x86.jar"
includes="*jnidispatch*"
prefix="jni/x86"/>
<fileset dir="${build.aar}"/>
</zip>
</target>
<target name="platform-jar" depends="jar">
<subant target="jar" failonerror="true">
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
<property name="libs.junit.classpath" refid="test.libs"/>
<property name="javac.source" value="${platform.compatibility}"/>
<property name="javac.target" value="${platform.compatibility}"/>
<!-- OSGi manifest properties -->
<property name="vendor" value="${vendor}"/>
<property name="impl.title" value="${impl.title}.platform"/>
<property name="impl.version" value="${impl.version}"/>
<property name="spec.title" value="${spec.title}"/>
<property name="spec.vendor" value="${spec.vendor}"/>
<property name="spec.version" value="${spec.version}"/>
<property name="osgi.version" value="${osgi.version}"/>
<fileset dir="${contrib}" includes="platform/build.xml" />
</subant>
<!-- Sources package as required by maven -->
<zip zipfile="${platform-sources-jar}">
<zipfileset dir="${contrib}/platform/src" />
</zip>
</target>
<target name="contrib-jars" depends="platform-jar" description="Build contrib jars">
<subant target="jar" failonerror="true">
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
<property name="libs.junit.classpath" refid="test.libs"/>
<property name="javac.source" value="${compatibility}" />
<property name="javac.target" value="${compatibility}" />
<fileset dir="${contrib}" includes="*/build.xml" excludes="platform/build.xml"/>
</subant>
</target>
<target name="idea-jar" depends="jar" description="Build Intellij Idea convenience jar">
<jar destfile="${dist}/idea-dispatch.jar" createUnicodeExtraFields="never" encoding="UTF-8">
<zipfileset src="${dist-jar}" excludes="**/*.class"/>
</jar>
</target>
<target name="javah" depends="compile" unless="-native">
<condition property="grep" value="/usr/sfw/bin/ggrep">
<os name="SunOS"/>
</condition>
<condition property="grep" value="ggrep">
<os name="OpenBSD"/>
</condition>
<property name="grep" value="grep"/>
<condition property="grep.required" value="false" else="true">
<os name="AIX"/>
</condition>
<!-- args are based on GNU grep, other versions may differ -->
<apply dir="${build.headers}" executable="${grep}" parallel="true"
failonerror="${grep.required}" relative="true" output="${md5.file}"
error="${md5.file}.error">
<arg value="-A"/>
<arg value="1"/>
<arg value="JNIEXPORT"/>
<fileset dir="${build.headers}" includes="*.h"/>
</apply>
<apply dir="${build.headers}" executable="${grep}" parallel="true"
failonerror="${grep.required}" relative="true" output="${md5.file}"
error="${md5.file}.error" append="true">
<arg value="#define"/>
<fileset dir="${build.headers}" includes="*.h"/>
</apply>
<!-- Clean up gcj javah output to match that of Sun's javah -->
<fixcrlf file="${md5.file}" eol="unix"/>
<replaceregexp match="^((.*\.h):JNIEXPORT[^(]+)( +\(.*)"
replace="\1
\2- \3
--"
byline="true"
file="${md5.file}"/>
<replaceregexp match="(JNIEnv *\*) *env"
replace="\1"
byline="true"
file="${md5.file}"/>
<replaceregexp match="
--
.*\.h-$"
replace=""
flags="m"
file="${md5.file}"/>
<checksum property="md5" file="${md5.file}" />
<propertyfile file="${jni.info}">
<entry key="checksum" value="${md5}" />
<entry key="version" value="${jni.version}" />
</propertyfile>
<condition property="jni.valid" value="true">
<or>
<os name="AIX"/>
<equals arg1="${jni.md5}" arg2="${md5}" trim="true"/>
<equals arg1="${jni.md5}" arg2=""/>
</or>
</condition>
</target>
<!-- Invalidate native libraries when native API changes -->
<target name="-native-api-check" depends="javah" unless="jni.valid">
<echo>Invalidating native code, new checksum is ${md5}</echo>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/darwin-ppc.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/darwin-ppc64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/darwin-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/darwin-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/darwin-aarch64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/win32-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/win32-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/win32-aarch64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/w32ce-arm.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-arm.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-armel.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-aarch64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-ia64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-ppc.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-ppc64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-ppc64le.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-sparcv9.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-mips64el.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-loongarch64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-s390x.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-riscv64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/freebsd-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/freebsd-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/openbsd-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/openbsd-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/sunos-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/sunos-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/sunos-sparc.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/sunos-sparcv9.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-arm.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-armv7.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-aarch64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-mips.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-mips64.jar" overwrite="true"/>
<delete failOnError="false" includeEmptyDirs="true">
<fileset dir="${build.native}" includes="*.o,*jnidispatch*"/>
</delete>
<fail>API for native code has changed, or javah output is inconsistent. Re-run this build after checking ${md5.file} or updating jni.version and jni.md5 in build.xml</fail>
</target>
<target name=":rsrc">
<condition property="-rsrc">
<and>
<not><equals arg1="${build.os.family}" arg2="windows"/></not>
<not><equals arg1="${os.prefix}" arg2="w32ce-arm"/></not>
</and>
</condition>
</target>
<target name="rsrc" depends="-setup,:rsrc" unless="-rsrc"
description="Generate w32 DLL version resource information">
<property name="rsrc" location="${build.native}/jnidispatch.rc"/>
<copy todir="${build.native}" file="${native}/jnidispatch.rc"/>
<replaceregexp match="FILEVERSION.*"
replace="FILEVERSION ${jni.major},${jni.minor},${jni.revision},${jni.build}"
preserveLastModified="true"
file="${rsrc}" byline="true"/>
<replaceregexp match="PRODUCTVERSION.*"
replace="PRODUCTVERSION ${jna.major},${jna.minor},${jna.revision},${jna.build}"
preserveLastModified="true"
file="${rsrc}" byline="true"/>
<replaceregexp match="FileVersion.*"
replace="FileVersion","${jni.version}""
preserveLastModified="true"
file="${rsrc}" byline="true"/>
<replaceregexp match="Full Version.*"
replace="Full Version","${jni.version} b${jni.build}""
preserveLastModified="true"
file="${rsrc}" byline="true"/>
<replaceregexp match="ProductVersion.*"
replace="ProductVersion","${spec.version}""
preserveLastModified="true"
file="${rsrc}" byline="true"/>
<replaceregexp match="(Copyright.*-)2..."
replace="\1${year}"
preserveLastModified="true"
file="${rsrc}" byline="true"/>
</target>
<target name="-prepare-native" depends="-setup,rsrc">
<property name="comment" value="# auto-generated by ant"/>
<condition property="make.OS" value="OS=w32ce">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<condition property="make.OS" value="OS=android">
<matches pattern="^android-" string="${os.prefix}"/>
</condition>
<property name="make.OS" value="IGNORE="/>
<!-- Ensure Makefile ARCH property properly set for darwin -->
<condition property="ARCH" value="aarch64">
<equals arg1="${os.prefix}" arg2="darwin-aarch64"/>
</condition>
<condition property="ARCH" value="i386">
<equals arg1="${os.prefix}" arg2="darwin-x86"/>
</condition>
<condition property="ARCH" value="x86-64">
<equals arg1="${os.prefix}" arg2="darwin-x86-64"/>
</condition>
<condition property="ARCH" value="ppc">
<equals arg1="${os.prefix}" arg2="darwin-ppc"/>
</condition>
<condition property="ARCH" value="ppc64">
<equals arg1="${os.prefix}" arg2="darwin-ppc64"/>
</condition>
<condition property="ARCH" value="arm">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<condition property="ARCH" value="arm">
<equals arg1="${os.prefix}" arg2="android-arm"/>
</condition>
<condition property="ARCH" value="armv7">
<equals arg1="${os.prefix}" arg2="android-armv7"/>
</condition>
<condition property="ARCH" value="aarch64">
<matches string="${os.prefix}" pattern="-aarch64$"/>
</condition>
<condition property="ARCH" value="x86">
<equals arg1="${os.prefix}" arg2="android-x86"/>
</condition>
<condition property="ARCH" value="x86-64">
<equals arg1="${os.prefix}" arg2="android-x86-64"/>
</condition>
<condition property="ARCH" value="mips">
<equals arg1="${os.prefix}" arg2="android-mips"/>
</condition>
<condition property="ARCH" value="mips64">
<equals arg1="${os.prefix}" arg2="android-mips64"/>
</condition>
<condition property="ARCH" value="ppc">
<equals arg1="${os.prefix}" arg2="aix-ppc"/>
</condition>
<condition property="ARCH" value="ppc64">
<equals arg1="${os.prefix}" arg2="aix-ppc64"/>
</condition>
<condition property="ARCH" value="riscv64">
<matches string="${os.prefix}" pattern="-riscv64$"/>
</condition>
<!-- ensure ARCH is set properly for 64-bit capable platforms -->
<!-- use ANT_OPTS=-d64/-d32 to build 64-bit/32-bit if not the platform default -->
<property name="ARCH" value="${build.os.arch}"/>