home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.062 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  23.1 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.062
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.062
  11. Problem:    Python doesn't work properly when installed in another directory
  12.         than expected.
  13. Solution:   Figure out home directory in configure and use Py_SetPythonHome()
  14.         at runtime. (Roland Puntaier)
  15. Files:        src/configure.in, src/auto/configure, src/if_python.c,
  16.         src/if_python3.c
  17.  
  18.  
  19. *** ../vim-7.3.061/src/configure.in    2010-11-03 22:32:18.000000000 +0100
  20. --- src/configure.in    2010-11-16 17:47:36.000000000 +0100
  21. ***************
  22. *** 891,899 ****
  23.   
  24.       PYTHON_LIBS="${vi_cv_path_python_plibs}"
  25.       if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
  26. !       PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}"
  27.       else
  28. !       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}"
  29.       fi
  30.       PYTHON_SRC="if_python.c"
  31.       dnl For Mac OSX 10.2 config.o is included in the Python library.
  32. --- 891,899 ----
  33.   
  34.       PYTHON_LIBS="${vi_cv_path_python_plibs}"
  35.       if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
  36. !       PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
  37.       else
  38. !       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}\\\""
  39.       fi
  40.       PYTHON_SRC="if_python.c"
  41.       dnl For Mac OSX 10.2 config.o is included in the Python library.
  42. ***************
  43. *** 905,911 ****
  44.       if test "${vi_cv_var_python_version}" = "1.4"; then
  45.          PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
  46.       fi
  47. !     PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  48.   
  49.       dnl On FreeBSD linking with "-pthread" is required to use threads.
  50.       dnl _THREAD_SAFE must be used for compiling then.
  51. --- 905,911 ----
  52.       if test "${vi_cv_var_python_version}" = "1.4"; then
  53.          PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
  54.       fi
  55. !     PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  56.   
  57.       dnl On FreeBSD linking with "-pthread" is required to use threads.
  58.       dnl _THREAD_SAFE must be used for compiling then.
  59. ***************
  60. *** 1063,1071 ****
  61.   
  62.         PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
  63.         if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
  64. !         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}"
  65.         else
  66. !         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}"
  67.         fi
  68.         PYTHON3_SRC="if_python3.c"
  69.         dnl For Mac OSX 10.2 config.o is included in the Python library.
  70. --- 1063,1071 ----
  71.   
  72.         PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
  73.         if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
  74. !         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
  75.         else
  76. !         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}\\\""
  77.         fi
  78.         PYTHON3_SRC="if_python3.c"
  79.         dnl For Mac OSX 10.2 config.o is included in the Python library.
  80. ***************
  81. *** 1143,1151 ****
  82.   if test "$python_ok" = yes && test "$python3_ok" = yes; then
  83.     AC_DEFINE(DYNAMIC_PYTHON)
  84.     AC_DEFINE(DYNAMIC_PYTHON3)
  85. !   AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL)
  86.     cflags_save=$CFLAGS
  87. !   CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
  88.     ldflags_save=$LDFLAGS
  89.     LDFLAGS="$LDFLAGS -ldl"
  90.     AC_RUN_IFELSE([
  91. --- 1143,1151 ----
  92.   if test "$python_ok" = yes && test "$python3_ok" = yes; then
  93.     AC_DEFINE(DYNAMIC_PYTHON)
  94.     AC_DEFINE(DYNAMIC_PYTHON3)
  95. !   AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python)
  96.     cflags_save=$CFLAGS
  97. !   CFLAGS="$CFLAGS $PYTHON_CFLAGS"
  98.     ldflags_save=$LDFLAGS
  99.     LDFLAGS="$LDFLAGS -ldl"
  100.     AC_RUN_IFELSE([
  101. ***************
  102. *** 1156,1170 ****
  103.        * Only the first pyhton version used will be switched on.
  104.        */
  105.   
  106. !     int no_rtl_global_needed_for(char *python_instsoname)
  107.       {
  108.         int needed = 0;
  109.         void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  110.         if (pylib != 0)
  111.         {
  112.             void (*init)(void) = dlsym(pylib, "Py_Initialize");
  113.             int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  114.             void (*final)(void) = dlsym(pylib, "Py_Finalize");
  115.             (*init)();
  116.             needed = (*simple)("import termios") == -1;
  117.             (*final)();
  118. --- 1156,1172 ----
  119.        * Only the first pyhton version used will be switched on.
  120.        */
  121.   
  122. !     int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
  123.       {
  124.         int needed = 0;
  125.         void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  126.         if (pylib != 0)
  127.         {
  128. +           void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
  129.             void (*init)(void) = dlsym(pylib, "Py_Initialize");
  130.             int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  131.             void (*final)(void) = dlsym(pylib, "Py_Finalize");
  132. +           (*pfx)(prefix);
  133.             (*init)();
  134.             needed = (*simple)("import termios") == -1;
  135.             (*final)();
  136. ***************
  137. *** 1176,1188 ****
  138.       int main(int argc, char** argv)
  139.       {
  140.         int not_needed = 0;
  141. !       if (no_rtl_global_needed_for("libpython2.7.so.1.0") && no_rtl_global_needed_for("libpython3.1.so.1.0"))
  142.               not_needed = 1;
  143.         return !not_needed;
  144.       }],
  145.       [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
  146.     CFLAGS=$cflags_save
  147.     LDFLAGS=$ldflags_save
  148.     PYTHON_SRC="if_python.c"
  149.     PYTHON_OBJ="objects/if_python.o"
  150.     PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
  151. --- 1178,1237 ----
  152.       int main(int argc, char** argv)
  153.       {
  154.         int not_needed = 0;
  155. !       if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}"))
  156.               not_needed = 1;
  157.         return !not_needed;
  158.       }],
  159.       [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
  160.     CFLAGS=$cflags_save
  161.     LDFLAGS=$ldflags_save
  162. +   AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3)
  163. +   cflags_save=$CFLAGS
  164. +   CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
  165. +   ldflags_save=$LDFLAGS
  166. +   LDFLAGS="$LDFLAGS -ldl"
  167. +   AC_RUN_IFELSE([
  168. +     #include <dlfcn.h>
  169. +     #include <wchar.h>
  170. +     /* If this program fails, then RTLD_GLOBAL is needed.
  171. +      * RTLD_GLOBAL will be used and then it is not possible to
  172. +      * have both python versions enabled in the same vim instance.
  173. +      * Only the first pyhton version used will be switched on.
  174. +      */
  175. +     int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
  176. +     {
  177. +       int needed = 0;
  178. +       void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  179. +       if (pylib != 0)
  180. +       {
  181. +           void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
  182. +           void (*init)(void) = dlsym(pylib, "Py_Initialize");
  183. +           int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  184. +           void (*final)(void) = dlsym(pylib, "Py_Finalize");
  185. +           (*pfx)(prefix);
  186. +           (*init)();
  187. +           needed = (*simple)("import termios") == -1;
  188. +           (*final)();
  189. +           dlclose(pylib);
  190. +       }
  191. +       return !needed;
  192. +     }
  193. +     int main(int argc, char** argv)
  194. +     {
  195. +       int not_needed = 0;
  196. +       if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}"))
  197. +             not_needed = 1;
  198. +       return !not_needed;
  199. +     }],
  200. +     [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
  201. +   CFLAGS=$cflags_save
  202. +   LDFLAGS=$ldflags_save
  203.     PYTHON_SRC="if_python.c"
  204.     PYTHON_OBJ="objects/if_python.o"
  205.     PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
  206. *** ../vim-7.3.061/src/auto/configure    2010-11-03 22:32:18.000000000 +0100
  207. --- src/auto/configure    2010-11-16 17:47:42.000000000 +0100
  208. ***************
  209. *** 5326,5334 ****
  210.   
  211.       PYTHON_LIBS="${vi_cv_path_python_plibs}"
  212.       if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
  213. !       PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}"
  214.       else
  215. !       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}"
  216.       fi
  217.       PYTHON_SRC="if_python.c"
  218.           if test "x$MACOSX" = "xyes"; then
  219. --- 5326,5334 ----
  220.   
  221.       PYTHON_LIBS="${vi_cv_path_python_plibs}"
  222.       if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
  223. !       PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
  224.       else
  225. !       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}\\\""
  226.       fi
  227.       PYTHON_SRC="if_python.c"
  228.           if test "x$MACOSX" = "xyes"; then
  229. ***************
  230. *** 5339,5345 ****
  231.       if test "${vi_cv_var_python_version}" = "1.4"; then
  232.          PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
  233.       fi
  234. !     PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  235.   
  236.                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5
  237.   $as_echo_n "checking if -pthread should be used... " >&6; }
  238. --- 5339,5345 ----
  239.       if test "${vi_cv_var_python_version}" = "1.4"; then
  240.          PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
  241.       fi
  242. !     PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  243.   
  244.                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5
  245.   $as_echo_n "checking if -pthread should be used... " >&6; }
  246. ***************
  247. *** 5601,5609 ****
  248.   
  249.         PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
  250.         if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
  251. !         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}"
  252.         else
  253. !         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}"
  254.         fi
  255.         PYTHON3_SRC="if_python3.c"
  256.               if test "x$MACOSX" = "xyes"; then
  257. --- 5601,5609 ----
  258.   
  259.         PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
  260.         if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
  261. !         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
  262.         else
  263. !         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}\\\""
  264.         fi
  265.         PYTHON3_SRC="if_python3.c"
  266.               if test "x$MACOSX" = "xyes"; then
  267. ***************
  268. *** 5708,5717 ****
  269.   
  270.     $as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h
  271.   
  272. !   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL" >&5
  273. ! $as_echo_n "checking whether we can do without RTLD_GLOBAL... " >&6; }
  274.     cflags_save=$CFLAGS
  275. !   CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
  276.     ldflags_save=$LDFLAGS
  277.     LDFLAGS="$LDFLAGS -ldl"
  278.     if test "$cross_compiling" = yes; then :
  279. --- 5708,5717 ----
  280.   
  281.     $as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h
  282.   
  283. !   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python" >&5
  284. ! $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python... " >&6; }
  285.     cflags_save=$CFLAGS
  286. !   CFLAGS="$CFLAGS $PYTHON_CFLAGS"
  287.     ldflags_save=$LDFLAGS
  288.     LDFLAGS="$LDFLAGS -ldl"
  289.     if test "$cross_compiling" = yes; then :
  290. ***************
  291. *** 5730,5744 ****
  292.        * Only the first pyhton version used will be switched on.
  293.        */
  294.   
  295. !     int no_rtl_global_needed_for(char *python_instsoname)
  296.       {
  297.         int needed = 0;
  298.         void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  299.         if (pylib != 0)
  300.         {
  301.             void (*init)(void) = dlsym(pylib, "Py_Initialize");
  302.             int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  303.             void (*final)(void) = dlsym(pylib, "Py_Finalize");
  304.             (*init)();
  305.             needed = (*simple)("import termios") == -1;
  306.             (*final)();
  307. --- 5730,5746 ----
  308.        * Only the first pyhton version used will be switched on.
  309.        */
  310.   
  311. !     int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
  312.       {
  313.         int needed = 0;
  314.         void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  315.         if (pylib != 0)
  316.         {
  317. +           void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
  318.             void (*init)(void) = dlsym(pylib, "Py_Initialize");
  319.             int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  320.             void (*final)(void) = dlsym(pylib, "Py_Finalize");
  321. +           (*pfx)(prefix);
  322.             (*init)();
  323.             needed = (*simple)("import termios") == -1;
  324.             (*final)();
  325. ***************
  326. *** 5750,5756 ****
  327.       int main(int argc, char** argv)
  328.       {
  329.         int not_needed = 0;
  330. !       if (no_rtl_global_needed_for("libpython2.7.so.1.0") && no_rtl_global_needed_for("libpython3.1.so.1.0"))
  331.               not_needed = 1;
  332.         return !not_needed;
  333.       }
  334. --- 5752,5758 ----
  335.       int main(int argc, char** argv)
  336.       {
  337.         int not_needed = 0;
  338. !       if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}"))
  339.               not_needed = 1;
  340.         return !not_needed;
  341.       }
  342. ***************
  343. *** 5767,5774 ****
  344. --- 5769,5844 ----
  345.     conftest.$ac_objext conftest.beam conftest.$ac_ext
  346.   fi
  347.   
  348.     CFLAGS=$cflags_save
  349.     LDFLAGS=$ldflags_save
  350. +   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python3" >&5
  351. + $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python3... " >&6; }
  352. +   cflags_save=$CFLAGS
  353. +   CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
  354. +   ldflags_save=$LDFLAGS
  355. +   LDFLAGS="$LDFLAGS -ldl"
  356. +   if test "$cross_compiling" = yes; then :
  357. +   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  358. + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  359. + as_fn_error "cannot run test program while cross compiling
  360. + See \`config.log' for more details." "$LINENO" 5; }
  361. + else
  362. +   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  363. + /* end confdefs.h.  */
  364. +     #include <dlfcn.h>
  365. +     #include <wchar.h>
  366. +     /* If this program fails, then RTLD_GLOBAL is needed.
  367. +      * RTLD_GLOBAL will be used and then it is not possible to
  368. +      * have both python versions enabled in the same vim instance.
  369. +      * Only the first pyhton version used will be switched on.
  370. +      */
  371. +     int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
  372. +     {
  373. +       int needed = 0;
  374. +       void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  375. +       if (pylib != 0)
  376. +       {
  377. +           void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
  378. +           void (*init)(void) = dlsym(pylib, "Py_Initialize");
  379. +           int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  380. +           void (*final)(void) = dlsym(pylib, "Py_Finalize");
  381. +           (*pfx)(prefix);
  382. +           (*init)();
  383. +           needed = (*simple)("import termios") == -1;
  384. +           (*final)();
  385. +           dlclose(pylib);
  386. +       }
  387. +       return !needed;
  388. +     }
  389. +     int main(int argc, char** argv)
  390. +     {
  391. +       int not_needed = 0;
  392. +       if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}"))
  393. +             not_needed = 1;
  394. +       return !not_needed;
  395. +     }
  396. + _ACEOF
  397. + if ac_fn_c_try_run "$LINENO"; then :
  398. +   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  399. + $as_echo "yes" >&6; };$as_echo "#define PY3_NO_RTLD_GLOBAL 1" >>confdefs.h
  400. + else
  401. +   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  402. + $as_echo "no" >&6; }
  403. + fi
  404. + rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  405. +   conftest.$ac_objext conftest.beam conftest.$ac_ext
  406. + fi
  407. +   CFLAGS=$cflags_save
  408. +   LDFLAGS=$ldflags_save
  409.     PYTHON_SRC="if_python.c"
  410.     PYTHON_OBJ="objects/if_python.o"
  411.     PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
  412. *** ../vim-7.3.061/src/if_python.c    2010-10-23 14:02:48.000000000 +0200
  413. --- src/if_python.c    2010-11-16 17:07:00.000000000 +0100
  414. ***************
  415. *** 102,108 ****
  416.   #  include <dlfcn.h>
  417.   #  define FARPROC void*
  418.   #  define HINSTANCE void*
  419. ! #  ifdef PY_NO_RTLD_GLOBAL
  420.   #   define load_dll(n) dlopen((n), RTLD_LAZY)
  421.   #  else
  422.   #   define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
  423. --- 102,108 ----
  424.   #  include <dlfcn.h>
  425.   #  define FARPROC void*
  426.   #  define HINSTANCE void*
  427. ! #  if defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)
  428.   #   define load_dll(n) dlopen((n), RTLD_LAZY)
  429.   #  else
  430.   #   define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
  431. ***************
  432. *** 168,173 ****
  433. --- 168,174 ----
  434.   # define Py_BuildValue dll_Py_BuildValue
  435.   # define Py_FindMethod dll_Py_FindMethod
  436.   # define Py_InitModule4 dll_Py_InitModule4
  437. + # define Py_SetPythonHome dll_Py_SetPythonHome
  438.   # define Py_Initialize dll_Py_Initialize
  439.   # define Py_Finalize dll_Py_Finalize
  440.   # define Py_IsInitialized dll_Py_IsInitialized
  441. ***************
  442. *** 226,231 ****
  443. --- 227,233 ----
  444.   static PyObject*(*dll_Py_BuildValue)(char *, ...);
  445.   static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *);
  446.   static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int);
  447. + static void(*dll_Py_SetPythonHome)(char *home);
  448.   static void(*dll_Py_Initialize)(void);
  449.   static void(*dll_Py_Finalize)(void);
  450.   static int(*dll_Py_IsInitialized)(void);
  451. ***************
  452. *** 310,315 ****
  453. --- 312,318 ----
  454.   # else
  455.       {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
  456.   # endif
  457. +     {"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome},
  458.       {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
  459.       {"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize},
  460.       {"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized},
  461. ***************
  462. *** 349,355 ****
  463.   {
  464.       int i;
  465.   
  466. ! #if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON3)
  467.       /* Can't have Python and Python3 loaded at the same time.
  468.        * It cause a crash, because RTLD_GLOBAL is needed for
  469.        * standard C extension libraries of one or both python versions. */
  470. --- 352,358 ----
  471.   {
  472.       int i;
  473.   
  474. ! #if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON3)
  475.       /* Can't have Python and Python3 loaded at the same time.
  476.        * It cause a crash, because RTLD_GLOBAL is needed for
  477.        * standard C extension libraries of one or both python versions. */
  478. ***************
  479. *** 543,548 ****
  480. --- 546,555 ----
  481.       }
  482.   #endif
  483.   
  484. + #ifdef PYTHON_HOME
  485. +     Py_SetPythonHome(PYTHON_HOME);
  486. + #endif
  487.       init_structs();
  488.   
  489.   #if !defined(MACOS) || defined(MACOS_X_UNIX)
  490. *** ../vim-7.3.061/src/if_python3.c    2010-10-23 14:02:48.000000000 +0200
  491. --- src/if_python3.c    2010-11-16 17:07:26.000000000 +0100
  492. ***************
  493. *** 80,86 ****
  494.   #  include <dlfcn.h>
  495.   #  define FARPROC void*
  496.   #  define HINSTANCE void*
  497. ! #  ifdef PY_NO_RTLD_GLOBAL
  498.   #   define load_dll(n) dlopen((n), RTLD_LAZY)
  499.   #  else
  500.   #   define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
  501. --- 80,86 ----
  502.   #  include <dlfcn.h>
  503.   #  define FARPROC void*
  504.   #  define HINSTANCE void*
  505. ! #  if defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)
  506.   #   define load_dll(n) dlopen((n), RTLD_LAZY)
  507.   #  else
  508.   #   define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
  509. ***************
  510. *** 132,137 ****
  511. --- 132,138 ----
  512.   # define PyType_Ready py3_PyType_Ready
  513.   #undef Py_BuildValue
  514.   # define Py_BuildValue py3_Py_BuildValue
  515. + # define Py_SetPythonHome py3_Py_SetPythonHome
  516.   # define Py_Initialize py3_Py_Initialize
  517.   # define Py_Finalize py3_Py_Finalize
  518.   # define Py_IsInitialized py3_Py_IsInitialized
  519. ***************
  520. *** 170,175 ****
  521. --- 171,177 ----
  522.    * Pointers for dynamic link
  523.    */
  524.   static int (*py3_PySys_SetArgv)(int, wchar_t **);
  525. + static void (*py3_Py_SetPythonHome)(wchar_t *home);
  526.   static void (*py3_Py_Initialize)(void);
  527.   static PyObject* (*py3_PyList_New)(Py_ssize_t size);
  528.   static PyGILState_STATE (*py3_PyGILState_Ensure)(void);
  529. ***************
  530. *** 254,259 ****
  531. --- 256,262 ----
  532.   } py3_funcname_table[] =
  533.   {
  534.       {"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
  535. +     {"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
  536.       {"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
  537.       {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
  538.       {"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
  539. ***************
  540. *** 336,342 ****
  541.       int i;
  542.       void *ucs_from_string, *ucs_from_string_and_size;
  543.   
  544. ! # if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON)
  545.       /* Can't have Python and Python3 loaded at the same time.
  546.        * It cause a crash, because RTLD_GLOBAL is needed for
  547.        * standard C extension libraries of one or both python versions. */
  548. --- 339,345 ----
  549.       int i;
  550.       void *ucs_from_string, *ucs_from_string_and_size;
  551.   
  552. ! # if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON)
  553.       /* Can't have Python and Python3 loaded at the same time.
  554.        * It cause a crash, because RTLD_GLOBAL is needed for
  555.        * standard C extension libraries of one or both python versions. */
  556. ***************
  557. *** 539,544 ****
  558. --- 542,552 ----
  559.   
  560.       init_structs();
  561.   
  562. + #ifdef PYTHON3_HOME
  563. +     Py_SetPythonHome(PYTHON3_HOME);
  564. + #endif
  565.       /* initialise threads */
  566.       PyEval_InitThreads();
  567.   
  568. *** ../vim-7.3.061/src/version.c    2010-11-16 16:25:46.000000000 +0100
  569. --- src/version.c    2010-11-16 17:12:40.000000000 +0100
  570. ***************
  571. *** 716,717 ****
  572. --- 716,719 ----
  573.   {   /* Add new patch number below this line */
  574. + /**/
  575. +     62,
  576.   /**/
  577.  
  578. -- 
  579. ARTHUR: CHARGE!
  580.    [The mighty ARMY charges.  Thundering noise of feet.  Clatter of coconuts.
  581.    Shouts etc.   Suddenly there is a wail of a siren and a couple of police
  582.    cars roar round in front of the charging ARMY and the POLICE leap out and
  583.    stop them.  TWO POLICEMAN and the HISTORIAN'S WIFE.  Black Marias skid up
  584.    behind them.]
  585. HISTORIAN'S WIFE: They're the ones, I'm sure.
  586.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  587.  
  588.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  589. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  590. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  591.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  592.