On 08/31/2011 12:02 AM, Bram Moolenaar wrote:
Roland Puntaier wrote:
I've tried
./configure --enable-pythoninterp --enable-python3interp
on Linux From Scratch with python 2.7 and python 3.2 both compiled with
--enable-shared.
I would have expected both to work in one instance of vim, but the same
messages came up.
E836: This Vim cannot execute :python after using :py3
E837: This Vim cannot execute :py3 after using :python
I had a look at auto/config.log and it showed that both could do without
RTLD_GLOBAL.
On the other hand auto/config.h only had
#define PY_NO_RTLD_GLOBAL 1
It turns out that an according #undef needs to be in config.h.in.
I've added it for python 3, then a vim instance worked with both :python
and :py3.
The patch is attached.
Thanks for finding this pesky little problem! I'll include it soon.
after trying with LFS I've tried with ArchLinux, which compiles python 3
and python 2 with --enable-shared.
Doing so I've found another little problem:
Archlinux VIM also enables perl and then the python[3] configure test
for RTLD_GLOBAL does not compile,
because it doesn't find the symbols in libdl (dlopen, dlsym, ... ).
The solution:
-ldl needs to go before the other LDFLAGS.
The patch is attached.
Roland
--
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
*** configure.in 2011-08-31 08:24:58.821189763 +0200
--- /home/roland/src/vim/src/configure.in 2011-08-30 21:47:14.014551690
+0200
***************
*** 1161,1167 ****
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON_CFLAGS"
ldflags_save=$LDFLAGS
! LDFLAGS="-ldl $LDFLAGS"
AC_RUN_IFELSE([
#include <dlfcn.h>
/* If this program fails, then RTLD_GLOBAL is needed.
--- 1161,1167 ----
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON_CFLAGS"
ldflags_save=$LDFLAGS
! LDFLAGS="$LDFLAGS -ldl"
AC_RUN_IFELSE([
#include <dlfcn.h>
/* If this program fails, then RTLD_GLOBAL is needed.
***************
*** 1205,1211 ****
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
ldflags_save=$LDFLAGS
! LDFLAGS="-ldl $LDFLAGS"
AC_RUN_IFELSE([
#include <dlfcn.h>
#include <wchar.h>
--- 1205,1211 ----
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
ldflags_save=$LDFLAGS
! LDFLAGS="$LDFLAGS -ldl"
AC_RUN_IFELSE([
#include <dlfcn.h>
#include <wchar.h>