Kenny
Kenny

Reputation: 1121

install_name_tool does not make any changes?

My app needs to load a dylib provided by a hardware manufacturer. Using otool on the dylib produces this output:

$otool -L harwdware.2.dylib 
hardware.2.dylib:
    @executable_path/../Addittional/hardware.2.dylib (compatibility version 3.0.0, current version 3.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

And I'd like to change @executable_path/../Addittional/ to @executable_path/../Frameworks/ which is actually shorter, so it should fit. But when I run:

install_name_tool -change @executable_path/../Addittional/hardware.2.dylib @executable_path/../Frameworks/hardware.2.dylib hardware.2.dylib

then nothing happens, nothing changes and the output from otool is the same as before.

Where am I going wrong?

Upvotes: 4

Views: 1080

Answers (1)

Kenny
Kenny

Reputation: 1121

Thanks to @trojanfoe the correct command line is:

install_name_tool -id "@executable_path/../Frameworks/hardware.2.dylib"  hardware.2.dylib

Upvotes: 5

Related Questions