Mac OS X: Added support for compile_native target. Moved optional libraries to compile_native_optional target

This commit is contained in:
Elias Naur 2006-07-07 12:41:36 +00:00
parent fd867d88bd
commit bf414409c0
4 changed files with 29 additions and 17 deletions

View File

@ -646,10 +646,10 @@
</condition>
<antcall target="-compile_native_linux" />
<condition property="lwjgl.platform.mac">
<condition property="lwjgl.platform.macosx">
<os name="Mac OS X" />
</condition>
<antcall target="-compile_native_mac" />
<antcall target="-compile_native_macosx" />
</target>
<target name="compile_native_optional" depends="headers" description="Compiles the native files">
@ -658,6 +658,10 @@
<os name="Linux" />
</condition>
<antcall target="-compile_native_linux_optional" />
<condition property="lwjgl.platform.macosx">
<os name="Mac OS X" />
</condition>
<antcall target="-compile_native_macosx_optional" />
</target>
@ -706,7 +710,7 @@
<!-- Compiles LWJGL on Linux platforms -->
<target name="-compile_native_linux" if="lwjgl.platform.linux">
<ant antfile="platform_build/linux_ant/build.xml" inheritAll="false"/>
<copy file="${lwjgl.bin}/liblwjgl.so" tofile="${lwjgl.lib}/linux/liblwjgl.so" />
<copy file="${lwjgl.bin}/liblwjgl.so" todir="${lwjgl.lib}/linux"/>
</target>
<target name="-compile_native_linux_optional" if="lwjgl.platform.linux">
@ -715,7 +719,6 @@
<fail message="Missing JAVA_HOME path environment property" unless="env.JAVA_HOME"/>
<fail message="Missing FMOD path environment property" unless="env.FMOD"/>
<exec executable="make" dir="${lwjgl.src.native}/linux"/>
<exec executable="make" dir="${lwjgl.src.native}/common/devil">
<arg line="-f Makefile.linux"/>
</exec>
@ -726,22 +729,25 @@
<move file="${lwjgl.src.native}/common/fmod3/liblwjgl-fmod3.so" tofile="${lwjgl.lib}/linux/liblwjgl-fmod3.so" />
</target>
<target name="-compile_native_macosx" if="lwjgl.platform.macosx">
<ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>
<copy file="${lwjgl.bin}/liblwjgl.jnilib" todir="${lwjgl.lib}/macosx"/>
</target>
<!-- Compiles LWJGL on Mac OS X platforms -->
<target name="-compile_native_mac" if="lwjgl.platform.mac">
<target name="-compile_native_macosx_optional" if="lwjgl.platform.macosx">
<!-- check for required properties -->
<property environment="env"/>
<fail message="Missing AL path environment property" unless="env.AL"/>
<fail message="Missing FMOD path environment property" unless="env.FMOD"/>
<exec executable="make" dir="${lwjgl.src.native}/macosx" failonerror="true"/>
<exec executable="make" dir="${lwjgl.src.native}/common/devil">
<arg line="-f Makefile.macosx"/>
</exec>
<exec executable="make" dir="${lwjgl.src.native}/common/fmod3">
<arg line="-f Makefile.macosx"/>
</exec>
<move file="${lwjgl.src.native}/macosx/liblwjgl.jnilib" tofile="${lwjgl.lib}/macosx/liblwjgl.jnilib" />
<move file="${lwjgl.src.native}/common/devil/liblwjgl-devil.jnilib" tofile="${lwjgl.lib}/macosx/liblwjgl-devil.jnilib" />
<move file="${lwjgl.src.native}/common/fmod3/liblwjgl-fmod3.jnilib" tofile="${lwjgl.lib}/macosx/liblwjgl-fmod3.jnilib" />
</target>

View File

@ -0,0 +1,3 @@
#!/bin/sh
nm -g "$1"/*.o | grep "Java_" | cut -d ' ' -f3 | cut -c 1-

View File

@ -1,5 +1,7 @@
<?xml version="1.0" ?>
<project name="OS X Native code" basedir="." default="nativelibrary">
<project name="OS X Native code" basedir="../../bin" default="nativelibrary">
<property name="native" location="../src/native"/>
<target name="init">
<mkdir dir="ppc"/>
<mkdir dir="intel"/>
@ -10,17 +12,19 @@
<fileset dir="intel"/>
<fileset dir="ppc"/>
<fileset dir="." includes="liblwjgl.jnilib"/>
<fileset dir="." includes="lwjgl.symbols"/>
</delete>
</target>
<target name="compile">
<apply dir="${dstdir}" executable="${compiler}" os="Mac OS X" skipemptyfilesets="true" failonerror="true" dest="${dstdir}">
<arg line="${cflags} -O2 -Wall -c -fPIC -I${sdkroot}/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -I../../common -I.."/>
<arg line="${cflags} -O2 -Wall -c -fPIC -I${sdkroot}/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -I${native}/common -I${native}/macosx"/>
<!-- Map from *.m and *.c to .o -->
<mapper type="regexp" from="^(.*)\.(c|m)" to="\1.o"/>
<fileset dir="." includes="*.m"/>
<fileset dir="." includes="*.c"/>
<fileset dir="../common" includes="*.c"/>
<fileset dir="../generated" includes="*.c"/>
<fileset dir="${native}/macosx" includes="*.m"/>
<fileset dir="${native}/macosx" includes="*.c"/>
<fileset dir="${native}/common" includes="*.c"/>
<fileset dir="${native}/generated" includes="*.c"/>
</apply>
</target>
@ -51,7 +55,9 @@
<param name="sdkroot" location="${legacy_sdkroot}"/>
<param name="cflags" value=""/>
</antcall>
<exec executable="./build-symbol-list" output="lwjgl.symbols"/>
<exec vmlauncher="false" executable="../platform_build/macosx_ant/build-symbol-list" output="lwjgl.symbols" failonerror="true">
<arg path="intel"/>
</exec>
<antcall target="link">
<param name="objdir" location="intel"/>
<param name="libname" value="liblwjgl-intel.jnilib"/>

View File

@ -1,3 +0,0 @@
#!/bin/sh
nm -g intel/*.o | grep "Java_" | cut -d ' ' -f3 | cut -c 1-