[gnome-keyring] build: Improve ssh-agent command detection



commit 72b95a43ca4902c9b8c41c4962094e301278797e
Author: Daiki Ueno <dueno src gnome org>
Date:   Sun Mar 4 11:18:40 2018 +0100

    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 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ff8c7b6..ec1aee3 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"
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]