Linking
- Dynamic Libraries, RPATH, and Mac OS - Oracle Joe Di Pol's Blog
- GitHub - auriamg/macdylibbundler: Utility to ease bundling libraries into executables for OSX
- @executable path, @load path and @rpath · wincent.com
- mikeash.com: Friday Q&A 2009-11-06: Linking and Install Names
- c++ - Make /usr/local/lib a default library search path for ld on mac os x? - Stack Overflow
- https://github.com/tito/osxrelocator
- https://github.com/chearon/macpack
- https://github.com/stargazystudios/macos-dylibtools
- https://matthew-brett.github.io/docosx/mac_runtime_link.html
Note from my own debugging of a autotools configure script:
+ echo "LIBRARY_PATH=$(brew --prefix)/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}" >> $GITHUB_ENV
Set macOS LIBRARY_PATH for Homebrew
Per the macOS ld(1) man page https://www.unix.com/man-page/OSX/1/ld/,
The default library search path is /usr/lib then /usr/local/lib.
When
HOMEBREW_PREFIX=/usr/local
, this is where the.dylib
files for X11 are symlinked by Homebrew.When
AC_PATH_XTRA
is called, it uses/usr/bin/gcc
(Apple clang) and since the libraries are found in/usr/local/lib
, it does not need to specify any-L
paths.However when
libtool
is used to call Homebrewgfortran
, it sets the flag-syslibroot
which per the man page for ld(1):The -syslibroot option will prepend a prefix to all search paths.
and this means that it no longer looks under
/usr/local/lib
by default. To fix this, add the default path back by setting theLIBRARY_PATH
environment variable.
Package managers
Distribution
.dmg
Plist
- A Simple PlistBuddy Tutorial - Fotsies Technology Blog
- What is PlistBuddy?. PlistBuddy is mac build-in program… - by Mark - Medium