git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10610 75d07b2b-3a1a-0410-a2c5-0572b91ccdca3.0
parent
785d50f516
commit
c1402b30e9
@ -0,0 +1,105 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project name="build openal-soft natives" default="all" basedir="../"> |
||||
<!-- load cpp compiler ant task --> |
||||
<taskdef resource="cpptasks.tasks" classpath="lib/antlibs/cpptasks.jar"/> |
||||
<!-- load properties --> |
||||
<property file="nbproject/openal-soft-native.properties"/> |
||||
|
||||
<condition property="ndk-build-name" value="ndk-build.cmd" else="ndk-build"> |
||||
<os family="windows" /> |
||||
</condition> |
||||
|
||||
<fileset id="lib.jars" dir="${openal-soft.lib.dir}"> |
||||
<include name="**/*.jar"/> |
||||
</fileset> |
||||
<fileset id="lib.jme.jars" dir="${openal-soft.jme.dir}"> |
||||
<include name="**/*.jar"/> |
||||
</fileset> |
||||
|
||||
<pathconvert property="lib.importpath"> |
||||
<fileset refid="lib.jars"/> |
||||
<fileset refid="lib.jme.jars"/> |
||||
</pathconvert> |
||||
|
||||
<target name="build-openal-soft-natives" description="builds the native openal-soft library for android" depends="create-native-headers, -create-folders, compile-android"> |
||||
<echo message="Updating native jME3-openal-soft-natives.jar"/> |
||||
<zip basedir="${openal-soft.output.dir}" file="${openal-soft.output.base}/jME3-openal-soft-natives-android.jar" compress="true"/> |
||||
<copy file="${openal-soft.output.base}/jME3-openal-soft-natives-android.jar" todir="dist/opt/native-openal-soft/"/> |
||||
</target> |
||||
|
||||
<target name="create-native-headers" description="creates the native C++ headers for the java native methods"> |
||||
<javah destdir="${openal-soft.source.dir}" classpath="${openal-soft.build.dir}${path.separator}${lib.importpath}"> |
||||
<class name="com.jme3.audio.android.AndroidOpenALSoftAudioRenderer"/> |
||||
</javah> |
||||
</target> |
||||
|
||||
<target name="-create-folders" description="creates the needed folders"> |
||||
<mkdir dir="${openal-soft.build.dir}"/> |
||||
<mkdir dir="${openal-soft.build.dir}/jni"/> |
||||
<mkdir dir="${openal-soft.output.base}"/> |
||||
<mkdir dir="${openal-soft.output.dir}"/> |
||||
</target> |
||||
|
||||
<target name="compile-android" description="compiles libopenalsoftjme using the Android NDK" depends="-check-android-ndk" if="haveAndoidNdk"> |
||||
<!-- copy OpenAL Soft files into jni directory --> |
||||
<echo>Copying OpenAL Soft source files to build directory from ${openal-soft.include}</echo> |
||||
<copy todir="${openal-soft.build.dir}/jni" verbose="true" flatten="false" overwrite="true"> |
||||
<fileset dir="${openal-soft.include}"> |
||||
<include name="**/*.*"/> |
||||
<!-- |
||||
<include name="**/*.cpp"/> |
||||
<include name="**/*.h"/> |
||||
<include name="**/*.cl"/> |
||||
<include name="**/*.c"/> |
||||
<include name="**/*.inc"/> |
||||
<exclude name="/android/*.*"/> |
||||
<include name="**/*.*" /> |
||||
--> |
||||
</fileset> |
||||
</copy> |
||||
|
||||
<!-- copy jME3 Native OpenAL Soft files into jni directory --> |
||||
<!-- |
||||
<echo>Copying jME3 JNI files for OpenAL Soft to build directory from ${openal-soft.source.dir}</echo> |
||||
<copy todir="build/openal-soft-android/jni" verbose="true" flatten="false" overwrite="true"> |
||||
<fileset dir="${openal-soft.source.dir}"> |
||||
<include name="*.cpp" /> |
||||
<include name="*.h" /> |
||||
<include name="**/*.*" /> |
||||
</fileset> |
||||
</copy> |
||||
--> |
||||
|
||||
<!-- copy Android.mk and Application.mk files into jni directory --> |
||||
<echo>Copying Android Make and JNI files for OpenAL Soft to build directory from ${openal-soft.source.dir}</echo> |
||||
<copy todir="${openal-soft.build.dir}/jni" verbose="true" flatten="false" overwrite="true"> |
||||
<fileset dir="${openal-soft.source.dir}"> |
||||
<include name="*.*" /> |
||||
</fileset> |
||||
</copy> |
||||
<!-- |
||||
<copy file="${openal-soft.source.dir}/Android.mk" todir="build/openal-soft-android/jni" verbose="true"/> |
||||
<copy file="${openal-soft.source.dir}/Application.mk" todir="build/openal-soft-android/jni" verbose="true"/> |
||||
--> |
||||
|
||||
<exec executable="${ndk.dir}/${ndk-build-name}" failonerror="true" > |
||||
<!--<arg line="NDK_DEBUG=1"/>--> |
||||
<arg line="TARGET_PLATFORM=android-9"/> |
||||
<arg line="-C ${openal-soft.build.dir}/"/> |
||||
</exec> |
||||
|
||||
<!-- copy resulting library directories to jarcontent directory --> |
||||
<copy todir="${openal-soft.output.dir}" verbose="true" flatten="false"> |
||||
<fileset dir="${openal-soft.build.dir}/libs"> |
||||
<include name="**/*.*"/> |
||||
<!--exclude name="**/x86/*.*"/--> |
||||
</fileset> |
||||
</copy> |
||||
|
||||
</target> |
||||
|
||||
<target name="-check-android-ndk"> |
||||
<available file="${ndk.dir}/${ndk-build-name}" property="haveAndoidNdk"/> |
||||
</target> |
||||
|
||||
</project> |
@ -0,0 +1,2 @@ |
||||
$label=Native OpenAL Soft |
||||
$target.build=build-openal-soft-natives |
@ -0,0 +1,23 @@ |
||||
########################################################## |
||||
# these are the ant build properties for openal-soft-jme # |
||||
########################################################## |
||||
# location of Android NDK if available |
||||
ndk.dir=D:/android/android-ndk-r7 |
||||
|
||||
# directory of OpenAL Soft download |
||||
openal-soft.folder=../openalsoft_1_15_1/openal-soft |
||||
|
||||
# compile options |
||||
openal-soft.compile.debug=false |
||||
|
||||
# native header include directories |
||||
openal-soft.java.include=${java.home}/../include |
||||
|
||||
# dont change these.. |
||||
openal-soft.include=${openal-soft.folder} |
||||
openal-soft.source.dir=src/openal-soft-native/android |
||||
openal-soft.build.dir=build/openal-soft/ |
||||
openal-soft.output.base=lib/openal-soft |
||||
openal-soft.output.dir=${openal-soft.output.base}/jarcontent |
||||
openal-soft.jme.dir=dist |
||||
openal-soft.lib.dir=dist/lib |
Loading…
Reference in new issue