Added linux specific build.xml for building liblwjgl.so. Moved FMOD and Devil native builds to compile_native_optional ant target

This commit is contained in:
Elias Naur 2006-07-07 11:00:32 +00:00
parent ce2096e10d
commit fbde91bbce
2 changed files with 62 additions and 11 deletions

View File

@ -1,4 +1,4 @@
<project name="LWJGL" default="compile" basedir=".">
<project name="LWJGL" default="all" basedir=".">
<!-- ================================================================== -->
<!-- Global properties for build -->
@ -249,10 +249,7 @@
<target name="clean" description="Cleans the diectories controlled by this ant script">
<delete dir="${lwjgl.temp}" quiet="true" failonerror="false" taskname="cleaning temp folder" />
<delete dir="${lwjgl.docs}/javadoc" quiet="true" failonerror="false" taskname="cleaning javadoc folder" />
<delete dir="${lwjgl.bin}/org" quiet="true" failonerror="false" taskname="cleaning bin folder" />
<delete taskname="cleaning bin folder" failonerror="false">
<fileset dir="${lwjgl.bin}" includes="*.class" />
</delete>
<delete dir="${lwjgl.bin}" quiet="true" failonerror="false" taskname="cleaning bin folder" />
</target>
<!-- Creates a distribution of LWJGL -->
@ -297,6 +294,8 @@
<antcall target="-distribute" />
</target>
<target name="all" description="Creates the Java archives and the natives for the current platform" depends="jars, compile_native"/>
<!-- Create ONLY the jar archives -->
<target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="-initialize, compile, -createjars">
<move todir="libs/">
@ -465,7 +464,7 @@
</target>
<!-- Compiles the Java source code -->
<target name="compile" description="Compiles the java source code">
<target name="compile" description="Compiles the java source code" depends="-initialize">
<javac debug="yes" destdir="${lwjgl.bin}" includes="org/lwjgl/opengl/**" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar" taskname="core">
<src path="${lwjgl.src}/java/"/>
<src path="${lwjgl.src}/generated/"/>
@ -632,6 +631,8 @@
</apply>
</target>
<target name="compile_native_all" depends="compile_native, compile_native_optional" description="Compiles the native files"/>
<!-- Compiles the native files -->
<target name="compile_native" depends="headers" description="Compiles the native files">
<!-- check each platform, and run their build target -->
@ -650,6 +651,15 @@
</condition>
<antcall target="-compile_native_mac" />
</target>
<target name="compile_native_optional" depends="headers" description="Compiles the native files">
<!-- check each platform, and run their build target -->
<condition property="lwjgl.platform.linux">
<os name="Linux" />
</condition>
<antcall target="-compile_native_linux_optional" />
</target>
<!-- Compiles LWJGL on Win32 platforms -->
<target name="-compile_native_win32" if="lwjgl.platform.windows">
@ -695,9 +705,12 @@
<!-- Compiles LWJGL on Linux platforms -->
<target name="-compile_native_linux" if="lwjgl.platform.linux">
<echo>Compiling Linux LWJGL version</echo>
<ant antfile="platform_build/linux_ant/build.xml" inheritAll="false"/>
<copy file="${lwjgl.bin}/liblwjgl.so" tofile="${lwjgl.lib}/linux/liblwjgl.so" />
</target>
<!-- check for required properties -->
<target name="-compile_native_linux_optional" if="lwjgl.platform.linux">
<!-- check for required properties -->
<property environment="env"/>
<fail message="Missing JAVA_HOME path environment property" unless="env.JAVA_HOME"/>
<fail message="Missing FMOD path environment property" unless="env.FMOD"/>
@ -709,7 +722,6 @@
<exec executable="make" dir="${lwjgl.src.native}/common/fmod3">
<arg line="-f Makefile.linux"/>
</exec>
<move file="${lwjgl.src.native}/linux/liblwjgl.so" tofile="${lwjgl.lib}/linux/liblwjgl.so" />
<move file="${lwjgl.src.native}/common/devil/liblwjgl-devil.so" tofile="${lwjgl.lib}/linux/liblwjgl-devil.so" />
<move file="${lwjgl.src.native}/common/fmod3/liblwjgl-fmod3.so" tofile="${lwjgl.lib}/linux/liblwjgl-fmod3.so" />
</target>
@ -745,12 +757,12 @@
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/build.xml" dest="." />
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/src" dest="." />
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/doc" dest="." />
<ant dir="LWJGL" target="compile_native" />
<ant dir="LWJGL" target="compile_native_all" />
<ant dir="LWJGL" target="release" />
</target>
<!-- -->
<target name="sign" description="Using relased files, creates the nescesarry files used for jnlp demos">
<target name="sign" description="Using released files, creates the necessary files used for jnlp demos">
<!-- delete existing temp -->
<delete dir="${lwjgl.temp}"/>

View File

@ -0,0 +1,39 @@
<?xml version="1.0"?>
<project name="lwjgl native code, linux" basedir="../../bin" default="compile">
<property name="native" location="../src/native"/>
<property name="libname" value="liblwjgl.so"/>
<property name="libs" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lpthread -L${java.home}/lib/i386 -ljawt -Wl,-static,-lXxf86vm,-lXcursor,-lXrender,-lXrandr,-lXfixes,-call_shared"/>
<property name="cflags" value="-O2 -Wall -c -fPIC -std=c99 -pthread"/>
<property name="linker_flags" value="-Wl,--version-script=${native}/linux/lwjgl.map -shared -O2 -Wall -o ${libname} ${libs}"/>
<target name="clean">
<delete>
<fileset dir="." includes="*.o"/>
<fileset file="${libname}"/>
</delete>
</target>
<target name="compile">
<apply dir="." executable="cc" dest="." skipemptyfilesets="true" failonerror="true">
<arg line="${cflags}"/>
<arg value="-I${java.home}/include"/>
<arg value="-I${java.home}/include/linux"/>
<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="cc" failonerror="true">
<srcfile/>
<arg line="${linker_flags}"/>
<fileset dir="." includes="*.o"/>
</apply>
<apply dir="." parallel="true" executable="strip" failonerror="true">
<fileset file="${libname}"/>
</apply>
</target>
</project>