From: Ka-Hing C. <ja...@ja...> - 2004-01-03 20:35:38
|
Mike Hearn said: > Hi, > > Attached is a patch which allows gaim binaries to be installed to any > prefix. At runtime, when enabled, gaim will get its prefix and use that > to load data files, plugins, etc. I wrote a patch a while back for the same purpose. It looks at the command used to run gaim to figure out the prefix. It's not been updated but I think it would be fairly trivial to do so. > 1) An addition to configure.ac - the feature is optional and off by > default so developers who run Gaim in tree are not disturbed. Those who > want to make relocatable binary packages can specify --enable-binreloc > to configure. My patch didn't do this, I think Ethan said that this is not necessary. > We take the address of an empty string in order to locate the base > address of the ELF mmap it belongs to (via dladdr). We then scan the > linker mappings in /proc/self/maps to obtain the absolute path of that > binary. We assume an FHS directory layout, so if gaim is installed to > /usr/local/bin/gaim we take /usr/local to be the prefix, then append the > necessary string onto it to obtain the required path. We use a TLS slot > to ensure there are no memory leaks. How is this approach better than Ben's or mine? (I've not looked at his patch, I assume that it's quite functionally similar, if not the same, as mine) I am attaching this outdated patch for reference purpose. It was tested on OS X and Linux. - khc |