patch 8.0.1692: Python may not work when using statically linked library

Problem:    Python may not work when using statically linked library .
Solution:   Do not define PYTHON_HOME and PYTHON3_HOME in configure if the
            Python library is linked statically.
diff --git a/src/configure.ac b/src/configure.ac
index e2867b4..4e71de3 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -1255,7 +1255,7 @@
 	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
+	if test "X$have_python_config_dir" = "X1" -a "$enable_pythoninterp" = "dynamic"; then
 	  dnl Define PYTHON_HOME if --with-python-config-dir was used
 	  PYTHON_CFLAGS="${PYTHON_CFLAGS} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
 
@@ -1469,7 +1469,7 @@
         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
+	if test "X$have_python3_config_dir" = "X1" -a "$enable_python3interp" = "dynamic"; 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