Mk/Uses/python.mk: Remove PYTHON3_DEFAULT and use PYTHON_DEFAULT instead

- Remove unnecessary PYTHON3_DEFAULT
- Replace PYTHON3_DEFAULT with PYTHON_DEFAULT

Regarding DEFAULT_VERSIONS, both python and python3 point to the same value
which makes python3 a duplicate. And we do not really support python=2.7.
Therefore, use python for Python 3.x and python2 for legacy Python 2.7.
This commit is contained in:
Po-Chuan Hsieh
2023-09-30 08:30:47 +08:00
parent 204d12db01
commit 9ef210b6cd

View File

@@ -415,10 +415,6 @@ _PYTHON_RUN_DEP= yes
_PYTHON_TEST_DEP= yes
. endif
. if ${PYTHON2_DEFAULT} != ${PYTHON_DEFAULT} && ${PYTHON3_DEFAULT} != ${PYTHON_DEFAULT}
WARNING+= "PYTHON_DEFAULT must be a version present in PYTHON2_DEFAULT or PYTHON3_DEFAULT, if you want more Python flavors, set BUILD_ALL_PYTHON_FLAVORS in your make.conf"
. endif
. if ${_PYTHON_ARGS} == 2.7
DEV_WARNING+= "lang/python27 reached End of Life and will be removed somewhere in the future, please convert to a modern version of python"
. elif ${_PYTHON_ARGS} == 2
@@ -462,7 +458,7 @@ _PYTHON_VERSION_NONSUPPORTED= ${_PYTHON_VERSION_MAXIMUM} at most
# If we have an unsupported version of Python, try another.
. if defined(_PYTHON_VERSION_NONSUPPORTED)
.undef _PYTHON_VERSION
. for ver in ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
. for ver in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${_PYTHON_VERSIONS}
__VER= ${ver}
. if !defined(_PYTHON_VERSION) && \
!(!empty(_PYTHON_VERSION_MINIMUM) && ( \
@@ -480,7 +476,7 @@ IGNORE= needs an unsupported version of Python
# Automatically generates FLAVORS if empty
. if empty(FLAVORS) && defined(_PYTHON_FEATURE_FLAVORS)
. undef _VALID_PYTHON_VERSIONS
. for ver in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
. for ver in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${_PYTHON_VERSIONS}
__VER= ${ver}
. if !(!empty(_PYTHON_VERSION_MINIMUM) && ( \
${__VER:${_VC}} < ${_PYTHON_VERSION_MINIMUM:${_VC}})) && \
@@ -502,7 +498,7 @@ _ALL_PYTHON_FLAVORS= ${_PYTHON_VERSIONS:S/.//:S/^/py/}
. if defined(BUILD_ALL_PYTHON_FLAVORS) || defined(_PYTHON_FEATURE_ALLFLAVORS)
FLAVORS= ${_ALL_PYTHON_FLAVORS}
. else
. for _v in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT}
. for _v in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT}
_f= py${_v:S/.//}
. if ${_ALL_PYTHON_FLAVORS:M${_f}} && !${FLAVORS:M${_f}}
. if !empty(FLAVORS)