-AC_ARG_ENABLE([ldiskfs-build],
- AC_HELP_STRING([--enable-ldiskfs-build],
- [enable ldiskfs configure/make]),
- [], [
- LDISKFS_DIR_INTREE=$(readlink -f $PWD/ldiskfs)
- if test x$LDISKFS_DIR = x$LDISKFS_DIR_INTREE; then
- enable_ldiskfs_build='yes'
- else
- enable_ldiskfs_build='no'
- fi
- ])
-
-AC_MSG_CHECKING([whether to build ldiskfs])
-if test x$enable_ldiskfs_build = xyes; then
- AC_MSG_RESULT([$enable_ldiskfs_build])
- LDISKFS_SUBDIR="ldiskfs"
-
- LB_CHECK_FILE([$LDISKFS_DIR/configure], [], [
- AC_MSG_ERROR([Complete ldiskfs build system must exist])])
- LB_LDISKFS_EXT_SOURCE
-
- AC_SUBST(LDISKFS_SUBDIR)
-else
- enable_ldiskfs_build='no'
- AC_MSG_RESULT([$enable_ldiskfs_build])
-fi
-])
-
-AC_DEFUN([LB_LDISKFS_SYMVERS],
-[
-AC_MSG_CHECKING([ldiskfs module symbols])
-if test -r $LDISKFS_OBJ/Module.symvers; then
- LDISKFS_SYMBOLS=Module.symvers
-elif test -r $LDISKFS_OBJ/Modules.symvers; then
- LDISKFS_SYMBOLS=Modules.symvers
-elif test -r $LDISKFS_OBJ/ldiskfs/Module.symvers; then
- LDISKFS_SYMBOLS=Module.symvers
-elif test -r $LDISKFS_OBJ/ldiskfs/Modules.symvers; then
- LDISKFS_SYMBOLS=Modules.symvers
-else
- LDISKFS_SYMBOLS=$SYMVERFILE
-fi
-
-AC_MSG_RESULT([$LDISKFS_SYMBOLS])
-AC_SUBST(LDISKFS_SYMBOLS)
-])
-
-AC_DEFUN([LB_LDISKFS_RELEASE],
-[
-AC_MSG_CHECKING([ldiskfs source release])
-if test -r $LDISKFS_OBJ/config.h; then
- tmp_flags="$EXTRA_KCFLAGS"
- EXTRA_KCFLAGS="-I$LDISKFS_DIR $EXTRA_KCFLAGS"
- LB_LINUX_TRY_MAKE([
- #undef PACKAGE_NAME
- #undef PACKAGE_TARNAME
- #undef PACKAGE_VERSION
- #undef PACKAGE_STRING
- #undef PACKAGE_BUGREPORT
- #undef PACKAGE
- #undef VERSION
- #undef STDC_HEADERS
-
- #include <$LDISKFS_OBJ/config.h>
- ],[
- char *LDISKFS_RELEASE;
- LDISKFS_RELEASE=VERSION;
- ],[
- $makerule LUSTRE_KERNEL_TEST=conftest.i
- ],[
- test -s build/conftest.i
- ],[
- eval $(grep "LDISKFS_RELEASE=" build/conftest.i)
- ],[
- AC_MSG_RESULT([unknown])
- AC_MSG_ERROR([Could not preprocess test program.])
- ])
- EXTRA_KCFLAGS="$tmp_flags"
- rm build/conftest.i
-elif test -r $LDISKFS_DIR/configure.ac; then
- LDISKFS_RELEASE=$(awk '/AC\_INIT/ { print [$]3 }' \
- $LDISKFS_DIR/configure.ac | tr ',' '\n')