1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

Check for libssh2 >= 1.0 for phy driver

* configure.in: phyp driver uses libssh2_session_block_directions()
  which is only available in libssh2 >= 1.0, so check for this symbol
  too when configuring
This commit is contained in:
Maximilian Wilhelm 2009-09-09 16:21:38 +02:00 committed by Daniel Veillard
parent aec22258ef
commit 56ad465675

View File

@ -875,37 +875,61 @@ elif test "$with_libssh2" = "no"; then
fi fi
if test "$with_phyp" = "check"; then if test "$with_phyp" = "check"; then
AC_CHECK_LIB([ssh2],[libssh2_session_startup],[ AC_CHECK_LIB([ssh2],[libssh2_session_startup],[
LIBSSH2_LIBS="$LIBSSH2_LIBS -lssh2 -L$libssh2_path" LIBSSH2_LIBS="$LIBSSH2_LIBS -lssh2 -L$libssh2_path"
AC_SUBST([LIBSSH2_LIBS])],[ AC_SUBST([LIBSSH2_LIBS])
],[
with_phyp="no" with_phyp="no"
with_libssh2="no"; with_libssh2="no";
],[]) ],[])
if test "$with_phyp" != "no"; then if test "$with_phyp" != "no"; then
AC_CHECK_HEADERS([libssh2.h],[ AC_CHECK_HEADERS([libssh2.h],[
with_phyp="yes" with_phyp="yes"
LIBSSH2_CFLAGS="-I/usr/local/include" LIBSSH2_CFLAGS="-I/usr/local/include"
AC_SUBST([LIBSSH2_CFLAGS]) AC_SUBST([LIBSSH2_CFLAGS])
AC_DEFINE_UNQUOTED([WITH_PHYP], 1, ],[
[whether IBM HMC / IVM driver is enabled]) with_phyp="no"
],[ with_libssh2="no";
with_phyp="no" ],[
with_libssh2="no"; ])
],[]) fi
fi
if test "$with_phyp" != "no"; then
saved_libs="$LIBS"
LIBS="$LIBS -lssh2"
AC_TRY_LINK([#include <libssh2.h>], [
(void) libssh2_session_block_directions(NULL);
], [
AC_DEFINE_UNQUOTED([WITH_PHYP], 1, [whether IBM HMC / IVM driver is enabled])
], [
with_phyp=no
AC_MSG_NOTICE([Function libssh2_session_block_directions() not present in your version of libssh2 but required for Phyp driver, disabling it])
])
LIBS="$saved_libs"
fi
elif test "$with_phyp" = "yes"; then elif test "$with_phyp" = "yes"; then
AC_CHECK_LIB([ssh2],[libssh2_session_startup],[ AC_CHECK_LIB([ssh2],[libssh2_session_startup],[
LIBSSH2_LIBS="$LIBSSH2_LIBS -lssh2 -L$libssh2_path" LIBSSH2_LIBS="$LIBSSH2_LIBS -lssh2 -L$libssh2_path"
AC_SUBST([LIBSSH2_LIBS])],[ AC_SUBST([LIBSSH2_LIBS])],[
AC_MSG_ERROR([You must install the libssh2 to compile Phype driver.]) AC_MSG_ERROR([You must install the libssh2 to compile Phyp driver.])
]) ])
AC_CHECK_HEADERS([libssh2.h],[ AC_CHECK_HEADERS([libssh2.h],[
LIBSSH2_CFLAGS="-I/usr/local/include" LIBSSH2_CFLAGS="-I/usr/local/include"
AC_SUBST([LIBSSH2_CFLAGS])],[ AC_SUBST([LIBSSH2_CFLAGS])],[
AC_MSG_ERROR([Cannot find libssh2 headers.Is libssh2 installed ?]) AC_MSG_ERROR([Cannot find libssh2 headers. Is libssh2 installed ?])
],[]) ],[])
saved_libs="$LIBS"
LIBS="$LIBS -lssh2"
AC_TRY_LINK([#include <libssh2.h>], [
(void) libssh2_session_block_directions(NULL);
], [], [
AC_MSG_ERROR([Function libssh2_session_block_directions() not present in your version of libssh2. Need >= 1.0])
])
LIBS="$saved_libs"
AC_DEFINE_UNQUOTED([WITH_PHYP], 1, AC_DEFINE_UNQUOTED([WITH_PHYP], 1,
[whether IBM HMC / IVM driver is enabled]) [whether IBM HMC / IVM driver is enabled])
fi fi