]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.0.1686: Python does not work when configuring with specific dir v8.0.1686
authorBram Moolenaar <Bram@vim.org>
Tue, 10 Apr 2018 16:13:05 +0000 (18:13 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 Apr 2018 16:13:05 +0000 (18:13 +0200)
Problem:    Python does not work when configuring with specific dir. (Rajdeep)
Solution:   Do define PYTHON_HOME and PYTHON3_HOME in configure if the Python
            config dir was specified.

src/auto/configure
src/configure.ac
src/version.c

index f549479896632a841ba03d12f91141a5fc77c01f..838129db85dbd03fb2dab7d8ad3a40c883a5d2a0 100755 (executable)
@@ -5955,7 +5955,7 @@ fi
 
 # Check whether --with-python-config-dir was given.
 if test "${with_python_config_dir+set}" = set; then :
-  withval=$with_python_config_dir;  vi_cv_path_python_conf="${withval}"
+  withval=$with_python_config_dir;  vi_cv_path_python_conf="${withval}"; have_python_config_dir=1
 fi
 
 
@@ -6062,6 +6062,10 @@ $as_echo "$vi_cv_dll_name_python" >&6; }
        else
          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}"
        fi
+       if test "X$have_python_config_dir" = "X1"; then
+                 PYTHON_CFLAGS="${PYTHON_CFLAGS} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
+
+       fi
        PYTHON_SRC="if_python.c"
        PYTHON_OBJ="objects/if_python.o"
        if test "${vi_cv_var_python_version}" = "1.4"; then
@@ -6312,7 +6316,7 @@ fi
 
 # Check whether --with-python3-config-dir was given.
 if test "${with_python3_config_dir+set}" = set; then :
-  withval=$with_python3_config_dir;  vi_cv_path_python3_conf="${withval}"
+  withval=$with_python3_config_dir;  vi_cv_path_python3_conf="${withval}"; have_python3_config_dir=1
 fi
 
 
@@ -6394,6 +6398,9 @@ $as_echo "$vi_cv_dll_name_python3" >&6; }
         else
           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}${vi_cv_var_python3_abiflags}"
         fi
+       if test "X$have_python3_config_dir" = "X1"; then
+                 PYTHON3_CFLAGS="${PYTHON3_CFLAGS}  -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'"
+       fi
         PYTHON3_SRC="if_python3.c"
         PYTHON3_OBJ="objects/if_python3.o"
 
index fd667f8e33b93857c2cbdaaffca78e1bf1eb7949..e2867b422e264c1567dd0550a9f155dcd8a6075e 100644 (file)
@@ -1157,7 +1157,7 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
 
       AC_ARG_WITH(python-config-dir,
        [  --with-python-config-dir=PATH  Python's config directory],
-       [ vi_cv_path_python_conf="${withval}" ] )
+       [ vi_cv_path_python_conf="${withval}"; have_python_config_dir=1 ] )
 
       AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
       [
@@ -1255,6 +1255,11 @@ eof
        else
          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}"
        fi
+       if test "X$have_python_config_dir" = "X1"; then
+         dnl Define PYTHON_HOME if --with-python-config-dir was used
+         PYTHON_CFLAGS="${PYTHON_CFLAGS} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
+
+       fi
        PYTHON_SRC="if_python.c"
        PYTHON_OBJ="objects/if_python.o"
        if test "${vi_cv_var_python_version}" = "1.4"; then
@@ -1399,7 +1404,7 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic";
   
       AC_ARG_WITH(python3-config-dir,
        [  --with-python3-config-dir=PATH  Python's config directory],
-       [ vi_cv_path_python3_conf="${withval}" ] )
+       [ vi_cv_path_python3_conf="${withval}"; have_python3_config_dir=1 ] )
   
       AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
       [
@@ -1464,6 +1469,10 @@ eof
         else
           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}${vi_cv_var_python3_abiflags}"
         fi
+       if test "X$have_python3_config_dir" = "X1"; then
+         dnl Define PYTHON3_HOME if --with-python-config-dir was used
+         PYTHON3_CFLAGS="${PYTHON3_CFLAGS}  -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'"
+       fi
         PYTHON3_SRC="if_python3.c"
         PYTHON3_OBJ="objects/if_python3.o"
   
index ff8d0c4bbe973c5624047fe8a725b0dd7227090e..08b672892a4feba220769721cbfb7dc4f05a598e 100644 (file)
@@ -762,6 +762,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1686,
 /**/
     1685,
 /**/