#!/bin/sh
#
# This script runs the version of gnucash in the current build tree
# with the valgrind memory-allocation debugger.  This is a slightly
# modified version of the overrides/gnucash shell script (and should
# be kept in sync with that).
#
exec ./src/bin/overrides/gnucash-build-env valgrind -v \
        --suppressions=./src/valgrind-gnucash.supp  \
        --error-limit=no \
        guile -e main -s "$0" "$@"

!#

(use-modules (gnucash main))

(define (main args)
  ;; UGLY HACK -- FIXME -- code should be rewritten to not need this.
  ;; In particular, we should be using gnc_scm_lookup where we're using
  ;; gh_lookup or gh_eval_str now.
  (set-current-module (resolve-module '(gnucash main)))
  (gnc:main))

;; Local Variables:
;; mode: scheme
;; End:
