From aa4cc872d630d7de170bdc4202d072220c053325 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 18 Dec 2011 23:10:15 +0100 Subject: Fix regression of commit b669435d277a10e6163034aba286ecccce013f69, which removed the lib-base-name search for OSX --- src/java/com/jogamp/common/os/NativeLibrary.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/java/com/jogamp/common/os') diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java index 1770f5b..b74f30d 100755 --- a/src/java/com/jogamp/common/os/NativeLibrary.java +++ b/src/java/com/jogamp/common/os/NativeLibrary.java @@ -333,6 +333,13 @@ public class NativeLibrary implements DynamicLookupHelper { }); addPaths(userDir, baseNames, paths); + if (!searchSystemPathFirst) { + // Add just the library names to use the OS's search algorithm + for (int i = 0; i < baseNames.length; i++) { + paths.add(baseNames[i]); + } + } + // Add probable Mac OS X-specific paths if (Platform.OS_TYPE == Platform.OSType.MACOS) { // Add historical location @@ -340,12 +347,7 @@ public class NativeLibrary implements DynamicLookupHelper { // Add current location addPaths("/System/Library/Frameworks/" + libName + ".Framework", baseNames, paths); } - - if (!searchSystemPathFirst) { - // Add just the library names to use the OS's search algorithm - paths.addAll(Arrays.asList(baseNames)); - } - + return paths; } @@ -400,13 +402,18 @@ public class NativeLibrary implements DynamicLookupHelper { } } - String[] res = new String[prefixes.length * suffixes.length]; + String[] res = new String[prefixes.length * suffixes.length + + ( Platform.OS_TYPE == Platform.OSType.MACOS ? 1 : 0 )]; int idx = 0; for (int i = 0; i < prefixes.length; i++) { for (int j = 0; j < suffixes.length; j++) { res[idx++] = prefixes[i] + libName + suffixes[j]; } } + if (Platform.OS_TYPE == Platform.OSType.MACOS) { + // Plain library-base-name in Framework folder + res[idx++] = libName; + } return res; } -- cgit v1.2.3