Hello,
I cloned https://github.com/textmate/textmate https://github.com/textmate/textmate to my Mac, then successfully built and ran it. But when I copy the binary to another Mac, it cannot be launched because of missed dylibs. I compared linked dependencies with public Beta version and detected the following difference:
/Applications/TextMate.app/Contents/Frameworks/plist.dylib: @rpath/plist.dylib (compatibility version 1.0.0, current version 1.0.1) @rpath/cf.dylib (compatibility version 1.0.0, current version 1.0.1) @rpath/io.dylib (compatibility version 1.0.0, current version 1.0.1) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
vs
/Users/vadim/build/TextMate/Applications/TextMate/TextMate.app/Contents/Frameworks/plist.dylib: @rpath/plist.dylib (compatibility version 1.0.0, current version 1.0.1) @rpath/cf.dylib (compatibility version 1.0.0, current version 1.0.1) @rpath/io.dylib (compatibility version 1.0.0, current version 1.0.1) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.15.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0) /usr/local/lib/libcapnp--no-undefined.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/local/lib/libkj--no-undefined.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
Apparently that another Mac does not have capnp and kj in /usr/local/lib/. Maybe you can hint why these dylibs are linked and why the paths are absolute? 🙏
Thanks in advance, Vadim
P. S. This is my first request, and I submitted it to the IRC channel because not sure where to look for help, sorry for duplication.
On 6 Nov 2016, at 15:13, Vadim Shpakovski wrote:
Apparently that another Mac does not have capnp and kj in /usr/local/lib/. Maybe you can hint why these dylibs are linked and why the paths are absolute? 🙏
They are linked because they are needed :)
Unfortunately clang does not allow one to specify “prefer static library over dynamic library” (as gcc’s linker does), and *currently* TextMate’s build system uses `-lcapnp -lkj` to link these libraries (the alternative is to use `/path/to/libcapnp.a` to ensure the static version is linked, but then the build system must know where the user has the static library installed, and asserts that they indeed does have the static library).
I have an updated build system that does do the direct path linking which I’ll push to `master` shortly, this should solve this issue.