Locating libraries installed with MacPorts

Mick Jordan mick.jordan at oracle.com
Thu Oct 6 00:21:49 CEST 2016


I have several libraries installed via MacPorts (that also exists in 
/usr/lib FWIW), e.g, libpcre and libz. I was rather surprised to see 
that these resolve to the MacPorts location,i.e., /opt/local/lib even 
though I am not passing -L/opt/local/lib to the link step. I thought 
this might be because I was using gcc to do the compilation/linking and 
that is also installed via MacPorts, but I get the same behavior when 
using clang. I added -Wl,-v to the link step and it lists the 
directories it is searching and /opt/local/lib is not included in the 
list. So my question is how is ld resolving to /opt/local/include. I 
have no environment variables such as LDFLAGS set, although 
/opt/local/bin is on my PATH.

I'm running MacPorts 2.3.4 in El Capitan.

Thanks
Mick



More information about the macports-users mailing list