Updates for solaris and linux builds.

This commit is contained in:
Jeremy Booth 2009-04-08 21:53:59 +00:00
parent 18e1db9336
commit 4deab98889
2 changed files with 87 additions and 22 deletions

View File

@ -254,13 +254,15 @@
<antcall target="-compile_native_win32" />
<condition property="lwjgl.platform.linux">
<or>
<os name="Linux" />
<os name="SunOS" />
</or>
<os name="Linux" />
</condition>
<antcall target="-compile_native_linux" />
<condition property="lwjgl.platform.solaris">
<os name="SunOS" />
</condition>
<antcall target="-compile_native_solaris" />
<condition property="lwjgl.platform.macosx">
<os name="Mac OS X" />
</condition>
@ -283,6 +285,15 @@
</copy>
</target>
<!-- Compiles LWJGL on solaris platforms -->
<target name="-compile_native_solaris" if="lwjgl.platform.solaris">
<!-- Reusing the linux ant task, but copy the output to solaris -->
<ant antfile="platform_build/linux_ant/build.xml" inheritAll="false"/>
<copy todir="${lwjgl.lib}/solaris">
<fileset dir="${lwjgl.bin}/lwjgl" includes="liblwjgl*.so"/>
</copy>
</target>
<!-- Compiles LWJGL on Mac platforms -->
<target name="-compile_native_macosx" if="lwjgl.platform.macosx">
<ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>

View File

@ -4,12 +4,14 @@
<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="cflags" value="-O2 -Wall -c -fPIC -std=c99 -Wunused"/>
<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="cflags32" value="-O2 -Wall -c -fPIC -std=c99 -Wunused"/>
<target name="clean">
<delete>
<fileset dir="x32"/>
<fileset dir="x64"/>
<fileset dir="." includes="*.o"/>
<fileset dir="." includes="*.so"/>
</delete>
@ -22,22 +24,49 @@
<condition property="xf86vm_lib" value="-lXxf86vm" else="-Wl,-static,-lXxf86vm,-call_shared">
<os name="SunOS" />
</condition>
<condition property="libs" value="${libs64}" else="${libs32} ${xf86vm_lib}">
<equals arg1="${hwplatform}" arg2="x86_64"/>
</condition>
<condition property="libname" value="${libname64}" else="${libname32}">
<equals arg1="${hwplatform}" arg2="x86_64"/>
</condition>
<condition property="cflags_pthread" value="-pthreads" else="-pthread">
<os name="SunOS" />
</condition>
<condition property="version_script_flags" value="" else="-Wl,--version-script=${native}/linux/lwjgl.map">
<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_flags" value="${version_script_flags} -shared -O2 -Wall -o ${libname} ${libs}"/>
<apply dir="." executable="gcc" dest="." skipemptyfilesets="true" failonerror="true">
<arg line="${cflags} ${cflags_pthread}"/>
<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}"/>
<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>
<antcall target="compile32"/>
<antcall target="compile64"/>
</target>
<target name="compile32" unless="build.64bit.only">
<mkdir dir="x32"/>
<apply dir="x32" 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"/>
@ -52,12 +81,37 @@
</apply>
<apply dir="." parallel="true" executable="gcc" failonerror="true">
<srcfile/>
<arg line="${linker_flags}"/>
<fileset dir="." includes="*.o"/>
<arg line="${linker_flags32}"/>
<fileset dir="x32" includes="*.o"/>
</apply>
<apply dir="." parallel="true" executable="strip" failonerror="true">
<fileset file="${libname}"/>
<fileset file="${libname32}"/>
</apply>
</target>
<target name="compile64" unless="build.32bit.only">
<mkdir dir="x64"/>
<apply dir="x64" executable="gcc" skipemptyfilesets="true" failonerror="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}/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_flags64}"/>
<fileset dir="x64" includes="*.o"/>
</apply>
<apply dir="." parallel="true" executable="strip" failonerror="true">
<fileset file="${libname64}"/>
</apply>
</target>
</project>