Codebase list lwjgl / ad084d3 debian / patches / 01allarchs
ad084d3

Tree @ad084d3 (Download .tar.gz)

01allarchs @ad084d3raw · history · blame

Description: To build on all archs
Author: Gabriele Giacone <1o5g4r8o@gmail.com>

--- a/platform_build/linux_ant/build.xml
+++ b/platform_build/linux_ant/build.xml
@@ -1,17 +1,22 @@
 <?xml version="1.0"?>
 
 <project name="lwjgl native code, linux" basedir="../../bin/lwjgl" default="compile">
+	<exec executable="/usr/bin/dpkg-architecture" outputproperty="arch">
+		<arg value="-qDEB_BUILD_ARCH"/>
+	</exec>
 	<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 -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 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/${arch} -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>
@@ -41,6 +46,7 @@
 
 		<property name="linker_flags32" value="${version_script_flags32} -shared -O2 -Wall -o ${libname32} ${libs32} ${xf86vm_lib}"/>
 		<property name="linker_flags64" value="${version_script_flags64} -shared -O2 -Wall -o ${libname64} ${libs64} ${xf86vm_lib}"/>
+		<property name="linker_flagsdeb" value="${version_script_flags32} -shared -O2 -Wall -o ${libname32} ${libs} ${xf86vm_lib}"/>
 
     	<condition property="build.32bit.only">
     		<not>
@@ -58,9 +64,12 @@
     			<equals arg1="${hwplatform}" arg2="x86_64"/>
     		</and>
     	</condition>
+
+    	<condition property="build.debian">
+    			<os name="Linux"/>
+    	</condition>
     	
-    	<antcall target="compile32"/>
-    	<antcall target="compile64"/>
+    	<antcall target="compiledeb"/>
     </target>
 	
     <target name="compile32" unless="build.64bit.only">
@@ -114,4 +123,30 @@
 			<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}"/>
+			<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}/linux"/>
+			<mapper type="glob" from="*.c" to="*.o"/>
+			<fileset dir="${native}/linux" includes="*.c"/>
+			<fileset dir="${native}/generated" includes="*.c"/>
+			<fileset dir="${native}/common" 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>