diff options
author | Ryan Moeller <[email protected]> | 2019-06-04 18:05:46 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-06-04 18:05:46 -0700 |
commit | 1a132f063882bba08253b6c0abf3846cdacfb7a6 (patch) | |
tree | 151ffde614984751f0396ecba359f8946d95a342 /config/always-pyzfs.m4 | |
parent | df24bcf00a60a5a9b1673f4012ee4cbea8c13a69 (diff) |
Make Python detection optional and more portable
Previously, --without-python would cause ./configure to fail. Now it is
able to proceed, and the Python scripts will not be built.
Use portable parameter expansion matching instead of nonstandard
substring matching to detect the Python version. This test is
duplicated in several places, so define a function for it.
Don't assume the full path to binaries, since different platforms do
install things in different places. Use AC_CHECK_PROGS instead.
When building without Python, also build without pyzfs.
Sponsored by: iXsystems, Inc.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Eli Schwartz <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #8809
Closes #8731
Diffstat (limited to 'config/always-pyzfs.m4')
-rw-r--r-- | config/always-pyzfs.m4 | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/config/always-pyzfs.m4 b/config/always-pyzfs.m4 index d74d6f1a7..6f32e98fe 100644 --- a/config/always-pyzfs.m4 +++ b/config/always-pyzfs.m4 @@ -18,7 +18,12 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [ DEFINE_PYZFS='--without pyzfs' ]) ], [ - DEFINE_PYZFS='' + AS_IF([test $PYTHON != :], [ + DEFINE_PYZFS='' + ], [ + enable_pyzfs=no + DEFINE_PYZFS='--without pyzfs' + ]) ]) AC_SUBST(DEFINE_PYZFS) @@ -26,10 +31,10 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [ dnl # Require python-devel libraries dnl # AS_IF([test "x$enable_pyzfs" = xcheck -o "x$enable_pyzfs" = xyes], [ - AS_IF([test "${PYTHON_VERSION:0:2}" = "2."], [ + AS_IF([ZFS_AC_PYTHON_VERSION_IS_2], [ PYTHON_REQUIRED_VERSION=">= '2.7.0'" ], [ - AS_IF([test "${PYTHON_VERSION:0:2}" = "3."], [ + AS_IF([ZFS_AC_PYTHON_VERSION_IS_3], [ PYTHON_REQUIRED_VERSION=">= '3.4.0'" ], [ AC_MSG_ERROR("Python $PYTHON_VERSION unknown") |