summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-08-09 23:54:15 -0700
committerHarshavardhana <harsha@harshavardhana.net>2014-08-11 09:02:51 -0700
commitc77a77ef0fca8371bba956b78a2da80f73f6f26b (patch)
treeb6dc9e1b13f5405ce3f516375d0468764bccc009
parentccb5dc01b8916f0e7d1e3d3535a81cc8b0f0c25e (diff)
osx: Enable qemu feature build on Darwin
Change-Id: Ie5d437aa6c52c180fd8d54680c5f882e75c0bf7e BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8448 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r--configure.ac6
-rw-r--r--contrib/qemu/include/sysemu/os-posix.h2
-rw-r--r--contrib/qemu/util/oslib-posix.c8
-rw-r--r--glusterfsd/src/Makefile.am2
-rw-r--r--xlators/features/qemu-block/src/Makefile.am3
5 files changed, 13 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 61ba9a28037..3c72b34f0d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -603,7 +603,7 @@ AC_SUBST(SYNCDAEMON_COMPILE)
AC_SUBST(SYNCDAEMON_SUBDIR)
# end SYNCDAEMON section
-# CDC xlator - check if libz is present if so enable HAVE_LIB_Z
+# CDC xlator - check if libz is present if so enable HAVE_LIB_Z
BUILD_CDC=yes
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],,
[AC_CHECK_LIB([z], [deflate], [LIBZ_LIBS="-lz"],
@@ -716,7 +716,8 @@ fi
AC_SUBST(HAVE_LINKAT)
dnl check for Monotonic clock
-AC_CHECK_FUNC([clock_gettime], [has_monotonic_clock=yes], AC_CHECK_LIB([rt], [clock_gettime], , AC_MSG_WARN([System doesn't have monotonic clock using contrib])))
+AC_CHECK_LIB([rt], [clock_gettime], ,
+ AC_MSG_WARN([System doesn't have monotonic clock using contrib]))
dnl Add cmockery2 for unit tests
case $host_os in
@@ -924,7 +925,6 @@ case $host_os in
GF_LDFLAGS=""
GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse"
BUILD_FUSERMOUNT="no"
- BUILD_QEMU_BLOCK="no"
FUSERMOUNT_SUBDIR=""
GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd"
;;
diff --git a/contrib/qemu/include/sysemu/os-posix.h b/contrib/qemu/include/sysemu/os-posix.h
index ed8cbaff6a3..ac4a80e6d8c 100644
--- a/contrib/qemu/include/sysemu/os-posix.h
+++ b/contrib/qemu/include/sysemu/os-posix.h
@@ -36,7 +36,7 @@ int os_mlock(void);
typedef struct timeval qemu_timeval;
#define qemu_gettimeofday(tp) gettimeofday(tp, NULL)
-#if !defined(CONFIG_UTIMENSAT) || defined(__FreeBSD__)
+#if !defined(CONFIG_UTIMENSAT) || defined(__FreeBSD__) || defined(__APPLE__)
#ifndef UTIME_NOW
# define UTIME_NOW ((1l << 30) - 1l)
#endif
diff --git a/contrib/qemu/util/oslib-posix.c b/contrib/qemu/util/oslib-posix.c
index 77cb9b72d1d..bac4c1a158e 100644
--- a/contrib/qemu/util/oslib-posix.c
+++ b/contrib/qemu/util/oslib-posix.c
@@ -86,7 +86,7 @@ void *qemu_oom_check(void *ptr)
void *qemu_memalign(size_t alignment, size_t size)
{
void *ptr;
-#if defined(_POSIX_C_SOURCE) && !defined(__sun__)
+#if defined(_POSIX_C_SOURCE) && !defined(__sun__) || defined(__APPLE__)
int ret;
ret = posix_memalign(&ptr, alignment, size);
if (ret != 0) {
@@ -175,11 +175,13 @@ int qemu_pipe(int pipefd[2])
int ret;
#ifdef CONFIG_PIPE2
+#ifdef pipe2
ret = pipe2(pipefd, O_CLOEXEC);
if (ret != -1 || errno != ENOSYS) {
return ret;
}
#endif
+#endif
ret = pipe(pipefd);
if (ret == 0) {
qemu_set_cloexec(pipefd[0]);
@@ -194,7 +196,8 @@ int qemu_utimens(const char *path, const struct timespec *times)
struct timeval tv[2], tv_now;
struct stat st;
int i;
-#if defined(CONFIG_UTIMENSAT) && !defined(__FreeBSD__)
+#if defined(CONFIG_UTIMENSAT)
+#ifdef utimensat
int ret;
ret = utimensat(AT_FDCWD, path, times, AT_SYMLINK_NOFOLLOW);
@@ -202,6 +205,7 @@ int qemu_utimens(const char *path, const struct timespec *times)
return ret;
}
#endif
+#endif
/* Fallback: use utimes() instead of utimensat() */
/* happy if special cases */
diff --git a/glusterfsd/src/Makefile.am b/glusterfsd/src/Makefile.am
index a2f05b64f65..66ede7a336f 100644
--- a/glusterfsd/src/Makefile.am
+++ b/glusterfsd/src/Makefile.am
@@ -15,7 +15,7 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) \
AM_CFLAGS = -Wall $(GF_CFLAGS)
-CLEANFILES =
+CLEANFILES =
$(top_builddir)/libglusterfs/src/libglusterfs.la:
$(MAKE) -C $(top_builddir)/libglusterfs/src/ all
diff --git a/xlators/features/qemu-block/src/Makefile.am b/xlators/features/qemu-block/src/Makefile.am
index 08a7b62a0db..801a1c45325 100644
--- a/xlators/features/qemu-block/src/Makefile.am
+++ b/xlators/features/qemu-block/src/Makefile.am
@@ -3,7 +3,8 @@ xlator_LTLIBRARIES = qemu-block.la
xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/features
qemu_block_la_LDFLAGS = -module -avoid-version
-qemu_block_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(GLIB_LIBS) -lz -lrt
+qemu_block_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
+ $(GLIB_LIBS) $(LIBZ_LIBS)
qemu_block_la_SOURCES_qemu = \
$(CONTRIBDIR)/qemu/qemu-coroutine.c \