Commits

Anonymous committed 6bbdb9c

updated for version 7.3.212
Problem: With Python 3.2 ":py3" fails.
Solution: Move PyEval_InitThreads() to after Py_Initialize(). (Roland
Puntaier) Check abiflags in configure. (Andreas Behr)

  • Participants
  • Parent commits 286612e
  • Tags v7-3-212

Comments (0)

Files changed (4)

File src/auto/configure

 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5
 $as_echo "$vi_cv_var_python3_version" >&6; }
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's abiflags" >&5
+$as_echo_n "checking Python's abiflags... " >&6; }
+if test "${vi_cv_var_python3_abiflags+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+     vi_cv_var_python3_abiflags=
+     if ${vi_cv_path_python3} -c \
+         "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
+     then
+       vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
+         "import sys; print(sys.abiflags)"`
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5
+$as_echo "$vi_cv_var_python3_abiflags" >&6; }
+
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5
 $as_echo_n "checking Python's install prefix... " >&6; }
 if test "${vi_cv_path_python3_pfx+set}" = set; then :
 else
 
      vi_cv_path_python3_conf=
+     config_dir="config"
+     if test "${vi_cv_var_python3_abiflags}" != ""; then
+       config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
+     fi
      for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
        for subdir in lib64 lib share; do
-         d="${path}/${subdir}/python${vi_cv_var_python3_version}/config"
+         d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
          if test -d "$d" && test -f "$d/config.c"; then
            vi_cv_path_python3_conf="$d"
          fi
                     eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
           rm -f -- "${tmp_mkf}"
           vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
-          vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS} ${python3_LINKFORSHARED}"
+          vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
                     vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
           vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
 
 
       PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
       if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
-        PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
+        PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
       else
-        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}\\\""
+        PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
       fi
       PYTHON3_SRC="if_python3.c"
             if test "x$MACOSX" = "xyes"; then

File src/configure.in

           ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'`
     ]])
 
+    dnl -- get abiflags for python 3.2 or higher (PEP 3149)
+    AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags,
+    [
+     vi_cv_var_python3_abiflags=
+     if ${vi_cv_path_python3} -c \
+         "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
+     then
+       vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \    
+         "import sys; print(sys.abiflags)"`
+     fi ])
+
     dnl -- find where python3 thinks it was installed
     AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx,
     [ vi_cv_path_python3_pfx=`
     AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
     [
      vi_cv_path_python3_conf=
+     config_dir="config"
+     if test "${vi_cv_var_python3_abiflags}" != ""; then
+       config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
+     fi
      for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
        for subdir in lib64 lib share; do
-         d="${path}/${subdir}/python${vi_cv_var_python3_version}/config"
+         d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
          if test -d "$d" && test -f "$d/config.c"; then
            vi_cv_path_python3_conf="$d"
          fi
           eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
           rm -f -- "${tmp_mkf}"
           vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
-          vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS} ${python3_LINKFORSHARED}"
+          vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
           dnl remove -ltermcap, it can conflict with an earlier -lncurses
           vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
           vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
 
       PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
       if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
-        PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
+        PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
       else
-        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}\\\""
+        PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
       fi
       PYTHON3_SRC="if_python3.c"
       dnl For Mac OSX 10.2 config.o is included in the Python library.

File src/if_python3.c

 	Py_SetPythonHome(PYTHON3_HOME);
 #endif
 
-	/* initialise threads */
-	PyEval_InitThreads();
-
 #if !defined(MACOS) || defined(MACOS_X_UNIX)
 	Py_Initialize();
 #else
 	PyMac_Initialize();
 #endif
+	/* initialise threads, must be after Py_Initialize() */
+	PyEval_InitThreads();
 
 #ifdef DYNAMIC_PYTHON3
 	get_py3_exceptions();

File src/version.c

 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    212,
+/**/
     211,
 /**/
     210,