diff options
author | Werner Koch <[email protected]> | 2015-10-20 15:32:23 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2015-10-20 15:32:23 +0000 |
commit | 734c61dc9d4915605816803182c9adcc1594e008 (patch) | |
tree | ffc41ebe8bbc43f131ccf78708d2ca24388a7f31 /g10/gpg.c | |
parent | gpg: Don't die immediately if the TOFU DB is locked. (diff) | |
download | gnupg-734c61dc9d4915605816803182c9adcc1594e008.tar.gz gnupg-734c61dc9d4915605816803182c9adcc1594e008.zip |
build: Allow building without SQLlite support.
* configure.ac: Add option --dsiable-tofu and --disable-sqlite.
(NEED_SQLITE_VERSION): New var.
(USE_TOFU): New ac_define and am_conditional.
* autogen.sh (build-w32): Add PKG_CONFIG_LIBDIR to configure so that
pkg-config find the correct .pc file.
* g10/Makefile.am (tofu_source): New. Build only if enabled.
* g10/gpg.c (parse_trust_model)[!USE_TOFU]: Disable tofu models.
(parse_tofu_policy)[!USE_TOFU]: Disable all.
(parse_tofu_db_format)[!USE_TOFU]: Disable all.
(main) <aTOFUPolicy>[!USE_TOFU]: Skip.
* g10/keyedit.c (show_key_with_all_names_colon)[!USE_TOFU]: Do not
call tofu functions.
* g10/keylist.c (list_keyblock_colon)[!USE_TOFU]: Ditto.
* g10/trustdb.c (tdb_get_validity_core)[!USE_TOFU]: Skip tofu
processing.
--
This allows to build a minimal version of GnuPG. It is also currently
required to build for Windows.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/gpg.c')
-rw-r--r-- | g10/gpg.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1949,10 +1949,12 @@ parse_trust_model(const char *model) opt.trust_model=TM_ALWAYS; else if(ascii_strcasecmp(model,"direct")==0) opt.trust_model=TM_DIRECT; +#ifdef USE_TOFU else if(ascii_strcasecmp(model,"tofu")==0) opt.trust_model=TM_TOFU; else if(ascii_strcasecmp(model,"tofu+pgp")==0) opt.trust_model=TM_TOFU_PGP; +#endif /*USE_TOFU*/ else if(ascii_strcasecmp(model,"auto")==0) opt.trust_model=TM_AUTO; else @@ -1963,6 +1965,7 @@ parse_trust_model(const char *model) static int parse_tofu_policy (const char *policy) { +#ifdef USE_TOFU if (ascii_strcasecmp (policy, "auto") == 0) return TOFU_POLICY_AUTO; else if (ascii_strcasecmp (policy, "good") == 0) @@ -1974,6 +1977,7 @@ parse_tofu_policy (const char *policy) else if (ascii_strcasecmp (policy, "ask") == 0) return TOFU_POLICY_ASK; else +#endif /*USE_TOFU*/ { log_error (_("unknown TOFU policy '%s'\n"), policy); g10_exit (1); @@ -1983,6 +1987,7 @@ parse_tofu_policy (const char *policy) static int parse_tofu_db_format (const char *db_format) { +#ifdef USE_TOFU if (ascii_strcasecmp (db_format, "auto") == 0) return TOFU_DB_AUTO; else if (ascii_strcasecmp (db_format, "split") == 0) @@ -1990,6 +1995,7 @@ parse_tofu_db_format (const char *db_format) else if (ascii_strcasecmp (db_format, "flat") == 0) return TOFU_DB_FLAT; else +#endif /*USE_TOFU*/ { log_error (_("unknown TOFU DB format '%s'\n"), db_format); g10_exit (1); @@ -4417,6 +4423,7 @@ main (int argc, char **argv) break; case aTOFUPolicy: +#ifdef USE_TOFU { int policy; int i; @@ -4487,7 +4494,6 @@ main (int argc, char **argv) } merge_keys_and_selfsig (kb); - if (tofu_set_policy (kb, policy)) g10_exit (1); } @@ -4495,6 +4501,7 @@ main (int argc, char **argv) keydb_release (hd); } +#endif /*USE_TOFU*/ break; case aListPackets: |