How does brew connect with the dynamic linker (dyld)


(Primo Bianchi) #1

Hi there,

for the last couple of days I’ve been trying to understand how brew gets the dynamic linker (dyld) to look for libraries in the their own subdirectories in Cellar.

The bin symlinks for executables are super easy to understand.
On the other hand, I can’t understand how brew links libraries from outside the standard /urs/local/lib and /usr/local/include, can anybody help me?

I’ve been trying to divide /usr/local/lib into multiple subdirectories in a script of my own and understanding this dynamic in brew seemed like the perfect starting point.


(Sean Molenaar) #2

Almost all make scripts check /usr/include by default and sometimes brew specifies where they need to look ( /usr/local/include ). It’s really that simple.