From c7b12d340c94799e7ed4cc873a7bf018fa92cf2f Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 15 Sep 2013 20:33:04 -0700 Subject: [PATCH] basic install checking --- home/shrc.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/home/shrc.zsh b/home/shrc.zsh index bb10002..68a3d24 100644 --- a/home/shrc.zsh +++ b/home/shrc.zsh @@ -15,13 +15,15 @@ ify() { $@ | $ex } +has() { which "$1" >/dev/null && which "$1"; } + # cleanup in case of inherited exports for x in AR CC CPP CXX CFLAGS CPPFLAGS CXXFLAGS LDFLAGS RANLIB RC WINDRES; do export $x= done export PREFIX="$HOME/opt/local" -export CC=clang +export CC="$(has clang || has gcc)" export CFLAGS='-march=native -O2' export LDFLAGS='-Wl,-O1,--sort-common,-z,relro' export CFLAGS="$CFLAGS -I'$HOME/opt/local/include'" @@ -35,7 +37,7 @@ export GOPATH="$HOME/go" for x in ls dir vdir grep fgrep egrep; do alias $x="$x --color=auto" done -alias make="colormake" +alias make="$(has colormake || has make)" # just flags export LESS='-SR'