|
From: | Ivan Levashew |
Subject: | Re: Relocatable packages, once again |
Date: | Wed, 11 Feb 2009 21:16:50 +0600 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X; ru; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 ThunderBrowse/3.2.2.1 Mnenhy/0.7.6.666 |
Paolo Bonzini wrote:
_NSGetExecutable returned garbage last time I used it, so I'd favour the same method as for libraries: libdl.For programs' resources instead the resources should be found in a path related to the program's path. You can also use the relocatable.c file here. In general, this part is easier to do since most platforms including Mac OS X have a way to find the executable.
GNU libraries/utilities are likely to provide support for the earliest OSes, and libdl was absent till (I don't know which version exactly, 10.3 or 10.4). Somebody has implemented libdl interface on top of Mach API, and it became part of Mac OS X.
I would better use libdl interface because Apple will care about it in the future OSes, but Mach API is sometimes being dropped (like it happened to _NSGetExecutable) or changed.
Proper handling of Mac OS X 10.2 - 10.6 would require using either system libdl or built-in one in the abscence of system one.
-- If you want to get to the top, you have to start at the bottom
[Prev in Thread] | Current Thread | [Next in Thread] |