{"id":19382635,"url":"https://github.com/funkym/install_name_prefix_tool","last_synced_at":"2025-04-23T20:32:24.222Z","repository":{"id":8722345,"uuid":"10393754","full_name":"FunkyM/install_name_prefix_tool","owner":"FunkyM","description":"Shell script for Mac OS X which changes the library prefix for a series of shared libraries in a folder or a single executable.","archived":false,"fork":false,"pushed_at":"2013-06-14T06:08:00.000Z","size":120,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T20:11:15.526Z","etag":null,"topics":["linking","macos","otool","shared-libraries","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FunkyM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-30T22:54:25.000Z","updated_at":"2024-10-19T04:05:16.000Z","dependencies_parsed_at":"2022-09-23T14:57:24.461Z","dependency_job_id":null,"html_url":"https://github.com/FunkyM/install_name_prefix_tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunkyM%2Finstall_name_prefix_tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunkyM%2Finstall_name_prefix_tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunkyM%2Finstall_name_prefix_tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunkyM%2Finstall_name_prefix_tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FunkyM","download_url":"https://codeload.github.com/FunkyM/install_name_prefix_tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509837,"owners_count":21442507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linking","macos","otool","shared-libraries","shell"],"created_at":"2024-11-10T09:22:33.056Z","updated_at":"2025-04-23T20:32:22.942Z","avatar_url":"https://github.com/FunkyM.png","language":"Shell","readme":"install_name\\_prefix\\_tool\n========================\n\nShell script for Mac OS X which changes the library prefix for a series of shared libraries in a folder or a single executable.\n\nOverview\n--------\n\nThis is a simple bash script which processes a series of Mac OS X shared libraries (.dylib) in a directory and uses [install\\_name\\_tool](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/install_name_tool.1.html) to modify the binary library link names.\n\nThe use-case for this script is usually to modify a series of existing shared libraries or an executable for loading from a relative location.\n\nExample\n-------\n\nSay you have a couple of libraries which dependent upon each other and installed them in a directory \"/usr/local/lib/\".\n\nNow you want to package these libraries with your main application. If you check each libraries link dependencies using \"otool -L [LIBRARY_FILE]\", you'll notice they point to \"/usr/local/lib/\".\n\nUsing this script, you can now modify all of the library links at once for instance to some local folder next to the main binary. If you copy all libraries to a \"lib/\" folder next to your main application binary, you can run the following command to make all shared libraries load and reside in \"lib/\".\n\u003cpre\u003e\n$ install_name_prefix_tool.sh ./lib /usr/local/lib @executable_path/lib\n\u003c/pre\u003e\nFinally you must also modify the loader path for your application to pick up the shared libraries from the relative \"lib/\" folder.\n\u003cpre\u003e\n$ install_name_prefix_tool.sh ./myapplication /usr/local/lib @executable_path/lib\n\u003c/pre\u003e\n\nIf you now verify the links using otool again, you'll notice that it now uses the new prefix to lookup dependent libraries which will be relative to your main executable due to the special token \"@executable_path\".\n\nHandy, ain't it?","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkym%2Finstall_name_prefix_tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkym%2Finstall_name_prefix_tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkym%2Finstall_name_prefix_tool/lists"}