mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
a9b0a7ba93
This commit rewrites our ancient `./configure` script from shell into Python. The impetus for this change is to remove `config.mk` which is just a vestige of the old makefile build system at this point. Instead all configuration is now solely done through `config.toml`. The python script allows us to more flexibly program (aka we can use loops easily) and create a `config.toml` which is based off `config.toml.example`. This way we can preserve comments and munge various values as we see fit. It is intended that the configure script here is a drop-in replacement for the previous configure script, no functional change is intended. Also note that the rationale for this is also because our build system requires Python, so having a python script a bit earlier shouldn't cause too many problems. Closes #40730
18 lines
275 B
Bash
Executable File
18 lines
275 B
Bash
Executable File
#!/bin/sh
|
|
|
|
script="$(dirname $0)"/src/bootstrap/configure.py
|
|
|
|
try() {
|
|
cmd=$1
|
|
shift
|
|
T=$($cmd --version 2>/dev/null)
|
|
if [ $? -eq 0 ]; then
|
|
exec $cmd "$script" "$@"
|
|
fi
|
|
}
|
|
|
|
try python2.7 "$@"
|
|
try python27 "$@"
|
|
try python2 "$@"
|
|
exec python $script "$@"
|