Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Problem with Bundle-NativeCode and macosx
Problem with Bundle-NativeCode and macosx [message #552352] Wed, 11 August 2010 20:27 Go to next message
Lars Holmstrom is currently offline Lars HolmstromFriend
Messages: 5
Registered: August 2010
Junior Member
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:
* 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.
* I have confirmed that the libraries are all spelled correctly and are getting bundled with the MacOSX plugin jar file, via the "Binary Build" mechanism.
* 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.
* 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. This is a hassle, however, because it is an extra deployment step and the libraries won't be automatically updated when the plugin is.
* I am running Eclipse 3.5.2

Here are a couple of questions:
* Has anyone done this with Gallileo and gotten it to work?
* Is it perhaps fixed in Helios?
* Anybody have any hints on how to debug this kind of thing? I have turned all of the debug logging options on in the org.eclipse.osgi.jar .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?
Re: Problem with Bundle-NativeCode and macosx [message #552362 is a reply to message #552352] Wed, 11 August 2010 22:04 Go to previous messageGo to next message
BJ Hargrave is currently offline BJ HargraveFriend
Messages: 55
Registered: July 2009
Member
The OSGi Compliance Tests successfully load native code on Mac OS X with the following:


macosx_x86/libNative.jnilib; osname="mac os x"; processor=x86,
macosx_x86-64/libNative.jnilib; osname="mac os x"; processor=x86-64

The native code must have a .jnilib file extension.

[Updated on: Wed, 11 August 2010 22:04]

Report message to a moderator

Re: Problem with Bundle-NativeCode and macosx [message #552808 is a reply to message #552362] Fri, 13 August 2010 15:46 Go to previous message
Lars Holmstrom is currently offline Lars HolmstromFriend
Messages: 5
Registered: August 2010
Junior Member
BJ Hargrave - your suggestion to switch to the jnilib extension did the trick for me. Thanks much. I have been trying to resolve this for a while.
Previous Topic:P2 enabled RCP app: Updating doesn't update features/plugins
Next Topic:Helios RPC failed for p2 update feature
Goto Forum:
  


Current Time: Mon Dec 22 04:18:42 GMT 2014

Powered by FUDForum. Page generated in 0.01711 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software