mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
build: properly handle ./configure --with-libpcap
Without this fix, ./configure --with-libpcap will cause --with-libpcap=yes to be implicitly passed down, which cause yes/bin/pcap-config to be searched for rather than /usr/bin/pcap-config. Also output pcap: no when pcap is not found or disabled.
This commit is contained in:
parent
5faf88fe98
commit
0b9ab2abf1
30
configure.ac
30
configure.ac
@ -1194,20 +1194,22 @@ LIBPCAP_FOUND="no"
|
|||||||
|
|
||||||
AC_ARG_WITH([libpcap], AC_HELP_STRING([--with-libpcap=@<:@PFX@:>@], [libpcap location]))
|
AC_ARG_WITH([libpcap], AC_HELP_STRING([--with-libpcap=@<:@PFX@:>@], [libpcap location]))
|
||||||
if test "$with_qemu" = "yes"; then
|
if test "$with_qemu" = "yes"; then
|
||||||
if test "x$with_libpcap" != "xno" ; then
|
AS_CASE(["x$with_libpcap"],
|
||||||
if test "x$with_libpcap" != "x" ; then
|
[xno], [LIBPCAP_CONFIG=""],
|
||||||
LIBPCAP_CONFIG=$with_libpcap/bin/$LIBPCAP_CONFIG
|
[x|xyes], [LIBPCAP_CONFIG="pcap-config"],
|
||||||
fi
|
[LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config"]
|
||||||
AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED )
|
)
|
||||||
if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then
|
AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED )
|
||||||
else
|
if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then
|
||||||
LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`"
|
AC_MSG_RESULT(no)
|
||||||
LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`"
|
else
|
||||||
LIBPCAP_FOUND="yes"
|
LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`"
|
||||||
AC_MSG_RESULT(yes)
|
LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`"
|
||||||
fi
|
LIBPCAP_FOUND="yes"
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
fi
|
fi
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$LIBPCAP_FOUND" = "xyes"; then
|
if test "x$LIBPCAP_FOUND" = "xyes"; then
|
||||||
@ -2406,7 +2408,7 @@ AC_MSG_NOTICE([ xmlrpc: $XMLRPC_CFLAGS $XMLRPC_LIBS])
|
|||||||
else
|
else
|
||||||
AC_MSG_NOTICE([ xmlrpc: no])
|
AC_MSG_NOTICE([ xmlrpc: no])
|
||||||
fi
|
fi
|
||||||
if test "$with_qemu" = "yes" ; then
|
if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then
|
||||||
AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
|
AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
|
||||||
else
|
else
|
||||||
AC_MSG_NOTICE([ pcap: no])
|
AC_MSG_NOTICE([ pcap: no])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user