Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96db9d5

Browse files
committed
configure: Update python search order
Some systems don't ship with "python" by default anymore, only"python3" or "python2" or some combination, so include those in theconfigure search.Back-patch of commit7291733. At the time that was only pushedback as far as v10, because of concerns about interactions withcommitb21c569. Closer analysis shows that if we justs/AC_PATH_PROG/AC_PATH_PROGS/, there is no effect on the olderbranches' behavior when PYTHON is explicitly specified, so it shouldbe okay to back-patch: this will not break any configuration thatworked before. And the need to support platforms with only a"python3" or "python2" executable is getting ever more urgent.Original patch by Peter Eisentraut, back-patch analysis by meDiscussion:https://www.postgresql.org/message-id/flat/1457.1543184081%40sss.pgh.pa.us#c9cc1199338fd6a257589c6dcea6cf8d
1 parent603a534 commit96db9d5

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

‎config/python.m4

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66

77
# PGAC_PATH_PYTHON
88
# ----------------
9-
# Look for Python and set the output variable 'PYTHON'
10-
# to 'python' if found, empty otherwise.
9+
# Look for Python and set the output variable 'PYTHON' if found,
10+
# fail otherwise.
11+
#
12+
# As the Python 3 transition happens and PEP 394 isn't updated, we
13+
# need to cater to systems that don't have unversioned "python" by
14+
# default. Some systems ship with "python3" by default and perhaps
15+
# have "python" in an optional package. Some systems only have
16+
# "python2" and "python3", in which case it's reasonable to prefer the
17+
# newer version.
1118
AC_DEFUN([PGAC_PATH_PYTHON],
12-
[AC_PATH_PROG(PYTHON,python)
19+
[AC_PATH_PROGS(PYTHON,[python python3 python2])
1320
if test x"$PYTHON" = x""; then
1421
AC_MSG_ERROR([Python not found])
1522
fi

‎configure

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7562,8 +7562,10 @@ fi
75627562
fi
75637563

75647564
iftest"$with_python" = yes;then
7565-
# Extract the first word of "python", so it can be a program name with args.
7566-
set dummy python; ac_word=$2
7565+
forac_progin python python3 python2
7566+
do
7567+
# Extract the first word of "$ac_prog", so it can be a program name with args.
7568+
set dummy$ac_prog; ac_word=$2
75677569
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for$ac_word">&5
75687570
$as_echo_n"checking for$ac_word...">&6; }
75697571
if${ac_cv_path_PYTHON+:}false;then:
@@ -7602,6 +7604,9 @@ $as_echo "no" >&6; }
76027604
fi
76037605

76047606

7607+
test -n"$PYTHON"&&break
7608+
done
7609+
76057610
iftest x"$PYTHON" = x"";then
76067611
as_fn_error$?"Python not found""$LINENO" 5
76077612
fi

‎doc/src/sgml/installation.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,8 @@ su - postgres
14381438
<![%standalone-include[the <application>PL/Python</>
14391439
documentation]]>
14401440
<![%standalone-ignore[<xref linkend="plpython-python23">]]>
1441-
for more information.
1441+
for more information. If this is not set, the following are probed
1442+
in this order: <literal>python python3 python2</literal>.
14421443
</para>
14431444
</listitem>
14441445
</varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp