Add support for saving the passphrase with libsecret.
* configure.ac (COMMON_CFLAGS): New variable. AC_SUBST it. (COMMON_LIBS): Likewise. AC_SUBST it. (LIBSECRET_CFLAGS): Likewise. (LIBSECRET_LIBS): Likewise. (--enable-libsecret): Add option to enable support for libsecret. If enabled, check for its presense. * pinentry/password-cache.h: New field. * pinentry/password-cache.c: New field. * pinentry/pinentry.h (struct pinentry): Add fields pin_from_cache, allow_external_password_cache, tried_password_cache, keyinfo, and may_cache_password. * pinentry/pinentry.c: Include "password-cache.h". (pinentry): Initialize new fields. (option_handler): Handle the "allow-external-password-cache" option. (cmd_setkeyinfo): Implement it. (cmd_getpin): Read the password from the cache, if appropriate. Save it to the cache, if appropriate. * pinentry/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS). (LDADD): Add $(COMMON_LIBS). (libpinentry_a_SOURCES): Add password-cache.h password-cache.c. * gtk+-2/pinentry-gtk-2.c (may_save_passphrase_toggled): New function. (create_window): Take additional parameter, the pinentry's context. Update callers. [HAVE_LIBSECRET]: Show a checkbox asking whether the passphrase should be saved. * gtk+-2/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS). (LDADD): Add $(COMMON_LIBS). * curses/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS). (LDADD): Add $(COMMON_LIBS). * tty/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS). (LDADD): Add $(COMMON_LIBS). * doc/pinentry.texi (Protocol): Update documentation. Describe the protocol and provide some justification.