BuildRequires: libssh-devel >= 0.7.0
%endif
+# On RHEL-7 rpcgen is still part of glibc-common package
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: rpcgen
-BuildRequires: libtirpc-devel
%endif
+BuildRequires: libtirpc-devel
+
%if %{with_firewalld_zone}
BuildRequires: firewalld-filesystem
%endif
dnl
AC_DEFUN([LIBVIRT_CHECK_XDR], [
- with_xdr="no"
if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then
- dnl Where are the XDR functions?
- dnl If portablexdr is installed, prefer that.
- dnl Otherwise try -lxdr (some MinGW)
- dnl -ltirpc (glibc 2.13.90 or newer) or none (most Unix)
- AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
- AC_SEARCH_LIBS([xdrmem_create],[xdr tirpc],[],
- [AC_MSG_ERROR([Cannot find a XDR library])])
- ])
+ dnl On MinGW portablexdr provides XDR functions, on linux they are
+ dnl provided by libtirpc and on FreeBSD/macOS there is no need to
+ dnl use extra library as it's provided by libc directly.
+
with_xdr="yes"
- dnl Recent glibc requires -I/usr/include/tirpc for <rpc/rpc.h>
- old_CFLAGS=$CFLAGS
- AC_CACHE_CHECK([where to find <rpc/rpc.h>], [lv_cv_xdr_cflags], [
- for add_CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do
- if test x"$add_CFLAGS" = xmissing; then
- lv_cv_xdr_cflags=missing; break
- fi
- CFLAGS="$old_CFLAGS $add_CFLAGS"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rpc/rpc.h>
- ]])], [lv_cv_xdr_cflags=${add_CFLAGS:-none}; break])
- done
- ])
- CFLAGS=$old_CFLAGS
- case $lv_cv_xdr_cflags in
- none) XDR_CFLAGS= ;;
- missing) AC_MSG_ERROR([Unable to find <rpc/rpc.h>]) ;;
- *) XDR_CFLAGS=$lv_cv_xdr_cflags ;;
- esac
- AC_SUBST([XDR_CFLAGS])
+ if test "$with_win" = "yes"; then
+ LIBVIRT_CHECK_LIB([XDR], [portablexdr], [xdrmem_create], [rpc/rpc.h])
+ elif test "$with_linux" = "yes"; then
+ LIBVIRT_CHECK_PKG([XDR], [libtirpc], [0.1.10])
+ else
+ AM_CONDITIONAL([WITH_XDR], [test "x$with_xdr" = "xyes"])
+ fi
fi
])