|
From: Leif M. <le...@ta...> - 2003-09-12 04:20:03
|
Mike, That is actually exactly how I have been waning to eventually do this. I have gotten support checked into CVS for naming the native library based on the platform and architecture. On Windows, the file can be named any of the following: wrapper-windows-x86.dll wrapper-windows.dll wrapper.dll On Linux, the following: libwrapper-linux-i386.so libwrapper-linux.so libwrapper.so On Solaris, the following: libwrapper-sunos-sparc.so libwrapper-sunos.so libwrapper.so I need to get the possible names for the other supported platforms resolved by working with the volunteers who help with those builds. The next step is to come up with a shell script which is capable of doing the same thing with the wrapper binary. Once that is done then a full cross platform release will be possible. Cheers, Leif Mike Castle wrote: >In article <106...@we...>, >Fredrik Israelsson <wra...@li...> wrote: > > >>I don't question writing the wrapper in C. My question is more like why one >>cannot make one wrapper release with binaries needed for all platforms. I mean, >>storage space for the few MB:s needed is not a problem theese days. >> >> > >I'm of two minds about this myself. > >After all, the JRE doesn't come with only one package; you have to download >a different package for each arch. Ok, well, Sun's is like that; I have no >experience with any others, so maybe they do. > >But on the other hand, personally I package my app separately with all >wrapper stuff appropriate for supports platforms, and distribute all addons >(JDK, 3rd party libs, etc) as a second package, which is platform specific. > >Now, currently we only support Linux and Win32, so there are no conflicts >with wrapper and wrapper.exe and wrapper.dll and libwrapper.so. > >But, what if I want to package another unix like platform that also uses >.so? Then it becomes a bit trickier. > >Sure, I could have wrapper.Linux and wrapper.FreeBSD and modify wrapper.sh >to call wrapper.`uname -s` or something. But that doesn't solve the >dynamically loaded library issue. > >I think a nice enhancement would be if the call to System.loadLibrary() >first tried "wrapper" and if that didn't work, try "wrapper.arch" or >something. I'm no Java expert, but it looks like the java property os.name >might be appropriate? Actually, may be a good idea to use os.name + >os.arch to correctly support same OS on multiple platforms. Linux and >FreeBSD, for example, both work on non-i386 arch. And if you're supporting >FreeBSD, which has to build their own java from Sun's source anyway, might >as well support them compiling it on a myriad of platforms. > >One reason this really concerns me is that the developers here like to run >the same compiled code on two machines to test communications. Sometimes >those two machines are different OSes. We're lucky now that Linux and >Win32 can coexist. But if we start supporting other platforms, it becomes >more of an issue. > >Anyway, just my thoughts on the matter. > >Cheers, >mrc > > |