|
Karsten Hopp |
25f6c2 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
25f6c2 |
Subject: Patch 7.3.062
|
|
Karsten Hopp |
25f6c2 |
Fcc: outbox
|
|
Karsten Hopp |
25f6c2 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
25f6c2 |
Mime-Version: 1.0
|
|
Karsten Hopp |
25f6c2 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
25f6c2 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
25f6c2 |
------------
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
Patch 7.3.062
|
|
Karsten Hopp |
25f6c2 |
Problem: Python doesn't work properly when installed in another directory
|
|
Karsten Hopp |
25f6c2 |
than expected.
|
|
Karsten Hopp |
25f6c2 |
Solution: Figure out home directory in configure and use Py_SetPythonHome()
|
|
Karsten Hopp |
25f6c2 |
at runtime. (Roland Puntaier)
|
|
Karsten Hopp |
25f6c2 |
Files: src/configure.in, src/auto/configure, src/if_python.c,
|
|
Karsten Hopp |
25f6c2 |
src/if_python3.c
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
*** ../vim-7.3.061/src/configure.in 2010-11-03 22:32:18.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
--- src/configure.in 2010-11-16 17:47:36.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 891,899 ****
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON_LIBS="${vi_cv_path_python_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}"
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! 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}"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON_SRC="if_python.c"
|
|
Karsten Hopp |
25f6c2 |
dnl For Mac OSX 10.2 config.o is included in the Python library.
|
|
Karsten Hopp |
25f6c2 |
--- 891,899 ----
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON_LIBS="${vi_cv_path_python_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! 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}\\\""
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON_SRC="if_python.c"
|
|
Karsten Hopp |
25f6c2 |
dnl For Mac OSX 10.2 config.o is included in the Python library.
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 905,911 ****
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_var_python_version}" = "1.4"; then
|
|
Karsten Hopp |
25f6c2 |
PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
dnl On FreeBSD linking with "-pthread" is required to use threads.
|
|
Karsten Hopp |
25f6c2 |
dnl _THREAD_SAFE must be used for compiling then.
|
|
Karsten Hopp |
25f6c2 |
--- 905,911 ----
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_var_python_version}" = "1.4"; then
|
|
Karsten Hopp |
25f6c2 |
PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
dnl On FreeBSD linking with "-pthread" is required to use threads.
|
|
Karsten Hopp |
25f6c2 |
dnl _THREAD_SAFE must be used for compiling then.
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 1063,1071 ****
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}"
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_SRC="if_python3.c"
|
|
Karsten Hopp |
25f6c2 |
dnl For Mac OSX 10.2 config.o is included in the Python library.
|
|
Karsten Hopp |
25f6c2 |
--- 1063,1071 ----
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_SRC="if_python3.c"
|
|
Karsten Hopp |
25f6c2 |
dnl For Mac OSX 10.2 config.o is included in the Python library.
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 1143,1151 ****
|
|
Karsten Hopp |
25f6c2 |
if test "$python_ok" = yes && test "$python3_ok" = yes; then
|
|
Karsten Hopp |
25f6c2 |
AC_DEFINE(DYNAMIC_PYTHON)
|
|
Karsten Hopp |
25f6c2 |
AC_DEFINE(DYNAMIC_PYTHON3)
|
|
Karsten Hopp |
25f6c2 |
! AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL)
|
|
Karsten Hopp |
25f6c2 |
cflags_save=$CFLAGS
|
|
Karsten Hopp |
25f6c2 |
! CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
|
|
Karsten Hopp |
25f6c2 |
ldflags_save=$LDFLAGS
|
|
Karsten Hopp |
25f6c2 |
LDFLAGS="$LDFLAGS -ldl"
|
|
Karsten Hopp |
25f6c2 |
AC_RUN_IFELSE([
|
|
Karsten Hopp |
25f6c2 |
--- 1143,1151 ----
|
|
Karsten Hopp |
25f6c2 |
if test "$python_ok" = yes && test "$python3_ok" = yes; then
|
|
Karsten Hopp |
25f6c2 |
AC_DEFINE(DYNAMIC_PYTHON)
|
|
Karsten Hopp |
25f6c2 |
AC_DEFINE(DYNAMIC_PYTHON3)
|
|
Karsten Hopp |
25f6c2 |
! AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python)
|
|
Karsten Hopp |
25f6c2 |
cflags_save=$CFLAGS
|
|
Karsten Hopp |
25f6c2 |
! CFLAGS="$CFLAGS $PYTHON_CFLAGS"
|
|
Karsten Hopp |
25f6c2 |
ldflags_save=$LDFLAGS
|
|
Karsten Hopp |
25f6c2 |
LDFLAGS="$LDFLAGS -ldl"
|
|
Karsten Hopp |
25f6c2 |
AC_RUN_IFELSE([
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 1156,1170 ****
|
|
Karsten Hopp |
25f6c2 |
* Only the first pyhton version used will be switched on.
|
|
Karsten Hopp |
25f6c2 |
*/
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! int no_rtl_global_needed_for(char *python_instsoname)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int needed = 0;
|
|
Karsten Hopp |
25f6c2 |
void* pylib = dlopen(python_instsoname, RTLD_LAZY);
|
|
Karsten Hopp |
25f6c2 |
if (pylib != 0)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
void (*init)(void) = dlsym(pylib, "Py_Initialize");
|
|
Karsten Hopp |
25f6c2 |
int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
|
|
Karsten Hopp |
25f6c2 |
void (*final)(void) = dlsym(pylib, "Py_Finalize");
|
|
Karsten Hopp |
25f6c2 |
(*init)();
|
|
Karsten Hopp |
25f6c2 |
needed = (*simple)("import termios") == -1;
|
|
Karsten Hopp |
25f6c2 |
(*final)();
|
|
Karsten Hopp |
25f6c2 |
--- 1156,1172 ----
|
|
Karsten Hopp |
25f6c2 |
* Only the first pyhton version used will be switched on.
|
|
Karsten Hopp |
25f6c2 |
*/
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int needed = 0;
|
|
Karsten Hopp |
25f6c2 |
void* pylib = dlopen(python_instsoname, RTLD_LAZY);
|
|
Karsten Hopp |
25f6c2 |
if (pylib != 0)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
+ void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
|
|
Karsten Hopp |
25f6c2 |
void (*init)(void) = dlsym(pylib, "Py_Initialize");
|
|
Karsten Hopp |
25f6c2 |
int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
|
|
Karsten Hopp |
25f6c2 |
void (*final)(void) = dlsym(pylib, "Py_Finalize");
|
|
Karsten Hopp |
25f6c2 |
+ (*pfx)(prefix);
|
|
Karsten Hopp |
25f6c2 |
(*init)();
|
|
Karsten Hopp |
25f6c2 |
needed = (*simple)("import termios") == -1;
|
|
Karsten Hopp |
25f6c2 |
(*final)();
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 1176,1188 ****
|
|
Karsten Hopp |
25f6c2 |
int main(int argc, char** argv)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int not_needed = 0;
|
|
Karsten Hopp |
25f6c2 |
! if (no_rtl_global_needed_for("libpython2.7.so.1.0") && no_rtl_global_needed_for("libpython3.1.so.1.0"))
|
|
Karsten Hopp |
25f6c2 |
not_needed = 1;
|
|
Karsten Hopp |
25f6c2 |
return !not_needed;
|
|
Karsten Hopp |
25f6c2 |
}],
|
|
Karsten Hopp |
25f6c2 |
[AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
|
|
Karsten Hopp |
25f6c2 |
CFLAGS=$cflags_save
|
|
Karsten Hopp |
25f6c2 |
LDFLAGS=$ldflags_save
|
|
Karsten Hopp |
25f6c2 |
PYTHON_SRC="if_python.c"
|
|
Karsten Hopp |
25f6c2 |
PYTHON_OBJ="objects/if_python.o"
|
|
Karsten Hopp |
25f6c2 |
PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
|
|
Karsten Hopp |
25f6c2 |
--- 1178,1237 ----
|
|
Karsten Hopp |
25f6c2 |
int main(int argc, char** argv)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int not_needed = 0;
|
|
Karsten Hopp |
25f6c2 |
! if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}"))
|
|
Karsten Hopp |
25f6c2 |
not_needed = 1;
|
|
Karsten Hopp |
25f6c2 |
return !not_needed;
|
|
Karsten Hopp |
25f6c2 |
}],
|
|
Karsten Hopp |
25f6c2 |
[AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
CFLAGS=$cflags_save
|
|
Karsten Hopp |
25f6c2 |
LDFLAGS=$ldflags_save
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3)
|
|
Karsten Hopp |
25f6c2 |
+ cflags_save=$CFLAGS
|
|
Karsten Hopp |
25f6c2 |
+ CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
|
|
Karsten Hopp |
25f6c2 |
+ ldflags_save=$LDFLAGS
|
|
Karsten Hopp |
25f6c2 |
+ LDFLAGS="$LDFLAGS -ldl"
|
|
Karsten Hopp |
25f6c2 |
+ AC_RUN_IFELSE([
|
|
Karsten Hopp |
25f6c2 |
+ #include <dlfcn.h>
|
|
Karsten Hopp |
25f6c2 |
+ #include <wchar.h>
|
|
Karsten Hopp |
25f6c2 |
+ /* If this program fails, then RTLD_GLOBAL is needed.
|
|
Karsten Hopp |
25f6c2 |
+ * RTLD_GLOBAL will be used and then it is not possible to
|
|
Karsten Hopp |
25f6c2 |
+ * have both python versions enabled in the same vim instance.
|
|
Karsten Hopp |
25f6c2 |
+ * Only the first pyhton version used will be switched on.
|
|
Karsten Hopp |
25f6c2 |
+ */
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
|
|
Karsten Hopp |
25f6c2 |
+ {
|
|
Karsten Hopp |
25f6c2 |
+ int needed = 0;
|
|
Karsten Hopp |
25f6c2 |
+ void* pylib = dlopen(python_instsoname, RTLD_LAZY);
|
|
Karsten Hopp |
25f6c2 |
+ if (pylib != 0)
|
|
Karsten Hopp |
25f6c2 |
+ {
|
|
Karsten Hopp |
25f6c2 |
+ void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
|
|
Karsten Hopp |
25f6c2 |
+ void (*init)(void) = dlsym(pylib, "Py_Initialize");
|
|
Karsten Hopp |
25f6c2 |
+ int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
|
|
Karsten Hopp |
25f6c2 |
+ void (*final)(void) = dlsym(pylib, "Py_Finalize");
|
|
Karsten Hopp |
25f6c2 |
+ (*pfx)(prefix);
|
|
Karsten Hopp |
25f6c2 |
+ (*init)();
|
|
Karsten Hopp |
25f6c2 |
+ needed = (*simple)("import termios") == -1;
|
|
Karsten Hopp |
25f6c2 |
+ (*final)();
|
|
Karsten Hopp |
25f6c2 |
+ dlclose(pylib);
|
|
Karsten Hopp |
25f6c2 |
+ }
|
|
Karsten Hopp |
25f6c2 |
+ return !needed;
|
|
Karsten Hopp |
25f6c2 |
+ }
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ int main(int argc, char** argv)
|
|
Karsten Hopp |
25f6c2 |
+ {
|
|
Karsten Hopp |
25f6c2 |
+ int not_needed = 0;
|
|
Karsten Hopp |
25f6c2 |
+ if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}"))
|
|
Karsten Hopp |
25f6c2 |
+ not_needed = 1;
|
|
Karsten Hopp |
25f6c2 |
+ return !not_needed;
|
|
Karsten Hopp |
25f6c2 |
+ }],
|
|
Karsten Hopp |
25f6c2 |
+ [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ CFLAGS=$cflags_save
|
|
Karsten Hopp |
25f6c2 |
+ LDFLAGS=$ldflags_save
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
PYTHON_SRC="if_python.c"
|
|
Karsten Hopp |
25f6c2 |
PYTHON_OBJ="objects/if_python.o"
|
|
Karsten Hopp |
25f6c2 |
PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
|
|
Karsten Hopp |
25f6c2 |
*** ../vim-7.3.061/src/auto/configure 2010-11-03 22:32:18.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
--- src/auto/configure 2010-11-16 17:47:42.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 5326,5334 ****
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON_LIBS="${vi_cv_path_python_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}"
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! 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}"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON_SRC="if_python.c"
|
|
Karsten Hopp |
25f6c2 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
25f6c2 |
--- 5326,5334 ----
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON_LIBS="${vi_cv_path_python_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! 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}\\\""
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON_SRC="if_python.c"
|
|
Karsten Hopp |
25f6c2 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 5339,5345 ****
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_var_python_version}" = "1.4"; then
|
|
Karsten Hopp |
25f6c2 |
PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5
|
|
Karsten Hopp |
25f6c2 |
$as_echo_n "checking if -pthread should be used... " >&6; }
|
|
Karsten Hopp |
25f6c2 |
--- 5339,5345 ----
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_var_python_version}" = "1.4"; then
|
|
Karsten Hopp |
25f6c2 |
PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
! PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5
|
|
Karsten Hopp |
25f6c2 |
$as_echo_n "checking if -pthread should be used... " >&6; }
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 5601,5609 ****
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}"
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}"
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_SRC="if_python3.c"
|
|
Karsten Hopp |
25f6c2 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
25f6c2 |
--- 5601,5609 ----
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
|
|
Karsten Hopp |
25f6c2 |
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
|
|
Karsten Hopp |
25f6c2 |
else
|
|
Karsten Hopp |
25f6c2 |
! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
PYTHON3_SRC="if_python3.c"
|
|
Karsten Hopp |
25f6c2 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 5708,5717 ****
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
$as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL" >&5
|
|
Karsten Hopp |
25f6c2 |
! $as_echo_n "checking whether we can do without RTLD_GLOBAL... " >&6; }
|
|
Karsten Hopp |
25f6c2 |
cflags_save=$CFLAGS
|
|
Karsten Hopp |
25f6c2 |
! CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
|
|
Karsten Hopp |
25f6c2 |
ldflags_save=$LDFLAGS
|
|
Karsten Hopp |
25f6c2 |
LDFLAGS="$LDFLAGS -ldl"
|
|
Karsten Hopp |
25f6c2 |
if test "$cross_compiling" = yes; then :
|
|
Karsten Hopp |
25f6c2 |
--- 5708,5717 ----
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
$as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python" >&5
|
|
Karsten Hopp |
25f6c2 |
! $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python... " >&6; }
|
|
Karsten Hopp |
25f6c2 |
cflags_save=$CFLAGS
|
|
Karsten Hopp |
25f6c2 |
! CFLAGS="$CFLAGS $PYTHON_CFLAGS"
|
|
Karsten Hopp |
25f6c2 |
ldflags_save=$LDFLAGS
|
|
Karsten Hopp |
25f6c2 |
LDFLAGS="$LDFLAGS -ldl"
|
|
Karsten Hopp |
25f6c2 |
if test "$cross_compiling" = yes; then :
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 5730,5744 ****
|
|
Karsten Hopp |
25f6c2 |
* Only the first pyhton version used will be switched on.
|
|
Karsten Hopp |
25f6c2 |
*/
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! int no_rtl_global_needed_for(char *python_instsoname)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int needed = 0;
|
|
Karsten Hopp |
25f6c2 |
void* pylib = dlopen(python_instsoname, RTLD_LAZY);
|
|
Karsten Hopp |
25f6c2 |
if (pylib != 0)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
void (*init)(void) = dlsym(pylib, "Py_Initialize");
|
|
Karsten Hopp |
25f6c2 |
int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
|
|
Karsten Hopp |
25f6c2 |
void (*final)(void) = dlsym(pylib, "Py_Finalize");
|
|
Karsten Hopp |
25f6c2 |
(*init)();
|
|
Karsten Hopp |
25f6c2 |
needed = (*simple)("import termios") == -1;
|
|
Karsten Hopp |
25f6c2 |
(*final)();
|
|
Karsten Hopp |
25f6c2 |
--- 5730,5746 ----
|
|
Karsten Hopp |
25f6c2 |
* Only the first pyhton version used will be switched on.
|
|
Karsten Hopp |
25f6c2 |
*/
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int needed = 0;
|
|
Karsten Hopp |
25f6c2 |
void* pylib = dlopen(python_instsoname, RTLD_LAZY);
|
|
Karsten Hopp |
25f6c2 |
if (pylib != 0)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
+ void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
|
|
Karsten Hopp |
25f6c2 |
void (*init)(void) = dlsym(pylib, "Py_Initialize");
|
|
Karsten Hopp |
25f6c2 |
int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
|
|
Karsten Hopp |
25f6c2 |
void (*final)(void) = dlsym(pylib, "Py_Finalize");
|
|
Karsten Hopp |
25f6c2 |
+ (*pfx)(prefix);
|
|
Karsten Hopp |
25f6c2 |
(*init)();
|
|
Karsten Hopp |
25f6c2 |
needed = (*simple)("import termios") == -1;
|
|
Karsten Hopp |
25f6c2 |
(*final)();
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 5750,5756 ****
|
|
Karsten Hopp |
25f6c2 |
int main(int argc, char** argv)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int not_needed = 0;
|
|
Karsten Hopp |
25f6c2 |
! if (no_rtl_global_needed_for("libpython2.7.so.1.0") && no_rtl_global_needed_for("libpython3.1.so.1.0"))
|
|
Karsten Hopp |
25f6c2 |
not_needed = 1;
|
|
Karsten Hopp |
25f6c2 |
return !not_needed;
|
|
Karsten Hopp |
25f6c2 |
}
|
|
Karsten Hopp |
25f6c2 |
--- 5752,5758 ----
|
|
Karsten Hopp |
25f6c2 |
int main(int argc, char** argv)
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int not_needed = 0;
|
|
Karsten Hopp |
25f6c2 |
! if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}"))
|
|
Karsten Hopp |
25f6c2 |
not_needed = 1;
|
|
Karsten Hopp |
25f6c2 |
return !not_needed;
|
|
Karsten Hopp |
25f6c2 |
}
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 5767,5774 ****
|
|
Karsten Hopp |
25f6c2 |
--- 5769,5844 ----
|
|
Karsten Hopp |
25f6c2 |
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
|
Karsten Hopp |
25f6c2 |
fi
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
CFLAGS=$cflags_save
|
|
Karsten Hopp |
25f6c2 |
LDFLAGS=$ldflags_save
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python3" >&5
|
|
Karsten Hopp |
25f6c2 |
+ $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python3... " >&6; }
|
|
Karsten Hopp |
25f6c2 |
+ cflags_save=$CFLAGS
|
|
Karsten Hopp |
25f6c2 |
+ CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
|
|
Karsten Hopp |
25f6c2 |
+ ldflags_save=$LDFLAGS
|
|
Karsten Hopp |
25f6c2 |
+ LDFLAGS="$LDFLAGS -ldl"
|
|
Karsten Hopp |
25f6c2 |
+ if test "$cross_compiling" = yes; then :
|
|
Karsten Hopp |
25f6c2 |
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
|
Karsten Hopp |
25f6c2 |
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
|
Karsten Hopp |
25f6c2 |
+ as_fn_error "cannot run test program while cross compiling
|
|
Karsten Hopp |
25f6c2 |
+ See \`config.log' for more details." "$LINENO" 5; }
|
|
Karsten Hopp |
25f6c2 |
+ else
|
|
Karsten Hopp |
25f6c2 |
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
Karsten Hopp |
25f6c2 |
+ /* end confdefs.h. */
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ #include <dlfcn.h>
|
|
Karsten Hopp |
25f6c2 |
+ #include <wchar.h>
|
|
Karsten Hopp |
25f6c2 |
+ /* If this program fails, then RTLD_GLOBAL is needed.
|
|
Karsten Hopp |
25f6c2 |
+ * RTLD_GLOBAL will be used and then it is not possible to
|
|
Karsten Hopp |
25f6c2 |
+ * have both python versions enabled in the same vim instance.
|
|
Karsten Hopp |
25f6c2 |
+ * Only the first pyhton version used will be switched on.
|
|
Karsten Hopp |
25f6c2 |
+ */
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
|
|
Karsten Hopp |
25f6c2 |
+ {
|
|
Karsten Hopp |
25f6c2 |
+ int needed = 0;
|
|
Karsten Hopp |
25f6c2 |
+ void* pylib = dlopen(python_instsoname, RTLD_LAZY);
|
|
Karsten Hopp |
25f6c2 |
+ if (pylib != 0)
|
|
Karsten Hopp |
25f6c2 |
+ {
|
|
Karsten Hopp |
25f6c2 |
+ void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
|
|
Karsten Hopp |
25f6c2 |
+ void (*init)(void) = dlsym(pylib, "Py_Initialize");
|
|
Karsten Hopp |
25f6c2 |
+ int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
|
|
Karsten Hopp |
25f6c2 |
+ void (*final)(void) = dlsym(pylib, "Py_Finalize");
|
|
Karsten Hopp |
25f6c2 |
+ (*pfx)(prefix);
|
|
Karsten Hopp |
25f6c2 |
+ (*init)();
|
|
Karsten Hopp |
25f6c2 |
+ needed = (*simple)("import termios") == -1;
|
|
Karsten Hopp |
25f6c2 |
+ (*final)();
|
|
Karsten Hopp |
25f6c2 |
+ dlclose(pylib);
|
|
Karsten Hopp |
25f6c2 |
+ }
|
|
Karsten Hopp |
25f6c2 |
+ return !needed;
|
|
Karsten Hopp |
25f6c2 |
+ }
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ int main(int argc, char** argv)
|
|
Karsten Hopp |
25f6c2 |
+ {
|
|
Karsten Hopp |
25f6c2 |
+ int not_needed = 0;
|
|
Karsten Hopp |
25f6c2 |
+ if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}"))
|
|
Karsten Hopp |
25f6c2 |
+ not_needed = 1;
|
|
Karsten Hopp |
25f6c2 |
+ return !not_needed;
|
|
Karsten Hopp |
25f6c2 |
+ }
|
|
Karsten Hopp |
25f6c2 |
+ _ACEOF
|
|
Karsten Hopp |
25f6c2 |
+ if ac_fn_c_try_run "$LINENO"; then :
|
|
Karsten Hopp |
25f6c2 |
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
|
Karsten Hopp |
25f6c2 |
+ $as_echo "yes" >&6; };$as_echo "#define PY3_NO_RTLD_GLOBAL 1" >>confdefs.h
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ else
|
|
Karsten Hopp |
25f6c2 |
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
|
Karsten Hopp |
25f6c2 |
+ $as_echo "no" >&6; }
|
|
Karsten Hopp |
25f6c2 |
+ fi
|
|
Karsten Hopp |
25f6c2 |
+ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
|
Karsten Hopp |
25f6c2 |
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
|
|
Karsten Hopp |
25f6c2 |
+ fi
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ CFLAGS=$cflags_save
|
|
Karsten Hopp |
25f6c2 |
+ LDFLAGS=$ldflags_save
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
PYTHON_SRC="if_python.c"
|
|
Karsten Hopp |
25f6c2 |
PYTHON_OBJ="objects/if_python.o"
|
|
Karsten Hopp |
25f6c2 |
PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
|
|
Karsten Hopp |
25f6c2 |
*** ../vim-7.3.061/src/if_python.c 2010-10-23 14:02:48.000000000 +0200
|
|
Karsten Hopp |
25f6c2 |
--- src/if_python.c 2010-11-16 17:07:00.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 102,108 ****
|
|
Karsten Hopp |
25f6c2 |
# include <dlfcn.h>
|
|
Karsten Hopp |
25f6c2 |
# define FARPROC void*
|
|
Karsten Hopp |
25f6c2 |
# define HINSTANCE void*
|
|
Karsten Hopp |
25f6c2 |
! # ifdef PY_NO_RTLD_GLOBAL
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY)
|
|
Karsten Hopp |
25f6c2 |
# else
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
|
|
Karsten Hopp |
25f6c2 |
--- 102,108 ----
|
|
Karsten Hopp |
25f6c2 |
# include <dlfcn.h>
|
|
Karsten Hopp |
25f6c2 |
# define FARPROC void*
|
|
Karsten Hopp |
25f6c2 |
# define HINSTANCE void*
|
|
Karsten Hopp |
25f6c2 |
! # if defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY)
|
|
Karsten Hopp |
25f6c2 |
# else
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 168,173 ****
|
|
Karsten Hopp |
25f6c2 |
--- 168,174 ----
|
|
Karsten Hopp |
25f6c2 |
# define Py_BuildValue dll_Py_BuildValue
|
|
Karsten Hopp |
25f6c2 |
# define Py_FindMethod dll_Py_FindMethod
|
|
Karsten Hopp |
25f6c2 |
# define Py_InitModule4 dll_Py_InitModule4
|
|
Karsten Hopp |
25f6c2 |
+ # define Py_SetPythonHome dll_Py_SetPythonHome
|
|
Karsten Hopp |
25f6c2 |
# define Py_Initialize dll_Py_Initialize
|
|
Karsten Hopp |
25f6c2 |
# define Py_Finalize dll_Py_Finalize
|
|
Karsten Hopp |
25f6c2 |
# define Py_IsInitialized dll_Py_IsInitialized
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 226,231 ****
|
|
Karsten Hopp |
25f6c2 |
--- 227,233 ----
|
|
Karsten Hopp |
25f6c2 |
static PyObject*(*dll_Py_BuildValue)(char *, ...);
|
|
Karsten Hopp |
25f6c2 |
static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *);
|
|
Karsten Hopp |
25f6c2 |
static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int);
|
|
Karsten Hopp |
25f6c2 |
+ static void(*dll_Py_SetPythonHome)(char *home);
|
|
Karsten Hopp |
25f6c2 |
static void(*dll_Py_Initialize)(void);
|
|
Karsten Hopp |
25f6c2 |
static void(*dll_Py_Finalize)(void);
|
|
Karsten Hopp |
25f6c2 |
static int(*dll_Py_IsInitialized)(void);
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 310,315 ****
|
|
Karsten Hopp |
25f6c2 |
--- 312,318 ----
|
|
Karsten Hopp |
25f6c2 |
# else
|
|
Karsten Hopp |
25f6c2 |
{"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
|
|
Karsten Hopp |
25f6c2 |
# endif
|
|
Karsten Hopp |
25f6c2 |
+ {"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome},
|
|
Karsten Hopp |
25f6c2 |
{"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
|
|
Karsten Hopp |
25f6c2 |
{"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize},
|
|
Karsten Hopp |
25f6c2 |
{"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized},
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 349,355 ****
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int i;
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! #if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON3)
|
|
Karsten Hopp |
25f6c2 |
/* Can't have Python and Python3 loaded at the same time.
|
|
Karsten Hopp |
25f6c2 |
* It cause a crash, because RTLD_GLOBAL is needed for
|
|
Karsten Hopp |
25f6c2 |
* standard C extension libraries of one or both python versions. */
|
|
Karsten Hopp |
25f6c2 |
--- 352,358 ----
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
int i;
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! #if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON3)
|
|
Karsten Hopp |
25f6c2 |
/* Can't have Python and Python3 loaded at the same time.
|
|
Karsten Hopp |
25f6c2 |
* It cause a crash, because RTLD_GLOBAL is needed for
|
|
Karsten Hopp |
25f6c2 |
* standard C extension libraries of one or both python versions. */
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 543,548 ****
|
|
Karsten Hopp |
25f6c2 |
--- 546,555 ----
|
|
Karsten Hopp |
25f6c2 |
}
|
|
Karsten Hopp |
25f6c2 |
#endif
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
+ #ifdef PYTHON_HOME
|
|
Karsten Hopp |
25f6c2 |
+ Py_SetPythonHome(PYTHON_HOME);
|
|
Karsten Hopp |
25f6c2 |
+ #endif
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
init_structs();
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
#if !defined(MACOS) || defined(MACOS_X_UNIX)
|
|
Karsten Hopp |
25f6c2 |
*** ../vim-7.3.061/src/if_python3.c 2010-10-23 14:02:48.000000000 +0200
|
|
Karsten Hopp |
25f6c2 |
--- src/if_python3.c 2010-11-16 17:07:26.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 80,86 ****
|
|
Karsten Hopp |
25f6c2 |
# include <dlfcn.h>
|
|
Karsten Hopp |
25f6c2 |
# define FARPROC void*
|
|
Karsten Hopp |
25f6c2 |
# define HINSTANCE void*
|
|
Karsten Hopp |
25f6c2 |
! # ifdef PY_NO_RTLD_GLOBAL
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY)
|
|
Karsten Hopp |
25f6c2 |
# else
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
|
|
Karsten Hopp |
25f6c2 |
--- 80,86 ----
|
|
Karsten Hopp |
25f6c2 |
# include <dlfcn.h>
|
|
Karsten Hopp |
25f6c2 |
# define FARPROC void*
|
|
Karsten Hopp |
25f6c2 |
# define HINSTANCE void*
|
|
Karsten Hopp |
25f6c2 |
! # if defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY)
|
|
Karsten Hopp |
25f6c2 |
# else
|
|
Karsten Hopp |
25f6c2 |
# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 132,137 ****
|
|
Karsten Hopp |
25f6c2 |
--- 132,138 ----
|
|
Karsten Hopp |
25f6c2 |
# define PyType_Ready py3_PyType_Ready
|
|
Karsten Hopp |
25f6c2 |
#undef Py_BuildValue
|
|
Karsten Hopp |
25f6c2 |
# define Py_BuildValue py3_Py_BuildValue
|
|
Karsten Hopp |
25f6c2 |
+ # define Py_SetPythonHome py3_Py_SetPythonHome
|
|
Karsten Hopp |
25f6c2 |
# define Py_Initialize py3_Py_Initialize
|
|
Karsten Hopp |
25f6c2 |
# define Py_Finalize py3_Py_Finalize
|
|
Karsten Hopp |
25f6c2 |
# define Py_IsInitialized py3_Py_IsInitialized
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 170,175 ****
|
|
Karsten Hopp |
25f6c2 |
--- 171,177 ----
|
|
Karsten Hopp |
25f6c2 |
* Pointers for dynamic link
|
|
Karsten Hopp |
25f6c2 |
*/
|
|
Karsten Hopp |
25f6c2 |
static int (*py3_PySys_SetArgv)(int, wchar_t **);
|
|
Karsten Hopp |
25f6c2 |
+ static void (*py3_Py_SetPythonHome)(wchar_t *home);
|
|
Karsten Hopp |
25f6c2 |
static void (*py3_Py_Initialize)(void);
|
|
Karsten Hopp |
25f6c2 |
static PyObject* (*py3_PyList_New)(Py_ssize_t size);
|
|
Karsten Hopp |
25f6c2 |
static PyGILState_STATE (*py3_PyGILState_Ensure)(void);
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 254,259 ****
|
|
Karsten Hopp |
25f6c2 |
--- 256,262 ----
|
|
Karsten Hopp |
25f6c2 |
} py3_funcname_table[] =
|
|
Karsten Hopp |
25f6c2 |
{
|
|
Karsten Hopp |
25f6c2 |
{"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
|
|
Karsten Hopp |
25f6c2 |
+ {"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
|
|
Karsten Hopp |
25f6c2 |
{"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
|
|
Karsten Hopp |
25f6c2 |
{"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
|
|
Karsten Hopp |
25f6c2 |
{"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 336,342 ****
|
|
Karsten Hopp |
25f6c2 |
int i;
|
|
Karsten Hopp |
25f6c2 |
void *ucs_from_string, *ucs_from_string_and_size;
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! # if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON)
|
|
Karsten Hopp |
25f6c2 |
/* Can't have Python and Python3 loaded at the same time.
|
|
Karsten Hopp |
25f6c2 |
* It cause a crash, because RTLD_GLOBAL is needed for
|
|
Karsten Hopp |
25f6c2 |
* standard C extension libraries of one or both python versions. */
|
|
Karsten Hopp |
25f6c2 |
--- 339,345 ----
|
|
Karsten Hopp |
25f6c2 |
int i;
|
|
Karsten Hopp |
25f6c2 |
void *ucs_from_string, *ucs_from_string_and_size;
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
! # if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON)
|
|
Karsten Hopp |
25f6c2 |
/* Can't have Python and Python3 loaded at the same time.
|
|
Karsten Hopp |
25f6c2 |
* It cause a crash, because RTLD_GLOBAL is needed for
|
|
Karsten Hopp |
25f6c2 |
* standard C extension libraries of one or both python versions. */
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 539,544 ****
|
|
Karsten Hopp |
25f6c2 |
--- 542,552 ----
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
init_structs();
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
+ #ifdef PYTHON3_HOME
|
|
Karsten Hopp |
25f6c2 |
+ Py_SetPythonHome(PYTHON3_HOME);
|
|
Karsten Hopp |
25f6c2 |
+ #endif
|
|
Karsten Hopp |
25f6c2 |
+
|
|
Karsten Hopp |
25f6c2 |
/* initialise threads */
|
|
Karsten Hopp |
25f6c2 |
PyEval_InitThreads();
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
*** ../vim-7.3.061/src/version.c 2010-11-16 16:25:46.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
--- src/version.c 2010-11-16 17:12:40.000000000 +0100
|
|
Karsten Hopp |
25f6c2 |
***************
|
|
Karsten Hopp |
25f6c2 |
*** 716,717 ****
|
|
Karsten Hopp |
25f6c2 |
--- 716,719 ----
|
|
Karsten Hopp |
25f6c2 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
25f6c2 |
+ /**/
|
|
Karsten Hopp |
25f6c2 |
+ 62,
|
|
Karsten Hopp |
25f6c2 |
/**/
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
--
|
|
Karsten Hopp |
25f6c2 |
ARTHUR: CHARGE!
|
|
Karsten Hopp |
25f6c2 |
[The mighty ARMY charges. Thundering noise of feet. Clatter of coconuts.
|
|
Karsten Hopp |
25f6c2 |
Shouts etc. Suddenly there is a wail of a siren and a couple of police
|
|
Karsten Hopp |
25f6c2 |
cars roar round in front of the charging ARMY and the POLICE leap out and
|
|
Karsten Hopp |
25f6c2 |
stop them. TWO POLICEMAN and the HISTORIAN'S WIFE. Black Marias skid up
|
|
Karsten Hopp |
25f6c2 |
behind them.]
|
|
Karsten Hopp |
25f6c2 |
HISTORIAN'S WIFE: They're the ones, I'm sure.
|
|
Karsten Hopp |
25f6c2 |
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
|
|
Karsten Hopp |
25f6c2 |
|
|
Karsten Hopp |
25f6c2 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
25f6c2 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
25f6c2 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
25f6c2 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|