[Pythonmac-SIG] Name that Python
Tony Lownds
tony@lownds.com
Mon, 22 Jul 2002 07:24:40 -0700
At 6:46 PM -0400 7/21/02, Bob Ippolito wrote:
>You not only have to make it in there, but it has to link to the
>right place .. otool -Lv on the executable should say
>@executable_path/../PrivateFrameworks/Python.framework/Versions/2.3/Python
>.. It doesn't work just by dropping it where it needs to go, and I
>don't know of any tools to change this path in the Mach-O header
>post-link.
Bill mentioned the tool: install_name_tool
NAME
install_name_tool - change dynamic shared library install
names
SYNOPSIS
install_name_tool [-change old new ] ... [-id name] file
DESCRIPTION
Install_name_tool changes the dynamic shared library
install names recorded in a Mach-O binary. For this tool
to work when the install names are larger the binary
should be built with the ld(1) -header-
pad_max_install_names option.
...and it works for what we need it for:
ironchef:~% sudo tcsh
root# cd /Applications/Python.app/Contents/MacOS/
root# otool -Lv python
python:
...
Python.framework/Versions/2.3/Python (compatibility version
2.3.0, current version 2.3.0)
...
root# install_name_tool -change Python.framework/Versions/2.3/Python
@executable_path/../Frameworks/Python.framework/Versions/2.3/Python
python
root# otool -Lv python python:
...
@executable_path/../Frameworks/Python.framework/Versions/2.3/Python
(compatibility version 2.3.0, current version 2.3.0)
...
root# mkdir ../Frameworks
root# mv /Library/Frameworks/Python.framework ../Frameworks/
root# ./python
Pythonw 2.3a0 (#1, Jul 15 2002, 08:02:36)
[GCC 2.95.2 19991024 (release)] on darwin
Type "copyright", "credits" or "license" for more information.
>>> ^D
root#
Changing the shared library doesn't seem to be necessary.
-Tony