# LIBSSH2_CHECK_CONFIG ([DEFAULT-ACTION])
# ----------------------------------------------------------
# Checks for ssh2. DEFAULT-ACTION is the string yes or no to
# specify whether to default to --with-ssh2 or --without-ssh2.
# If not supplied, DEFAULT-ACTION is no.
# The minimal supported SSH2 library version is 1.0.0.
# This macro #defines HAVE_SSH2 if a required header files are
# found, and sets @SSH2_LDFLAGS@, @SSH2_CFLAGS@ and @SSH2_LIBS@
# to the necessary values.
# Users may override the detected values by doing something like:
# SSH2_LIBS="-lssh2" SSH2_CFLAGS="-I/usr/myinclude" ./configure
# This macro is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
AC_DEFUN([LIBSSH2_TRY_LINK],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
LIBSSH2_SESSION *session;
session = libssh2_session_init();
]])],[found_ssh2="yes"],[])
AC_DEFUN([LIBSSH2_ACCEPT_VERSION],
# Zabbix minimal major supported version of libssh2:
minimal_libssh2_major_version=1
found_ssh2_version_major=`cat $1 | $EGREP \#define.*LIBSSH2_VERSION_MAJOR | $AWK '{print @S|@3;}'`
if test $found_ssh2_version_major -ge $minimal_libssh2_major_version; then
accept_ssh2_version="yes"
AC_DEFUN([LIBSSH2_CHECK_CONFIG],
AC_ARG_WITH(ssh2,[If you want to use SSH2 based checks:
AS_HELP_STRING([--with-ssh2@<:@=DIR@:>@],[use SSH2 package @<:@default=no@:>@, DIR is the SSH2 library install directory.])],
if test "$withval" = "no"; then
elif test "$withval" = "yes"; then
],[want_ssh2=ifelse([$1],,[no],[$1])]