aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-06-21 18:48:37 +0200
committerSven Gothel <[email protected]>2019-06-21 18:48:37 +0200
commite44b9364353a6173598eb98d276795d77cc4456c (patch)
tree6fec026bef8865fe49d7e9bce7fbecc59d824cb0 /src/java/com/jogamp
parent8ce56955f989f0d8ac21335ea563f9c7eb111154 (diff)
iOS: NativeLibrary: Refine iOS, use proper alt system path for iOS+OSX, relax closeLibrary(..)
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r--src/java/com/jogamp/common/os/DynamicLibraryBundle.java2
-rw-r--r--src/java/com/jogamp/common/os/NativeLibrary.java64
2 files changed, 38 insertions, 28 deletions
diff --git a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
index a3d6198..fee3c01 100644
--- a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
+++ b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
@@ -282,7 +282,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
} else {
if( null == dynLinkGlobal ) {
- dynLinkGlobal = lib.getDynamicLinker();
+ dynLinkGlobal = lib.dynamicLinker();
}
nativeLibraries.add(lib);
toolLibLoaded[i]=true;
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java
index 39d1475..1b05700 100644
--- a/src/java/com/jogamp/common/os/NativeLibrary.java
+++ b/src/java/com/jogamp/common/os/NativeLibrary.java
@@ -89,12 +89,17 @@ public final class NativeLibrary implements DynamicLookupHelper {
break;
case MACOS:
- case IOS:
prefixes = new String[] { "lib" };
suffixes = new String[] { ".dylib", ".jnilib" };
isOSX = true;
break;
+ case IOS:
+ prefixes = new String[] { "lib" };
+ suffixes = new String[] { ".dylib" };
+ isOSX = true;
+ break;
+
/*
case ANDROID:
case FREEBSD:
@@ -211,29 +216,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
loader);
Platform.initSingleton(); // loads native gluegen-rt library
- final DynamicLinker dynLink;
- switch (PlatformPropsImpl.OS_TYPE) {
- case WINDOWS:
- dynLink = new WindowsDynamicLinkerImpl();
- break;
-
- case MACOS:
- case IOS:
- dynLink = new MacOSXDynamicLinkerImpl();
- break;
-
- case ANDROID:
- if( PlatformPropsImpl.CPU_ARCH.is32Bit ) {
- dynLink = new BionicDynamicLinker32bitImpl();
- } else {
- dynLink = new BionicDynamicLinker64BitImpl();
- }
- break;
-
- default:
- dynLink = new PosixDynamicLinkerImpl();
- break;
- }
+ final DynamicLinker dynLink = getDynamicLinker();
// Iterate down these and see which one if any we can actually find.
for (final Iterator<String> iter = possiblePaths.iterator(); iter.hasNext(); ) {
@@ -312,7 +295,34 @@ public final class NativeLibrary implements DynamicLookupHelper {
return dynLink.lookupSymbolGlobal(funcName);
}
- /* pp */ final DynamicLinker getDynamicLinker() { return dynLink; }
+ /* pp */ final DynamicLinker dynamicLinker() { return dynLink; }
+
+ /* pp */ static DynamicLinker getDynamicLinker() {
+ final DynamicLinker dynLink;
+ switch (PlatformPropsImpl.OS_TYPE) {
+ case WINDOWS:
+ dynLink = new WindowsDynamicLinkerImpl();
+ break;
+
+ case MACOS:
+ case IOS:
+ dynLink = new MacOSXDynamicLinkerImpl();
+ break;
+
+ case ANDROID:
+ if( PlatformPropsImpl.CPU_ARCH.is32Bit ) {
+ dynLink = new BionicDynamicLinker32bitImpl();
+ } else {
+ dynLink = new BionicDynamicLinker64BitImpl();
+ }
+ break;
+
+ default:
+ dynLink = new PosixDynamicLinkerImpl();
+ break;
+ }
+ return dynLink;
+ }
/** Retrieves the low-level library handle from this NativeLibrary
object. On the Windows platform this is an HMODULE, and on Unix
@@ -433,9 +443,9 @@ public final class NativeLibrary implements DynamicLookupHelper {
// Add probable Mac OS X-specific paths
if ( isOSX ) {
// Add historical location
- addPaths("/Library/Frameworks/" + libName + ".Framework", baseNames, paths);
+ addPaths("/Library/Frameworks/" + libName + ".framework", baseNames, paths);
// Add current location
- addPaths("/System/Library/Frameworks/" + libName + ".Framework", baseNames, paths);
+ addPaths("/System/Library/Frameworks/" + libName + ".framework", baseNames, paths);
}
}