common: Support locating components in the build tree.
authorJustus Winter <justus@g10code.com>
Wed, 14 Dec 2016 13:18:22 +0000 (14:18 +0100)
committerJustus Winter <justus@g10code.com>
Wed, 14 Dec 2016 15:41:18 +0000 (16:41 +0100)
commitca1e9749bfb069d90aa44efbf6f3d611b6104c1b
tree523a466ed36ebeb7b54d6149fddebfe5475edbd9
parent55dc81125abc43cd3cc8db951fc3b8a81767942d
common: Support locating components in the build tree.

* common/homedir.c (gnupg_build_directory): New variable.
(gnupg_module_name_called): Likewise.
(gnupg_set_builddir): New function.
(gnupg_set_builddir_from_env): Likewise.
(gnupg_module_name): Support locating components in the build tree.
* common/util.h (gnupg_set_builddir): New prototype.
* tests/openpgp/defs.scm (tools): Drop 'gpg and 'gpg-agent.
(tool): Rename to 'tool-hardcoded.
(gpg-conf): New function, with accessors for the results.
(gpg-components): New variable.
(tool): New function.
* tools/gpgconf.c (enum cmd_and_opt_values): New key.
(opts): New option '--build-prefix'.
(main): Handle new option.
--

This change makes sure that the components from the build tree are
used, and not some older installed version in PATH.  It also lets us
make GPGME use components from the build tree, making it possible to
execute GPGME's test suite with them.

Signed-off-by: Justus Winter <justus@g10code.com>
common/homedir.c
common/util.h
tests/openpgp/defs.scm
tools/gpgconf.c