From ca1e9749bfb069d90aa44efbf6f3d611b6104c1b Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 14 Dec 2016 14:18:22 +0100 Subject: 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 --- tools/gpgconf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/gpgconf.c') diff --git a/tools/gpgconf.c b/tools/gpgconf.c index 5f7912a03..d056f4f57 100644 --- a/tools/gpgconf.c +++ b/tools/gpgconf.c @@ -44,6 +44,7 @@ enum cmd_and_opt_values oNull = '0', oNoVerbose = 500, oHomedir, + oBuilddir, aListComponents, aCheckPrograms, @@ -98,6 +99,7 @@ static ARGPARSE_OPTS opts[] = { oRuntime, "runtime", 0, N_("activate changes at runtime, if possible") }, /* hidden options */ { oHomedir, "homedir", 2, "@" }, + { oBuilddir, "build-prefix", 2, "@" }, { oNull, "null", 0, "@" }, { oNoVerbose, "no-verbose", 0, "@"}, {0} @@ -483,6 +485,7 @@ main (int argc, char **argv) case oVerbose: opt.verbose++; break; case oNoVerbose: opt.verbose = 0; break; case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break; + case oBuilddir: gnupg_set_builddir (pargs.r.ret_str); break; case oNull: opt.null = 1; break; case aListDirs: -- cgit v1.2.3