I'm far from an expert on the subject matter. Maybe some app that was written for Linux/BSD or whatever is looking at a LD_LIBRARY_PATH on its own and its nothing to do with the OS? I've never tried messing with LD_LIBRARY_PATH on OSX, but its not *supposed* to do anything normally. The OS Relies on DYLD_LIBRARY_PATH. If you change it, you have to make sure it encompasses every single location for every library accessed... or there are major issues. This is what makes DYLD_FALLBACK_LIBRARY_PATH very useful. If the library isn't found, it'll check the fallback locations. Usually its best to not mess with DYLD_LIBRARY_PATH.... but being a fallback, if a user actually has the file on their machine in a normal location, it can cause problems making anything portable, because it goes with the one it finds first. You might want to use otool on your binaries and dylibs and see what exact location they are looking for things in. You can also use install_name_tool to modify them to look in other places. Very useful tools to change things around after they are built.
doh123 <wineforum-user at winehq.org> wrote:>Sent: Sep 6, 2010 8:33 PM >To: wine-users at winehq.org >Subject: [Wine] [Fwd: Trouble with libgsm on Mac OS X 10.6.2] > >I'm far from an expert on the subject matter. Maybe some app that was written for Linux/BSD or whatever is looking at a >LD_LIBRARY_PATH on its own and its nothing to do with the OS? I've never tried messing with LD_LIBRARY_PATH on OSX, but >its not *supposed* to do anything normally.I agree with both Ryan and you, LD_LIBRARY_PATH is supposed to do absolutely NOTHING under MacOSX. However, Wine needs it for some strange reason. If I leave it out, the built dependency libraries are not found for freetype and fontconfig (and I know that fontconfig is included with MacOSX 10.6 now.) Otherwise, I get a series of freetype cannot be found, install freetype 2.0.5 or higher. I'll look at the Fink setup script to see how they did this.> >The OS Relies on DYLD_LIBRARY_PATH. If you change it, you have to make sure it encompasses every single location for >every library accessed... or there are major issues. This is what makes DYLD_FALLBACK_LIBRARY_PATH very useful. If the >library isn't found, it'll check the fallback locations. Usually its best to not mess with DYLD_LIBRARY_PATH.... but >being a fallback, if a user actually has the file on their machine in a normal location, it can cause problems making >anything portable, because it goes with the one it finds first.That statement is correct. That is why most .app files don't use it. Again, it is most interesting that adding the DYLB_LIBRARY_PATH causes calls to Wine's 'fake' dll files to fail.> >You might want to use otool on your binaries and dylibs and see what exact location they are looking for things in. You >can also use install_name_tool to modify them to look in other places. Very useful tools to change things around after >they are built.They are looking at @excutable_path/../lib/<filename here> and /usr/lib/<filename here> The second library file is definitely there, but the first I could not figure out. BTW, I am running $BUILDDIRECTORY/dlls/gdi32/tests/gdi32.exe.so (the test program for gdi32), when I run into this mess. The file is a mach-o 32 bit executable. Again, it is strange that LD_LIBRARY_PATH is doing anything at all, but it is. I cannot explain it, except that Wine comes from Linux and is not 'pure' Apple ObjC code and that may have something to do with it. I'll have to get WineSkin and see what you are doing differently that I'm not. James McKenzie
James Mckenzie wrote:> > I agree with both Ryan and you, LD_LIBRARY_PATH is supposed to do absolutely NOTHING under MacOSX. However, Wine needs it for some strange reason. If I leave it out, the built dependency libraries are not found for freetype and fontconfig (and I know that fontconfig is included with MacOSX 10.6 now.) Otherwise, I get a series of freetype cannot be found, install freetype 2.0.5 or higher. I'll look at the Fink setup script to see how they did this. >This error can be fixed with DYLD_FALLBACK_LIBRARY_PATH... James Mckenzie wrote:> > They are looking at @excutable_path/../lib/<filename here> and /usr/lib/<filename here> The second library file is definitely there, but the first I could not figure out. >@executable_path in wine or wineserver will mean the folder the executable is in, then ../ goes back one folder, then it goes into the lib folder where Wine stuff should be. Wine actually uses @executable_path which makes it easier to be moved around and run from anywhere, where most everything else built (especially from Macports) uses hard set locations from root. James Mckenzie wrote:> > I'll have to get WineSkin and see what you are doing differently that I'm not.You can take a look in a Wineskin wrapper at Contents/MacOS/Wineskin. Its just a bash script (though rather long). There is a function in there for running Wine with some different launch options. Every one uses a DYLD_FALLBACK_LIBRARY_PATH... but overall the code in there is a mess because I have to handle more than just Wine, and its been slowly modified over several versions... I need to re-write the whole thing some time... since Wineskin version 1.2 (not related to Wine version numbers), i do not use fontconfig at all... for some reason when I do, it often takes 30+ seconds to start Wine as it caches fonts for the user in the $HOME/Library/Application Support/Wine. Wine runs fine without it other than sometimes having to install fonts, but easily done with Winetricks. I think Macports does the same thing.. using DYLD_FALLBACK_LIBRARY_PATH. They install a bash script.. and the "wine" file in bin is just that bash script not the real wine program... and it sets this on run for the user.
doh123 <wineforum-user at winehq.org> wrote:>Sent: Sep 7, 2010 11:37 AM >To: wine-users at winehq.org >Subject: [Wine] [Fwd: Trouble with libgsm on Mac OS X 10.6.2] > > >James Mckenzie wrote: >> >> I agree with both Ryan and you, LD_LIBRARY_PATH is supposed to do absolutely NOTHING under MacOSX. However, Wine needs it for some strange reason. If I leave it out, the built dependency libraries are not found for freetype and fontconfig (and I know that fontconfig is included with MacOSX 10.6 now.) Otherwise, I get a series of freetype cannot be found, install freetype 2.0.5 or higher. I'll look at the Fink setup script to see how they did this. >> > >This error can be fixed with DYLD_FALLBACK_LIBRARY_PATH... >I'll have to check this, but I remember that this variable is set to point to the same directories, but in a different order. James McKenzie