Hi Adam,
On Monday, 7 May 2018 15:31:37 CEST Adam Robinson wrote:
I have attached a patch that allowed the build to complete
successfully on
macOS.
I haven't tried building the daemon under macOS, but I patched two files
there in a similar manner to some of the other files for consistency (just
the include order for rpc headers).
This is great to hear. I have few notes regarding your patch:
diff --git a/common/mlutils/unix_utils-c.c
b/common/mlutils/unix_utils-c.c
index 1b5eb7957..6d8aa0b6c 100644
--- a/common/mlutils/unix_utils-c.c
+++ b/common/mlutils/unix_utils-c.c
@@ -55,6 +55,10 @@
#include <windows.h>
#endif
+#ifdef __APPLE__ && __MACH__
+#include <sys/mount.h>
+#endif
This must be a configure check, including it if found. See other
headers e.g. in the same file, before the bit you added.
diff --git a/daemon/tsk.c b/daemon/tsk.c
index ad10d74fe..00a4b04b4 100644
--- a/daemon/tsk.c
+++ b/daemon/tsk.c
@@ -23,8 +23,8 @@
#include <inttypes.h>
#include <string.h>
#include <unistd.h>
-#include <rpc/xdr.h>
#include <rpc/types.h>
+#include <rpc/xdr.h>
#include "guestfs_protocol.h"
#include "daemon.h"
All of these changes look good to me. Would it be possible for you to
create a git formatted patch (so with proper authorship, description,
etc) only with them?
diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
index 17cf556d9..b78a5cefa 100644
--- a/m4/guestfs-libraries.m4
+++ b/m4/guestfs-libraries.m4
@@ -181,9 +181,14 @@ PKG_CHECK_MODULES([RPC], [libtirpc], [], [
# If we don't have libtirpc, then we must have <rpc/xdr.h> and
# some library to link to in libdir.
RPC_CFLAGS=""
+ AC_CHECK_HEADER([rpc/types.h], [AC_DEFINE([HAVE_RPC_TYPES_H],
+ [], [no rpc/types.h])])
AC_CHECK_HEADER([rpc/xdr.h],[],[
- AC_MSG_ERROR([XDR header files are required])
- ])
+ AC_MSG_ERROR([XDR header files are required])],
+[#ifdef HAVE_RPC_TYPES_H
+# include <rpc/types.h>
+#endif
+])
Considering we assume that rpc/types.h exists, there is no need to
check it at configure time -- just include it directly in the
AC_CHECK_HEADER for rpc/xdr.h.
Also, this needs to be in its own patch (with authorship, description,
etc).
--
Pino Toscano