diff options
author | Brian Behlendorf <[email protected]> | 2018-02-14 17:01:15 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-05-29 14:51:39 -0700 |
commit | a91258913fb597db7f409f3534512cf2249bceb6 (patch) | |
tree | 7c489b0ed42187c10046f52fe8f2e4883f884db1 /config | |
parent | 1149b62d20b7ed9d8ae25d5da7a06213d79b7602 (diff) |
Prepare SPL repo to merge with ZFS repo
This commit removes everything from the repository except the core
SPL implementation for Linux. Those files which remain have been
moved to non-conflicting locations to facilitate the merge.
The README.md and associated files have been updated accordingly.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'config')
-rw-r--r-- | config/.gitignore | 9 | ||||
-rw-r--r-- | config/Rules.am | 14 | ||||
-rw-r--r-- | config/config.awk | 15 | ||||
-rw-r--r-- | config/deb.am | 58 | ||||
-rw-r--r-- | config/kernel-fallocate-pax.m4 | 19 | ||||
-rw-r--r-- | config/kernel-fallocate.m4 | 68 | ||||
-rw-r--r-- | config/kernel-kmem.m4 | 58 | ||||
-rw-r--r-- | config/kernel-truncate-range.m4 | 19 | ||||
-rw-r--r-- | config/rpm.am | 87 | ||||
-rw-r--r-- | config/spl-build.m4 | 755 | ||||
-rw-r--r-- | config/spl-meta.m4 | 170 | ||||
-rw-r--r-- | config/tgz.am | 44 |
12 files changed, 77 insertions, 1239 deletions
diff --git a/config/.gitignore b/config/.gitignore deleted file mode 100644 index cd811a0a9..000000000 --- a/config/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/compile -/config.guess -/config.sub -/depcomp -/install-sh -/ltmain.sh -/missing -/libtool.m4 -/lt*.m4 diff --git a/config/Rules.am b/config/Rules.am deleted file mode 100644 index 7c5d3283f..000000000 --- a/config/Rules.am +++ /dev/null @@ -1,14 +0,0 @@ -############################################################################### -# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. -# Copyright (C) 2007 The Regents of the University of California. -# Written by Brian Behlendorf <[email protected]>. -############################################################################### -# Common rules for user space components. -############################################################################### - -DEFAULT_INCLUDES = -include ${top_builddir}/spl_config.h - -AM_LIBTOOLFLAGS = --silent -AM_CPPFLAGS = -D__USE_LARGEFILE64 -AM_CFLAGS = -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -AM_CFLAGS += ${DEBUG_CFLAGS} diff --git a/config/config.awk b/config/config.awk deleted file mode 100644 index cc4b7cc26..000000000 --- a/config/config.awk +++ /dev/null @@ -1,15 +0,0 @@ -# Remove default preprocessor define's from config.h -# PACKAGE -# PACKAGE_BUGREPORT -# PACKAGE_NAME -# PACKAGE_STRING -# PACKAGE_TARNAME -# PACKAGE_VERSION -# STDC_HEADERS -# VERSION - -BEGIN { RS = "" ; FS = "\n" } \ - !/.#define PACKAGE./ && \ - !/.#define VERSION./ && \ - !/.#define STDC_HEADERS./ \ - { print $0"\n" } diff --git a/config/deb.am b/config/deb.am deleted file mode 100644 index f745c9181..000000000 --- a/config/deb.am +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################### -# Copyright (C) 2010 Lawrence Livermore National Security, LLC. -# Written by Brian Behlendorf <[email protected]>. -############################################################################### -# Build targets for DEB packages. -# -# Long term native distro specific Debian style packaging should be added. -# In the short term RPM packages are built and converted to DEB packages -# using alien. If someone familiar with Debian style packaging were to -# update the build system to correctly build Debian style packages I would -# happily take it. Until then we will have to make due with alien. -# -############################################################################### - -deb-local: - @(if test "${HAVE_DPKGBUILD}" = "no"; then \ - echo -e "\n" \ - "*** Required util ${DPKGBUILD} missing. Please install the\n" \ - "*** package for your distribution which provides ${DPKGBUILD},\n" \ - "*** re-run configure, and try again.\n"; \ - exit 1; \ - fi; \ - if test "${HAVE_ALIEN}" = "no"; then \ - echo -e "\n" \ - "*** Required util ${ALIEN} missing. Please install the\n" \ - "*** package for your distribution which provides ${ALIEN},\n" \ - "*** re-run configure, and try again.\n"; \ - exit 1; \ - fi) - -deb-kmod: deb-local rpm-kmod - name=${PACKAGE}; \ - version=${VERSION}-${RELEASE}; \ - arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \ - debarch=`$(DPKG) --print-architecture`; \ - pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \ - fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \ - $(RM) $$pkg1 - -deb-dkms: deb-local rpm-dkms - name=${PACKAGE}; \ - version=${VERSION}-${RELEASE}; \ - arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \ - debarch=`$(DPKG) --print-architecture`; \ - pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \ - fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \ - $(RM) $$pkg1 - -deb-utils: deb-local rpm-utils - name=${PACKAGE}; \ - version=${VERSION}-${RELEASE}; \ - arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ - debarch=`$(DPKG) --print-architecture`; \ - pkg1=$${name}-$${version}.$${arch}.rpm; \ - fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \ - $(RM) $$pkg1 - -deb: deb-kmod deb-dkms deb-utils diff --git a/config/kernel-fallocate-pax.m4 b/config/kernel-fallocate-pax.m4 new file mode 100644 index 000000000..ac75a4c8e --- /dev/null +++ b/config/kernel-fallocate-pax.m4 @@ -0,0 +1,19 @@ +dnl # +dnl # PaX Linux 2.6.38 - 3.x API +dnl # +AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [ + AC_MSG_CHECKING([whether fops->fallocate() exists]) + SPL_LINUX_TRY_COMPILE([ + #include <linux/fs.h> + ],[ + long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL; + struct file_operations_no_const fops __attribute__ ((unused)) = { + .fallocate = fallocate, + }; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel-fallocate.m4 b/config/kernel-fallocate.m4 deleted file mode 100644 index b8c82f464..000000000 --- a/config/kernel-fallocate.m4 +++ /dev/null @@ -1,68 +0,0 @@ -dnl # -dnl # Linux 2.6.38 - 3.x API -dnl # -AC_DEFUN([SPL_AC_KERNEL_FILE_FALLOCATE], [ - AC_MSG_CHECKING([whether fops->fallocate() exists]) - SPL_LINUX_TRY_COMPILE([ - #include <linux/fs.h> - ],[ - long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL; - struct file_operations fops __attribute__ ((unused)) = { - .fallocate = fallocate, - }; - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) -dnl # -dnl # Linux 2.6.x - 2.6.37 API -dnl # -AC_DEFUN([SPL_AC_KERNEL_INODE_FALLOCATE], [ - AC_MSG_CHECKING([whether iops->fallocate() exists]) - SPL_LINUX_TRY_COMPILE([ - #include <linux/fs.h> - ],[ - long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL; - struct inode_operations fops __attribute__ ((unused)) = { - .fallocate = fallocate, - }; - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # -dnl # PaX Linux 2.6.38 - 3.x API -dnl # -AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [ - AC_MSG_CHECKING([whether fops->fallocate() exists]) - SPL_LINUX_TRY_COMPILE([ - #include <linux/fs.h> - ],[ - long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL; - struct file_operations_no_const fops __attribute__ ((unused)) = { - .fallocate = fallocate, - }; - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # -dnl # The fallocate callback was moved from the inode_operations -dnl # structure to the file_operations structure. -dnl # -AC_DEFUN([SPL_AC_KERNEL_FALLOCATE], [ - SPL_AC_KERNEL_FILE_FALLOCATE - SPL_AC_KERNEL_INODE_FALLOCATE - SPL_AC_PAX_KERNEL_FILE_FALLOCATE -]) diff --git a/config/kernel-kmem.m4 b/config/kernel-kmem.m4 new file mode 100644 index 000000000..cc055e530 --- /dev/null +++ b/config/kernel-kmem.m4 @@ -0,0 +1,58 @@ +dnl # +dnl # Enabled by default it provides a minimal level of memory tracking. +dnl # A total count of bytes allocated is kept for each alloc and free. +dnl # Then at module unload time a report to the console will be printed +dnl # if memory was leaked. +dnl # +AC_DEFUN([SPL_AC_DEBUG_KMEM], [ + AC_ARG_ENABLE([debug-kmem], + [AS_HELP_STRING([--enable-debug-kmem], + [Enable basic kmem accounting @<:@default=no@:>@])], + [], + [enable_debug_kmem=no]) + + AS_IF([test "x$enable_debug_kmem" = xyes], + [ + KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM" + DEBUG_KMEM="_with_debug_kmem" + AC_DEFINE([DEBUG_KMEM], [1], + [Define to 1 to enable basic kmem accounting]) + ], [ + DEBUG_KMEM="_without_debug_kmem" + ]) + + AC_SUBST(DEBUG_KMEM) + AC_MSG_CHECKING([whether basic kmem accounting is enabled]) + AC_MSG_RESULT([$enable_debug_kmem]) +]) + +dnl # +dnl # Disabled by default it provides detailed memory tracking. This +dnl # feature also requires --enable-debug-kmem to be set. When enabled +dnl # not only will total bytes be tracked but also the location of every +dnl # alloc and free. When the SPL module is unloaded a list of all leaked +dnl # addresses and where they were allocated will be dumped to the console. +dnl # Enabling this feature has a significant impact on performance but it +dnl # makes finding memory leaks pretty straight forward. +dnl # +AC_DEFUN([SPL_AC_DEBUG_KMEM_TRACKING], [ + AC_ARG_ENABLE([debug-kmem-tracking], + [AS_HELP_STRING([--enable-debug-kmem-tracking], + [Enable detailed kmem tracking @<:@default=no@:>@])], + [], + [enable_debug_kmem_tracking=no]) + + AS_IF([test "x$enable_debug_kmem_tracking" = xyes], + [ + KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING" + DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking" + AC_DEFINE([DEBUG_KMEM_TRACKING], [1], + [Define to 1 to enable detailed kmem tracking]) + ], [ + DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking" + ]) + + AC_SUBST(DEBUG_KMEM_TRACKING) + AC_MSG_CHECKING([whether detailed kmem tracking is enabled]) + AC_MSG_RESULT([$enable_debug_kmem_tracking]) +]) diff --git a/config/kernel-truncate-range.m4 b/config/kernel-truncate-range.m4 deleted file mode 100644 index 4b1600b61..000000000 --- a/config/kernel-truncate-range.m4 +++ /dev/null @@ -1,19 +0,0 @@ -dnl # -dnl # 3.5 API change, -dnl # inode_operations.truncate_range removed -dnl # -AC_DEFUN([SPL_AC_INODE_TRUNCATE_RANGE], [ - AC_MSG_CHECKING([whether truncate_range() inode operation is available]) - SPL_LINUX_TRY_COMPILE([ - #include <linux/fs.h> - ],[ - struct inode_operations ops; - ops.truncate_range = NULL; - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_INODE_TRUNCATE_RANGE, 1, - [truncate_range() inode operation is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/rpm.am b/config/rpm.am deleted file mode 100644 index 51a20b3e6..000000000 --- a/config/rpm.am +++ /dev/null @@ -1,87 +0,0 @@ -############################################################################### -# Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC. -# Copyright (C) 2007 The Regents of the University of California. -# Written by Brian Behlendorf <[email protected]>. -############################################################################### -# Build targets for RPM packages. -############################################################################### - -srpm-kmod: - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \ - def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_KMOD}' srpm-common - -srpm-dkms: - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ - def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_DKMS}' srpm-common - -srpm-utils: - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ - def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_UTIL}' srpm-common - -srpm: srpm-kmod srpm-dkms srpm-utils -srpms: srpm-kmod srpm-dkms srpm-utils - -rpm-kmod: srpm-kmod - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \ - def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_KMOD}' rpm-common - -rpm-dkms: srpm-dkms - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ - def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common - -rpm-utils: srpm-utils - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ - def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common - -rpm: rpm-kmod rpm-dkms rpm-utils -rpms: rpm-kmod rpm-dkms rpm-utils - -rpm-local: - @(if test "${HAVE_RPMBUILD}" = "no"; then \ - echo -e "\n" \ - "*** Required util ${RPMBUILD} missing. Please install the\n" \ - "*** package for your distribution which provides ${RPMBUILD},\n" \ - "*** re-run configure, and try again.\n"; \ - exit 1; \ - fi; \ - mkdir -p $(rpmbuild)/TMP && \ - mkdir -p $(rpmbuild)/BUILD && \ - mkdir -p $(rpmbuild)/RPMS && \ - mkdir -p $(rpmbuild)/SRPMS && \ - mkdir -p $(rpmbuild)/SPECS && \ - cp ${RPM_SPEC_DIR}/$(rpmspec) $(rpmbuild)/SPECS && \ - mkdir -p $(rpmbuild)/SOURCES && \ - cp $(top_srcdir)/scripts/kmodtool $(rpmbuild)/SOURCES && \ - cp $(distdir).tar.gz $(rpmbuild)/SOURCES) - -srpm-common: dist - @(dist=`$(RPM) --eval %{?dist}`; \ - rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \ - rpmspec=$(pkg).spec; \ - rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \ - $(MAKE) $(AM_MAKEFLAGS) \ - rpmbuild="$$rpmbuild" \ - rpmspec="$$rpmspec" \ - rpm-local || exit 1; \ - LANG=C $(RPMBUILD) \ - --define "_tmppath $$rpmbuild/TMP" \ - --define "_topdir $$rpmbuild" \ - $(def) -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \ - cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \ - rm -R $$rpmbuild) - -rpm-common: - @(dist=`$(RPM) --eval %{?dist}`; \ - rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \ - rpmspec=$(pkg).spec; \ - rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \ - $(MAKE) $(AM_MAKEFLAGS) \ - rpmbuild="$$rpmbuild" \ - rpmspec="$$rpmspec" \ - rpm-local || exit 1; \ - LANG=C ${RPMBUILD} \ - --define "_tmppath $$rpmbuild/TMP" \ - --define "_topdir $$rpmbuild" \ - $(def) --rebuild $$rpmpkg || exit 1; \ - cp $$rpmbuild/RPMS/*/* . || exit 1; \ - rm -R $$rpmbuild) diff --git a/config/spl-build.m4 b/config/spl-build.m4 deleted file mode 100644 index 5c6c02af2..000000000 --- a/config/spl-build.m4 +++ /dev/null @@ -1,755 +0,0 @@ -############################################################################### -# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. -# Copyright (C) 2007 The Regents of the University of California. -# Written by Brian Behlendorf <[email protected]>. -############################################################################### -# SPL_AC_CONFIG_KERNEL: Default SPL kernel configuration. -############################################################################### - -AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ - SPL_AC_KERNEL - - if test "${LINUX_OBJ}" != "${LINUX}"; then - KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" - fi - AC_SUBST(KERNELMAKE_PARAMS) - - KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes" - AC_SUBST(KERNELCPPFLAGS) - - SPL_AC_TEST_MODULE - SPL_AC_ATOMIC_SPINLOCK - SPL_AC_SHRINKER_CALLBACK - SPL_AC_CTL_NAME - SPL_AC_CONFIG_TRIM_UNUSED_KSYMS - SPL_AC_PDE_DATA - SPL_AC_SET_FS_PWD_WITH_CONST - SPL_AC_2ARGS_VFS_FSYNC - SPL_AC_INODE_TRUNCATE_RANGE - SPL_AC_FS_STRUCT_SPINLOCK - SPL_AC_KUIDGID_T - SPL_AC_KERNEL_FALLOCATE - SPL_AC_CONFIG_ZLIB_INFLATE - SPL_AC_CONFIG_ZLIB_DEFLATE - SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE - SPL_AC_SHRINK_CONTROL_STRUCT - SPL_AC_RWSEM_SPINLOCK_IS_RAW - SPL_AC_RWSEM_ACTIVITY - SPL_AC_RWSEM_ATOMIC_LONG_COUNT - SPL_AC_SCHED_RT_HEADER - SPL_AC_SCHED_SIGNAL_HEADER - SPL_AC_4ARGS_VFS_GETATTR - SPL_AC_3ARGS_VFS_GETATTR - SPL_AC_2ARGS_VFS_GETATTR - SPL_AC_USLEEP_RANGE - SPL_AC_KMEM_CACHE_ALLOCFLAGS - SPL_AC_WAIT_ON_BIT - SPL_AC_INODE_LOCK - SPL_AC_GROUP_INFO_GID - SPL_AC_KMEM_CACHE_CREATE_USERCOPY - SPL_AC_WAIT_QUEUE_ENTRY_T - SPL_AC_WAIT_QUEUE_HEAD_ENTRY - SPL_AC_IO_SCHEDULE_TIMEOUT - SPL_AC_KERNEL_WRITE - SPL_AC_KERNEL_READ - SPL_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST -]) - -AC_DEFUN([SPL_AC_MODULE_SYMVERS], [ - modpost=$LINUX/scripts/Makefile.modpost - AC_MSG_CHECKING([kernel file name for module symbols]) - if test "x$enable_linux_builtin" != xyes -a -f "$modpost"; then - if grep -q Modules.symvers $modpost; then - LINUX_SYMBOLS=Modules.symvers - else - LINUX_SYMBOLS=Module.symvers - fi - - if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then - AC_MSG_ERROR([ - *** Please make sure the kernel devel package for your distribution - *** is installed. If you are building with a custom kernel, make sure the - *** kernel is configured, built, and the '--with-linux=PATH' configure - *** option refers to the location of the kernel source.]) - fi - else - LINUX_SYMBOLS=NONE - fi - AC_MSG_RESULT($LINUX_SYMBOLS) - AC_SUBST(LINUX_SYMBOLS) -]) - -AC_DEFUN([SPL_AC_KERNEL], [ - AC_ARG_WITH([linux], - AS_HELP_STRING([--with-linux=PATH], - [Path to kernel source]), - [kernelsrc="$withval"]) - - AC_ARG_WITH([linux-obj], - AS_HELP_STRING([--with-linux-obj=PATH], - [Path to kernel build objects]), - [kernelbuild="$withval"]) - - AC_MSG_CHECKING([kernel source directory]) - if test -z "$kernelsrc"; then - if test -e "/lib/modules/$(uname -r)/source"; then - headersdir="/lib/modules/$(uname -r)/source" - sourcelink=$(readlink -f "$headersdir") - elif test -e "/lib/modules/$(uname -r)/build"; then - headersdir="/lib/modules/$(uname -r)/build" - sourcelink=$(readlink -f "$headersdir") - else - sourcelink=$(ls -1d /usr/src/kernels/* \ - /usr/src/linux-* \ - 2>/dev/null | grep -v obj | tail -1) - fi - - if test -n "$sourcelink" && test -e ${sourcelink}; then - kernelsrc=`readlink -f ${sourcelink}` - else - kernelsrc="[Not found]" - fi - else - if test "$kernelsrc" = "NONE"; then - kernsrcver=NONE - fi - withlinux=yes - fi - - AC_MSG_RESULT([$kernelsrc]) - if test ! -d "$kernelsrc"; then - AC_MSG_ERROR([ - *** Please make sure the kernel devel package for your distribution - *** is installed and then try again. If that fails, you can specify the - *** location of the kernel source with the '--with-linux=PATH' option.]) - fi - - AC_MSG_CHECKING([kernel build directory]) - if test -z "$kernelbuild"; then - if test x$withlinux != xyes -a -e "/lib/modules/$(uname -r)/build"; then - kernelbuild=`readlink -f /lib/modules/$(uname -r)/build` - elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then - kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu} - elif test -d ${kernelsrc}-obj/${target_cpu}/default; then - kernelbuild=${kernelsrc}-obj/${target_cpu}/default - elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then - kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu} - else - kernelbuild=${kernelsrc} - fi - fi - AC_MSG_RESULT([$kernelbuild]) - - AC_MSG_CHECKING([kernel source version]) - utsrelease1=$kernelbuild/include/linux/version.h - utsrelease2=$kernelbuild/include/linux/utsrelease.h - utsrelease3=$kernelbuild/include/generated/utsrelease.h - if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then - utsrelease=linux/version.h - elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then - utsrelease=linux/utsrelease.h - elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then - utsrelease=generated/utsrelease.h - fi - - if test "$utsrelease"; then - kernsrcver=`(echo "#include <$utsrelease>"; - echo "kernsrcver=UTS_RELEASE") | - cpp -I $kernelbuild/include | - grep "^kernsrcver=" | cut -d \" -f 2` - - if test -z "$kernsrcver"; then - AC_MSG_RESULT([Not found]) - AC_MSG_ERROR([*** Cannot determine kernel version.]) - fi - else - AC_MSG_RESULT([Not found]) - if test "x$enable_linux_builtin" != xyes; then - AC_MSG_ERROR([*** Cannot find UTS_RELEASE definition.]) - else - AC_MSG_ERROR([ - *** Cannot find UTS_RELEASE definition. - *** Please run 'make prepare' inside the kernel source tree.]) - fi - fi - - AC_MSG_RESULT([$kernsrcver]) - - LINUX=${kernelsrc} - LINUX_OBJ=${kernelbuild} - LINUX_VERSION=${kernsrcver} - - AC_SUBST(LINUX) - AC_SUBST(LINUX_OBJ) - AC_SUBST(LINUX_VERSION) - - SPL_AC_MODULE_SYMVERS -]) - -dnl # -dnl # Default SPL user configuration -dnl # -AC_DEFUN([SPL_AC_CONFIG_USER], []) - -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 # -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 # -AC_DEFUN([SPL_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]) - ]) - - RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1"' - RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM) 1"' - RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_TRACKING) 1"' - RPM_DEFINE_UTIL= - RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"' - RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"' - 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|redhat']), - [RPM_SPEC_DIR="rpm/$withval"]) - - AC_MSG_CHECKING([whether spec files are available]) - AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)]) - - AC_SUBST(HAVE_RPM) - AC_SUBST(RPM) - AC_SUBST(RPM_VERSION) - - AC_SUBST(HAVE_RPMBUILD) - AC_SUBST(RPMBUILD) - AC_SUBST(RPMBUILD_VERSION) - - 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) -]) - -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([SPL_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([SPL_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([SPL_AC_DEFAULT_PACKAGE], [ - AC_MSG_CHECKING([linux distribution]) - if test -f /etc/toss-release ; then - VENDOR=toss ; - elif test -f /etc/fedora-release ; then - VENDOR=fedora ; - elif test -f /etc/redhat-release ; then - VENDOR=redhat ; - elif test -f /etc/gentoo-release ; then - VENDOR=gentoo ; - elif test -f /etc/arch-release ; then - VENDOR=arch ; - elif test -f /etc/SuSE-release ; then - VENDOR=sles ; - elif test -f /etc/slackware-version ; then - VENDOR=slackware ; - elif test -f /etc/lunar.release ; then - VENDOR=lunar ; - elif test -f /etc/lsb-release ; then - VENDOR=ubuntu ; - elif test -f /etc/debian_version ; then - VENDOR=debian ; - else - VENDOR= ; - fi - AC_MSG_RESULT([$VENDOR]) - AC_SUBST(VENDOR) - - AC_MSG_CHECKING([default package type]) - case "$VENDOR" in - toss) DEFAULT_PACKAGE=rpm ;; - redhat) DEFAULT_PACKAGE=rpm ;; - fedora) DEFAULT_PACKAGE=rpm ;; - gentoo) DEFAULT_PACKAGE=tgz ;; - arch) DEFAULT_PACKAGE=tgz ;; - sles) DEFAULT_PACKAGE=rpm ;; - slackware) DEFAULT_PACKAGE=tgz ;; - lunar) DEFAULT_PACKAGE=tgz ;; - ubuntu) DEFAULT_PACKAGE=deb ;; - debian) DEFAULT_PACKAGE=deb ;; - *) DEFAULT_PACKAGE=rpm ;; - esac - - AC_MSG_RESULT([$DEFAULT_PACKAGE]) - AC_SUBST(DEFAULT_PACKAGE) -]) - -dnl # -dnl # Default SPL user configuration -dnl # -AC_DEFUN([SPL_AC_PACKAGE], [ - SPL_AC_DEFAULT_PACKAGE - SPL_AC_RPM - SPL_AC_DPKG - SPL_AC_ALIEN -]) - -AC_DEFUN([SPL_AC_LICENSE], [ - AC_MSG_CHECKING([spl author]) - AC_MSG_RESULT([$SPL_META_AUTHOR]) - - AC_MSG_CHECKING([spl license]) - AC_MSG_RESULT([$SPL_META_LICENSE]) -]) - -AC_DEFUN([SPL_AC_CONFIG], [ - SPL_CONFIG=all - AC_ARG_WITH([config], - AS_HELP_STRING([--with-config=CONFIG], - [Config file 'kernel|user|all|srpm']), - [SPL_CONFIG="$withval"]) - AC_ARG_ENABLE([linux-builtin], - [AC_HELP_STRING([--enable-linux-builtin], - [Configure for builtin in-tree kernel modules @<:@default=no@:>@])], - [], - [enable_linux_builtin=no]) - - AC_MSG_CHECKING([spl config]) - AC_MSG_RESULT([$SPL_CONFIG]); - AC_SUBST(SPL_CONFIG) - - case "$SPL_CONFIG" in - kernel) SPL_AC_CONFIG_KERNEL ;; - user) SPL_AC_CONFIG_USER ;; - all) SPL_AC_CONFIG_KERNEL - SPL_AC_CONFIG_USER ;; - srpm) ;; - *) - AC_MSG_RESULT([Error!]) - AC_MSG_ERROR([Bad value "$SPL_CONFIG" for --with-config, - user kernel|user|all|srpm]) ;; - esac - - AM_CONDITIONAL([CONFIG_USER], - [test "$SPL_CONFIG" = user -o "$SPL_CONFIG" = all]) - AM_CONDITIONAL([CONFIG_KERNEL], - [test "$SPL_CONFIG" = kernel -o "$SPL_CONFIG" = all] && - [test "x$enable_linux_builtin" != xyes ]) -]) - -dnl # -dnl # Enable if the SPL should be compiled with internal debugging enabled. -dnl # By default this support is disabled. -dnl # -AC_DEFUN([SPL_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" - DEBUG_CFLAGS="-DDEBUG -Werror" - DEBUG_SPL="_with_debug" - ], [ - KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG" - DEBUG_CFLAGS="-DNDEBUG" - DEBUG_SPL="_without_debug" - ]) - - AC_SUBST(DEBUG_CFLAGS) - AC_SUBST(DEBUG_SPL) - AC_MSG_RESULT([$enable_debug]) -]) - -dnl # -dnl # Enabled by default it provides a minimal level of memory tracking. -dnl # A total count of bytes allocated is kept for each alloc and free. -dnl # Then at module unload time a report to the console will be printed -dnl # if memory was leaked. -dnl # -AC_DEFUN([SPL_AC_DEBUG_KMEM], [ - AC_ARG_ENABLE([debug-kmem], - [AS_HELP_STRING([--enable-debug-kmem], - [Enable basic kmem accounting @<:@default=no@:>@])], - [], - [enable_debug_kmem=no]) - - AS_IF([test "x$enable_debug_kmem" = xyes], - [ - KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM" - DEBUG_KMEM="_with_debug_kmem" - AC_DEFINE([DEBUG_KMEM], [1], - [Define to 1 to enable basic kmem accounting]) - ], [ - DEBUG_KMEM="_without_debug_kmem" - ]) - - AC_SUBST(DEBUG_KMEM) - AC_MSG_CHECKING([whether basic kmem accounting is enabled]) - AC_MSG_RESULT([$enable_debug_kmem]) -]) - -dnl # -dnl # Disabled by default it provides detailed memory tracking. This -dnl # feature also requires --enable-debug-kmem to be set. When enabled -dnl # not only will total bytes be tracked but also the location of every -dnl # alloc and free. When the SPL module is unloaded a list of all leaked -dnl # addresses and where they were allocated will be dumped to the console. -dnl # Enabling this feature has a significant impact on performance but it -dnl # makes finding memory leaks pretty straight forward. -dnl # -AC_DEFUN([SPL_AC_DEBUG_KMEM_TRACKING], [ - AC_ARG_ENABLE([debug-kmem-tracking], - [AS_HELP_STRING([--enable-debug-kmem-tracking], - [Enable detailed kmem tracking @<:@default=no@:>@])], - [], - [enable_debug_kmem_tracking=no]) - - AS_IF([test "x$enable_debug_kmem_tracking" = xyes], - [ - KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING" - DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking" - AC_DEFINE([DEBUG_KMEM_TRACKING], [1], - [Define to 1 to enable detailed kmem tracking]) - ], [ - DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking" - ]) - - AC_SUBST(DEBUG_KMEM_TRACKING) - AC_MSG_CHECKING([whether detailed kmem tracking is enabled]) - AC_MSG_RESULT([$enable_debug_kmem_tracking]) -]) - -dnl # -dnl # SPL_LINUX_CONFTEST -dnl # -AC_DEFUN([SPL_LINUX_CONFTEST], [ -cat confdefs.h - <<_ACEOF >conftest.c -$1 -_ACEOF -]) - -dnl # -dnl # SPL_LANG_PROGRAM(C)([PROLOGUE], [BODY]) -dnl # -m4_define([SPL_LANG_PROGRAM], [ -$1 -int -main (void) -{ -dnl Do *not* indent the following line: there may be CPP directives. -dnl Don't move the `;' right after for the same reason. -$2 - ; - return 0; -} -]) - -dnl # -dnl # SPL_LINUX_COMPILE_IFELSE / like AC_COMPILE_IFELSE -dnl # -AC_DEFUN([SPL_LINUX_COMPILE_IFELSE], [ - m4_ifvaln([$1], [SPL_LINUX_CONFTEST([$1])]) - rm -Rf build && mkdir -p build && touch build/conftest.mod.c - echo "obj-m := conftest.o" >build/Makefile - modpost_flag='' - test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage - AS_IF( - [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])], - [$4], - [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])] - ) - rm -Rf build -]) - -dnl # -dnl # SPL_LINUX_TRY_COMPILE like AC_TRY_COMPILE -dnl # -AC_DEFUN([SPL_LINUX_TRY_COMPILE], - [SPL_LINUX_COMPILE_IFELSE( - [AC_LANG_SOURCE([SPL_LANG_PROGRAM([[$1]], [[$2]])])], - [modules], - [test -s build/conftest.o], - [$3], [$4]) -]) - -dnl # -dnl # SPL_CHECK_SYMBOL_EXPORT -dnl # check symbol exported or not -dnl # -AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT], [ - grep -q -E '[[[:space:]]]$1[[[:space:]]]' \ - $LINUX_OBJ/Module*.symvers 2>/dev/null - rc=$? - if test $rc -ne 0; then - export=0 - for file in $2; do - grep -q -E "EXPORT_SYMBOL.*($1)" \ - "$LINUX_OBJ/$file" 2>/dev/null - rc=$? - if test $rc -eq 0; then - export=1 - break; - fi - done - if test $export -eq 0; then : - $4 - else : - $3 - fi - else : - $3 - fi -]) - -dnl # -dnl # SPL_LINUX_TRY_COMPILE_SYMBOL -dnl # like SPL_LINUX_TRY_COMPILE, except SPL_CHECK_SYMBOL_EXPORT -dnl # is called if not compiling for builtin -dnl # -AC_DEFUN([SPL_LINUX_TRY_COMPILE_SYMBOL], [ - SPL_LINUX_TRY_COMPILE([$1], [$2], [rc=0], [rc=1]) - if test $rc -ne 0; then : - $6 - else - if test "x$enable_linux_builtin" != xyes; then - SPL_CHECK_SYMBOL_EXPORT([$3], [$4], [rc=0], [rc=1]) - fi - if test $rc -ne 0; then : - $6 - else : - $5 - fi - fi -]) - -dnl # -dnl # SPL_CHECK_SYMBOL_HEADER -dnl # check if a symbol prototype is defined in listed headers. -dnl # -AC_DEFUN([SPL_CHECK_SYMBOL_HEADER], [ - AC_MSG_CHECKING([whether symbol $1 exists in header]) - header=0 - for file in $3; do - grep -q "$2" "$LINUX/$file" 2>/dev/null - rc=$? - if test $rc -eq 0; then - header=1 - break; - fi - done - if test $header -eq 0; then - AC_MSG_RESULT([no]) - $5 - else - AC_MSG_RESULT([yes]) - $4 - fi -]) - -dnl # -dnl # SPL_CHECK_HEADER -dnl # check whether header exists and define HAVE_$2_HEADER -dnl # -AC_DEFUN([SPL_CHECK_HEADER], - [AC_MSG_CHECKING([whether header $1 exists]) - SPL_LINUX_TRY_COMPILE([ - #include <$1> - ],[ - return 0; - ],[ - AC_DEFINE(HAVE_$2_HEADER, 1, [$1 exists]) - AC_MSG_RESULT(yes) - $3 - ],[ - AC_MSG_RESULT(no) - $4 - ]) -]) - -dnl # -dnl # Basic toolchain sanity check. Verify that kernel modules can -dnl # be built and which symbols can be used. -dnl # -AC_DEFUN([SPL_AC_TEST_MODULE], - [AC_MSG_CHECKING([whether modules can be built]) - SPL_LINUX_TRY_COMPILE([],[],[ - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - if test "x$enable_linux_builtin" != xyes; then - AC_MSG_ERROR([*** Unable to build an empty module.]) - else - AC_MSG_ERROR([ - *** Unable to build an empty module. - *** Please run 'make scripts' inside the kernel source tree.]) - fi - ]) - - AS_IF([test "x$cross_compiling" != xyes], [ - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([ - #include "$LINUX/include/linux/license.h" - ], [ - return !license_is_gpl_compatible( - "$SPL_META_LICENSE"); - ]) - ], [ - AC_DEFINE([SPL_IS_GPL_COMPATIBLE], [1], - [Define to 1 if GPL-only symbols can be used]) - ], [ - ]) - ]) -]) - -dnl # -dnl # Use the atomic implemenation based on global spinlocks. This -dnl # should only be needed by 32-bit kernels which do not provide -dnl # the atomic64_* API. It may be optionally enabled as a fallback -dnl # if problems are observed with the direct mapping to the native -dnl # Linux atomic operations. You may not disable atomic spinlocks -dnl # if you kernel does not an atomic64_* API. -dnl # -AC_DEFUN([SPL_AC_ATOMIC_SPINLOCK], [ - AC_ARG_ENABLE([atomic-spinlocks], - [AS_HELP_STRING([--enable-atomic-spinlocks], - [Atomic types use spinlocks @<:@default=check@:>@])], - [], - [enable_atomic_spinlocks=check]) - - SPL_LINUX_TRY_COMPILE([ - #include <linux/fs.h> - ],[ - atomic64_t *ptr __attribute__ ((unused)); - ],[ - have_atomic64_t=yes - AC_DEFINE(HAVE_ATOMIC64_T, 1, - [kernel defines atomic64_t]) - ],[ - have_atomic64_t=no - ]) - - AS_IF([test "x$enable_atomic_spinlocks" = xcheck], [ - AS_IF([test "x$have_atomic64_t" = xyes], [ - enable_atomic_spinlocks=no - ],[ - enable_atomic_spinlocks=yes - ]) - ]) - - AS_IF([test "x$enable_atomic_spinlocks" = xyes], [ - AC_DEFINE([ATOMIC_SPINLOCK], [1], - [Atomic types use spinlocks]) - ],[ - AS_IF([test "x$have_atomic64_t" = xno], [ - AC_MSG_FAILURE( - [--disable-atomic-spinlocks given but required atomic64 support is unavailable]) - ]) - ]) - - AC_MSG_CHECKING([whether atomic types use spinlocks]) - AC_MSG_RESULT([$enable_atomic_spinlocks]) - - AC_MSG_CHECKING([whether kernel defines atomic64_t]) - AC_MSG_RESULT([$have_atomic64_t]) -]) diff --git a/config/spl-meta.m4 b/config/spl-meta.m4 deleted file mode 100644 index fbfaec4ab..000000000 --- a/config/spl-meta.m4 +++ /dev/null @@ -1,170 +0,0 @@ -dnl # -dnl # DESCRIPTION: -dnl # Read meta data from the META file. When building from a git repository -dnl # the SPL_META_RELEASE field will be overwritten if there is an annotated -dnl # tag matching the form SPL_META_NAME-SPL_META_VERSION-*. This allows -dnl # for working builds to be uniquely identified using the git commit hash. -dnl # -dnl # The META file format is as follows: -dnl # ^[ ]*KEY:[ \t]+VALUE$ -dnl # -dnl # In other words: -dnl # - KEY is separated from VALUE by a colon and one or more spaces/tabs. -dnl # - KEY and VALUE are case sensitive. -dnl # - Leading spaces are ignored. -dnl # - First match wins for duplicate keys. -dnl # -dnl # A line can be commented out by preceding it with a '#' (or technically -dnl # any non-space character since that will prevent the regex from -dnl # matching). -dnl # -dnl # WARNING: -dnl # Placing a colon followed by a space or tab (ie, ":[ \t]+") within the -dnl # VALUE will prematurely terminate the string since that sequence is -dnl # used as the awk field separator. -dnl # -dnl # KEYS: -dnl # The following META keys are recognized: -dnl # Name, Version, Release, Date, Author, LT_Current, LT_Revision, LT_Age -dnl # -dnl # Written by Chris Dunlap <[email protected]>. -dnl # Modified by Brian Behlendorf <[email protected]>. -dnl # -AC_DEFUN([SPL_AC_META], [ - AC_PROG_AWK - AC_MSG_CHECKING([metadata]) - - META="$srcdir/META" - _spl_ac_meta_type="none" - if test -f "$META"; then - _spl_ac_meta_type="META file" - - SPL_META_NAME=_SPL_AC_META_GETVAL([(Name|Project|Package)]); - if test -n "$SPL_META_NAME"; then - AC_DEFINE_UNQUOTED([SPL_META_NAME], ["$SPL_META_NAME"], - [Define the project name.] - ) - AC_SUBST([SPL_META_NAME]) - fi - - SPL_META_VERSION=_SPL_AC_META_GETVAL([Version]); - if test -n "$SPL_META_VERSION"; then - AC_DEFINE_UNQUOTED([SPL_META_VERSION], ["$SPL_META_VERSION"], - [Define the project version.] - ) - AC_SUBST([SPL_META_VERSION]) - fi - - SPL_META_RELEASE=_SPL_AC_META_GETVAL([Release]); - if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then - _match="${SPL_META_NAME}-${SPL_META_VERSION}" - _alias=$(git describe --match=${_match} 2>/dev/null) - _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g') - if test -n "${_release}"; then - SPL_META_RELEASE=${_release} - _spl_ac_meta_type="git describe" - else - _match="${SPL_META_NAME}-${SPL_META_VERSION}-${SPL_META_RELEASE}" - _alias=$(git describe --match=${_match} 2>/dev/null) - _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g') - if test -n "${_release}"; then - SPL_META_RELEASE=${_release} - _spl_ac_meta_type="git describe" - fi - fi - fi - - if test -n "$SPL_META_RELEASE"; then - AC_DEFINE_UNQUOTED([SPL_META_RELEASE], ["$SPL_META_RELEASE"], - [Define the project release.] - ) - AC_SUBST([SPL_META_RELEASE]) - - RELEASE="$SPL_META_RELEASE" - AC_SUBST([RELEASE]) - fi - - SPL_META_LICENSE=_SPL_AC_META_GETVAL([License]); - if test -n "$SPL_META_LICENSE"; then - AC_DEFINE_UNQUOTED([SPL_META_LICENSE], ["$SPL_META_LICENSE"], - [Define the project license.] - ) - AC_SUBST([SPL_META_LICENSE]) - fi - - if test -n "$SPL_META_NAME" -a -n "$SPL_META_VERSION"; then - SPL_META_ALIAS="$SPL_META_NAME-$SPL_META_VERSION" - test -n "$SPL_META_RELEASE" && - SPL_META_ALIAS="$SPL_META_ALIAS-$SPL_META_RELEASE" - AC_DEFINE_UNQUOTED([SPL_META_ALIAS], - ["$SPL_META_ALIAS"], - [Define the project alias string.] - ) - AC_SUBST([SPL_META_ALIAS]) - fi - - SPL_META_DATA=_SPL_AC_META_GETVAL([Date]); - if test -n "$SPL_META_DATA"; then - AC_DEFINE_UNQUOTED([SPL_META_DATA], ["$SPL_META_DATA"], - [Define the project release date.] - ) - AC_SUBST([SPL_META_DATA]) - fi - - SPL_META_AUTHOR=_SPL_AC_META_GETVAL([Author]); - if test -n "$SPL_META_AUTHOR"; then - AC_DEFINE_UNQUOTED([SPL_META_AUTHOR], ["$SPL_META_AUTHOR"], - [Define the project author.] - ) - AC_SUBST([SPL_META_AUTHOR]) - fi - - m4_pattern_allow([^LT_(CURRENT|REVISION|AGE)$]) - SPL_META_LT_CURRENT=_SPL_AC_META_GETVAL([LT_Current]); - SPL_META_LT_REVISION=_SPL_AC_META_GETVAL([LT_Revision]); - SPL_META_LT_AGE=_SPL_AC_META_GETVAL([LT_Age]); - if test -n "$SPL_META_LT_CURRENT" \ - -o -n "$SPL_META_LT_REVISION" \ - -o -n "$SPL_META_LT_AGE"; then - test -n "$SPL_META_LT_CURRENT" || SPL_META_LT_CURRENT="0" - test -n "$SPL_META_LT_REVISION" || SPL_META_LT_REVISION="0" - test -n "$SPL_META_LT_AGE" || SPL_META_LT_AGE="0" - AC_DEFINE_UNQUOTED([SPL_META_LT_CURRENT], - ["$SPL_META_LT_CURRENT"], - [Define the libtool library 'current' - version information.] - ) - AC_DEFINE_UNQUOTED([SPL_META_LT_REVISION], - ["$SPL_META_LT_REVISION"], - [Define the libtool library 'revision' - version information.] - ) - AC_DEFINE_UNQUOTED([SPL_META_LT_AGE], ["$SPL_META_LT_AGE"], - [Define the libtool library 'age' - version information.] - ) - AC_SUBST([SPL_META_LT_CURRENT]) - AC_SUBST([SPL_META_LT_REVISION]) - AC_SUBST([SPL_META_LT_AGE]) - fi - fi - - AC_MSG_RESULT([$_spl_ac_meta_type]) - ] -) - -dnl # _SPL_AC_META_GETVAL (KEY_NAME_OR_REGEX) -dnl # -dnl # Returns the META VALUE associated with the given KEY_NAME_OR_REGEX expr. -dnl # -dnl # Despite their resemblance to line noise, -dnl # the "@<:@" and "@:>@" constructs are quadrigraphs for "[" and "]". -dnl # <www.gnu.org/software/autoconf/manual/autoconf.html#Quadrigraphs> -dnl # -dnl # The "$[]1" and "$[]2" constructs prevent M4 parameter expansion -dnl # so a literal $1 and $2 will be passed to the resulting awk script, -dnl # whereas the "$1" will undergo M4 parameter expansion for the META key. -dnl # -AC_DEFUN([_SPL_AC_META_GETVAL], - [`$AWK -F ':@<:@ \t@:>@+' '$[]1 ~ /^ *$1$/ { print $[]2; exit }' $META`]dnl -) diff --git a/config/tgz.am b/config/tgz.am deleted file mode 100644 index 765be43b9..000000000 --- a/config/tgz.am +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################### -# Copyright (C) 2010 Lawrence Livermore National Security, LLC. -# Written by Brian Behlendorf <[email protected]>. -############################################################################### -# Build targets for TGZ packages. -# -# Long term native distro specific Slackware style packaging should be added. -# In the short term RPM packages are built and converted to TGZ packages -# using alien. If someone familiar with Slackware style packaging were to -# update the build system to correctly build Slackware style packages I would -# happily take it. Until then we will have to make due with alien. -# -############################################################################### - -tgz-local: - @(if test "${HAVE_ALIEN}" = "no"; then \ - echo -e "\n" \ - "*** Required util ${ALIEN} missing. Please install the\n" \ - "*** package for your distribution which provides ${ALIEN},\n" \ - "*** re-run configure, and try again.\n"; \ - exit 1; \ - fi) - -tgz-kmod: tgz-local rpm-kmod -if CONFIG_KERNEL - name=${PACKAGE}; \ - version=${VERSION}-${RELEASE}; \ - arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \ - pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \ - fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \ - $(RM) $$pkg1 -endif - -tgz-utils: tgz-local rpm-utils -if CONFIG_USER - name=${PACKAGE}; \ - version=${VERSION}-${RELEASE}; \ - arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ - pkg1=$${name}-$${version}.$${arch}.rpm; \ - fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \ - $(RM) $$pkg1 -endif - -tgz: tgz-kmod tgz-utils |