Skip to content

Commit

Permalink
LU-3497 build: Use alt. path for ZFS development headers
Browse files Browse the repository at this point in the history
In the move to dkms the ability to use ZFS userland developement
headers from the ZFS source tree instead of /usr/include was
removed. This patch restores the ability to build lustre using
ZFS on any build box that lacks having the ZFS developement rpms
installed.

Signed-off-by: James Simmons <[email protected]>
Change-Id: I901b00cfa27798e571d6579e81f191f0a79536da
Reviewed-on: http://review.whamcloud.com/8261
Tested-by: Jenkins
Reviewed-by: Minh Diep <[email protected]>
Tested-by: Maloo <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
  • Loading branch information
jasimmons1973 authored and Oleg Drokin committed Nov 17, 2013
1 parent 5ee03f6 commit c25461c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
38 changes: 32 additions & 6 deletions config/lustre-build-zfs.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ dnl # * /usr/src/zfs-${VERSION}
dnl # * ../spl/
dnl # * $LINUX
dnl #
dnl # --with-zfs-devel=path
dnl # - User provided directory where zfs development headers
dnl # are located. This option is typically used when user
dnl # uses rpm2cpio to unpack src rpm.
dnl #
dnl # --with-zfs=path - Enable zfs support and use the zfs headers in the
dnl # provided path. No autodetection is performed and
dnl # if no headers are found this is a fatal error.
Expand Down Expand Up @@ -263,16 +268,37 @@ AC_DEFUN([LB_ZFS], [
AC_SUBST(ZFS_SYMBOLS)
])

AC_DEFUN([LB_ZFS_DEVEL], [
AC_ARG_WITH([zfs-devel],
[AS_HELP_STRING([--with-zfs-devel=PATH],
[Path to zfs development headers])],
[zfsdevel="$withval"])
AC_MSG_CHECKING([user provided zfs devel headers])
AS_IF([test ! -z "${zfsdevel}"], [
AS_IF([test -d "${zfsdevel}/usr/include/libspl" && test -d "${zfsdevel}/usr/include/libzfs"], [
zfslib="-I $zfsdevel/usr/include/libspl -I $zfsdevel/usr/include/libzfs"
], [
AC_MSG_ERROR([Path to development headers directory does not exist])
])
])
AC_MSG_RESULT([$zfslib])
])

AC_DEFUN([LB_ZFS_USER], [
dnl #
dnl # Detect user space zfs development headers.
dnl #
AC_MSG_CHECKING([zfs devel headers])
AS_IF([test -d /usr/include/libzfs && test -d /usr/include/libspl], [
zfslib="-I /usr/include/libspl -I /usr/include/libzfs"
], [
zfslib="[Not found]"
enable_zfs=no
AS_IF([test -z "${zfslib}"], [
AS_IF([test -e $zfssrc/include/libzfs.h && test -e $zfssrc/lib/libspl/include], [
zfslib="-I $zfssrc/lib/libspl/include -I $zfssrc/include"
], [test -d /usr/include/libzfs && test -d /usr/include/libspl], [
zfslib="-I /usr/include/libspl -I /usr/include/libzfs"
], [
zfslib="[Not Found]"
enable_zfs=no
])
])
AC_MSG_RESULT([$zfslib])
Expand Down Expand Up @@ -314,7 +340,7 @@ AC_DEFUN([LB_PATH_ZFS], [
LB_SPL
LB_ZFS
])
LB_ZFS_DEVEL
LB_ZFS_USER
dnl #
Expand Down
10 changes: 10 additions & 0 deletions contrib/lbuild/lbuild
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,16 @@ build_spl_zfs() {
for rpm in $rpms; do
rpm2cpio $rpm | cpio -id
done

if [ "$pkg" == "zfs" ]; then
mkdir -p $TOPDIR/zfsdevel
pushd $TOPDIR/zfsdevel
# We also need to extract zfs-devel rpm
local devel_rpm=$(ls -1 $TOPDIR/RPMS/*/$pkg-devel-*.rpm)
rpm2cpio $devel_rpm | cpio -id
popd
CONFIGURE_FLAGS="--with-$pkg-devel=$TOPDIR/zfsdevel ${CONFIGURE_FLAGS}"
fi
popd

CONFIGURE_FLAGS="--with-$pkg=$(ls -d $TOPDIR/usr/src/$pkg-*/|tail -1) ${CONFIGURE_FLAGS}"
Expand Down

0 comments on commit c25461c

Please sign in to comment.