Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
SAGE_CHECK_PYTHON_FOR_VENV: Rework with less nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Feb 1, 2021
1 parent 372adcb commit fc8b676
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions m4/sage_check_python_for_venv.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,29 @@ AC_DEFUN([SAGE_CHECK_PYTHON_FOR_VENV], [
dnl m4_define([conftest_venv], [config-venv]) .... for debugging only
rm -rf conftest_venv
AS_IF(["]PYTHON_EXE[" build/bin/sage-venv conftest_venv && conftest_venv/bin/python3 -c "import ]REQUIRED_MODULES["], [
AS_VAR_SET([python3_result], [yes])
SAGE_PYTHON_CHECK_DISTUTILS([CC="$CC" CXX="$CXX" conftest_venv/bin/python3], [
SAGE_ARCHFLAGS="unset"
COMMANDS_IF_GOOD
], [
AS_CASE([$host],
[*-*-darwin*], [
dnl #31227: Try if setting ARCHFLAGS to empty fixes it
SAGE_PYTHON_CHECK_DISTUTILS([CC="$CC" CXX="$CXX" ARCHFLAGS="" conftest_venv/bin/python3], [
SAGE_ARCHFLAGS=""
COMMANDS_IF_GOOD
], [
AC_MSG_RESULT([no, the version is in the supported range, and the modules can be imported, but $reason (even with ARCHFLAGS set to empty)])
AS_VAR_SET([python3_result],
["no, the version is in the supported range, and the modules can be imported, but $reason (even with ARCHFLAGS set to empty)"])
])
], [
AC_MSG_RESULT([no, the version is in the supported range, and the modules can be imported, but $reason])
]
)
AS_VAR_SET([python3_result],
["no, the version is in the supported range, and the modules can be imported, but $reason"])
])
])
AS_VAR_IF([python3_result], [yes], [
dnl these commands are expected to call AC_MSG_RESULT
COMMANDS_IF_GOOD
], [
AC_MSG_RESULT([$python3_result])
])
], [
AC_MSG_RESULT([no, the version is in the supported range but cannot import one of the required modules: ]REQUIRED_MODULES)
Expand Down

0 comments on commit fc8b676

Please sign in to comment.