2

I have been desperately trying to build MacVim against a custom Python framework with no luck so far. I have tried many things, at the end MacVim builds with no errors, but when I check the linking of the final binary, it always lists as being linked against the default OSX Python.Framework, which is not something that I want.

Here is my configure command:
./configure --prefix=/Users/me/apps/Darwin64/macvim-7.4.258-clang-500.2.79\
    --with-features=huge \
    --enable-rubyinterp=yes \
    --enable-perlinterp=yes \
    --enable-cscope \
    --enable-pythoninterp=yes \
    --with-python-config-dir=/Users/me/apps/Darwin64/python2.7/lib/python2.7/config \
    --enable-luainterp=yes \
    --with-lua-prefix=/Users/me/apps/Darwin64/lua-5.2.3-clang-500.2

I have every possible environment variable out there set to point to the correct python folder ($PYTHONPATH, $PYTHONHOME etc.) My custom Python build is solid and healthy, I have never had issues with it.

Analysing the configure and build logs, I can see that the build process is finding my custom Python2.7 every time it performs some kind of a check:

(from the build log)
-I/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79/include/python2.7 -DPYTHON_HOME='"/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79"'


(from the config log)
configure:5792: found /Users/me/apps/Darwin64/bin/python
...
configure:5837: checking Python's install prefix
configure:5846: result: /Users/me/apps/Darwin64/python2.7.6-clang-500.2.79
...
configure:6014: checking if compile and link flags for Python are sane
configure:6031: gcc -o conftest -g -O2 -I/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79/include/python2.7 -DPYTHON_HOME='"/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79"'  -DMACOS_X_UNIX  conftest.c  -framework Python >&5
configure:6031: $? = 0
configure:6032: result: yes
...

So despite the fact that it is all properly set, the resulting MacVim.app is always built against the default Python.Framework:

$ otool -L ./MacVim.app/Contents/MacOS/Vim | grep "Python"
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)

I am suspecting (at least this is what I have seen on some other discussion groups) that the Python linking is hardcoded somewhere despite the fact that the checks are going through with no issues.

Could you please help me with this? Other bits and pieces in my pipeline compiles fine against my custom python, but things are breaking for me when MacVim is not using the Python framework every other package is using. For example YouCompleteMe will compile fine using my custom Python but the MacVim will start crashing because of this Python framework discrepancy.

Thank you very much!

mbilyanov
  • 2,315
  • 4
  • 29
  • 49
  • Possible solution here: http://stackoverflow.com/questions/6490513/vim-failing-to-compile-with-python-on-os-x/8276426#8276426 which refers to a bug in the Python Makefile. – Cometsong Jun 01 '15 at 15:31

0 Answers0