Skip to content

Commit e1a3231

Browse files
committed
patch 8.0.1719: cannot specify which Python executable configure should use
Problem: Cannot specify which Python executable configure should use. Solution: Add --with-python-command and --with-python3-command.
1 parent 6c67219 commit e1a3231

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed

src/auto/configure

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,10 @@ enable_mzschemeinterp
802802
with_plthome
803803
enable_perlinterp
804804
enable_pythoninterp
805+
with_python_command
805806
with_python_config_dir
806807
enable_python3interp
808+
with_python3_command
807809
with_python3_config_dir
808810
enable_tclinterp
809811
with_tclsh
@@ -1532,8 +1534,10 @@ Optional Packages:
15321534
--with-lua-prefix=PFX Prefix where Lua is installed.
15331535
--with-luajit Link with LuaJIT instead of Lua.
15341536
--with-plthome=PLTHOME Use PLTHOME.
1535-
--with-python-config-dir=PATH Python's config directory
1536-
--with-python3-config-dir=PATH Python's config directory
1537+
--with-python-command=NAME name of the Python 2 command (default: python2 or python)
1538+
--with-python-config-dir=PATH Python's config directory (deprecated)
1539+
--with-python3-command=NAME name of the Python 3 command (default: python3 or python)
1540+
--with-python3-config-dir=PATH Python's config directory (deprecated)
15371541
--with-tclsh=PATH which tclsh to use (default: tclsh8.0)
15381542
--with-ruby-command=RUBY name of the Ruby command (default: ruby)
15391543
--with-x use the X Window System
@@ -5937,6 +5941,21 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
59375941
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
59385942
fi
59395943

5944+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python-command argument" >&5
5945+
$as_echo_n "checking --with-python-command argument... " >&6; }
5946+
5947+
5948+
# Check whether --with-python-command was given.
5949+
if test "${with_python_command+set}" = set; then :
5950+
withval=$with_python_command; vi_cv_path_python="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python" >&5
5951+
$as_echo "$vi_cv_path_python" >&6; }
5952+
else
5953+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5954+
$as_echo "no" >&6; }
5955+
fi
5956+
5957+
5958+
if test "X$vi_cv_path_python" = "X"; then
59405959
for ac_prog in python2 python
59415960
do
59425961
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -5982,6 +6001,7 @@ fi
59826001
test -n "$vi_cv_path_python" && break
59836002
done
59846003

6004+
fi
59856005
if test "X$vi_cv_path_python" != "X"; then
59866006

59876007
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5
@@ -6271,6 +6291,21 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic";
62716291
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
62726292
fi
62736293

6294+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python3-command argument" >&5
6295+
$as_echo_n "checking --with-python3-command argument... " >&6; }
6296+
6297+
6298+
# Check whether --with-python3-command was given.
6299+
if test "${with_python3_command+set}" = set; then :
6300+
withval=$with_python3_command; vi_cv_path_python3="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3" >&5
6301+
$as_echo "$vi_cv_path_python3" >&6; }
6302+
else
6303+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6304+
$as_echo "no" >&6; }
6305+
fi
6306+
6307+
6308+
if test "X$vi_cv_path_python3" = "X"; then
62746309
for ac_prog in python3 python
62756310
do
62766311
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6316,6 +6351,7 @@ fi
63166351
test -n "$vi_cv_path_python3" && break
63176352
done
63186353

6354+
fi
63196355
if test "X$vi_cv_path_python3" != "X"; then
63206356

63216357
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5

src/configure.ac

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,15 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
11171117
fi
11181118

11191119
dnl -- find the python executable
1120-
AC_PATH_PROGS(vi_cv_path_python, python2 python)
1120+
AC_MSG_CHECKING(--with-python-command argument)
1121+
AC_SUBST(vi_cv_path_python)
1122+
AC_ARG_WITH(python-command, [ --with-python-command=NAME name of the Python 2 command (default: python2 or python)],
1123+
vi_cv_path_python="$withval"; AC_MSG_RESULT($vi_cv_path_python),
1124+
AC_MSG_RESULT(no))
1125+
1126+
if test "X$vi_cv_path_python" = "X"; then
1127+
AC_PATH_PROGS(vi_cv_path_python, python2 python)
1128+
fi
11211129
if test "X$vi_cv_path_python" != "X"; then
11221130

11231131
dnl -- get its version number
@@ -1156,7 +1164,7 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
11561164
dnl -- where the Python implementation library archives are
11571165

11581166
AC_ARG_WITH(python-config-dir,
1159-
[ --with-python-config-dir=PATH Python's config directory],
1167+
[ --with-python-config-dir=PATH Python's config directory (deprecated)],
11601168
[ vi_cv_path_python_conf="${withval}"; have_python_config_dir=1 ] )
11611169

11621170
AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
@@ -1343,7 +1351,15 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic";
13431351
fi
13441352

13451353
dnl -- find the python3 executable
1346-
AC_PATH_PROGS(vi_cv_path_python3, python3 python)
1354+
AC_MSG_CHECKING(--with-python3-command argument)
1355+
AC_SUBST(vi_cv_path_python3)
1356+
AC_ARG_WITH(python3-command, [ --with-python3-command=NAME name of the Python 3 command (default: python3 or python)],
1357+
vi_cv_path_python3="$withval"; AC_MSG_RESULT($vi_cv_path_python3),
1358+
AC_MSG_RESULT(no))
1359+
1360+
if test "X$vi_cv_path_python3" = "X"; then
1361+
AC_PATH_PROGS(vi_cv_path_python3, python3 python)
1362+
fi
13471363
if test "X$vi_cv_path_python3" != "X"; then
13481364

13491365
dnl -- get its version number
@@ -1393,7 +1409,7 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic";
13931409
dnl -- where the Python implementation library archives are
13941410

13951411
AC_ARG_WITH(python3-config-dir,
1396-
[ --with-python3-config-dir=PATH Python's config directory],
1412+
[ --with-python3-config-dir=PATH Python's config directory (deprecated)],
13971413
[ vi_cv_path_python3_conf="${withval}"; have_python3_config_dir=1 ] )
13981414

13991415
AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ static char *(features[]) =
762762

763763
static int included_patches[] =
764764
{ /* Add new patch number below this line */
765+
/**/
766+
1719,
765767
/**/
766768
1718,
767769
/**/

0 commit comments

Comments
 (0)