bashrc & zshrc: use clang when installed

clang sounds interesting and ZNC and WeeChat have automatic testing for
it and I have successfully compiled Python with it. Setting bash/zshrc
to use it seems like a good way to test what support it and what
doesn't.
This commit is contained in:
Mikaela Suomalainen 2014-09-20 00:08:16 +03:00
parent 621f44daca
commit b9c52c921d
2 changed files with 32 additions and 1 deletions

15
bashrc
View File

@ -801,6 +801,21 @@ erase-mbr() {
echo dd if=/dev/zero of=$1 bs=512 count=2
}
# Use clang if installed. It seems interesting and this is probably good
# way to test it. This might not be a function, but I don't have any better
# place for this.
if hash clang 2>/dev/null; then
export CC=clang
else
unset CC
fi
if hash clang++ 2>/dev/null; then
export CXX=clang++
else
unset CXX
fi
# .custom
if [ -f ~/.custom ]; then
source ~/.custom

18
zshrc
View File

@ -10,7 +10,7 @@ UNAME=$(uname)
# enable terminal bell
if [ -f /usr/bin/xset ];
if [[ -f /usr/bin/xset ]];
then
(xset b on&)
fi
@ -774,6 +774,22 @@ erase-mbr() {
echo dd if=/dev/zero of=$1 bs=512 count=2
}
# Use clang if installed. It seems interesting and this is probably good
# way to test it. This might not be a function, but I don't have any better
# place for this.
if hash clang 2>/dev/null; then
export CC=clang
else
unset CC
fi
if hash clang++ 2>/dev/null; then
export CXX=clang++
else
unset CXX
fi
# Source files for miscannellious modifications.
# .custom