Changes between Version 2 and Version 3 of OSXFrameworks


Ignore:
Timestamp:
Dec 18, 2007 12:45:02 AM (8 years ago)
Author:
judah
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OSXFrameworks

    v2 v3  
    4141
    4242=== Loading at runtime ===
    43 When you run a program which was linked against a framework, it is loaded by the dynamic link editor, {{{dyld}}}.  The dynamic linker searches for the framework using the following
    44 variables, whose default values may be overwritten by setting environmental variables (colon-separated strings)
    45  * {{{DYLD_FRAMEWORK_PATH}}}, which defaults to empty
    46  * {{{DYLD_FALLBACK_FRAMEWORK_PATH}}}, which defaults to searching the following:
     43When you run a program which was linked against a framework, it is loaded by the dynamic link editor, {{{dyld}}}.  The dynamic linker searches for the framework using the following algorithm. 
     44(The default values of `DYLD_(FALLBACK_)FRAMEWORK_PATH` may be overwritten by setting environmental variables as colon-separated strings).
     45 * Look in each of the entries of {{{DYLD_FRAMEWORK_PATH}}}, which defaults to empty.
     46 * Check the current directory.
     47 * Look in each of the entries of {{{DYLD_FALLBACK_FRAMEWORK_PATH}}}, which defaults to searching the following:
    4748    * {{{$HOME/Library/Frameworks}}}
    4849    * {{{/Library/Frameworks}}}
    4950    * {{{/Network/Library/Frameworks}}}
    5051    * {{{/System/Library/Frameworks}}}
     52 * If the framework name starts with `"@executable_path"` or `"@loader_path"`, replace it with, e.g., the full path to the application bundle:
     53   * [http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html]
     54   * [http://www.cocoadev.com/index.pl?LinkingAuxiliaryExecutablesToEmbeddedFramework]
     55
    5156
    5257Note that the {{{-F}}} is irrelevant to runtime behavior! (Apple's docs are not at all clear, but that's definitely how it works.)
    5358
    54 Also, note {{{$HOME/Library/Frameworks}}} is searched by default at runtime, despite what {{{dyld}}}'s manpage says; I've checked the source of dyld.cpp and tested the behavior to confirm.
     59Also, note {{{$HOME/Library/Frameworks}}} is searched by default at runtime, despite what {{{dyld}}}'s manpage says.  I've checked the source of dyld.cpp and tested the behavior to confirm; you can download it at the following locations (requires free Apple ID registration)
     60 * [http://www.opensource.apple.com/darwinsource/ Download the source of all Darwin releases]
     61 * [http://www.opensource.apple.com/darwinsource/10.5/dyld-95.3/src/dyld.cpp Direct link to dyld.cpp]
    5562
    56