blob: 7ef26b6e51301b82eb08422156a68f47164bbaf6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/bin/bash
arch=$(uname -m)
if [ "${arch}" != "x86_64" ]; then
echo "This tool is only meant to be used on x86_64!"
exit 1
fi
count=$(find /usr/bin/riscv64-*-gcc -printf "%f\n" | grep -v elf -c)
if [ "$count" -lt 1 ]; then
echo "There are too many options for the compiler, not even trying... Bail!"
exit 1
fi
bin=$(find /usr/bin/riscv64-*-gcc -printf "%f\n" | grep -v elf | rev | cut -c4- | rev)
export ARCH="riscv"
export CROSS_COMPILE="${bin}"
|