mirror of https://gitee.com/openkylin/libvirt.git
m4/virt-libpcap: error out if asked for libpcap but it was not found
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
368e143a1c
commit
604f6ef85f
|
@ -26,7 +26,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [
|
||||||
LIBPCAP_CONFIG="pcap-config"
|
LIBPCAP_CONFIG="pcap-config"
|
||||||
LIBPCAP_CFLAGS=""
|
LIBPCAP_CFLAGS=""
|
||||||
LIBPCAP_LIBS=""
|
LIBPCAP_LIBS=""
|
||||||
LIBPCAP_FOUND="no"
|
|
||||||
|
|
||||||
if test "x$with_libpcap" != "xno"; then
|
if test "x$with_libpcap" != "xno"; then
|
||||||
case $with_libpcap in
|
case $with_libpcap in
|
||||||
|
@ -36,21 +35,22 @@ AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [
|
||||||
AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [
|
AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [
|
||||||
AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED )
|
AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED )
|
||||||
if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then
|
if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then
|
||||||
|
if test "x$with_libpcap" != "xcheck"; then
|
||||||
|
AC_MSG_ERROR([You must install libpcap >= $LIBPCAP_REQUIRED to compile libvirt])
|
||||||
|
fi
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
with_libpcap="no"
|
||||||
else
|
else
|
||||||
LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`"
|
LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`"
|
||||||
LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`"
|
LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`"
|
||||||
LIBPCAP_FOUND="yes"
|
with_libpcap="yes"
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$LIBPCAP_FOUND" = "xyes"; then
|
if test "x$with_libpcap" = "xyes"; then
|
||||||
AC_DEFINE_UNQUOTED([HAVE_LIBPCAP], 1, [whether libpcap can be used])
|
AC_DEFINE_UNQUOTED([HAVE_LIBPCAP], 1, [whether libpcap can be used])
|
||||||
with_libpcap="yes"
|
|
||||||
else
|
|
||||||
with_libpcap="no"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST([LIBPCAP_CFLAGS])
|
AC_SUBST([LIBPCAP_CFLAGS])
|
||||||
|
|
Loading…
Reference in New Issue