|Problem with Bundle-NativeCode and macosx [message #550655]
||Wed, 04 August 2010 05:23
| Lars Holmstrom
Registered: August 2010
Does anybody have any experience bundling native libraries with your plugins using the OSGi Manifest's Bundle-NativeCode directive? I am using this directive to target several different platforms. It works for Win32/64 and Linux 32/64, but can't get it to work for MacOSx. Here is my Bundle-NativeCode directive:|
Bundle-NativeCode: /libNative/Linux/x64/libapdm.so; /libNative/Linux/x64/ftd2xx.so; osname=linux; processor=x86_64,
/libNative/Linux/i386/libapdm.so; /libNative/Linux/i386/ftd2xx.so; osname=linux; processor=x86,
/libNative/Windows/i386/apdm.dll; /libNative/Windows/i386/ftd2xx.dll; osname=win32; processor=x86,
/libNative/Windows/x64/apdm.dll; /libNative/Windows/x64/ftd2xx64.dll; osname=win32; processor=x86_64,
/libNative/MacOSX/i386/ftd2xx.dylib; /libNative/MacOSX/i386/libapdm.dylib; osname=macosx; processor=x86,
/libNative/MacOSX/x64/ftd2xx.dylib; /libNative/MacOSX/x64/libapdm.dylib; osname=macosx; processor=x86_64
Here are some notes:
* I have confirmed that the libraries are all spelled correctly and are getting bundled with the MacOSX plugin jar file.
* If I misspell one of the MacOSX native libraries, the application won't launch due to an error (Missing host Bundle-NativeCode_0.0.0.). In other words, it IS reading the directive and DOES parse the library names at launch time.
* On other platforms (e.g., Win64), the native libraries are added to the plugin_root\configuration\org.eclipse.osgi\bundles\1\1\.cp\ folder. This is not true when launching the app on the MacOSX platform. My java jars and icons are placed there, but not the native libraries.
* If I add these libraries to plugin_root\Plugin.app\Contents\MacOS, they are found and used correctly and the program works as expected on a Mac machine.
* I am running Eclipse 3.5.2
* The error I get is of the "external library not found" variety, and is identical to the error I get on any platform when the libraries are missing.
Here are a couple of questions:
* Has anyone done this with Gallileo and gotten it to work?
* Anybody have any hints on how to debug this kind of thing? I have turned all of the debug logging options on in the osgi .options file, but this does not provide any feedback about the loading of native libraries.
* The root directory for MacOSX apps is not the plugin_root folder, but is rather the plugin_root\Plugin.app\Contents\MacOS folder. Perhaps this could be part of the issue?
[Updated on: Tue, 10 August 2010 21:19]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02258 seconds