Hi,

2016/8/6 Sat 12:42:06 UTC+9 Marslo Jiao wrote:
> On Thursday, 7 January 2016 19:18:30 UTC+8, Ken Takata  wrote:
> > Hi Marslo,
> > 
> > 2016/1/7 Thu 17:40:38 UTC+9 Marslo Jiao wrote:
> > > The preinstall (default) and newinstall (2.7.11) are all Py_UNICODE_SIZE 
> > > == 2
> > 
> > Oh, really? I think it's very strange.
> > BTW, it's not so important.
> > 
> > The problem is why the Vim's configure script misdetected the python's 
> > header
> > directory.  The configure script checks python2 command first, then python
> > command.  If the preinstalled python has python2 command, and if your self-
> > built python doesn't have python2 command, the misdetection might occur.
> > 
> > Maybe we should use INCLUDEPY variable from <python-config-dir>/Makefile?
> > 
> > E.g.:
> > 
> > --- a/src/configure.in
> > +++ b/src/configure.in
> > @@ -1128,6 +1128,7 @@
> >     @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
> >     @echo "python_DLLLIBRARY='$(DLLLIBRARY)'"
> >     @echo "python_INSTSONAME='$(INSTSONAME)'"
> > +   @echo "python_INCLUDEPY='$(INCLUDEPY)'"
> >     @echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'"
> >     @echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'"
> >     @echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'"
> > @@ -1182,9 +1183,9 @@
> >  
> >     PYTHON_LIBS="${vi_cv_path_python_plibs}"
> >     if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
> > -     
> > PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}
> >  -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
> > +     PYTHON_CFLAGS="-I${python_INCLUDEPY} 
> > -I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} 
> > -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
> >     else
> > -     
> > PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}
> >  -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} 
> > -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
> > +     PYTHON_CFLAGS="-I${python_INCLUDEPY} 
> > -I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} 
> > -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} 
> > -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
> >     fi
> >     PYTHON_SRC="if_python.c"
> >     PYTHON_OBJ="objects/if_python.o"
> > 
> > 
> > Sorry, this patch is not tested at all.
> > (Maybe a similar patch for python3 is also needed.)
> > 
> > 
> > Regards,
> > Ken Takata
> 
> Hi Ken Takata
> 
> Sorry for trouble you again. This error occurred again.
> 
> ----------------------------
> Error is:
> The --with-python-config-dir=/usr/local/lib/python2.7/config has been set, 
> but vim/Makefile still use the /usr as the PYTHON_HOME:
> 
> gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE 
> -D_FORTIFY_SOURCE=1       -I/usr/include/python2.7 -DPYTHON_HOME='"/usr"' 
> -pthread -fPIE  -o objects/if_python.o if_python.c
> if_python.c:67:20: fatal error: Python.h: No such file or directory
>  #include <Python.h>
>                     ^
> compilation terminated.
> make[1]: *** [objects/if_python.o] Error 1
> make[1]: Leaving directory `/home/marslo/.vim/vimsrc/src'
> make: *** [first] Error 2
> 
> ----------------------
> 
> The following is the part of compiled log (full log has been attached. 
> nohup.out):
> ...
> checking --enable-pythoninterp argument... yes
> checking for python2... (cached) /bin/python2
> checking Python version... (cached) 2.7
> checking Python is 2.3 or better... yep
> checking Python's install prefix... (cached) /usr
> checking Python's execution prefix... (cached) /usr
> (cached) checking Python's configuration directory... (cached) 
> /usr/local/lib/python2.7/config
> (cached) checking Python's dll name... (cached) libpython2.7.so.1.0
> checking if -pthread should be used... yes
> checking if compile and link flags for Python are sane... yes
> ...
> 
> 
> ----------------------
> 
> 
> System: Red Hat Enterprise Linux Server 7.2
> 
> Python: 2.7.12
> Python was built by:
> ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath 
> /usr/local/lib" --enable-unicode=ucs4 --with-cxx-main=g++
> make && make altinstall
> ln -s /usr/local/bin/python2.7 /usr/local/bin/python

Did you apply the patch for checking INCLUDEPY?
https://groups.google.com/d/msg/vim_dev/e88fjqTyfCQ/imxf0v9oAwAJ

Note that need to run "make autoconf" after patching src/configure.in.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui