diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/java/net/java/games/joal/ALCImpl.java | 26 | ||||
-rw-r--r-- | src/native/build.xml | 21 |
2 files changed, 21 insertions, 26 deletions
diff --git a/src/java/net/java/games/joal/ALCImpl.java b/src/java/net/java/games/joal/ALCImpl.java index 38a1b6e..c689f7d 100644 --- a/src/java/net/java/games/joal/ALCImpl.java +++ b/src/java/net/java/games/joal/ALCImpl.java @@ -50,14 +50,9 @@ final class ALCImpl implements ALC { } public Device alcOpenDevice(String deviceName) { - System.out.println("Entering alcOpenDevice2()"); - Device result = openDeviceNative(deviceName); - System.out.println("Exiting alcOpenDevice2()"); - return result; + return openDeviceNative(deviceName); } - /* - private native int openDeviceNative(String deviceName); -*/ + private native Device openDeviceNative(String deviceName); public void alcCloseDevice(Device device) { @@ -67,22 +62,7 @@ final class ALCImpl implements ALC { } private native void closeDeviceNative(int pointer); -/* - public Context alcCreateContext(Device device, int[] attrs) { - Context result = null; - if(device != null) { - int pointer = createContextNative(device.pointer, attrs); - if (pointer != 0) { - result = new Context(this, pointer); - contextMap.put(new Integer(pointer), result); - } - } - return result; - } -*/ -/* - private native int createContextNative(int pointer, int[] attrs); -*/ + public Context alcCreateContext(Device device, int[] attrs) { Context result = null; if(device != null) { diff --git a/src/native/build.xml b/src/native/build.xml index a0c3b3a..61a93b3 100644 --- a/src/native/build.xml +++ b/src/native/build.xml @@ -33,7 +33,6 @@ * design, construction, operation or maintenance of any nuclear facility. --> - <project name="Sun Games Initiative Client Technologies" basedir="." default="all"> <target name="init"> @@ -41,6 +40,12 @@ <property name="no_cygwin" value="-mno-cygwin"/> <property name="sources" value="common_tools.c extal.c eaxfactory.c eaxbind.c alfactory.c alcbind.c albind.c"/> <property name="specs" value="-specs='./specs.new'"/> + <condition property="isOSX"> + <and> + <os family="mac"/> + <os family="unix"/> + </and> + </condition> <condition property="isUnix"> <os family="unix" /> </condition> @@ -66,7 +71,16 @@ <param name="output" value="../../lib/libjoal.so"/> </antcall> </target> - + + <target name="compile-jnilib" depends="init" if="isOSX"> + <echo message="Compiling shared library for OSX"/> + <antcall target="compile-native-lib"> + <param name="include" value="-I${jdk.home}/include -I${openal.home}/Headers"/> + <param name="compilerflags" value="-O3 -D_AGL -bundle "/> + <param name="output" value="../../lib/libjoal.jnilib"/> + </antcall> + </target> + <target name="compile-native-lib"> <echo message="${cc} ${include} ${compilerflags} -o ${output} ${sources}" /> <exec executable="${cc}"> @@ -74,7 +88,7 @@ </exec> </target> - <target name="compile" depends="compile-so, compile-dll"> + <target name="compile" depends="compile-so, compile-dll, compile-jnilib"> </target> <target name="javadoc" depends="init"> @@ -89,5 +103,6 @@ <target name="clean" description="Clean all build products."> <delete file="../../lib/joal.dll" /> <delete file="../../lib/libjoal.so" /> + <delete file="../../lib/libjoal.jnilib"/> </target> </project> |