1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-03 09:41:10 +03:00
juvix/config/configure.sh

36 lines
536 B
Bash
Raw Normal View History

#!/usr/bin/env bash
if [ ! -d "config" ]; then
printf "This script should be run from the root of the project.\n" 1>&2
exit 1
fi
if [ -z "$CC" ]; then
CC="clang"
fi
if [ -z "$CARGO" ]; then
CARGO="cargo"
fi
if $CC -target wasm32-wasi --print-supported-cpus >/dev/null 2>&1; then
WASM="true"
else
WASM="false"
fi
if $CARGO --version >/dev/null 2>&1; then
RUST="true"
else
RUST="false"
fi
cat <<EOF > config/config.json
{
"wasm": $WASM,
"rust": $RUST,
"clang": "$CC",
"cargo": "$CARGO"
}
EOF