Re: [gtk-osx-users] [gtk-mac-bundler] gtk3-demo oudated?



On Sep 11, 2012, at 11:52 AM, Paolo Borelli <paolo borelli gmail com> wrote:

> Hi John,
> 
> 
> 	thanks for the quick reply! We will try to push push a github branch
> with our local modifications once we get things working.
> 
> Among other things we saw that the bundler makes use of
> @executable_path, but that is deprecated (and in our case it does not
> work since we have some helper gtk programs that are in different dirs).
> We switched to @loader_path which seems to work fine... I guess we'll
> push this change too and let you pick if it is the correct solution[1]
> 
> Ciao
> 	Paolo
> 
> 
> 1) to be honest I think we should just patch the libraries to find
> things in locations relative to their position instead of editing paths
> in the bundler: for instance the win32 port already does that:
> 
> http://git.gnome.org/browse/gdk-pixbuf/tree/gdk-pixbuf/queryloaders.c#n240

Where does it say that @executable_path is deprecated? It doesn't say anything about that in the dyld man page on Mountain Lion.

In any case, you seem to be confusing dynamic linking with loading loadable modules. OSX's dynamic loader, dyld (1), uses rpaths for everything. @executable_path, @loader_path, and @rpath are ways to set those rpaths to be relative to something instead of absolute; that's what the bundler is setting up. You absolutely should be using GModule to find loadable modules and using OS-dependent path-finding functions or XDG to calculate the paths. Let's keep Win32 out of this: That linker doesn't do anything very well.

At present, the install_name_tool pass just goes through the list of prefixes that you pass in from the config file and changes them to @executable_path/../Resources/, relying on all executables being in Contents/MacOS. To use @loader_path, it would have to work out for each file the relative path to the new location of the prefix. Doable, but a lot more complicated that the existing code. Much easier to use the "dest" attribute on binary to put all of your utility functions in Contents/MacOS.

Regards,
John Ralls




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]