Package list lwjgl / debian/2.7.1+dfsg-5 debian / patches / allarchs.patch
debian/2.7.1+dfsg-5

Tree @debian/2.7.1+dfsg-5 (Download .tar.gz)

allarchs.patch @debian/2.7.1+dfsg-5raw · history · blame

Author: Gabriele Giacone <1o5g4r8o@gmail.com>
Description: support for building on all architectures

--- a/platform_build/linux_ant/build.xml
+++ b/platform_build/linux_ant/build.xml
@@ -6,12 +6,14 @@
 	<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 -lXcursor -lXrandr -lXxf86vm -L${java.home}/lib/${os.arch}" />
 	<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 +43,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>
@@ -59,8 +62,11 @@
     		</and>
     	</condition>
 
-    	<antcall target="compile32"/>
-    	<antcall target="compile64"/>
+	<condition property="build.debian">
+		<os name="Linux" />
+	</condition>
+
+	<antcall target="compiledeb" />
     </target>
 
     <target name="compile32" unless="build.64bit.only">
@@ -114,4 +120,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>