diff options
author | Sven Gothel <[email protected]> | 2014-07-11 03:05:41 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-11 03:05:41 +0200 |
commit | f5c48efcf546ba4e08e197ccced6df83b57e1755 (patch) | |
tree | add2ce9506acb35ce3a34c763afb6d2b91a5081e /make/Manifest-rt-natives | |
parent | be61c7f33ec8e4f3214e8d2969ee88cd327fce9d (diff) |
Bug 1024: Add fallback for native-jar-file location via classpath
In situations, where the native-jar file is not located within
the same parent URI as it's java-jar file, our location mechanism fails.
This patch adds a classloader based native-jar file location mechanism as a fallback,
requiring the native jar file to be included in the users CLASSPATH.
Classloader based location algorithm in JNILibLoaderBase.addNativeJarLibsImpl(..):
- Extract the 'module-name' from the given classFromJavaJar's package name,
i.e. the last package-part: 'jogamp.common.Debug' -> 'common'
Hence it is important to pass a 'classFromJavaJar',
which last package segment reflects the module-name!
- <os.and.arch> -> <os_and_arch_dot>, e.g. linux-amd64 -> linux.amd64 (linux/amd64)
- Locate class 'jogamp.nativetag.<module-name>.<os_and_arch_dot>.TAG',
e.g. 'jogamp.nativetag.common.linux.amd64.TAG'
- Use located class's JarFile URI .. continue as usual
Injection of above mentioned TAG class via gluegen-cpptasks-base.xml macro 'native.tag.jar':
- Creates dummy TAG.java code
- Compiles TAG.java
- Creates the native-jar file
Example:
<native.tag.jar objdir="${build}/obj"
nativejarfile="${build}/gluegen-rt-natives-${os.and.arch}.jar"
manifestfile="${build}/Manifest-rt-natives.temp"
module="common"
includelibs="*gluegen-rt.${native.library.suffix}" />
Note that the manifest file uses a matching Extension-Name:
Extension-Name: jogamp.nativetag.common
Diffstat (limited to 'make/Manifest-rt-natives')
-rwxr-xr-x | make/Manifest-rt-natives | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/make/Manifest-rt-natives b/make/Manifest-rt-natives index d95830e..90c5590 100755 --- a/make/Manifest-rt-natives +++ b/make/Manifest-rt-natives @@ -11,7 +11,7 @@ Implementation-Commit: @SCM_COMMIT@ Implementation-Vendor: JogAmp Community Implementation-Vendor-Id: com.jogamp Implementation-URL: http://jogamp.org/ -Extension-Name: com.jogamp.common +Extension-Name: jogamp.nativetag.common Trusted-Library: true Permissions: all-permissions Application-Library-Allowable-Codebase: * |