Re: install_name_tool
Re: install_name_tool
- Subject: Re: install_name_tool
- From: Martin <email@hidden>
- Date: Sat, 21 Jun 2008 00:16:15 +0200
Sometimes you just need someone to tell you to read *again* the man
page and actually try to understand what the words mean ;-)
Thanks Sherm!
-Martin
On Jun 20, 2008, at 12:25 PM, Sherm Pendley wrote:
On Fri, Jun 20, 2008 at 3:12 AM, Martin <email@hidden>
wrote:
Thanks for your answers but it's still not working here. Plus I
don't really
see why I should use "-id" option since what I really want to do is
*change*
one of the paths.
Straight from "man install_name_tool":
-change old new
Changes the dependent shared library install name old
to new in
the specified Mach-O binary. More than one of these
options can
be specified. If the Mach-O binary does not contain
the old
install name in a specified -change option the
option is
ignored.
-id name
Changes the shared library identification name of
a dynamic
shared library to name. If the Mach-O binary is not
a dynamic
shared library and the -id option is specified it is
ignored.
You *have* read the man page for the tool you're using, right? :-)
$ install_name_tool -change
/Users/martin/Library/Frameworks/Foo.framework/Versions/A/Foo
@executable_path../../Frameworks/Foo.framework/Versions/A/Foo
Foo.framework/Foo
What you're doing here is, wherever Foo.framework/Foo is *linked to* a
dependent shared library at the first path, change that reference to
refer to the second path instead. That is, the -change option doesn't
change the install name of the target. It changes the target's
references to *other* libraries.
If any applications have linked against your framework using the old
install_name, you could use the -change option to update the apps'
references to your framework.
There are no error messages given by install_name_tool, it just
silently
does nothing...
That's what it's documented to, when -change is used and
Foo.framework/Foo has no external references to the given path.
As others have suggested, the easiest way to set the install name for
a framework is to "get info" on the target in Xcode and enter it
there. That's simple, automatic, and painless. That said, if the above
is copy & pasted, and its the same path you tried with the -id option,
you're missing a slash after @executable_path, and looking a directory
too far up the tree. It should be:
install_name_tool -id
@executable_path/../Frameworks/Foo.framework/Versions/A/Foo
Suggested reading:
<http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/install_name_tool.1.html
>
<http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html
>
- especially the section titled "Embedding a Private Framework in Your
Application Bundle".
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden