#!/bin/sh

bin_available() {
	where "$1" | grep -vq ccache
}

export GPG_TTY=$(tty)
export EDITOR=/usr/bin/vim
export ORIG_PATH="$PATH"
export PATH="/opt/sbase/bin/:$PATH"

if bin_available clang; then
	export CC=clang
	export CXX=clang++
elif bin_available gcc ; then
	export CC=gcc
	export CXX=g++
elif bin_available tcc ; then
	export CC=tcc
fi

# Do separate paths on '/' for word operations like ^W
WORDCHARS=${WORDCHARS/\//}

# u=rwx,g=,o=
umask 077