From 7546fd9cf69775cc256bd9d2878b2426fe14248b Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Mon, 20 May 2019 16:51:59 -0400 Subject: [PATCH] configure: better error handling on session key check. There are a few changes bundled here: * say "No." explicitly if there's a failure. * try to avoid implying that gpgme-config is necessary to build notmuch itself (it's not, though it may be useful if you need to rebuild gmime). * leave _check_session_keys and _check_session_keys.c around if ./configure fails, so that the user can play with it more easily for debugging. * let error messages show when _check_session_keys.c is built. Signed-off-by: Daniel Kahn Gillmor Amended by DB: use command -v instead of which. --- configure | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/configure b/configure index e157aadf..f7d37e50 100755 --- a/configure +++ b/configure @@ -529,7 +529,7 @@ int main () { return 0; } EOF - if ${CC} ${CFLAGS} ${gmime_cflags} ${gmime_ldflags} _check_session_keys.c -o _check_session_keys > /dev/null 2>&1 \ + if ${CC} ${CFLAGS} ${gmime_cflags} ${gmime_ldflags} _check_session_keys.c -o _check_session_keys \ && TEMP_GPG=$(mktemp -d) \ && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < test/gnupg-secret-key.asc \ && SESSION_KEY=$(GNUPGHOME=${TEMP_GPG} ./_check_session_keys) \ @@ -538,17 +538,21 @@ EOF printf "OK.\n" else cat </dev/null; then + printf 'Your current GPGME development version is: %s\n' "$(gpgme-config --version)" + else + printf 'You do not have the GPGME development libraries installed.\n' + fi + rm -rf "$TEMP_GPG" errors=$((errors + 1)) fi else @@ -1023,7 +1027,7 @@ for flag in -Wmissing-declarations; do done printf "\n\t%s\n" "${WARN_CFLAGS}" -rm -f minimal minimal.c _libversion.c _libversion _libversion.sh +rm -f minimal minimal.c _libversion.c _libversion _libversion.sh _check_session_keys.c _check_session_keys # construct the Makefile.config cat > Makefile.config <