-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·46 lines (38 loc) · 1.39 KB
/
Copy pathconfigure
File metadata and controls
executable file
·46 lines (38 loc) · 1.39 KB
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
39
40
41
42
43
44
45
46
#!/bin/sh
set -e
need_rustc="1.91.0"
if [ -d "$HOME/.cargo/bin" ]; then
PATH="$PATH:$HOME/.cargo/bin"
export PATH
fi
if ! command -v rustc >/dev/null 2>&1; then
echo "ERROR: rustc >= ${need_rustc} is required to build Rsassy." >&2
echo "Install Rust from your system package manager or https://rustup.rs/." >&2
exit 1
fi
if ! command -v cargo >/dev/null 2>&1; then
echo "ERROR: Cargo is required to build Rsassy." >&2
echo "Install Cargo from your system package manager or https://rustup.rs/." >&2
exit 1
fi
rustc_version=$(rustc --version | sed -n 's/^rustc \([0-9][^ ]*\).*/\1/p')
rustc_version=${rustc_version%%-*}
if [ -z "$rustc_version" ]; then
echo "ERROR: could not determine rustc version from: $(rustc --version)" >&2
exit 1
fi
"${R_HOME}/bin/Rscript" -e 'args <- commandArgs(TRUE); quit(status = if (utils::compareVersion(args[1], args[2]) < 0) 1L else 0L)' "$rustc_version" "$need_rustc" || {
echo "ERROR: rustc >= ${need_rustc} is required; found ${rustc_version}." >&2
exit 1
}
rsassy_pkg_libs=
case " $* " in
*wasm32-unknown-emscripten*) rsassy_pkg_libs='-L$(LIBDIR) -lrsassy_rust' ;;
esac
cc_for_check=${CC:-cc}
if "$cc_for_check" --version 2>/dev/null | grep -qi emscripten; then
rsassy_pkg_libs='-L$(LIBDIR) -lrsassy_rust'
fi
sed "s|@RSASSY_PKG_LIBS@|${rsassy_pkg_libs}|g" src/Makevars.in > src/Makevars
echo "using $(rustc --version)"
echo "using $(cargo --version)"