dotfiles/.bash_rc.d/99.darwin.sh

25 lines
727 B
Bash

if [ "$(uname)" == "Darwin" ]; then # start darwin module
# if the go tool is installed then export the go GO* vars
# to any GUI apps like emacs.
if [ $(which go) ]; then
for e in $(go env | grep GO); do
var=$(expr $e : '\(.*\)=')
val=$(expr $e : '.*=\(.*\)')
#if [ $var ]; then
# launchctl setenv $var $val
#fi
done;
fi; # end go environment setup
if [ -d "/opt/brew" ]; then # setup brew cgo flags so that it can find brew libs
export CFLAGS="-I/opt/brew/include"
export CPPFLAGS="-I/opt/brew/include"
export LDFLAGS="-L/opt/brew/lib"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
fi
fi # end darwin module