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 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 # .custom
if [ -f ~/.custom ]; then if [ -f ~/.custom ]; then
source ~/.custom source ~/.custom

18
zshrc
View File

@ -10,7 +10,7 @@ UNAME=$(uname)
# enable terminal bell # enable terminal bell
if [ -f /usr/bin/xset ]; if [[ -f /usr/bin/xset ]];
then then
(xset b on&) (xset b on&)
fi fi
@ -774,6 +774,22 @@ erase-mbr() {
echo dd if=/dev/zero of=$1 bs=512 count=2 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. # Source files for miscannellious modifications.
# .custom # .custom