]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/config.sh
Merge commit '3ae8faff4d46ad92f194c2a4b941c3152a701b31' into clippyup
[rust.git] / compiler / rustc_codegen_cranelift / scripts / config.sh
1 # Note to people running shellcheck: this file should only be sourced, not executed directly.
2
3 set -e
4
5 dylib=$(echo "" | rustc --print file-names --crate-type dylib --crate-name rustc_codegen_cranelift -)
6
7 if echo "$RUSTC_WRAPPER" | grep sccache; then
8 echo
9 echo -e "\x1b[1;93m=== Warning: Unset RUSTC_WRAPPER to prevent interference with sccache ===\x1b[0m"
10 echo
11 export RUSTC_WRAPPER=
12 fi
13
14 dir=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)
15
16 export RUSTC=$dir"/bin/cg_clif"
17
18 export RUSTDOCFLAGS=$linker' -Cpanic=abort -Zpanic-abort-tests '\
19 '-Zcodegen-backend='$dir'/lib/'$dylib' --sysroot '$dir
20
21 # FIXME fix `#[linkage = "extern_weak"]` without this
22 if [[ "$(uname)" == 'Darwin' ]]; then
23    export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
24 fi
25
26 export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib:"$dir"/lib"
27 export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH