[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] build: find xdr headers on cygwin



* configure.ac (XDR_CFLAGS): Define when needed.
* src/Makefile.am (libvirt_driver_remote_la_CFLAGS): Use it.
---

On cygwin, './autogen.sh' still tries to enable --with-libvirtd, which
also enables networking, but that fails to compile because bridge.c
assumes <linux/param.h> and friends exist.  Also, vbox_XPCOMCGlue.c
fails to compile because it can't figure out an appropriate DYNLIB_NAME;
I don't know if anyone has ported a vbox shared library to cygwin
(where it would probably be named cygVBoxXPCMC.dll).

But with this patch, './autogen.sh --without-libvirtd --without-vbox'
successfully compiles.  It still fails several tests in 'make check',
which I hope to have time to look at next.

 configure.ac    |   24 ++++++++++++++++++++++++
 src/Makefile.am |    2 +-
 2 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index dde2cde..1c31e73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -333,6 +333,25 @@ if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then

     dnl check for cygwin's variation in xdr function names
     AC_CHECK_FUNCS([xdr_u_int64_t],[],[],[#include <rpc/xdr.h>])
+
+    dnl Cygwin 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 CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do
+        if test x"$CFLAGS" = xmissing; then
+          lv_cv_xdr_cflags=missing; break
+        fi
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rpc/rpc.h>
+        ]])], [lv_cv_xdr_cflags=${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])
 fi


@@ -2415,6 +2434,11 @@ AC_MSG_NOTICE([      nl: $LIBNL_CFLAGS $LIBNL_LIBS])
 else
 AC_MSG_NOTICE([      nl: no])
 fi
+if test "$with_remote" = "yes" || test "$with_libvirtd" = "yes" ; then
+AC_MSG_NOTICE([     xdr: $XDR_CFLAGS])
+else
+AC_MSG_NOTICE([     xdr: no])
+fi
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Test suite])
 AC_MSG_NOTICE([])
diff --git a/src/Makefile.am b/src/Makefile.am
index 0923d60..baa1bfd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -473,7 +473,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
 endif
 libvirt_driver_remote_la_CFLAGS =				\
 		$(GNUTLS_CFLAGS)				\
-		$(SASL_CFLAGS)					\
+		$(SASL_CFLAGS) $(XDR_CFLAGS)			\
 		-I top_srcdir@/src/conf				\
 		$(AM_CFLAGS)
 libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
-- 
1.7.3.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]