#!/bin/sh

PATH="/usr/local/bin:${PATH}"
export PATH

GUILE_WARN_DEPRECATED="no"
export GUILE_WARN_DEPRECATED

GNC_MODULE_PATH="/usr/local/lib/gnucash:${GNC_MODULE_PATH}"

EXTRA_PATH="${EXTRA_PATH}:/usr/local/share/gnucash/guile-modules"
EXTRA_PATH="${EXTRA_PATH}:/usr/local/share/gnucash/scm"
GUILE_LOAD_PATH="${EXTRA_PATH}:${GUILE_LOAD_PATH}"

EXTRA_LIBS="${GNC_MODULE_PATH}"
EXTRA_LIBS="${EXTRA_LIBS}:/usr/local/lib"
EXTRA_LIBS="${EXTRA_LIBS}:/usr/local/lib/gnucash"

LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
DYLD_LIBRARY_PATH="${EXTRA_LIBS}:${DYLD_LIBRARY_PATH}"

export GNC_MODULE_PATH
export GUILE_LOAD_PATH
export LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH

exec gnucash-bin "$@"
