if test "x$want_ssh" = "xyes"; then
AC_MSG_CHECKING(for SSH support)
if test "x$_libssh_dir" = "xno"; then
if test -f /usr/include/libssh/libssh.h; then
SSH_CFLAGS=-I/usr/include
SSH_LDFLAGS=-L/usr/lib
SSH_LIBS="-lssh"
found_ssh="yes"
LIBSSH_ACCEPT_VERSION([/usr/include/libssh/libssh.h])
elif test -f /usr/local/include/libssh/libssh.h; then
SSH_CFLAGS=-I/usr/local/include
SSH_LDFLAGS=-L/usr/local/lib
SSH_LIBS="-lssh"
found_ssh="yes"
LIBSSH_ACCEPT_VERSION([/usr/local/include/libssh/libssh.h])
else #libraries are not found in default directories
found_ssh="no"
AC_MSG_RESULT(no)
fi # test -f /usr/include/libssh/libssh.h; then
else # test "x$_libssh_dir" = "xno"; then
if test -f $_libssh_dir/include/libssh/libssh.h; then
SSH_CFLAGS=-I$_libssh_dir/include
SSH_LDFLAGS=-L$_libssh_dir/lib
SSH_LIBS="-lssh"
found_ssh="yes"
LIBSSH_ACCEPT_VERSION([$_libssh_dir/include/libssh/libssh.h])
else #if test -f $_libssh_dir/include/libssh/libssh.h; then
found_ssh="no"
AC_MSG_RESULT(no)
fi #test -f $_libssh_dir/include/libssh/libssh.h; then
fi #if test "x$_libssh_dir" = "xno"; then
fi # if test "x$want_ssh" != "xno"; then
...
AC_DEFUN([LIBSSH_ACCEPT_VERSION],
[
# Zabbix minimal major supported version of libssh:
minimal_libssh_major_version=0
minimal_libssh_minor_version=6
# get the major version
found_ssh_version_major=`cat $1 | $EGREP \#define.*'LIBSSH_VERSION_MAJOR ' | $AWK '{print @S|@3;}'`
found_ssh_version_minor=`cat $1 | $EGREP \#define.*'LIBSSH_VERSION_MINOR ' | $AWK '{print @S|@3;}'`
if test $((found_ssh_version_major)) -gt $((minimal_libssh_major_version)); then
accept_ssh_version="yes"
elif test $((found_ssh_version_major)) -lt $((minimal_libssh_major_version)); then
accept_ssh_version="no"
elif test $((found_ssh_version_minor)) -ge $((minimal_libssh_minor_version)); then
accept_ssh_version="yes"
else
accept_ssh_version="no"
fi;
])dnl