fi
fi
fi
-
;;
*)
ZFS_DIR=$(readlink -f $with_zfs)
AC_MSG_CHECKING([whether to enable zfs])
AC_MSG_RESULT([$with_zfs])
+if test x$with_zfs = xyes; then
+ AC_MSG_CHECKING([for location of zfs library headers])
+ if test -e "$ZFS_DIR/include/libzfs.h"; then
+ EXTRA_LIBZFS_INCLUDE="$EXTRA_LIBZFS_INCLUDE -I $ZFS_DIR/lib/libspl/include -I $ZFS_DIR/include"
+ AC_MSG_RESULT([$ZFS_DIR])
+ elif test -e "$ZFS_DIR/libzfs/libzfs.h"; then
+ EXTRA_LIBZFS_INCLUDE="$EXTRA_LIBZFS_INCLUDE -I $ZFS_DIR/libspl -I $ZFS_DIR/libzfs"
+ AC_MSG_RESULT([$ZFS_DIR])
+ elif test -e "/usr/include/libzfs/libzfs.h"; then
+ AC_MSG_RESULT([/usr/include])
+ EXTRA_LIBZFS_INCLUDE="$EXTRA_LIBZFS_INCLUDE -I /usr/include/libspl -I /usr/include/libzfs"
+ else
+ AC_MSG_RESULT([unknown])
+ AC_MSG_ERROR([Could not locate zfs library headers.])
+ fi
+ AC_SUBST(EXTRA_LIBZFS_INCLUDE)
+fi
+
AC_ARG_WITH([zfs-obj],
AC_HELP_STRING([--with-zfs-obj=path], [set path to zfs objects]),
[
LB_SPL_BUILD
LB_ZFS_BUILD
-
fi
AM_CONDITIONAL(SPL_BUILD, test x$enable_spl_build = xyes)
AC_MSG_CHECKING([zfs source release])
if test -r $ZFS_OBJ/zfs_config.h; then
tmp_flags="$EXTRA_KCFLAGS"
- EXTRA_KCFLAGS="-I$ZFS_DIR $EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-I$ZFS_OBJ $EXTRA_KCFLAGS"
LB_LINUX_TRY_MAKE([
#include <$ZFS_OBJ/zfs_config.h>
],[
EXTRA_PRE_CFLAGS += -I@SPL_DIR@ -I@SPL_DIR@/include
EXTRA_PRE_CFLAGS += -include @SPL_OBJ@/spl_config.h
-EXTRA_PRE_CFLAGS += -I@ZFS_DIR@ -I@ZFS_DIR@/include
+EXTRA_PRE_CFLAGS += -I@ZFS_OBJ@ -I@ZFS_OBJ@/include
EXTRA_PRE_CFLAGS += -include @ZFS_OBJ@/zfs_config.h
@INCLUDE_RULES@
if ZFS_ENABLED
mount_lustre_SOURCES += mount_utils_zfs.c
mount_lustre_CPPFLAGS = -DHAVE_IOCTL_IN_UNISTD_H
-mount_lustre_CPPFLAGS += -I /usr/include/libspl -I /usr/include/libzfs
+mount_lustre_CPPFLAGS += $(EXTRA_LIBZFS_INCLUDE)
mount_lustre_LDFLAGS = -pthread -rdynamic -ldl
endif
if ZFS_ENABLED
mkfs_lustre_SOURCES += mount_utils_zfs.c
mkfs_lustre_CPPFLAGS += -DHAVE_IOCTL_IN_UNISTD_H
-mkfs_lustre_CPPFLAGS += -I /usr/include/libspl -I /usr/include/libzfs
+mkfs_lustre_CPPFLAGS += $(EXTRA_LIBZFS_INCLUDE)
mkfs_lustre_LDFLAGS = -pthread -rdynamic -ldl
endif
if ZFS_ENABLED
tunefs_lustre_SOURCES += mount_utils_zfs.c
tunefs_lustre_CPPFLAGS += -DHAVE_IOCTL_IN_UNISTD_H
-tunefs_lustre_CPPFLAGS += -I /usr/include/libspl -I /usr/include/libzfs
+tunefs_lustre_CPPFLAGS += $(EXTRA_LIBZFS_INCLUDE)
tunefs_lustre_LDFLAGS = -pthread -rdynamic -ldl
endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
+#include "mount_utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <lustre_param.h>
#include <lnet/lnetctl.h>
#include <lustre_ver.h>
-#include "mount_utils.h"
#ifndef PATH_MAX
#define PATH_MAX 4096
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
+#include "mount_utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <lustre_ver.h>
#include <ctype.h>
#include <limits.h>
-#include "mount_utils.h"
#define MAXOPT 4096
#define MAX_RETRIES 99
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include "mount_utils.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <lustre_ver.h>
#include <sys/stat.h>
#include <sys/utsname.h>
-#include "mount_utils.h"
extern char *progname;
extern int verbose;
#ifndef _MOUNT_UTILS_H_
#define _MOUNT_UTILS_H_
+/* Some of the userland headers for libzfs also require
+ * zfs/spl linux kernel headers, but including these pull
+ * in linux kernel headers which conflicts with the
+ * userland version of libcfs. So the solution is tell the
+ * libzfs user land headrs that the zfs/spl kernel headers
+ * are already included even if this is not the case.
+ */
+#ifdef HAVE_ZFS_OSD
+#define _SPL_ZFS_H
+#define _SPL_SIGNAL_H
+#endif
#include <lustre_disk.h>
#include <lustre_param.h>
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
+#include "mount_utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <lustre_param.h>
#include <lnet/lnetctl.h>
#include <lustre_ver.h>
-#include "mount_utils.h"
#define MAX_HW_SECTORS_KB_PATH "queue/max_hw_sectors_kb"
#define MAX_SECTORS_KB_PATH "queue/max_sectors_kb"
/*
* Author: Brian Behlendorf <behlendorf1@llnl.gov>
*/
-
+#include "mount_utils.h"
#include <stdio.h>
#include <string.h>
-#include <libzfs/libzfs.h>
+#include <libzfs.h>
#include <dlfcn.h>
-#include "mount_utils.h"
-
/* Persistent mount data is stored in these user attributes */
#define LDD_VERSION_PROP "lustre:version"
#define LDD_FLAGS_PROP "lustre:flags"