2020-05-10 09:54:30 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#set -x
|
|
|
|
set -e
|
|
|
|
|
2022-01-30 20:45:14 -06:00
|
|
|
if [ -f ./gcc_path ]; then
|
2021-09-05 10:26:01 -05:00
|
|
|
export GCC_PATH=$(cat gcc_path)
|
|
|
|
else
|
|
|
|
echo 'Please put the path to your custom build of libgccjit in the file `gcc_path`, see Readme.md for details'
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-05-10 09:54:30 -05:00
|
|
|
|
|
|
|
export LD_LIBRARY_PATH="$GCC_PATH"
|
|
|
|
export LIBRARY_PATH="$GCC_PATH"
|
|
|
|
|
2022-01-30 20:45:14 -06:00
|
|
|
features=
|
|
|
|
|
|
|
|
if [[ "$1" == "--features" ]]; then
|
|
|
|
shift
|
|
|
|
features="--features $1"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2020-05-10 09:54:30 -05:00
|
|
|
if [[ "$1" == "--release" ]]; then
|
|
|
|
export CHANNEL='release'
|
2022-01-30 20:45:14 -06:00
|
|
|
CARGO_INCREMENTAL=1 cargo rustc --release $features
|
2020-05-10 09:54:30 -05:00
|
|
|
else
|
|
|
|
echo $LD_LIBRARY_PATH
|
|
|
|
export CHANNEL='debug'
|
2022-01-30 20:45:14 -06:00
|
|
|
cargo rustc $features
|
2020-05-10 09:54:30 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
source config.sh
|
|
|
|
|
|
|
|
rm -r target/out || true
|
|
|
|
mkdir -p target/out/gccjit
|
|
|
|
|
|
|
|
echo "[BUILD] sysroot"
|
|
|
|
time ./build_sysroot/build_sysroot.sh $CHANNEL
|