2010-08-26 22:22:58 +04:00
|
|
|
AC_DEFUN([ZFS_AC_LICENSE], [
|
|
|
|
AC_MSG_CHECKING([zfs author])
|
|
|
|
AC_MSG_RESULT([$ZFS_META_AUTHOR])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([zfs license])
|
|
|
|
AC_MSG_RESULT([$ZFS_META_LICENSE])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_DEBUG], [
|
|
|
|
AC_MSG_CHECKING([whether debugging is enabled])
|
|
|
|
AC_ARG_ENABLE([debug],
|
|
|
|
[AS_HELP_STRING([--enable-debug],
|
|
|
|
[Enable generic debug support @<:@default=no@:>@])],
|
|
|
|
[],
|
|
|
|
[enable_debug=no])
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_debug" = xyes],
|
|
|
|
[
|
|
|
|
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
|
|
|
|
HOSTCFLAGS="${HOSTCFLAGS} -DDEBUG -Werror"
|
|
|
|
DEBUG_CFLAGS="-DDEBUG -Werror"
|
|
|
|
DEBUG_STACKFLAGS="-fstack-check"
|
2012-02-27 22:12:40 +04:00
|
|
|
DEBUG_ZFS="_with_debug"
|
|
|
|
AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled])
|
2010-08-26 22:22:58 +04:00
|
|
|
],
|
|
|
|
[
|
|
|
|
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG "
|
|
|
|
HOSTCFLAGS="${HOSTCFLAGS} -DNDEBUG "
|
|
|
|
DEBUG_CFLAGS="-DNDEBUG"
|
|
|
|
DEBUG_STACKFLAGS=""
|
2012-02-27 22:12:40 +04:00
|
|
|
DEBUG_ZFS="_without_debug"
|
2010-08-26 22:22:58 +04:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_SUBST(DEBUG_CFLAGS)
|
|
|
|
AC_SUBST(DEBUG_STACKFLAGS)
|
2012-02-27 22:12:40 +04:00
|
|
|
AC_SUBST(DEBUG_ZFS)
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_MSG_RESULT([$enable_debug])
|
|
|
|
])
|
|
|
|
|
2012-03-21 03:00:17 +04:00
|
|
|
AC_DEFUN([ZFS_AC_DEBUG_DMU_TX], [
|
|
|
|
AC_ARG_ENABLE([debug-dmu-tx],
|
|
|
|
[AS_HELP_STRING([--enable-debug-dmu-tx],
|
|
|
|
[Enable dmu tx validation @<:@default=no@:>@])],
|
|
|
|
[],
|
|
|
|
[enable_debug_dmu_tx=no])
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_debug_dmu_tx" = xyes],
|
|
|
|
[
|
|
|
|
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_DMU_TX"
|
|
|
|
DEBUG_DMU_TX="_with_debug_dmu_tx"
|
|
|
|
AC_DEFINE([DEBUG_DMU_TX], [1],
|
|
|
|
[Define to 1 to enabled dmu tx validation])
|
|
|
|
],
|
|
|
|
[
|
|
|
|
DEBUG_DMU_TX="_without_debug_dmu_tx"
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_SUBST(DEBUG_DMU_TX)
|
|
|
|
AC_MSG_CHECKING([whether dmu tx validation is enabled])
|
|
|
|
AC_MSG_RESULT([$enable_debug_dmu_tx])
|
|
|
|
])
|
|
|
|
|
2011-06-15 02:09:05 +04:00
|
|
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
|
|
|
ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
|
|
|
|
])
|
|
|
|
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_DEFUN([ZFS_AC_CONFIG], [
|
|
|
|
TARGET_ASM_DIR=asm-generic
|
|
|
|
AC_SUBST(TARGET_ASM_DIR)
|
|
|
|
|
|
|
|
ZFS_CONFIG=all
|
|
|
|
AC_ARG_WITH([config],
|
|
|
|
AS_HELP_STRING([--with-config=CONFIG],
|
|
|
|
[Config file 'kernel|user|all|srpm']),
|
|
|
|
[ZFS_CONFIG="$withval"])
|
2012-07-17 12:36:43 +04:00
|
|
|
AC_ARG_ENABLE([linux-builtin],
|
|
|
|
[AC_HELP_STRING([--enable-linux-builtin],
|
|
|
|
[Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
|
|
|
|
[],
|
|
|
|
[enable_linux_builtin=no])
|
2010-08-26 22:22:58 +04:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([zfs config])
|
|
|
|
AC_MSG_RESULT([$ZFS_CONFIG]);
|
|
|
|
AC_SUBST(ZFS_CONFIG)
|
|
|
|
|
2011-06-15 02:09:05 +04:00
|
|
|
ZFS_AC_CONFIG_ALWAYS
|
|
|
|
|
2010-08-26 22:22:58 +04:00
|
|
|
case "$ZFS_CONFIG" in
|
|
|
|
kernel) ZFS_AC_CONFIG_KERNEL ;;
|
|
|
|
user) ZFS_AC_CONFIG_USER ;;
|
|
|
|
all) ZFS_AC_CONFIG_KERNEL
|
|
|
|
ZFS_AC_CONFIG_USER ;;
|
|
|
|
srpm) ;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([Error!])
|
|
|
|
AC_MSG_ERROR([Bad value "$ZFS_CONFIG" for --with-config,
|
|
|
|
user kernel|user|all|srpm]) ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AM_CONDITIONAL([CONFIG_USER],
|
2012-07-17 12:36:43 +04:00
|
|
|
[test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
|
2010-08-26 22:22:58 +04:00
|
|
|
AM_CONDITIONAL([CONFIG_KERNEL],
|
2012-07-17 12:36:43 +04:00
|
|
|
[test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
|
|
|
|
[test "x$enable_linux_builtin" != xyes ])
|
2010-08-26 22:22:58 +04:00
|
|
|
])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
|
|
|
|
dnl # are missing it is non-fatal but you will not be able to build
|
|
|
|
dnl # RPM packages and will be warned if you try too.
|
|
|
|
dnl #
|
2013-02-18 00:10:17 +04:00
|
|
|
dnl # By default the generic spec file will be used because it requires
|
|
|
|
dnl # minimal dependencies. Distribution specific spec files can be
|
|
|
|
dnl # placed under the 'rpm/<distribution>' directory and enabled using
|
|
|
|
dnl # the --with-spec=<distribution> configure option.
|
|
|
|
dnl #
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_DEFUN([ZFS_AC_RPM], [
|
|
|
|
RPM=rpm
|
|
|
|
RPMBUILD=rpmbuild
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether $RPM is available])
|
|
|
|
AS_IF([tmp=$($RPM --version 2>/dev/null)], [
|
|
|
|
RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
|
|
|
|
HAVE_RPM=yes
|
|
|
|
AC_MSG_RESULT([$HAVE_RPM ($RPM_VERSION)])
|
|
|
|
],[
|
|
|
|
HAVE_RPM=no
|
|
|
|
AC_MSG_RESULT([$HAVE_RPM])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether $RPMBUILD is available])
|
|
|
|
AS_IF([tmp=$($RPMBUILD --version 2>/dev/null)], [
|
|
|
|
RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
|
|
|
|
HAVE_RPMBUILD=yes
|
|
|
|
AC_MSG_RESULT([$HAVE_RPMBUILD ($RPMBUILD_VERSION)])
|
|
|
|
],[
|
|
|
|
HAVE_RPMBUILD=no
|
|
|
|
AC_MSG_RESULT([$HAVE_RPMBUILD])
|
|
|
|
])
|
|
|
|
|
2013-04-24 03:40:47 +04:00
|
|
|
RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1" --define "$(DEBUG_DMU_TX) 1"'
|
2013-02-18 00:10:17 +04:00
|
|
|
RPM_DEFINE_UTIL=
|
|
|
|
RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
|
|
|
|
RPM_DEFINE_DKMS=
|
|
|
|
|
|
|
|
SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
|
|
|
|
SRPM_DEFINE_UTIL=
|
|
|
|
SRPM_DEFINE_KMOD=
|
|
|
|
SRPM_DEFINE_DKMS=
|
|
|
|
|
|
|
|
RPM_SPEC_DIR="rpm/generic"
|
|
|
|
AC_ARG_WITH([spec],
|
|
|
|
AS_HELP_STRING([--with-spec=SPEC],
|
|
|
|
[Spec files 'generic|fedora']),
|
|
|
|
[RPM_SPEC_DIR="rpm/$withval"])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether spec files are available])
|
|
|
|
AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)])
|
|
|
|
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_SUBST(HAVE_RPM)
|
|
|
|
AC_SUBST(RPM)
|
|
|
|
AC_SUBST(RPM_VERSION)
|
|
|
|
|
|
|
|
AC_SUBST(HAVE_RPMBUILD)
|
|
|
|
AC_SUBST(RPMBUILD)
|
|
|
|
AC_SUBST(RPMBUILD_VERSION)
|
2013-02-18 00:10:17 +04:00
|
|
|
|
|
|
|
AC_SUBST(RPM_SPEC_DIR)
|
|
|
|
AC_SUBST(RPM_DEFINE_UTIL)
|
|
|
|
AC_SUBST(RPM_DEFINE_KMOD)
|
|
|
|
AC_SUBST(RPM_DEFINE_DKMS)
|
|
|
|
AC_SUBST(RPM_DEFINE_COMMON)
|
|
|
|
AC_SUBST(SRPM_DEFINE_UTIL)
|
|
|
|
AC_SUBST(SRPM_DEFINE_KMOD)
|
|
|
|
AC_SUBST(SRPM_DEFINE_DKMS)
|
|
|
|
AC_SUBST(SRPM_DEFINE_COMMON)
|
2010-08-26 22:22:58 +04:00
|
|
|
])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # Check for dpkg+dpkg-buildpackage to build DEB packages. If these
|
|
|
|
dnl # tools are missing it is non-fatal but you will not be able to build
|
|
|
|
dnl # DEB packages and will be warned if you try too.
|
|
|
|
dnl #
|
|
|
|
AC_DEFUN([ZFS_AC_DPKG], [
|
|
|
|
DPKG=dpkg
|
|
|
|
DPKGBUILD=dpkg-buildpackage
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether $DPKG is available])
|
|
|
|
AS_IF([tmp=$($DPKG --version 2>/dev/null)], [
|
|
|
|
DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $[7] }')
|
|
|
|
HAVE_DPKG=yes
|
|
|
|
AC_MSG_RESULT([$HAVE_DPKG ($DPKG_VERSION)])
|
|
|
|
],[
|
|
|
|
HAVE_DPKG=no
|
|
|
|
AC_MSG_RESULT([$HAVE_DPKG])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether $DPKGBUILD is available])
|
|
|
|
AS_IF([tmp=$($DPKGBUILD --version 2>/dev/null)], [
|
|
|
|
DPKGBUILD_VERSION=$(echo $tmp | \
|
|
|
|
$AWK '/Debian/ { print $[4] }' | cut -f-4 -d'.')
|
|
|
|
HAVE_DPKGBUILD=yes
|
|
|
|
AC_MSG_RESULT([$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)])
|
|
|
|
],[
|
|
|
|
HAVE_DPKGBUILD=no
|
|
|
|
AC_MSG_RESULT([$HAVE_DPKGBUILD])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_SUBST(HAVE_DPKG)
|
|
|
|
AC_SUBST(DPKG)
|
|
|
|
AC_SUBST(DPKG_VERSION)
|
|
|
|
|
|
|
|
AC_SUBST(HAVE_DPKGBUILD)
|
|
|
|
AC_SUBST(DPKGBUILD)
|
|
|
|
AC_SUBST(DPKGBUILD_VERSION)
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # Until native packaging for various different packing systems
|
|
|
|
dnl # can be added the least we can do is attempt to use alien to
|
|
|
|
dnl # convert the RPM packages to the needed package type. This is
|
|
|
|
dnl # a hack but so far it has worked reasonable well.
|
|
|
|
dnl #
|
|
|
|
AC_DEFUN([ZFS_AC_ALIEN], [
|
|
|
|
ALIEN=alien
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether $ALIEN is available])
|
|
|
|
AS_IF([tmp=$($ALIEN --version 2>/dev/null)], [
|
|
|
|
ALIEN_VERSION=$(echo $tmp | $AWK '{ print $[3] }')
|
|
|
|
HAVE_ALIEN=yes
|
|
|
|
AC_MSG_RESULT([$HAVE_ALIEN ($ALIEN_VERSION)])
|
|
|
|
],[
|
|
|
|
HAVE_ALIEN=no
|
|
|
|
AC_MSG_RESULT([$HAVE_ALIEN])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_SUBST(HAVE_ALIEN)
|
|
|
|
AC_SUBST(ALIEN)
|
|
|
|
AC_SUBST(ALIEN_VERSION)
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # Using the VENDOR tag from config.guess set the default
|
|
|
|
dnl # package type for 'make pkg': (rpm | deb | tgz)
|
|
|
|
dnl #
|
|
|
|
AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
|
|
|
|
AC_MSG_CHECKING([linux distribution])
|
2012-02-29 01:23:16 +04:00
|
|
|
if test -f /etc/toss-release ; then
|
|
|
|
VENDOR=toss ;
|
2010-08-26 22:22:58 +04:00
|
|
|
elif test -f /etc/fedora-release ; then
|
|
|
|
VENDOR=fedora ;
|
2012-02-29 01:23:16 +04:00
|
|
|
elif test -f /etc/redhat-release ; then
|
|
|
|
VENDOR=redhat ;
|
2011-05-14 18:25:37 +04:00
|
|
|
elif test -f /etc/gentoo-release ; then
|
|
|
|
VENDOR=gentoo ;
|
2012-02-29 01:23:16 +04:00
|
|
|
elif test -f /etc/arch-release ; then
|
|
|
|
VENDOR=arch ;
|
2010-08-26 22:22:58 +04:00
|
|
|
elif test -f /etc/SuSE-release ; then
|
|
|
|
VENDOR=sles ;
|
|
|
|
elif test -f /etc/slackware-version ; then
|
|
|
|
VENDOR=slackware ;
|
2011-05-03 02:39:59 +04:00
|
|
|
elif test -f /etc/lunar.release ; then
|
|
|
|
VENDOR=lunar ;
|
2012-02-29 01:23:16 +04:00
|
|
|
elif test -f /etc/lsb-release ; then
|
|
|
|
VENDOR=ubuntu ;
|
|
|
|
elif test -f /etc/debian_version ; then
|
|
|
|
VENDOR=debian ;
|
2010-08-26 22:22:58 +04:00
|
|
|
else
|
|
|
|
VENDOR= ;
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$VENDOR])
|
|
|
|
AC_SUBST(VENDOR)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([default package type])
|
|
|
|
case "$VENDOR" in
|
2012-02-29 01:23:16 +04:00
|
|
|
toss) DEFAULT_PACKAGE=rpm ;;
|
|
|
|
redhat) DEFAULT_PACKAGE=rpm ;;
|
|
|
|
fedora) DEFAULT_PACKAGE=rpm ;;
|
|
|
|
gentoo) DEFAULT_PACKAGE=tgz ;;
|
2013-02-17 23:11:41 +04:00
|
|
|
arch) DEFAULT_PACKAGE=tgz ;;
|
2012-02-29 01:23:16 +04:00
|
|
|
sles) DEFAULT_PACKAGE=rpm ;;
|
|
|
|
slackware) DEFAULT_PACKAGE=tgz ;;
|
|
|
|
lunar) DEFAULT_PACKAGE=tgz ;;
|
|
|
|
ubuntu) DEFAULT_PACKAGE=deb ;;
|
|
|
|
debian) DEFAULT_PACKAGE=deb ;;
|
|
|
|
*) DEFAULT_PACKAGE=rpm ;;
|
2010-08-26 22:22:58 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
AC_MSG_RESULT([$DEFAULT_PACKAGE])
|
|
|
|
AC_SUBST(DEFAULT_PACKAGE)
|
2011-03-18 01:02:28 +03:00
|
|
|
|
2013-02-17 23:11:41 +04:00
|
|
|
DEFAULT_INIT_DIR=$sysconfdir/init.d
|
2011-07-10 19:57:33 +04:00
|
|
|
AC_MSG_CHECKING([default init directory])
|
|
|
|
AC_MSG_RESULT([$DEFAULT_INIT_DIR])
|
|
|
|
AC_SUBST(DEFAULT_INIT_DIR)
|
|
|
|
|
2011-03-18 01:02:28 +03:00
|
|
|
AC_MSG_CHECKING([default init script type])
|
|
|
|
case "$VENDOR" in
|
2012-02-29 01:23:16 +04:00
|
|
|
toss) DEFAULT_INIT_SCRIPT=redhat ;;
|
2011-05-03 02:39:59 +04:00
|
|
|
redhat) DEFAULT_INIT_SCRIPT=redhat ;;
|
2011-03-18 01:02:28 +03:00
|
|
|
fedora) DEFAULT_INIT_SCRIPT=fedora ;;
|
2011-05-03 02:39:59 +04:00
|
|
|
gentoo) DEFAULT_INIT_SCRIPT=gentoo ;;
|
2013-02-17 23:11:41 +04:00
|
|
|
arch) DEFAULT_INIT_SCRIPT=lsb ;;
|
2012-02-29 01:23:16 +04:00
|
|
|
sles) DEFAULT_INIT_SCRIPT=lsb ;;
|
|
|
|
slackware) DEFAULT_INIT_SCRIPT=lsb ;;
|
|
|
|
lunar) DEFAULT_INIT_SCRIPT=lunar ;;
|
|
|
|
ubuntu) DEFAULT_INIT_SCRIPT=lsb ;;
|
|
|
|
debian) DEFAULT_INIT_SCRIPT=lsb ;;
|
|
|
|
*) DEFAULT_INIT_SCRIPT=lsb ;;
|
2011-03-18 01:02:28 +03:00
|
|
|
esac
|
|
|
|
|
|
|
|
AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT])
|
|
|
|
AC_SUBST(DEFAULT_INIT_SCRIPT)
|
2010-08-26 22:22:58 +04:00
|
|
|
])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # Default ZFS package configuration
|
|
|
|
dnl #
|
|
|
|
AC_DEFUN([ZFS_AC_PACKAGE], [
|
2012-01-13 05:24:05 +04:00
|
|
|
ZFS_AC_DEFAULT_PACKAGE
|
2010-08-26 22:22:58 +04:00
|
|
|
ZFS_AC_RPM
|
|
|
|
ZFS_AC_DPKG
|
|
|
|
ZFS_AC_ALIEN
|
|
|
|
])
|