From b9c52c921d21885c2f047030cca6c2b2fd05dc9e Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Sat, 20 Sep 2014 00:08:16 +0300 Subject: [PATCH] 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. --- bashrc | 15 +++++++++++++++ zshrc | 18 +++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index c78b506f..c4bf94d9 100644 --- a/bashrc +++ b/bashrc @@ -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 diff --git a/zshrc b/zshrc index afd8cce2..1aedcc5e 100644 --- a/zshrc +++ b/zshrc @@ -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