File: build.xml

package info (click to toggle)
lwjgl 2.9.3%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 9,520 kB
  • sloc: java: 70,871; ansic: 11,399; xml: 2,195; objc: 906; lisp: 76; makefile: 12; sh: 1
file content (167 lines) | stat: -rw-r--r-- 7,129 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0"?>

<project name="lwjgl native code, linux" basedir="../../bin/lwjgl" default="compile">
	<property name="native" location="../../src/native"/>
	<property name="libname32" value="liblwjgl.so"/>
	<property name="libname64" value="liblwjgl64.so"/>
	<property name="libs32" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/i386 -ljawt" />
	<property name="libs64" value="-L/usr/X11R6/lib64 -L/usr/X11/lib64 -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/amd64 -ljawt" />
	<property name="libs" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXcursor -lXrandr -lXxf86vm -L${java.home}/lib -ljawt" />
	<property name="cflags32" value="-O2 -Wall -c -fPIC -std=c99 -Wunused"/>

	<target name="clean">
		<delete>
			<fileset dir="x32"/>
			<fileset dir="x64"/>
			<fileset dir="deb"/>
			<fileset dir="." includes="*.o"/>
			<fileset dir="." includes="*.so"/>
		</delete>
	</target>

    <target name="compile">
		<exec executable="uname" outputproperty="hwplatform">
			<arg value="-m"/>
		</exec>
		<condition property="cflags_ppc64le" value="-mcpu=powerpc -m64" else="">
			<os arch="ppc64le"/>
		</condition>
		<echo message="value of arch is ${os.arch} the value of hwplatform is ${hwplatform} and cflags32 ${cflags32}" />
		<condition property="cflags_pthread" value="-pthreads" else="-pthread">
			<os name="SunOS" />
		</condition>
		<condition property="version_script_flags32" value="" else="-Wl,--version-script='${native}/linux/lwjgl.map'">
			<os name="SunOS" />
		</condition>
		<condition property="version_script_flags64" value="-m64" else="-Wl,--version-script='${native}/linux/lwjgl.map'">
			<and>
				<os name="SunOS" />
			</and>
		</condition>
    	<condition property="cflags64" value="-O2 -m64 -Wall -c -fPIC -std=c99 -Wunused" else="-O2 -Wall -c -fPIC -std=c99 -Wunused">
    		<os name="SunOS" />
    	</condition>

		<property name="linker_flags32" value="${version_script_flags32} -shared -O2 -Wall -o ${libname32} ${libs32}"/>
		<property name="linker_flags64" value="${version_script_flags64} -shared -O2 -Wall -o ${libname64} ${libs64}"/>
		<property name="linker_flagsdeb" value="${version_script_flags32} -shared -O2 -Wall -o ${libname32} ${libs}"/>

    	<condition property="build.32bit.only">
    		<not>
	    		<or>
					<equals arg1="${hwplatform}" arg2="x86_64"/>
					<equals arg1="${hwplatform}" arg2="i86pc"/>
				</or>
    		</not>
    	</condition>

    	<!-- On linux, the 64 bit jre doesn't have the 32 bit libs -->
    	<condition property="build.64bit.only">
    		<and>
    			<os name="Linux"/>
    			<equals arg1="${hwplatform}" arg2="x86_64"/>
    		</and>
    	</condition>

		<condition property="build.debian">
				<os name="Linux" />
		</condition>
		<antcall target="compiledeb" />
    </target>

    <target name="compile32" unless="build.64bit.only">
    	<mkdir dir="x32"/>
    	<apply dir="x32" executable="gcc" skipemptyfilesets="true" failonerror="true" parallel="true">
			<arg line="${cflags32} ${cflags_pthread}"/>
			<arg value="-I${java.home}/include"/>
			<arg value="-I${java.home}/include/linux"/>
			<arg value="-I${java.home}/../include"/>
			<arg value="-I${java.home}/../include/linux"/>
			<arg value="-I${java.home}/../include/solaris"/>
			<arg value="-I${native}/common"/>
		    <arg value="-I${native}/common/opengl"/>
			<arg value="-I${native}/linux"/>
		    <arg value="-I${native}/linux/opengl"/>
			<mapper type="glob" from="*.c" to="*.o"/>
		    <fileset dir="${native}/common" includes="*.c"/>
		    <fileset dir="${native}/common/opengl" includes="*.c"/>
		    <fileset dir="${native}/generated/openal" includes="*.c"/>
		    <fileset dir="${native}/generated/opencl" includes="*.c"/>
		    <fileset dir="${native}/generated/opengl" includes="*.c"/>
		    <fileset dir="${native}/linux" includes="*.c"/>
		    <fileset dir="${native}/linux/opengl" includes="*.c"/>
	    </apply>
		<apply dir="." parallel="true" executable="gcc" failonerror="true">
			<srcfile/>
			<arg line="${linker_flags32}"/>
			<fileset dir="x32" includes="*.o"/>
		</apply>
		<apply dir="." parallel="true" executable="strip" failonerror="true">
			<fileset file="${libname32}"/>
		</apply>
    </target>

    <target name="compile64" unless="build.32bit.only">
    	<mkdir dir="x64"/>
    	<apply dir="x64" executable="gcc" skipemptyfilesets="true" failonerror="true" parallel="true">
			<arg line="${cflags64} ${cflags_pthread}"/>
			<arg value="-I${java.home}/include"/>
			<arg value="-I${java.home}/include/linux"/>
			<arg value="-I${java.home}/../include"/>
			<arg value="-I${java.home}/../include/linux"/>
			<arg value="-I${java.home}/../include/solaris"/>
			<arg value="-I${native}/common"/>
		    <arg value="-I${native}/common/opengl"/>
			<arg value="-I${native}/linux"/>
		    <arg value="-I${native}/linux/opengl"/>
			<mapper type="glob" from="*.c" to="*.o"/>
		    <fileset dir="${native}/common" includes="*.c"/>
		    <fileset dir="${native}/common/opengl" includes="*.c"/>
		    <fileset dir="${native}/generated/openal" includes="*.c"/>
		    <fileset dir="${native}/generated/opencl" includes="*.c"/>    		
		    <fileset dir="${native}/generated/opengl" includes="*.c"/>
		    <fileset dir="${native}/linux" includes="*.c"/>
		    <fileset dir="${native}/linux/opengl" includes="*.c"/>
	    </apply>
		<apply dir="." parallel="true" executable="gcc" failonerror="true">
			<srcfile/>
			<arg line="${linker_flags64}"/>
			<fileset dir="x64" includes="*.o"/>
		</apply>
		<apply dir="." parallel="true" executable="strip" failonerror="true">
			<fileset file="${libname64}"/>
		</apply>
    </target>
<target name="compiledeb">    	
    	<mkdir dir="deb"/>
    	<apply dir="deb" executable="gcc" skipemptyfilesets="true" failonerror="true">
			<arg line="${cflags32} ${cflags_pthread} ${cflags_ppc64le}"/>
			<arg value="-I${java.home}/include"/>
			<arg value="-I${java.home}/include/linux"/>
			<arg value="-I${java.home}/../include"/>
			<arg value="-I${java.home}/../include/linux"/>
			<arg value="-I${java.home}/../include/solaris"/>
			<arg value="-I${native}/common"/>
			<arg value="-I${native}/common/opengl"/>
			<arg value="-I${native}"/>
			<arg value="-I${native}/linux"/>
			<arg value="-I${native}/linux/opengl"/>
			<mapper type="glob" from="*.c" to="*.o"/>
			<fileset dir="${native}/linux" includes="*.c"/>
			<fileset dir="${native}/linux/opengl" includes="*.c"/>
			<fileset dir="${native}/generated" includes="*.c"/>
			<fileset dir="${native}/common" includes="**/*.c" excludes="opengles/**/*"/>
			<fileset dir="${native}/generated/openal" includes="*.c"/>
			<fileset dir="${native}/generated/opencl" includes="*.c"/>    		
			<fileset dir="${native}/generated/opengl" includes="*.c"/>
		</apply>
		<apply dir="." parallel="true" executable="gcc" failonerror="true">
			<srcfile/>
			<arg line="${linker_flagsdeb}"/>
			<fileset dir="deb" includes="*.o"/>
		</apply>
		<apply dir="." parallel="true" executable="strip" failonerror="true">
			<fileset file="${libname32}"/>
		</apply>
    </target>
</project>