From 72b95a43ca4902c9b8c41c4962094e301278797e Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Sun, 4 Mar 2018 11:18:40 +0100 Subject: build: Improve ssh-agent command detection With this patch, configure skips the checks for the commands when --disable-ssh-agent; otherwise, error out if any of those commands ias unavailable. In either case, set SSH_AGENT and SSH_ADD macros so that ssh-agent code compile. --- configure.ac | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index ff8c7b61..ec1aee3b 100644 --- a/configure.ac +++ b/configure.ac @@ -347,21 +347,23 @@ AC_ARG_ENABLE([ssh-agent], AC_HELP_STRING([--disable-ssh-agent], [Don't include SSH agent in gnome-keyring])) -AC_PATH_PROG([SSH_AGENT], [ssh-agent], [false]) -AC_DEFINE_UNQUOTED(SSH_AGENT, "$SSH_AGENT", [The path to ssh-agent]) - -AC_PATH_PROG([SSH_ADD], [ssh-add], [false]) -AC_DEFINE_UNQUOTED(SSH_ADD, "$SSH_ADD", [The path to ssh-add]) - -if test "$enable_ssh_agent" != "no"; then - if test "$SSH_AGENT" = "false" -o "$SSH_ADD" = "false"; then - enable_ssh_agent=no +if test "$enable_ssh_agent" = "no"; then + SSH_AGENT=false + SSH_ADD=false +else + AC_PATH_PROG([SSH_AGENT], [ssh-agent], [no]) + AC_PATH_PROG([SSH_ADD], [ssh-add], [no]) + if test "$SSH_AGENT" = "no" -o "$SSH_ADD" = "no"; then + AC_MSG_ERROR([the ssh-agent and ssh-add commands were not found]) else enable_ssh_agent=yes AC_DEFINE(WITH_SSH, 1, [Whether to build SSH agent or not]) fi fi +AC_DEFINE_UNQUOTED(SSH_AGENT, "$SSH_AGENT", [The path to ssh-agent]) +AC_DEFINE_UNQUOTED(SSH_ADD, "$SSH_ADD", [The path to ssh-add]) + AM_CONDITIONAL(WITH_SSH, test "$enable_ssh_agent" != "no") ssh_status="$enable_ssh_agent" -- cgit v1.2.1