aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/build-test.xml145
-rwxr-xr-xmake/build.xml214
-rwxr-xr-xmake/joal-alc-CustomJavaCode.java3
-rwxr-xr-xmake/joal-alc.cfg22
-rwxr-xr-xmake/joal-alcabstract-CustomJavaCode.java12
-rw-r--r--make/joal-common-CustomJavaCode.java33
-rwxr-xr-xmake/joal.cfg5
-rwxr-xr-xmake/joalversion14
8 files changed, 296 insertions, 152 deletions
diff --git a/make/build-test.xml b/make/build-test.xml
new file mode 100644
index 0000000..e543a1c
--- /dev/null
+++ b/make/build-test.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+
+<!--
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+-->
+
+<project name="JOALTest" basedir="." default="all">
+
+ <property name="junit.path" value="${basedir}/${gluegen.root}/make/lib/junit.jar"/>
+ <property name="ant-contrib.jar" value="${gluegen.root}/make/lib/ant-contrib-1.0b3.jar" />
+
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+ </taskdef>
+
+ <target name="test.init">
+ <mkdir dir="classes"/>
+ <property name="rootrel.src.test" value="src/test" />
+ <property name="src.test" value="${project.root}/${rootrel.src.test}" />
+
+ <property name="results.test" value="${build}/test/results" />
+ <property name="build.test" value="${build}/test/build" />
+ <property name="obj.test" value="${build.test}/obj"/>
+
+ <property name="classes" value="${build.test}/classes" />
+ <property name="classes.path" location="${classes}"/> <!-- absolute path -->
+
+ <property name="java.dir.test" value="com/jogamp/openal/test"/>
+ <property name="java.part.test" value="${java.dir.test}/**"/>
+ <property name="java.dir.junit" value="${java.dir.test}/junit"/>
+ <property name="java.dir.manual" value="${java.dir.test}/manual"/>
+
+ <property name="obj.all.paths" value="${gluegen.root}/build/obj${path.separator}${obj}"/>
+ <property name="classpath.all" value="${gluegen.root}/build/gluegen-rt.jar${path.separator}${build}/joal.jar${path.separator}${classes}${path.separator}${junit.path}"/>
+
+ <property name="batchtest.timeout" value="1800000"/> <!-- 30 min -->
+ </target>
+
+ <target name="test.compile" depends="test.init">
+ <javac debug="true" srcdir="${src.test}" destdir="${classes}" includeantruntime="false"
+ classpath="${gluegen.root}/build/gluegen-rt.jar;../build/joal.jar;${junit.path}"/>
+ <copy todir="${classes}">
+ <fileset dir="${src.test}" includes="**/*.wav"/>
+ </copy>
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.test}"/>
+ </target>
+
+ <target name="test.auto.run" depends="junit.run"/>
+
+ <target name="junit.run" depends="test.compile">
+ <mkdir dir="${results.test}"/>
+ <junit forkmode="once" showoutput="true" fork="true" includeAntRuntime="true">
+ <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+ <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+ <jvmarg value="-Djogamp.debug.NativeLibrary=true"/>
+ <jvmarg value="-Djogamp.debug.NativeLibrary.Lookup=true"/>
+ <jvmarg value="-Djogamp.debug.ProcAddressHelper=true"/>
+ <batchtest todir="${results.test}">
+ <fileset dir="${classes}">
+ <include name="${java.dir.junit}/**/*Test*"/>
+ </fileset>
+ <formatter usefile="false" type="plain"/>
+ <formatter usefile="true" type="xml"/>
+ </batchtest>
+ <classpath>
+ <path path="${classpath.all}"/>
+ </classpath>
+ </junit>
+ </target>
+
+ <target name="test.manual.run" depends="test.compile">
+ <for param="test.class.path.m" keepgoing="true">
+ <!-- results in absolute path -->
+ <fileset dir="${classes}">
+ <include name="${java.dir.manual}/**/*Test*"/>
+ <exclude name="**/*$$*"/>
+ </fileset>
+ <sequential>
+ <var name="test.class.path" unset="true"/>
+ <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
+ <var name="test.class.fqn" unset="true"/>
+ <pathconvert property="test.class.fqn">
+ <fileset file="${classes}${file.separator}${test.class.path}"/>
+ <chainedmapper>
+ <globmapper from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
+ <packagemapper from="*.class" to="*"/> <!-- FQCN -->
+ </chainedmapper>
+ </pathconvert>
+ <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.log"/>
+ <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
+ <apply dir="." executable="${java.home}/bin/java"
+ parallel="false"
+ timeout="${batchtest.timeout}"
+ vmlauncher="false"
+ relative="true"
+ failonerror="false">
+ <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+ <env key="CLASSPATH" value="${classpath.all}"/>
+ <arg value="-Djava.library.path=${obj.all.paths}"/>
+ <arg line="-Djogamp.debug.NativeLibrary=true"/>
+ <arg line="-Djogamp.debug.NativeLibrary.Lookup=true"/>
+ <arg line="-Djogamp.debug.ProcAddressHelper=true"/>
+ <srcfile/>
+ <mappedresources>
+ <fileset dir="${classes}" includes="${test.class.path}"/>
+ <packagemapper from="*.class" to="*"/>
+ </mappedresources>
+ </apply>
+ </sequential>
+ </for>
+ </target>
+
+</project>
diff --git a/make/build.xml b/make/build.xml
index 710d0ef..fe020f2 100755
--- a/make/build.xml
+++ b/make/build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - Ant build for JOAL. This build has been tested with ANT 1.7.1. The
+ - Ant build for JOAL. This build has been tested with ANT 1.8.0. The
- optional.jar that contains the optional ANT tasks must be in the ANT
- classpath (typically the ant/lib directory).
-
@@ -31,36 +31,31 @@
-->
<project name="JOAL" basedir="." default="all">
- <!-- This is the version of JOAL you are building -->
- <property name="base_version" value="1.1.3"/>
+ <!-- This is the version of JOAL you are building -->
+ <property name="joal_base_version" value="2.0"/>
+ <tstamp>
+ <format property="version.timestamp" pattern="yyyyMMddHHmm"/>
+ </tstamp>
+ <property name="joal.version" value="${joal_base_version}-${version.timestamp}" />
- <condition property="rootrel.build" value="build">
+ <property name="project.root" value=".." />
+ <property name="gluegen.root" value="${project.root}/../gluegen" />
+
+ <condition property="rootrel.build" value="build">
<not>
<isset property="rootrel.build"/>
</not>
- </condition>
-
- <!-- Uncomment this property to perform a full release build -->
- <!-- property name="release-build" value="true" / -->
-
- <!-- Pull in GlueGen cpptasks build file -->
- <property name="gluegen.root" value="../../gluegen" />
- <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
+ </condition>
+ <property name="build" location="${project.root}/${rootrel.build}" />
- <!-- Set up version string (used in several places) based on whether we're
- doing a release build or not -->
- <target name="setup-version-string-release" if="release-build">
- <property name="version-string" value="${base_version}" />
- </target>
+ <property file="${build}/artifact.properties"/>
+ <property name="joal.build.number" value="manual-build"/>
+ <property name="joal.build.id" value="${version.timestamp}"/>
+ <property name="joal.build.branch" value="master"/>
+ <property name="joal.build.commit" value="manual"/>
- <target name="setup-version-string-prerelease" unless="release-build">
- <tstamp>
- <format property="timestamp" pattern="yyyyMMdd"/>
- </tstamp>
- <property name="version-string" value="${base_version}-pre-${timestamp}" />
- </target>
-
- <target name="setup-version-string" depends="setup-version-string-release,setup-version-string-prerelease" />
+ <!-- Pull in GlueGen cpptasks build file -->
+ <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
<!-- ================================================================== -->
<!--
@@ -315,6 +310,9 @@
<mkdir dir="${classes}" />
<mkdir dir="${obj}" />
<mkdir dir="${obj.joal}" />
+
+ <property name="archive.name" value="joal-${joal.version}" />
+ <property name="archive" value="${build}/${archive.name}" />
</target>
<target name="declare" depends="init,declare.win32,declare.linux,declare.solaris32,declare.macosx,declare.freebsd" />
@@ -365,7 +363,7 @@
-->
<target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip">
<!-- Add the GlueGen task to ANT -->
- <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask"
+ <taskdef name="gluegen" classname="com.jogamp.gluegen.ant.GlueGenTask"
classpathref="gluegen.classpath" />
<!-- Use the GlueGen task to generate the Java files -->
@@ -375,7 +373,7 @@
outputRootDir="${build}"
config="${joal.cfg}"
includeRefid="stub.includes.fileset.all"
- emitter="com.sun.gluegen.procaddress.ProcAddressEmitter">
+ emitter="com.jogamp.gluegen.procaddress.ProcAddressEmitter">
<classpath refid="gluegen.classpath" />
</gluegen>
@@ -384,7 +382,7 @@
outputRootDir="${build}"
config="${joal.constants.cfg}"
includeRefid="stub.includes.fileset.all"
- emitter="com.sun.gluegen.JavaEmitter">
+ emitter="com.jogamp.gluegen.JavaEmitter">
<classpath refid="gluegen.classpath" />
</gluegen>
@@ -393,7 +391,7 @@
outputRootDir="${build}"
config="${joal.alc.cfg}"
includeRefid="stub.includes.fileset.all"
- emitter="com.sun.gluegen.procaddress.ProcAddressEmitter">
+ emitter="com.jogamp.gluegen.procaddress.ProcAddressEmitter">
<classpath refid="gluegen.classpath" />
</gluegen>
@@ -402,7 +400,7 @@
outputRootDir="${build}"
config="${joal.alc.constants.cfg}"
includeRefid="stub.includes.fileset.all"
- emitter="com.sun.gluegen.JavaEmitter">
+ emitter="com.jogamp.gluegen.JavaEmitter">
<classpath refid="gluegen.classpath" />
</gluegen>
@@ -517,14 +515,16 @@
<!--
- Build the joal.jar file.
-->
- <target name="jar" depends="java.compile,setup-version-string">
+ <target name="jar" depends="java.compile">
<!-- Prepare the manifest -->
<copy file="joalversion"
tofile="tempversion"
overwrite="true">
<filterset>
- <filter token="VERSION" value="${version-string}"/>
- <filter token="BASEVERSION" value="${base_version}"/>
+ <filter token="VERSION" value="${joal.version}"/>
+ <filter token="SCM_BRANCH" value="${joal.build.branch}"/>
+ <filter token="SCM_COMMIT" value="${joal.build.commit}"/>
+ <filter token="BASEVERSION" value="${joal_base_version}"/>
</filterset>
</copy>
@@ -561,99 +561,36 @@
linkoffline="${javadoc.link} 142-packages" />
</target>
- <!-- Build zip archives for developers, both source and binaries -->
- <target name="zip" depends="setup-version-string">
+ <!-- Build binary zip archives for developers -->
+ <target name="developer-zip-archive" depends="init" unless="build.noarchives">
<!-- Clean up and create temporary directory -->
- <delete dir="../${rootrel.build}/tmp" failonerror="false" />
- <delete>
- <fileset dir="../${rootrel.build}">
- <include name="*.zip" />
- </fileset>
- </delete>
- <property name="joal.tmp.version" value="joal-${version-string}-${os.and.arch}" />
- <mkdir dir="../${rootrel.build}/tmp/${joal.tmp.version}/lib" />
- <copy file="../${rootrel.build}/joal.jar" todir="../${rootrel.build}/tmp/${joal.tmp.version}/lib" />
- <copy file="${gluegen-rt.jar}" todir="../${rootrel.build}/tmp/${joal.tmp.version}/lib" />
- <copy todir="../${rootrel.build}/tmp/${joal.tmp.version}/lib">
- <fileset dir="../${rootrel.build}/obj">
- <include name="*.${native.library.suffix}" />
- </fileset>
+ <delete includeEmptyDirs="true" quiet="true" dir="${archive}" failonerror="false" />
+ <mkdir dir="${archive}" />
+ <copy file="${build}/artifact.properties" todir="${archive}"/>
+ <mkdir dir="${archive}/jar" />
+ <copy todir="${archive}/jar">
+ <fileset dir="${build}" includes="joal*.jar"/>
</copy>
- <copy todir="../${rootrel.build}/tmp/${joal.tmp.version}/lib">
- <fileset dir="${gluegen.root}/${rootrel.build}/obj">
- <include name="*.${native.library.suffix}" />
- </fileset>
+ <mkdir dir="${archive}/lib" />
+ <copy todir="${archive}/lib">
+ <fileset dir="${build}/obj" includes="*.${native.library.suffix}"/>
</copy>
- <copy file="../README.txt" todir="../${rootrel.build}/tmp/${joal.tmp.version}" />
- <copy file="../LICENSE.txt" todir="../${rootrel.build}/tmp/${joal.tmp.version}" />
- <zip destfile="../${rootrel.build}/${joal.tmp.version}.zip"
- basedir="../${rootrel.build}/tmp"
- includes="${joal.tmp.version}/**" />
- <!-- Build a source archive as well -->
- <delete file="../${rootrel.build}/joal-${version-string}-src.zip" />
- <zip destfile="../${rootrel.build}/joal-${version-string}-src.zip"
- basedir="../.."
- includes="gluegen/LICENSE.txt,gluegen/doc/**,gluegen/make/**,gluegen/src/**,joal/README.txt,joal/LICENSE.txt,joal/make/**,joal/src/**,joal/${rootrel.build}/gensrc/classes/com/jogamp/openal/**"
- excludes="**/*.class,**/*~"
- />
- </target>
-
- <!-- ================================================================== -->
- <!--
- - Build the Java Web Start binaries out of native library builds for
- - each individual platform. To run this target, you need to
- - specify the property joal.dist.dir as a System property (i.e.,
- - "ant -Djoal.dist.dir=../dist dist"); directories named joal-linux,
- - joal-win32, and joal-macosx need to be inside that directory and each
- - of those directories needs to contain the native code for that platform
- - (libjoal.so, joal.dll, or libjoal.jnilib).
- -->
- <target name="dist.check" unless="joal.dist.dir">
- <fail>
-
- ******************************************************************
- ** To build the Joal distribution out of the platform-specific **
- ** component jars and native code, the property joal.dist.dir **
- ** needs to be specified on the command line. Please read the **
- ** comments associated with the "dist" target in the build.xml. **
- ******************************************************************
- </fail>
- </target>
-
- <target name="dist" depends="dist.check,setup-version-string">
- <delete>
- <fileset dir="${joal.dist.dir}" includes="*.jar" />
- <fileset dir="${joal.dist.dir}" includes="*.zip" />
- </delete>
- <!-- Copy Java Web Start jar files, source archive(s) and binary zip archives -->
- <copy todir="${joal.dist.dir}">
- <fileset dir="${joal.dist.dir}/joal-win/32">
- <include name="*.jar" />
- <include name="*.zip" />
- </fileset>
- <fileset dir="${joal.dist.dir}/joal-linux/32">
- <include name="*.jar" />
- <!-- Pick up source archive from Linux build as well -->
- <include name="*.zip" />
- </fileset>
- <fileset dir="${joal.dist.dir}/joal-macosx/ppc">
- <include name="*.jar" />
- <include name="*.zip" />
- </fileset>
- <fileset dir="${joal.dist.dir}/joal-macosx/fat">
- <include name="*.jar" />
- <include name="*.zip" />
- </fileset>
- <!-- NOTE: No OpenAL for Windows/AMD64, Linux/AMD64 or Solaris at the moment -->
+ <mkdir dir="${archive}/jnlp-files" />
+ <copy todir="${archive}/jnlp-files">
+ <fileset dir="${project.root}/jnlp-files" includes="*" />
</copy>
- <!-- Build one archive containing all jars related to Java Web Start -->
- <tstamp>
- <format property="timestamp" pattern="yyyyMMdd"/>
- </tstamp>
- <zip destfile="${joal.dist.dir}/joal-${version-string}-webstart.zip"
- basedir="${joal.dist.dir}"
- includes="*.jar"
- />
+ <mkdir dir="${archive}/www" />
+ <copy todir="${archive}/www">
+ <fileset dir="${project.root}/www" includes="*" />
+ </copy>
+ <copy file="../README.txt" todir="${archive}"/>
+ <copy file="../LICENSE.txt" todir="${archive}"/>
+ <delete quiet="true" file="${build}/${archive.name}.zip"/>
+ <zip destfile="${build}/${archive.name}.zip"
+ basedir="${build}"
+ includes="${archive.name}/**" />
+ <!-- Clean up after ourselves -->
+ <delete includeEmptyDirs="true" quiet="true" dir="${archive}" failonerror="false" />
</target>
<!-- ================================================================== -->
@@ -666,31 +603,50 @@
<fileset dir="${javadoc}" />
<fileset dir="${javadoc.dev}" />
</delete>
- <ant dir="../test" target="clean"/>
+ <ant antfile="build-test.xml" target="clean"/>
</target>
<!-- ================================================================== -->
<!--
- Build everything.
-->
- <target name="all" depends="init,declare">
+ <target name="all" depends="joal.compile, test.compile, tag.build, developer-zip-archive"/>
+
+ <target name="joal.compile" depends="init, declare">
<!-- Generate, compile, and build the jar for the Java sources. -->
<antcall target="jar" inheritRefs="true" />
<!-- Compile the native C sources . -->
<antcall target="c.build.joal" inheritRefs="true" />
+ </target>
- <!-- Build zip archives. -->
- <antcall target="zip" inheritRefs="true" />
+ <target name="tag.build">
+ <copy file="${gluegen.root}/${rootrel.build}/artifact.properties" todir="${build}" overwrite="true"/>
+ <echo message='joal.build.number=${joal.build.number}${line.separator}' file="${build}/artifact.properties" append="true"/>
+ <echo message='joal.build.id=${joal.build.id}${line.separator}' file="${build}/artifact.properties" append="true"/>
+ <echo message='joal.build.branch=${joal.build.branch}${line.separator}' file="${build}/artifact.properties" append="true"/>
+ <echo message='joal.build.commit=${joal.build.commit}${line.separator}' file="${build}/artifact.properties" append="true"/>
</target>
<!-- ================================================================== -->
<!--
- - Build and run tests.
+ - unit tests
-->
- <target name="test" depends="all">
- <ant dir="../test" target="test"/>
+ <target name="test.compile" depends="joal.compile">
+ <ant antfile="build-test.xml" target="test.compile" inheritRefs="true" inheritAll="true"/>
+ </target>
+
+ <target name="test.auto.run" depends="test.compile">
+ <ant antfile="build-test.xml" target="test.auto.run" inheritRefs="true" inheritAll="true"/>
+ </target>
+
+ <target name="junit.run" depends="test.compile">
+ <ant antfile="build-test.xml" target="junit.run" inheritRefs="true" inheritAll="true"/>
+ </target>
+
+ <target name="test.manual.run" depends="test.compile">
+ <ant antfile="build-test.xml" target="test.manual.run" inheritRefs="true" inheritAll="true"/>
</target>
</project>
diff --git a/make/joal-alc-CustomJavaCode.java b/make/joal-alc-CustomJavaCode.java
index 53696f4..be28d8c 100755
--- a/make/joal-alc-CustomJavaCode.java
+++ b/make/joal-alc-CustomJavaCode.java
@@ -1,6 +1,3 @@
-/** Entry point (through function pointer) to C language function: <br> <code> const ALCchar * alcGetString(ALCdevice * device, ALCenum param); </code> */
-public java.lang.String alcGetString(ALCdevice device, int param);
-
/** Fetches the names of the available ALC device specifiers.
Equivalent to the C call alcGetString(NULL, ALC_DEVICE_SPECIFIER). */
public java.lang.String[] alcGetDeviceSpecifiers();
diff --git a/make/joal-alc.cfg b/make/joal-alc.cfg
index 3134a06..b8013ab 100755
--- a/make/joal-alc.cfg
+++ b/make/joal-alc.cfg
@@ -10,7 +10,7 @@ Extends ALC ALCConstants
EmitProcAddressTable true
ProcAddressTableClassName ALCProcAddressTable
-GetProcAddressTableExpr ALProcAddressLookup.getALCProcAddressTable()
+GetProcAddressTableExpr alcProcAddressTable
ProcAddressNameExpr LP $UPPERCASE({0})
Import java.io.UnsupportedEncodingException
@@ -27,15 +27,18 @@ Ignore ^ALC_.+
# to use this routine to look up the ALC function pointers.
Ignore alcGetProcAddress
-# Move the body of alcGetString to a private method so we can
+# Manually implement alcGetString so we can
# implement alcGetString(NULL, ALC_DEVICE_SPECIFIER) in another method
-RenameJavaMethod alcGetString alcGetStringImpl
-# Specify the return length of this function with our own custom strlen
-ReturnValueCapacity alcGetStringImpl strlen_alc(_device_ptr, {1}, _res)
+ReturnsString alcGetString
+ManuallyImplement alcGetString
+ForceProcAddressGen alcGetString
+## Specify the return length of this function with our own custom strlen
+##ReturnValueCapacity alcGetStringImpl strlen_alc(_device_ptr, {1}, _res)
# Note that we don't declare this as "ReturnsString" because we're
# going to wrap it in another method
IncludeAs CustomJavaCode ALC joal-alc-CustomJavaCode.java
+IncludeAs CustomJavaCode ALCAbstractImpl joal-alcabstract-CustomJavaCode.java
# These routines use strings
ArgumentIsString alcIsExtensionPresent 1
@@ -55,14 +58,5 @@ ReturnValueCapacity alcGetCurrentContext 0
ReturnValueCapacity alcGetCurrentDevice 0
ReturnValueCapacity alcOpenDevice 0
-# Need a prologue on alcOpenDevice and epilogue on alcMakeContextCurrent
-# to set up the proc address tables the first time
-JavaPrologue alcOpenDevice ALProcAddressLookup.resetALCProcAddressTable();
-JavaEpilogue alcMakeContextCurrent ALProcAddressLookup.resetALProcAddressTable();
-
-# To be able to use alcGetString before a context is created we need
-# to instrument that routine as well
-JavaPrologue alcGetString ALProcAddressLookup.resetALCProcAddressTable();
-
IncludeAs CustomCCode joal-common-CustomCCode.c
IncludeAs CustomCCode joal-alc-impl-CustomCCode.c
diff --git a/make/joal-alcabstract-CustomJavaCode.java b/make/joal-alcabstract-CustomJavaCode.java
new file mode 100755
index 0000000..3420cc2
--- /dev/null
+++ b/make/joal-alcabstract-CustomJavaCode.java
@@ -0,0 +1,12 @@
+private static final ALCProcAddressTable alcProcAddressTable;
+
+static {
+ alcProcAddressTable = new ALCProcAddressTable();
+ if(null==alcProcAddressTable) {
+ throw new RuntimeException("Couldn't instantiate ALCProcAddressTable");
+ }
+ alcProcAddressTable.reset(ALImpl.alDynamicLookupHelper);
+}
+
+public static ALCProcAddressTable getALCProcAddressTable() { return alcProcAddressTable; }
+
diff --git a/make/joal-common-CustomJavaCode.java b/make/joal-common-CustomJavaCode.java
new file mode 100644
index 0000000..61c6d0c
--- /dev/null
+++ b/make/joal-common-CustomJavaCode.java
@@ -0,0 +1,33 @@
+static final DynamicLibraryBundle alDynamicLookupHelper;
+private static final ALProcAddressTable alProcAddressTable;
+
+static {
+ alProcAddressTable = new ALProcAddressTable();
+ if(null==alProcAddressTable) {
+ throw new RuntimeException("Couldn't instantiate ALProcAddressTable");
+ }
+ alDynamicLookupHelper = new DynamicLibraryBundle(new ALDynamicLibraryBundleInfo());
+ if(null==alDynamicLookupHelper) {
+ throw new RuntimeException("Null ALDynamicLookupHelper");
+ }
+ if(!alDynamicLookupHelper.isToolLibLoaded()) {
+ throw new RuntimeException("Couln't load native AL library");
+ }
+ if(!alDynamicLookupHelper.isLibComplete()) {
+ throw new RuntimeException("Couln't load native AL/JNI glue library");
+ }
+ alProcAddressTable.reset(alDynamicLookupHelper);
+}
+
+public static ALProcAddressTable getALProcAddressTable() { return alProcAddressTable; }
+
+static long alGetProcAddress(long alGetProcAddressHandle, java.lang.String procname)
+{
+ if (alGetProcAddressHandle == 0) {
+ throw new RuntimeException("Passed null pointer for method \"alGetProcAddress\"");
+ }
+ return dispatch_alGetProcAddressStatic(procname, alGetProcAddressHandle);
+}
+
+static native long dispatch_alGetProcAddressStatic(String fname, long procAddress);
+
diff --git a/make/joal.cfg b/make/joal.cfg
index 35bbd5c..e398112 100755
--- a/make/joal.cfg
+++ b/make/joal.cfg
@@ -9,9 +9,10 @@ Extends AL ALConstants
EmitProcAddressTable true
ProcAddressTableClassName ALProcAddressTable
-GetProcAddressTableExpr ALProcAddressLookup.getALProcAddressTable()
+GetProcAddressTableExpr alProcAddressTable
ProcAddressNameExpr LP $UPPERCASE({0})
+
Import com.jogamp.openal.*
Import com.jogamp.openal.impl.*
@@ -36,6 +37,8 @@ ArgumentIsString alIsExtensionPresent 0
ArgumentIsString alGetEnumValue 0
ArgumentIsString alGetProcAddress 0
+IncludeAs CustomJavaCode ALImpl joal-common-CustomJavaCode.java
+
# Provide #includes to native code
CustomCCode #include "al.h"
CustomCCode #ifndef _MSC_VER /* Non-Windows platforms */
diff --git a/make/joalversion b/make/joalversion
index 85b5770..da9fd7e 100755
--- a/make/joalversion
+++ b/make/joalversion
@@ -1,8 +1,12 @@
-Specification-Title: Java Binding for OpenAL
+Specification-Title: Java Bindings for OpenAL API Specification
Specification-Version: @BASEVERSION@
-Specification-Vendor: JogAmp.org
-Implementation-Title: Java Bindings for the OpenAL API
+Specification-Vendor: JogAmp Community
+Implementation-Title: Java Bindings for OpenAL Runtime Environment
Implementation-Version: @VERSION@
-Implementation-Vendor: JogAmp.org
+Implementation-Branch: @SCM_BRANCH@
+Implementation-Commit: @SCM_COMMIT@
+Implementation-Vendor: JogAmp Community
+Implementation-URL: http://jogamp.org/
Extension-Name: com.jogamp.openal
-Implementation-Vendor-Id: JogAmp.org
+Implementation-Vendor-Id: com.jogamp
+Trusted-Library: true