diff options
| author | Ben Striegel <ben.striegel@gmail.com> | 2012-06-25 20:18:09 -0400 |
|---|---|---|
| committer | Ben Striegel <ben.striegel@gmail.com> | 2012-06-25 20:18:09 -0400 |
| commit | 6322eda35ca0e5d05247eccfa820f0aa730591ce (patch) | |
| tree | 2b17bda0f63527792705794d397644cd9e9316b3 | |
| parent | 6e6d20a40f86d1f8d8dd8d28c882378218a040c9 (diff) | |
| download | rust-6322eda35ca0e5d05247eccfa820f0aa730591ce.tar.gz rust-6322eda35ca0e5d05247eccfa820f0aa730591ce.zip | |
Fail to configure without an LLVM-friendly Python
This addresses issue #2720. According to LLVM's documentation, it requires a version of Python between 2.4 and 2.7. Without the proper version, LLVM fails to build with cryptic errors. Prior to this commit, the configure script checked for the `python` command in the environment, but didn't actually check the version, which can cause problems e.g. on Linux distros where the default is Python 3. Now the configure script always prefers to select a more specific version of Python when available, in the order `python2.7` > `python2.6` > `python2` > `python`, and will always check to ensure that the interpreter's version is in the correct range.
| -rwxr-xr-x | configure | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/configure b/configure index f77c726a581..1bcbe513579 100755 --- a/configure +++ b/configure @@ -311,8 +311,13 @@ fi step_msg "looking for build programs" probe_need CFG_PERL perl -probe_need CFG_PYTHON python python2.6 python2 python3 probe_need CFG_CURL curl +probe_need CFG_PYTHON python2.7 python2.6 python2 python + +python_version=$($CFG_PYTHON -V 2>&1) +if [ $(echo $python_version | grep -c '^Python 2\.[4567]') -ne 1 ]; then + err "Found $python_version, but LLVM requires Python 2.4-2.7" +fi # If we have no git directory then we are probably a tarball distribution # and shouldn't attempt to load submodules |
