On Sep 24, 12:32 pm, björn <[email protected]> wrote:
> 2009/9/24 Petro Verkhogliad:
>
>
>
>
>
> > I am on OS X 10.5.8. I have 2 version of Python installed. The default
> > one provided by Apple, Python 2.5.1. And one I installed from
> > MacPorts, Python2.6.2.
>
> > The MacVim snapshot is built against Python 2.3.x. So I had to build
> > my own version of from source. I followed the instructions on the
> > MacVim wiki to build MacVim.app with one exception. I want to build
> > against 2.6.2. So I did this:
>
> > ./configure --without-x --disable-gpm --disable-nls --with-
> > tlib=ncurses --enable-multibyte --enable-rubyinterp --enable-
> > pythoninterp --enable-gui=macvim --with-python-config-dir=/opt/local/
> > Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config
> > && make
>
> > This picks up Python 2.6 during the configure and builds the "vim"
> > binary. If i start the newly built version of Vim and do:
> > :python import sys; print sys.version
>
> > it reports this:
> > 2.5.1 (r251:54863, Jun 17 2009, 20:37:34)
> > [GCC 4.0.1 (Apple Inc. build 5465)]
>
> > So, my question is, why does it go to 2.5.1 is there any way to force
> > it to use 2.6.2?
>
> Hi Petro,
>
> Well...I don't know _why_ it chooses the wrong version, but you may be
> able to edit src/auto/config.mk manually so that it references the
> version of Python you want (there are several PYTHON_* variables that
> you may have to tweak).
>
> When you do have a Vim binary at hand, the best way to check which
> Python version it uses is to open up Terminal and type
>
> otool -L Vim
>
> (in the same directory as the Vim binary, of course).
>
> Good luck,
> Björn
Hi Bjorn,
thanks for the suggestions. I think I finally got it. :)
The situation was this:
The auto/config.mk contains the following in the Python section:
PYTHON_SRC = if_python.c
PYTHON_OBJ = objects/if_python.o
PYTHON_CFLAGS = -I/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/include/python2.6
PYTHON_LIBS = -framework Python
PYTHON_CONFDIR = /opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/config
PYTHON_GETPATH_CFLAGS = -DPYTHONPATH='":/opt/local/Library/Frameworks/
Python.framework/Versions/2.6/lib/python26.zip:/opt/local/Library/
Frameworks/Python.framework/Versions/2.6/lib/python2.6:/opt/local/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-
darwin:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/plat-mac:/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages:/opt/local/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk:/
opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/lib-old:/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/lib-dynload:/opt/local/Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/site-packages:/opt/local/
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/Numeric:/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/site-packages/PyObjC"' -DPREFIX='"/opt/
local/Library/Frameworks/Python.framework/Versions/2.6"' -
DEXEC_PREFIX='"/opt/local/Library/Frameworks/Python.framework/Versions/
2.6"'
But "otool -L Vim" gives me:
$ otool -L Vim
Vim:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 12.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
(compatibility version 2.0.0, current version 136.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 111.1.4)
/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0,
current version 5.0.0)
/System/Library/Frameworks/Python.framework/Versions/2.5/Python
(compatibility version 2.5.0, current version 2.5.1)
/opt/local/lib/libruby.dylib (compatibility version 1.8.0, current
version 1.8.7)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current
version 227.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/
CoreServices (compatibility version 1.0.0, current version 32.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/
CoreFoundation (compatibility version 150.0.0, current version
476.19.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
(compatibility version 45.0.0, current version 949.54.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
(compatibility version 300.0.0, current version 677.26.0)
So, it is referencing the Python framework provided by Apple. So, to
force the built to ignore that I had to change where /System/Library/
Frameworks/Python.framework/Versions/Current points to.
$ pwd
/System/Library/Frameworks/Python.framework/Versions
$ ls -la
total 16
drwxr-xr-x 6 root wheel 204 Sep 24 12:52 .
drwxr-xr-x 7 root wheel 238 Aug 31 14:55 ..
drwxr-xr-x 8 root wheel 272 Aug 31 12:00 2.3
drwxr-xr-x 12 root wheel 408 Aug 31 14:55 2.5
lrwxr-xr-x 1 root wheel 59 Sep 24 12:52 Current -> /opt/local/
Library/Frameworks/Python.framework/Versions/2.6
lrwxr-xr-x 1 root wheel 3 Aug 31 09:39 old-Current -> 2.5
After doing this, I built Vim binary again. and otool gives the
desired output.
Thanks,
Petro
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---