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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Ant build for NEWT. This build has been tested with ANT 1.7.0. The
- optional.jar that contains the optional ANT tasks must be in the ANT
- classpath (typically the ant/lib directory).
-
- A clean download of NEWT is required for this build.
-
- This build has no dependence on environment variables; the needed
- ones (e.g. java.home, ANT_HOME) are all set by the Ant wrapper shell
- script, by the virtual machine, or elsewhere. However, on all platforms,
- the C compiler and linker should be in the path. All other paths that
- need to be set are in host.properties.
-
- NOTE: because the GlueGen config files have their own relative paths
- which cannot be overridden by GlueGen, GlueGen MUST be run from
- the "make" directory. This also means that this build.xml MUST
- be run from the "make" directory.
-
- Public targets:
- all: (default; autodetects OS and chooses C compiler from newt.properties)
- clean: clean all built
- javadoc: create the standard developer Javadoc (recommended)
- (Note: should build all first - may be dependence in the future)
- javadoc.spec: create the standard developer Javadoc but exclude com.sun.* classes
- javadoc.dev: create the internal developer Javadoc. This includes the
- Java and C file generators. Note that it is only supported
- to create the Javadoc for the platform on which you are
- currently running.
-
- Note: on Windows the "win32.c.compiler" property in newt.properties
- is required to select the appropriate C compiler. See the example
- newt.properties in this directory for valid values. On Mac OS X
- universal binaries may also be built by setting the "macosxfat"
- property in newt.properties; again see the example file in this
- directory.
-
- Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the
- ANT build, including the GlueGen and StaticGLInfo tasks, the building of
- the Java generated sources, the first and second phase Java compiles, and
- the building of the jar file. Thanks to Alex Radeski for the bulk of the
- port to the ant-contrib CPPTask framework. Thanks to Athomas Goldberg for
- the original OS detection code.
-
- Some environment defs affecting compilation
setup.cdcfp - Using the CDC Java runtime library
- no DoubleBuffer
- no LongBuffer
This will set
-> setup.noAWT
- Internal settings, may not be necessary to set them manually,
since all JAR archives are orthogonal.
setup.noAWT
setup.noOpenGL
-->
<project name="NEWT" basedir="." default="all">
<!-- This is the version of JOGL you are building -->
<property name="base_version" value="0.0.0-rc0"/>
<!-- Uncomment this property definition to cause a full release build to be done -->
<!-- without needing to specify the RI target on the command line -->
<property name="RImanifestfile" value="newtRIversion" />
<!-- Pull in GlueGen cpptasks build file -->
<property name="gluegen.root" value="../../gluegen" />
<import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
<available file="${user.home}/newt.compiler.xml" property="newt.compiler.present"/>
<import file="${user.home}/newt.compiler.xml" optional="true" />
<!-- ================================================================== -->
<!--
- Base initialization and detection of operating system.
-->
<target name="base.init">
<condition property="setup.noAWT">
<isset property="setup.cdcfp"/>
</condition>
<condition property="isCDCFP">
<isset property="setup.cdcfp"/>
</condition>
<condition property="javac.bootclasspath.jar"
value="../../gluegen/make/lib/cdc_fp.jar">
<isset property="setup.cdcfp"/>
</condition>
<echo message="setup.cdcfp: ${setup.cdcfp}" />
<echo message="setup.noAWT: ${setup.noAWT}" />
<echo message="setup.noOpenGL: ${setup.noOpenGL}" />
<echo message="javac.bootclasspath.jar: ${javac.bootclasspath.jar}" />
<!-- partitioning -->
<property name="java.part.core"
value="com/sun/javafx/newt/*, com/sun/javafx/newt/x11/*, com/sun/javafx/newt/windows/*, com/sun/javafx/newt/macosx/*, com/sun/javafx/newt/impl/*"/>
<property name="java.part.opengl"
value="com/sun/javafx/newt/opengl/*, com/sun/javafx/newt/opengl/kd/*"/>
<property name="java.part.awt"
value="com/sun/javafx/newt/awt/*"/>
<!-- condition excludes -->
<condition property="java.excludes.awt"
value="${java.part.awt}">
<isset property="setup.noAWT"/>
</condition>
<condition property="java.excludes.opengl"
value="${java.part.opengl}">
<isset property="setup.noOpenGL"/>
</condition>
<condition property="java.excludes.cdcfp"
value="">
<isset property="setup.cdcfp"/>
</condition>
<property name="java.excludes.all" value="${java.excludes.awt}, ${java.excludes.opengl}, ${java.excludes.cdcfp}" />
<echo message="java.excludes.all: ${java.excludes.all}" />
<!-- Set the project root directory to be up one directory. -->
<property name="project.root" value=".." />
<!-- Set the configuration and build files to this directory. -->
<property name="make" value="." />
</target>
<target name="base.init.sourcelevel.1">
<property name="newt.sourcelevel" value="1.4" />
</target>
<!--target name="base.init.sourcelevel.2" if="gluegen.nsig">
<property name="newt.sourcelevel" value="1.5" />
</target-->
<!-- ================================================================== -->
<!--
- Load user properties which override build defaults.
-->
<target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file">
<!-- Load the user specified properties file that defines various host
- specific paths. The user will be notified if this is does not
- exist. -->
<property name="user.properties.file" value="${user.home}/newt.properties" />
<property file="${user.properties.file}" />
<echo message="Loaded ${user.properties.file}." />
<property file="${user.home}/gluegen.properties" />
<echo message="Loaded ${user.home}/gluegen.properties." />
</target>
<!-- ================================================================== -->
<!--
- Declare all paths and user defined variables.
-->
<target name="declare.common" description="Declare properties" depends="load.user.properties">
<!-- The location and name of the configuration ANT file that will
- validate to ensure that all user-define variables are set. -->
<property name="validate.user.properties" value="${make}/validate-properties.xml" />
<!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
<property name="javacdebug" value="true" />
<property name="javacdebuglevel" value="source,lines" />
<!-- Names of directories relative to the project root.
Some of these are used in FileMappers later for dependence information
and need exact string matching, which is why they use file.separator
instead of "/". -->
<condition property="rootrel.build" value="build">
<not>
<isset property="rootrel.build"/>
</not>
</condition>
<property name="rootrel.build.newt" value="${rootrel.build}/newt" />
<property name="rootrel.src" value="src/newt" />
<property name="rootrel.src.java" value="${rootrel.src}/classes" />
<property name="rootrel.src.c" value="${rootrel.src}/native" />
<property name="rootrel.obj" value="${rootrel.build.newt}/obj" />
<property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" />
<property name="nativewindow.all.jar" value="../${rootrel.build}/nativewindow/nativewindow.all.jar" />
<property name="jogl.all.jar" value="../${rootrel.build}/jogl/jogl.all.jar" />
<!-- The source directories. -->
<property name="src.java" value="${project.root}/${rootrel.src.java}" />
<property name="src.c" value="${project.root}/${rootrel.src.c}" />
<property name="build" value="${project.root}/${rootrel.build.newt}" />
<!-- The generated source directories. -->
<property name="src.generated" value="${build}/gensrc" />
<property name="src.generated.c" value="${src.generated}/native/newt" />
<!-- The compiler output directories. -->
<property name="classes" value="${build}/classes" />
<property name="obj" value="${project.root}/${rootrel.obj}" />
<path id="nativewindow_gluegen_jogl.classpath">
<pathelement location="${nativewindow.all.jar}" />
<pathelement location="${gluegen-rt.jar}" />
<pathelement location="${jogl.all.jar}" />
</path>
<!-- The resulting newt.jar. -->
<property name="newt.core.jar" value="${build}/newt.core.jar" />
<property name="newt.ogl.jar" value="${build}/newt.ogl.jar" />
<property name="newt.awt.jar" value="${build}/newt.awt.jar" />
<property name="newt.all.jar" value="${build}/newt.all.jar" />
<!-- The javadoc dirs. -->
<property name="javadoc" value="${project.root}/javadoc_newt_public" />
<property name="javadoc.spec" value="${project.root}/javadoc_newt_spec" />
<property name="javadoc.dev" value="${project.root}/javadoc_newt_dev" />
<property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
<property name="javadoc.windowtitle" value="NEWT API -- ${base_version} Specification" />
<property name="javadoc.overview" value="spec-overview.html" />
<property name="javadoc.spec.packagenames" value="com.sun.javafx.newt, com.sun.javafx.newt.opengl" />
<property name="javadoc.packagenames" value="${javadoc.spec.packagenames}" />
<property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.javafx.newt.*" />
<property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="http://jcp.org/en/jsr/detail?id=231">license terms</a>." />
</target>
<!-- ================================================================== -->
<!--
- Initialize all parameters required for the build and create any
- required directories.
-->
<target name="init" depends="declare.common">
<!-- Call the external config validator script to make sure the config is ok and consistent -->
<ant antfile="${validate.user.properties}" inheritall="true"/>
<mkdir dir="${src.generated.c}" />
<mkdir dir="${src.generated.c}/X11" />
<mkdir dir="${src.generated.c}/KD" />
<mkdir dir="${src.generated.c}/MacOSX" />
<mkdir dir="${src.generated.c}/Windows" />
<mkdir dir="${classes}" />
<mkdir dir="${obj}" />
</target>
<!-- ================================================================== -->
<!--
- Compile the original and generated source. The composable pipelines
- will be generated.
-->
<target name="java.compile.1" if="javac.bootclasspath.jar">
<!-- Perform the first pass Java compile; everything -->
<javac destdir="${classes}"
excludes="${java.excludes.all}"
source="${newt.sourcelevel}"
bootclasspath="${javac.bootclasspath.jar}"
fork="yes"
memoryMaximumSize="128m"
debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<classpath refid="nativewindow_gluegen_jogl.classpath"/>
<src path="${src.java}" />
</javac>
</target>
<target name="java.compile.2" unless="javac.bootclasspath.jar">
<!-- Perform the second pass Java compile; everything. -->
<javac destdir="${classes}"
excludes="${java.excludes.all}"
source="${newt.sourcelevel}"
fork="yes"
memoryMaximumSize="128m"
debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<src path="${src.java}" />
<classpath refid="nativewindow_gluegen_jogl.classpath"/>
</javac>
</target>
<target name="java.compile" depends="java.compile.1,java.compile.2" />
<!-- ================================================================== -->
<!--
- Compile the native C code for JOGL (and optionally the Cg binding).
-->
<target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler" unless="newt.compiler.present">
<!-- compiler configuration -->
<!-- Note that we can use the base setups in the gluegen-cpptasks for most of these -->
<compiler id="compiler.cfg.freebsd.newt" extends="compiler.cfg.freebsd">
<!-- Need to force X11R6 headers on to include path after stub_includes -->
<includepath path="/usr/X11R6/include" />
</compiler>
<!-- linker configuration -->
<linker id="linker.cfg.linux.newt.x11" extends="linker.cfg.linux">
<syslibset dir="/usr/X11R6/lib" libs="X11"/>
<syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
</linker>
<linker id="linker.cfg.linux.amd64.newt.x11" extends="linker.cfg.linux.amd64">
<syslibset dir="/usr/X11R6/lib64" libs="X11"/>
<syslibset dir="/usr/X11R6/lib64" libs="Xxf86vm" />
</linker>
<linker id="linker.cfg.solaris.newt.x11" extends="linker.cfg.solaris">
<syslibset libs="X11"/>
</linker>
<linker id="linker.cfg.win32.mingw.newt" extends="linker.cfg.win32.mingw">
<linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
<syslibset libs="gdi32, kernel32"/>
</linker>
<linker id="linker.cfg.win32.msvc.newt" extends="linker.cfg.win32.msvc">
<syslibset libs="gdi32, user32, kernel32" />
</linker>
<linker id="linker.cfg.macosx.newt" extends="linker.cfg.macosx">
<linkerarg value="-framework" />
<linkerarg value="Cocoa" />
</linker>
<linker id="linker.cfg.hpux.newt" extends="linker.cfg.hpux">
<syslibset dir="/usr/lib" libs="X11"/>
</linker>
</target>
<target name="c.configure.win32.vc" if="isVCFamily">
<echo message="Win32.VC" />
<property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" />
<property name="linker.cfg.id.core" value="linker.cfg.win32.msvc" />
<property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.newt" />
</target>
<target name="c.configure.win32.mingw" if="isMingW">
<echo message="Win32.MingW" />
<property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
<property name="linker.cfg.id.core" value="linker.cfg.win32.mingw" />
<property name="linker.cfg.id.oswin" value="linker.cfg.win32.mingw.newt" />
</target>
<target name="c.configure.linux.x86" if="isLinuxX86">
<echo message="Linux.x86" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
<property name="linker.cfg.id.core" value="linker.cfg.linux" />
<property name="linker.cfg.id.oswin" value="linker.cfg.linux.newt.x11" />
</target>
<target name="c.configure.linux.amd64" if="isLinuxAMD64">
<echo message="Linux.AMD64" />
<property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
<property name="linker.cfg.id.core" value="linker.cfg.linux.amd64" />
<property name="linker.cfg.id.oswin" value="linker.cfg.linux.amd64.newt.x11" />
</target>
<target name="c.configure.linux.ia64" if="isLinuxIA64">
<echo message="Linux.IA64" />
<property name="compiler.cfg.id" value="compiler.cfg.linux" />
<property name="linker.cfg.id.core" value="linker.cfg.linux" />
<property name="linker.cfg.id.oswin" value="linker.cfg.linux.newt.x11" />
</target>
<target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" />
<target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
<echo message="Solaris" />
<property name="compiler.cfg.id" value="compiler.cfg.solaris" />
<property name="linker.cfg.id.core" value="linker.cfg.solaris" />
<property name="linker.cfg.id.oswin" value="linker.cfg.solaris.newt.x11" />
</target>
<target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9">
<echo message="SolarisSparcv9" />
<property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" />
<property name="linker.cfg.id.core" value="linker.cfg.solaris.sparcv9" />
<property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.newt.x11" />
</target>
<target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64">
<echo message="SolarisAMD64" />
<property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" />
<property name="linker.cfg.id.core" value="linker.cfg.solaris.amd64" />
<property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.newt.x11" />
</target>
<target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD">
<echo message="FreeBSD" />
<property name="compiler.cfg.id" value="compiler.cfg.freebsd.newt" />
<property name="linker.cfg.id.core" value="linker.cfg.linux" />
<property name="linker.cfg.id.oswin" value="linker.cfg.linux.newt.x11" />
</target>
<target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX">
<echo message="HP-UX" />
<property name="compiler.cfg.id" value="compiler.cfg.hpux" />
<property name="linker.cfg.id.core" value="linker.cfg.hpux" />
<property name="linker.cfg.id.oswin" value="linker.cfg.hpux.newt.x11" />
</target>
<target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" />
<target name="c.configure.x11" if="isX11" />
<target name="c.configure.macosx" if="isOSX">
<property name="compiler.cfg.id" value="compiler.cfg.macosx" />
<property name="linker.cfg.id.core" value="linker.cfg.macosx" />
<property name="linker.cfg.id.oswin" value="linker.cfg.macosx.newt" />
</target>
<target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" />
<target name="c.configure" depends="c.configure.1,c.configure.2" />
<target name="rename.mingw.dll" if="isMingW">
<move file="${src}" tofile="${dest}" />
</target>
<target name="rename.dylib" if="isOSX">
<move file="${src}" tofile="${dest}" />
</target>
<macrodef name="c.build">
<attribute name="c.compiler.src.files" />
<attribute name="compiler.cfg.id" />
<attribute name="linker.cfg.id" />
<attribute name="output.lib.name" />
<attribute name="c.compiler.use-jawt" default="false"/>
<sequential>
<echo message="Output lib name = @{output.lib.name}" />
<!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
<property name="c.compiler.debug" value="false" />
<!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } -->
<property name="c.compiler.optimise" value="none" />
<condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition>
<patternset id="c.src.files.newt">
<include name="${rootrel.src.c}/WindowsWindow.c" if="isWindows"/>
<include name="${rootrel.src.c}/*.m" if="isOSX"/>
<include name="${rootrel.src.c}/X11Window.c" if="isX11"/>
<include name="${rootrel.src.c}/KDWindow.c" if="useKD"/>
</patternset>
<echo message="Compiling @{output.lib.name}" />
<cc outtype="shared"
objdir="${obj}"
outfile="${obj}/@{output.lib.name}"
optimize="${c.compiler.optimise}"
debug="${c.compiler.debug}"
multithreaded="true"
exceptions="false"
rtti="false">
<!-- TODO: versioninfo companyname="java.net"
legalcopyright="Copyright"
productname="JOGL"
productversion="x.y.z"
description="Description"
fileversion="x.y.z"
filecomments="File Comment" /-->
<fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
<compiler extends="@{compiler.cfg.id}" >
<sysincludepath path="${java.includes.dir}"/>
<sysincludepath path="${java.includes.dir.platform}"/>
<includepath path="stub_includes/egl"/>
<!-- This is for the generated headers for handwritten C code -->
<includepath path="${src.generated.c}" />
<includepath path="${src.generated.c}/X11" if="isX11"/>
<includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
<includepath path="${src.generated.c}/Windows" if="isWindows"/>
<includepath path="${src.generated.c}/KD"/>
<!-- This must come last to not override real include paths -->
<!-- includepath path="stub_includes/macosx" if="isOSX" / -->
</compiler>
<linker extends="@{linker.cfg.id}">
<syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
<syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
</linker>
</cc>
<!-- FIXME: this is a hack; the cpptask should have an option to change the
suffix or at least understand the override from dylib to jnilib -->
<antcall target="rename.dylib" inheritRefs="true">
<param name="src" value="${build}/obj/lib@{output.lib.name}.dylib" />
<param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" />
</antcall>
<!-- FIXME: this is a hack; the cpptask should have an option to change the
suffix or at least understand the override from dylib to jnilib -->
<antcall target="rename.mingw.dll" inheritRefs="true">
<param name="src" value="${build}/obj/lib@{output.lib.name}.so" />
<param name="dest" value="${build}/obj/@{output.lib.name}.dll" />
</antcall>
</sequential>
</macrodef>
<target name="c.build.newt.prepare">
<javah destdir="../${rootrel.build.newt}/gensrc/native/newt/Windows" classpath="${newt.all.jar}" class="com.sun.javafx.newt.windows.WindowsWindow" />
<javah destdir="../${rootrel.build.newt}/gensrc/native/newt/MacOSX" classpath="${newt.all.jar}" class="com.sun.javafx.newt.macosx.MacWindow" />
<javah destdir="../${rootrel.build.newt}/gensrc/native/newt/X11" classpath="${newt.all.jar}" class="com.sun.javafx.newt.x11.X11Window" />
<javah destdir="../${rootrel.build.newt}/gensrc/native/newt/KD" classpath="${newt.all.jar}" class="com.sun.javafx.newt.opengl.kd.KDWindow" />
</target>
<target name="c.build.newt.windowlib">
<c.build c.compiler.src.files="c.src.files.newt"
output.lib.name="newt"
compiler.cfg.id="${compiler.cfg.id}"
linker.cfg.id="${linker.cfg.id.oswin}"/>
</target>
<target name="c.manifest" if="isVC8Family">
<!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll -->
<exec executable="mt">
<arg value="-manifest"/>
<arg value="${obj}/newt.dll.manifest"/>
<arg value="-outputresource:${obj}/newt.dll;#2"/>
</exec>
</target>
<target name="c.build.newt" depends="c.configure,c.build.newt.prepare,c.build.newt.windowlib">
<antcall target="c.manifest" inheritRefs="true" />
</target>
<!-- ================================================================== -->
<!--
- Build the newt.jar files.
-->
<target name="jar" depends="java.compile,cond-if-RImanifest,cond-else-RImanifest"/>
<target name="check-RIcond">
<condition property="RIcond-is-true">
<isset property="RImanifestfile"/>
</condition>
</target>
<target name="cond-if-RImanifest" depends="check-RIcond" if="RIcond-is-true">
<copy file="newtRIversion"
tofile="tempversion"
overwrite="true">
<filterset>
<filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
<filter token="BASEVERSION" value="${base_version}"/>
</filterset>
</copy>
<jar manifest="tempversion" destfile="${newt.core.jar}">
<fileset dir="${classes}"
includes="${java.part.core}"/>
</jar>
<jar manifest="tempversion" destfile="${newt.ogl.jar}">
<fileset dir="${classes}"
includes="${java.part.core}, ${java.part.opengl}"/>
</jar>
<jar manifest="tempversion" destfile="${newt.awt.jar}">
<fileset dir="${classes}"
includes="${java.part.awt}"/>
</jar>
<jar manifest="tempversion" destfile="${newt.all.jar}">
<fileset dir="${classes}">
<include name="com/sun/javafx/newt/**" />
</fileset>
</jar>
<delete file="tempversion"/>
</target>
<target name="cond-else-RImanifest" depends="check-RIcond" unless="RIcond-is-true">
<tstamp>
<format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
</tstamp>
<copy file="newtversion"
tofile="tempversion"
overwrite="true">
<filterset>
<filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
<filter token="BASEVERSION" value="${base_version}"/>
</filterset>
</copy>
<jar manifest="tempversion" destfile="${newt.jar}">
<fileset dir="${classes}">
<include name="com/sun/javafx/newt/**" />
</fileset>
</jar>
<delete file="tempversion"/>
</target>
<!-- ================================================================== -->
<!--
- Build the Javadocs for the sources.
- NOTE: these are not entirely correct as the javadocs targets depend
- on the platform specific build targets. To circumvent any
- errors, ensure that the source is built first.
-->
<target name="javadoc" depends="load.user.properties,init">
<!-- Build the general Javadoc -->
<javadoc packagenames="${javadoc.packagenames}"
excludepackagenames="${java.excludes.javadoc.packagenames}"
sourcepath="${src.java};${src.generated.java}"
destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
overview="${javadoc.overview}"
source="1.4"
linkoffline="${javadoc.link} 142-packages"
bottom="${javadoc.bottom}" >
<classpath refid="nativewindow_gluegen_jogl.classpath"/>
</javadoc>
</target>
<target name="javadoc.spec" depends="load.user.properties,init">
<!-- Build the general Javadoc -->
<javadoc packagenames="${javadoc.spec.packagenames}"
excludepackagenames="${java.excludes.javadoc.packagenames}"
sourcepath="${src.java};${src.generated.java}"
destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
overview="${javadoc.overview}"
source="1.4"
linkoffline="${javadoc.link} 142-packages"
bottom="${javadoc.bottom}" >
<classpath refid="nativewindow_gluegen_jogl.classpath"/>
</javadoc>
</target>
<target name="javadoc.dev" depends="load.user.properties,init">
<!-- Build the internal developer Javadoc -->
<javadoc packagenames="${javadoc.dev.packagenames}"
excludepackagenames="${java.excludes.javadoc.packagenames}"
sourcepath="${src.java};${src.generated.java}"
destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
overview="${javadoc.overview}"
source="1.4"
linkoffline="${javadoc.link} 142-packages"
bottom="${javadoc.bottom}" >
<classpath refid="nativewindow_gluegen_jogl.classpath"/>
</javadoc>
</target>
<target name="all.doc" description="Build NEWT docs" depends="init,javadoc,javadoc.spec,javadoc.dev" />
<!-- ================================================================== -->
<!--
- Build the platform-independent distribution out of jars built for
- Windows, Linux and Mac OS X; the Java sources for Jogl can't be
- fully cross-compiled at this time. To run this target, you need to
- specify the property newt.dist.dir as a System property (i.e.,
- "ant -Dnewt.dist.dir=../dist dist"); directories named newt-linux,
- newt-win, and newt-macosx need to be inside that directory and each
- of those directories needs to contain both the newt.jar for that
- platform as well as the native code (libnewt.so, newt.dll, or
- libnewt.jnilib). Also builds jars containing the native code for
- Windows, Linux, Mac OS X, Solaris/SPARC and Solaris/x86.
-->
<target name="dist.dir.check" unless="newt.dist.dir">
<fail>
******************************************************************
** To build the Jogl distribution out of the platform-specific **
** component jars and native code, the property newt.dist.dir **
** needs to be specified on the command line. Please read the **
** comments associated with the "dist" target in the build.xml. **
******************************************************************
</fail>
</target>
<target name="dist.check.windows" if="newt.dist.dir">
<condition property="windows.complete">
<and>
<available file="${newt.dist.dir}/newt-win/newt.jar" />
<available file="${newt.dist.dir}/newt-win/32/newt.dll" />
</and>
</condition>
<fail unless="windows.complete">
******************************************************************
** Files are missing from the Windows build. This will cause **
** the distribution to be incomplete. Please check the status **
** of the Windows build and try again. **
******************************************************************
</fail>
</target>
<target name="dist.check.windows-amd64" if="newt.dist.dir">
<condition property="windows-amd64.complete">
<and>
<available file="${newt.dist.dir}/newt-win/64/newt.dll" />
</and>
</condition>
<fail unless="windows-amd64.complete">
*********************************************************************
** Files are missing from the Windows/AMD64 build. This will cause **
** the distribution to be incomplete. Please check the status **
** of the Windows/AMD64 build and try again. **
*********************************************************************
</fail>
</target>
<target name="dist.check.linux" if="newt.dist.dir">
<condition property="linux.complete">
<and>
<available file="${newt.dist.dir}/newt-linux/newt.jar" />
<available file="${newt.dist.dir}/newt-linux/32/libnewt.so" />
</and>
</condition>
<fail unless="linux.complete">
******************************************************************
** Files are missing from the Linux build. This will cause **
** the distribution to be incomplete. Please check the status **
** of the Linux build and try again. **
******************************************************************
</fail>
</target>
<target name="dist.check.linux-amd64" if="newt.dist.dir">
<condition property="linux-amd64.complete">
<and>
<available file="${newt.dist.dir}/newt-linux/64/libnewt.so" />
</and>
</condition>
<fail unless="linux-amd64.complete">
*******************************************************************
** Files are missing from the Linux/AMD64 build. This will cause **
** the distribution to be incomplete. Please check the status **
** of the Linux/AMD64 build and try again. **
*******************************************************************
</fail>
</target>
<target name="dist.check.macosx" if="newt.dist.dir">
<condition property="macosx.complete">
<and>
<available file="${newt.dist.dir}/newt-macosx/newt.jar" />
<available file="${newt.dist.dir}/newt-macosx/ppc/libnewt.jnilib" />
</and>
</condition>
<fail unless="macosx.complete">
******************************************************************
** Files are missing from the Mac OS X build. This will cause **
** the distribution to be incomplete. Please check the status **
** of the Mac OS X build and try again. **
******************************************************************
</fail>
</target>
<target name="dist.check.macosxfat" if="newt.dist.dir">
<condition property="macosxfat.complete">
<and>
<available file="${newt.dist.dir}/newt-macosx/newt.jar" />
<available file="${newt.dist.dir}/newt-macosx/fat/libnewt.jnilib" />
</and>
</condition>
<fail unless="macosxfat.complete">
******************************************************************
** Files are missing from the Mac OS X build. This will cause **
** the distribution to be incomplete. Please check the status **
** of the Mac OS X build and try again. **
******************************************************************
</fail>
</target>
<target name="dist.check.solsparc" if="newt.dist.dir">
<condition property="solsparc.complete">
<and>
<available file="${newt.dist.dir}/newt-solsparc/newt.jar" />
<available file="${newt.dist.dir}/newt-solsparc/32/libnewt.so" />
</and>
</condition>
<fail unless="solsparc.complete">
******************************************************************
** Files are missing from the Solaris/SPARC build. This will **
** cause the distribution to be incomplete. Please check the **
** status of the Solaris/SPARC build and try again. **
******************************************************************
</fail>
</target>
<target name="dist.check.solsparcv9" if="newt.dist.dir">
<condition property="solsparcv9.complete">
<and>
<available file="${newt.dist.dir}/newt-solsparc/newt.jar" />
<available file="${newt.dist.dir}/newt-solsparc/64/libnewt.so" />
</and>
</condition>
<fail unless="solsparcv9.complete">
******************************************************************
** Files are missing from the Solaris/SPARCv9 build. This will **
** cause the distribution to be incomplete. Please check the **
** status of the Solaris/SPARCv9 build and try again. **
******************************************************************
</fail>
</target>
<target name="dist.check.solx86" if="newt.dist.dir">
<condition property="solx86.complete">
<and>
<available file="${newt.dist.dir}/newt-solx86/newt.jar" />
<available file="${newt.dist.dir}/newt-solx86/32/libnewt.so" />
</and>
</condition>
<fail unless="solx86.complete">
******************************************************************
** Files are missing from the Solaris/x86 build. This will **
** cause the distribution to be incomplete. Please check the **
** status of the Solaris/x86 build and try again. **
******************************************************************
</fail>
</target>
<target name="dist.check.solamd64" if="newt.dist.dir">
<condition property="solamd64.complete">
<and>
<available file="${newt.dist.dir}/newt-solx86/64/libnewt.so" />
</and>
</condition>
<fail unless="solamd64.complete">
******************************************************************
** Files are missing from the Solaris/x86/64 (amd64) build. This *
** will cause the distribution **
** to be incomplete. Please check the **
** status of the Solaris/x86 (amd64) build and try again. **
******************************************************************
</fail>
</target>
<!-- Helper task for dist target below -->
<!-- Required parameters: -->
<!-- zip.os.arch = the os/arch combination for this zip file (i.e., "windows-i586") -->
<!-- zip.src.so.dir = the directory containing the .so's / .dll's / .jnilib's for this platform-->
<target name="dist.build.zip">
<property name="newt.tmp.version" value="newt-${tmp.version}-${zip.os.arch}" />
<!-- Create all needed directories -->
<delete dir="${newt.dist.dir}/tmp" failonerror="false" />
<mkdir dir="${newt.dist.dir}/tmp/${newt.tmp.version}/lib" />
<!-- Copy in files -->
<copy todir="${newt.dist.dir}/tmp/${newt.tmp.version}/lib">
<fileset dir="${zip.src.so.dir}" includes="*${zip.so.suffix}" />
</copy>
<copy file="${newt.dist.dir}/newt.jar" todir="${newt.dist.dir}/tmp/${newt.tmp.version}/lib" />
<copy file="../CHANGELOG.txt" todir="${newt.dist.dir}/tmp/${newt.tmp.version}" />
<copy file="../COPYRIGHT.txt" todir="${newt.dist.dir}/tmp/${newt.tmp.version}" />
<copy file="../LICENSE.txt" tofile="${newt.dist.dir}/tmp/${newt.tmp.version}/LICENSE-NEWT-${tmp.version}.txt" />
<copy file="README-zip-bundles.txt"
tofile="${newt.dist.dir}/tmp/${newt.tmp.version}/README.txt"
overwrite="true">
<filterset>
<filter token="VERSION" value="${tmp.version}"/>
</filterset>
</copy>
<copy file="../doc/userguide/index.html" tofile="${newt.dist.dir}/tmp/${newt.tmp.version}/Userguide.html" />
<!-- zip it up -->
<zip destfile="${newt.dist.dir}/${newt.tmp.version}.zip"
basedir="${newt.dist.dir}/tmp"
includes="${newt.tmp.version}/**" />
</target>
<target name="setup-version-RI" if="RImanifestfile">
<property name="tmp.version" value="${base_version}" />
</target>
<target name="setup-version-non-RI" unless="RImanifestfile">
<tstamp>
<format property="timestamp" pattern="yyyyMMdd"/>
</tstamp>
<property name="tmp.version" value="${base_version}-pre-${timestamp}" />
</target>
<target name="dist" depends="dist.dir.check,dist.check.windows,dist.check.windows-amd64,dist.check.linux,dist.check.linux-amd64,dist.check.macosx,dist.check.macosxfat,dist.check.solsparc,dist.check.solsparcv9,dist.check.solx86,dist.check.solamd64,setup-version-RI,setup-version-non-RI">
<delete>
<fileset dir="${newt.dist.dir}" includes="*.jar" />
</delete>
<delete>
<fileset dir="${newt.dist.dir}" includes="*.zip" />
</delete>
<delete dir="${newt.dist.dir}/tmp" failonerror="false" />
<delete dir="${newt.dist.dir}/META-INF" failonerror="false" />
<!-- Extract manifest from one of the jars to re-use it in the dist jar -->
<unjar src="${newt.dist.dir}/newt-win/newt.jar" dest="${newt.dist.dir}" >
<patternset>
<include name="META-INF/MANIFEST.MF" />
</patternset>
</unjar>
<!-- Build jar files suitable for Java Web Start -->
<jar manifest="${newt.dist.dir}/META-INF/MANIFEST.MF" destfile="${newt.dist.dir}/newt.jar" duplicate="preserve">
<zipgroupfileset dir="${newt.dist.dir}"
includes="newt-win/newt.jar, newt-linux/newt.jar, newt-macosx/newt.jar" />
</jar>
<!-- Apply Pack200 repacking to allow later compression by that mechanism -->
<apply executable="pack200" verbose="true" >
<arg value="--repack" />
<fileset file="${newt.dist.dir}/newt.jar" />
</apply>
<jar destfile="${newt.dist.dir}/newt-natives-windows-i586.jar"
basedir="${newt.dist.dir}/newt-win/32"
includes="newt.dll" />
<jar destfile="${newt.dist.dir}/newt-natives-windows-amd64.jar"
basedir="${newt.dist.dir}/newt-win/64"
includes="newt.dll" />
<jar destfile="${newt.dist.dir}/newt-natives-linux-i586.jar"
basedir="${newt.dist.dir}/newt-linux/32"
includes="libnewt.so" />
<jar destfile="${newt.dist.dir}/newt-natives-linux-amd64.jar"
basedir="${newt.dist.dir}/newt-linux/64"
includes="libnewt.so" />
<jar destfile="${newt.dist.dir}/newt-natives-macosx-ppc.jar"
basedir="${newt.dist.dir}/newt-macosx/ppc"
includes="libnewt.jnilib" />
<jar destfile="${newt.dist.dir}/newt-natives-macosx-universal.jar"
basedir="${newt.dist.dir}/newt-macosx/fat"
includes="libnewt.jnilib" />
<jar destfile="${newt.dist.dir}/newt-natives-solaris-sparc.jar"
basedir="${newt.dist.dir}/newt-solsparc/32"
includes="libnewt.so" />
<jar destfile="${newt.dist.dir}/newt-natives-solaris-sparcv9.jar"
basedir="${newt.dist.dir}/newt-solsparc/64"
includes="libnewt.so" />
<jar destfile="${newt.dist.dir}/newt-natives-solaris-i586.jar"
basedir="${newt.dist.dir}/newt-solx86/32"
includes="libnewt.so" />
<jar destfile="${newt.dist.dir}/newt-natives-solaris-amd64.jar"
basedir="${newt.dist.dir}/newt-solx86/64"
includes="libnewt.so" />
<zip destfile="${newt.dist.dir}/newt-${tmp.version}-src.zip"
basedir="../.."
includes="jogl/*.txt,jogl/doc/**,jogl/make/**,jogl/src/newt/**"
excludes="**/*.class,**/*~"
/>
<!-- Create zip archives suitable for developers -->
<!-- Unfortunately, we have to replicate the os/arch name combinations from
gluegen-cpptasks.xml. The reason for this is that we can't generate these
zip archives on the platform where the builds run; we have to run the dist
target in order to get the platform-independent newt.jar. -->
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="linux-i586" />
<param name="zip.so.suffix" value=".so" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-linux/32" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="linux-amd64" />
<param name="zip.so.suffix" value=".so" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-linux/64" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="macosx-ppc" />
<param name="zip.so.suffix" value=".jnilib" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-macosx/ppc" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="macosx-universal" />
<param name="zip.so.suffix" value=".jnilib" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-macosx/fat" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="solaris-i586" />
<param name="zip.so.suffix" value=".so" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solx86/32" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="solaris-amd64" />
<param name="zip.so.suffix" value=".so" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solx86/64" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="solaris-sparc" />
<param name="zip.so.suffix" value=".so" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solsparc/32" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="solaris-sparcv9" />
<param name="zip.so.suffix" value=".so" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solsparc/64" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="windows-i586" />
<param name="zip.so.suffix" value=".dll" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-win/32" />
</antcall>
<antcall target="dist.build.zip" inheritAll="true">
<param name="zip.os.arch" value="windows-amd64" />
<param name="zip.so.suffix" value=".dll" />
<param name="zip.src.so.dir" value="${newt.dist.dir}/newt-win/64" />
</antcall>
<!-- Create one last zip archive by hand, this one containing all of the -->
<!-- Java Web Start jar files (for easier redistribution) -->
<zip destfile="${newt.dist.dir}/newt-${tmp.version}-webstart.zip"
basedir="${newt.dist.dir}"
includes="*.jar" />
<!-- Create a version.txt file indicating which version we just built -->
<echo message="${tmp.version}" file="${newt.dist.dir}/version.txt" />
</target>
<!-- ================================================================== -->
<!--
- Clean up all that is built.
-->
<target name="clean" description="Remove all build products" depends="declare.common">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${build}" />
<fileset dir="${javadoc}" />
<fileset dir="${javadoc.spec}" />
<fileset dir="${javadoc.dev}" />
</delete>
</target>
<!-- ================================================================== -->
<!--
- Build everything.
-->
<target name="all" description="Build NEWT JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.newt" />
<!-- ================================================================== -->
<!--
- Build everything and use Sun's Implementation tag in the manifest to
- indicate this is the Reference Implementation.
-->
<target name="RI">
<!-- Set property for using the RI manifest file so newt.jar is versioned
- properly
-->
<property name="RImanifestfile" value="newtRIversion" />
<antcall target="all" inheritRefs="true" />
</target>
</project>
|