-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure
executable file
·38 lines (35 loc) · 1.23 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# mimics: source ~/.cargo/env
export PATH="$HOME/.cargo/bin:$PATH"
# Write 'cargo' to Makevars
VERSION=$(cargo --version)
if [ $? -eq 0 ]; then
echo "Using `which cargo`"
echo "$VERSION"
# Check for old version of rustc (edition:2021 requires rust 1.56)
if [ "$(uname)" = "Linux" ]; then
VERNUM=$(echo $VERSION | cut -d' ' -f2) || true
MAJOR=$(echo $VERNUM | cut -d'.' -f1) || true
MINOR=$(echo $VERNUM | cut -d'.' -f2) || true
if [ "$MAJOR" -eq "1" ] && [ "$MINOR" -lt "56" ]; then
echo "Found old rust. Using legacy gifski 1.4.3 build."
cp -f src/legacy/* src/myrustlib/
fi
fi
exit 0
fi
# Try local version on MacOS, otherwise error
[ `uname` = "Darwin" ] && curl "https://autobrew.github.io/scripts/rust" -sSf | sh && exit 0
echo "------------------ RUST COMPILER NOT FOUND --------------------"
echo ""
echo "Cargo was not found on the PATH. Please install cargo / rustc:"
echo ""
echo " - yum install cargo (Fedora/CentOS)"
echo " - apt-get install cargo (Debian/Ubuntu)"
echo " - brew install rust (MacOS)"
echo ""
echo "Alternatively install Rust from: <https://www.rust-lang.org>"
echo ""
echo "---------------------------------------------------------------"
echo ""
exit 1