From 3a431c68c2fc928c228ae9aa686bfd4165a4188e Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Mon, 27 Jul 2009 10:39:28 -0700
Subject: [PATCH] Remove LINUXINCLUDE from autoconf wrapper, breaks 2.6.28+
 kernels. Modern kernel build systems at least post 2.6.16 will set this
 properly so we should not.  In fact post 2.6.28 the include headers have
 moved under arch so the guess we make here is completely wrong.  Letting the
 kernel build system set this ensure it will be correct.  Also drop the ulimit
 from the Makefile which, not surprisingly, turns out to be very non-portable.
  If your expecting failures set the ulimit in your shell before kicking off
 the test suite.

---
 config/kernel.m4    | 2 +-
 scripts/Makefile.am | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/config/kernel.m4 b/config/kernel.m4
index b61b842f36..d79ccc4d6d 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -255,7 +255,7 @@ AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [
 	rm -Rf build && mkdir -p build
 	echo "obj-m := conftest.o" >build/Makefile
 	AS_IF(
-		[AC_TRY_COMMAND(cp conftest.c build && make [$2] LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
+		[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) >/dev/null && AC_TRY_COMMAND([$3])],
 		[$4],
 		[_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
 	)
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 79e899954e..df04893b20 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -12,7 +12,6 @@ check:
 	@echo -n " ZTEST "
 	@echo    "===================================="
 	@echo
-	@$(shell ulimit -c unlimited)
 	@$(ZTEST) -V
 	@echo
 	@$(ZFS) -vu