Bash script for switching the current gcc compiler.
if [[ -z "$1" ]]; then | |
exit 1 | |
fi | |
if [[ -e $1/bin/avr-gcc-7.1.0 ]]; then | |
cppopt=gnu++1z | |
elif [[ -e $1/bin/avr-gcc-4.9.2 ]]; then | |
cppopt=gnu++11 | |
else | |
echo unknown compiler version | |
exit 1 | |
fi | |
HWDIR=~/Applications/Arduino.app/Contents/Java/hardware | |
# assuming tools/avr is already a symlink | |
rm $HWDIR/tools/avr | |
ln -s "$1" $HWDIR/tools/avr | |
perl -i.bak -ple "s/gnu\+\+1\w/$cppopt/" $HWDIR/arduino/avr/platform.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment