diff options
author | Daiki Ueno <dueno@src.gnome.org> | 2018-03-04 11:18:40 +0100 |
---|---|---|
committer | Daiki Ueno <dueno@src.gnome.org> | 2018-03-04 12:47:54 +0100 |
commit | 72b95a43ca4902c9b8c41c4962094e301278797e (patch) | |
tree | fefd7549ac07a88d6a8898b71aad7afd715d2664 | |
parent | 8db2b978e485d7349a46c734dd51fc30196da01a (diff) | |
download | gnome-keyring-72b95a43ca4902c9b8c41c4962094e301278797e.tar.gz |
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.
-rw-r--r-- | configure.ac | 20 |
1 files 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" |