On Wednesday, 6 January 2016 21:25:22 UTC+8, Marslo Jiao  wrote:
> vim source code from [email protected]:vim/vim.git (configuration log has been 
> attached):
> ===
> $ git clone [email protected]:vim/vim.git vimsrc
> $ cd vimsrc
> $ ./configure --prefix=$HOME/.marslo/myprograms/vim74 
> --enable-pythoninterp=yes 
> --with-python-config-dir=/usr/local/lib/python2.7/config 
> --enable-rubyinterp=yes --with-features=huge --disable-smack 
> --with-compiledby=marslo@china
> ...
> checking --enable-pythoninterp argument... yes
> checking for python2... /usr/bin/python2
> checking Python version... 2.7
> checking Python is 2.3 or better... yep
> checking Python's install prefix... /usr
> checking Python's execution prefix... /usr
> checking Python's configuration directory... (cached) 
> /usr/local/lib/python2.7/config
> checking if -pthread should be used... yes
> checking if compile and link flags for Python are sane... yes
> checking --enable-python3interp argument... no
> checking if -fPIE can be added for Python... yes
> ...
> configure: updating cache auto/config.cache
> configure: creating auto/config.status
> config.status: creating auto/config.mk
> config.status: creating auto/config.h
> $ make
> ...
> 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
> gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE 
> -D_FORTIFY_SOURCE=1        -I/usr/include -I/usr/include -DRUBY_VERSION=20 -o 
> objects/if_ruby.o if_ruby.c
> ...
> gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE 
> -D_FORTIFY_SOURCE=1        version.c -o objects/version.o
> link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly.
>   gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic  
> -L/usr/local/lib -Wl,--as-needed      -o vim objects/buffer.o 
> objects/blowfish.o objects/charset.o objects/crypt.o objects/crypt_zip.o 
> objects/diff.o objects/digraph.o objects/edit.o objects/eval.o 
> objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o 
> objects/ex_getln.o objects/fileio.o objects/fold.o objects/getchar.o 
> objects/hardcopy.o objects/hashtab.o  objects/if_cscope.o 
> objects/if_xcmdsrv.o objects/mark.o objects/memline.o objects/menu.o 
> objects/message.o objects/misc1.o objects/misc2.o objects/move.o 
> objects/mbyte.o objects/normal.o objects/ops.o objects/option.o 
> objects/os_unix.o objects/pathdef.o objects/popupmnu.o objects/quickfix.o 
> objects/regexp.o objects/screen.o objects/search.o objects/sha256.o 
> objects/spell.o objects/syntax.o  objects/tag.o objects/term.o objects/ui.o 
> objects/undo.o objects/version.o objects/window.o     objects/if_python.o   
> objects/if_ruby.o   objects/netbeans.o  objects/main.o objects/memfile.o      
>   -lm -ltinfo -lnsl  -lselinux  -ldl    -L/usr/local/lib/python2.7/config 
> -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   -lruby 
> -lpthread -lrt -ldl -lcrypt -lm
> objects/if_python.o: In function `StringToChars':
> /home/marslo/.vim/vimsrc/src/if_py_both.h:136: undefined reference to 
> `PyUnicodeUCS4_AsEncodedString'
> objects/if_python.o: In function `StringToLine':
> /home/marslo/.vim/vimsrc/src/if_py_both.h:3901: undefined reference to 
> `PyUnicodeUCS4_AsEncodedString'
> objects/if_python.o: In function `_ConvertFromPyObject':
> /home/marslo/.vim/vimsrc/src/if_py_both.h:5921: undefined reference to 
> `PyUnicodeUCS4_AsEncodedString'
> collect2: error: ld returned 1 exit status
> link.sh: Linking failed
> make[1]: *** [vim] Error 1
> make[1]: Leaving directory `/home/marslo/.vim/vimsrc/src'
> make: *** [first] Error 2
> 
> ===
> 
> 
> Python version is 2.7.10. I install python 2.7.10 by manually:
> ===
> $ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
> $ tar xf Python-2.7.10.tar.xz
> $ cd Python-2.7.10
> $ ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath 
> /usr/local/lib"
> $ make
> $ sudo make altinstall
> $ ln -s /usr/local/bin/python2.7 /usr/local/bin/python
> $ logout
> ===
> 
> 
> System information (auto/config.log. Has been attached)
> ===
>   $ auto/configure --prefix=/home/marslo/.marslo/myprograms/vim74 
> --enable-pythoninterp=yes 
> --with-python-config-dir=/usr/local/lib/python2.7/config 
> --enable-rubyinterp=yes --with-features=huge --disable-smack 
> --with-compiledby=marslo@appliance --srcdir=. --cache-file=auto/config.cache
> 
> ## --------- ##
> ## Platform. ##
> ## --------- ##
> 
> hostname = marslojiao
> uname -m = x86_64
> uname -r = 3.10.0-327.3.1.el7.x86_64
> uname -s = Linux
> uname -v = #1 SMP Wed Dec 9 14:09:15 UTC 2015
> 
> /usr/bin/uname -p = x86_64
> /bin/uname -X     = unknown
> 
> /bin/arch              = x86_64
> /usr/bin/arch -k       = unknown
> /usr/convex/getsysinfo = unknown
> /usr/bin/hostinfo      = unknown
> /bin/machine           = unknown
> /usr/bin/oslevel       = unknown
> /bin/universe          = unknown
> 
> PATH: /home/marslo/.marslo/myprograms/vim74/bin
> PATH: /home/marslo/.marslo/myprograms/git/bin
> PATH: /usr/local/bin
> PATH: /usr/bin
> PATH: /usr/local/sbin
> PATH: /usr/sbin
> PATH: /home/marslo/.local/bin
> PATH: /home/marslo/bin
> ...
> ...
> ===
> 
> Other information:
> ===
>  $ ldd /usr/local/bin/python
>         linux-vdso.so.1 =>  (0x00007ffed118a000)
>         libpython2.7.so.1.0 => /usr/local/lib/libpython2.7.so.1.0 
> (0x00007fa310359000)
>         libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa310130000)
>         libdl.so.2 => /lib64/libdl.so.2 (0x00007fa30ff2c000)
>         libutil.so.1 => /lib64/libutil.so.1 (0x00007fa30fd29000)
>         libm.so.6 => /lib64/libm.so.6 (0x00007fa30fa26000)
>         libc.so.6 => /lib64/libc.so.6 (0x00007fa30f665000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007fa310763000)
>  $ gcc --version
> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> ===

Okay..
when I re-install python by using:
===
$ sudo make altlinstall
$ sudo make commoninstall
===

The vim compile works!
I checked the python Makefile, it shows:
===
commoninstall:   \
        altbininstall libinstall inclinstall libainstall \
        sharedinstall oldsharedinstall altmaninstall \
===




Here the vim --version:
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  6 2016 22:01:28)
Included patches: 1-1054
Compiled by marslo@appliance
Huge version without GUI.  Features included (+) or not (-):
...
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
...
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/home/marslo/.marslo/myprograms/vim74/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE 
-D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic 
 -L/usr/local/lib -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  
-ldl    -L/usr/local/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm 
-Xlinker -export-dynamic   -lruby -lpthread -lrt -ldl -lcrypt -lm
===

:echo has('python') == 1
BUT, :python print 'abc' ==> E887: Sorry, this command is disabled, the 
Python's site module could not be loaded.

-- 
-- 
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