![]() Ln -sfn /usr/local/Cellar/ /1.0.2t /usr/local/opt/openssl If you are copying the library into your application bundle's Frameworks folder, you should prepend the library name with $BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/ to ensure that the script can find the library.Update: As of December 2020 and beyond, brew switch does not work, so use the other answer by brew install rbenv/tap/ You can put the install_name_tool invocations in a Run Script build phase. I'm copying the library to my application bundle's Frameworks folder so I'm telling it to look there: $install_name_tool -id libopencv_imgproc.2.3.1.dylib In my example (and perhaps in your application) my library expects to find itself somewhere other than my application bundle, so I need to change that as well with install_name_tool -id. Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) otool -L shows us that the change was made: $ otool -L libopencv_imgproc.2.3.1.dylib Repeat this for every library whose path you need to change. I'm telling it to look for libz.1.dylib in /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/ instead of /usr/lib: $ install_name_tool -change /usr/lib/libz.1.dylib /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libz.1.dylib libopencv_imgproc.2.3.1.dylib The first parameter is the current library path, the second is the desired library path, and the third is the library file. Then use install_name_tool -change to change whichever paths you need to change. usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) Lib/libopencv_core.2.3.dylib (compatibility version 2.3.0, current version 2.3.1) Lib/libopencv_imgproc.2.3.dylib (compatibility version 2.3.0, current version 2.3.1) In this example I'm working with libopencv_imgproc.2.3.1.dylib, but you'll use your cairo library's file name instead: $ otool -L libopencv_imgproc.2.3.1.dylib Here's a made-up example that you should be able to adapt.įirst, use otool -L to see which libraries cairo is using. If not, my confidence in this solution goes down considerably.) You should be able to use install_name_tool to change where cairo looks for its libraries. I thought isysroot would make it so the include and library paths were rerooted in the SDK but -isysroot doesn't seem to have any effect. I'm not sure how to get rid of that so it uses my options. While building cairo it has -I/usr/X11/lib on the gcc commands (with my options tacked on the end) so I imagine it's hitting that first. ![]() Adding -L$(SDKROOT)/usr/X11/lib and -L$(SDKROOT)/usr/X11R6/lib to the LDFLAGS in the Homebrew formula for cairo.Adding -I$(SDKROOT)/usr/X11/include and -I$(SDKROOT)/usr/X11R6/include to the CFLAGS and CXXFLAGS in the Homebrew formula for cairo. ![]()
0 Comments
Leave a Reply. |