@@ -465,6 +465,11 @@ AC_DEFUN([ZFS_AC_KERNEL], [
465
465
AC_SUBST ( LINUX )
466
466
AC_SUBST ( LINUX_OBJ )
467
467
AC_SUBST ( LINUX_VERSION )
468
+
469
+ dnl # create a relatively unique numeric checksum based on the kernel
470
+ dnl # version and path. this is included in the cache key below,
471
+ dnl # allowing different cached values for different kernels
472
+ _zfs_linux_cache_checksum=$(echo ${kernelsrc} {$kernelbuild} ${kernsrcver} | cksum | cut -f1 -d' ')
468
473
] )
469
474
470
475
AC_DEFUN ( [ ZFS_AC_KERNEL_VERSION_WARNING] , [
@@ -812,14 +817,18 @@ dnl # must never depend on the results of previous tests. Each test
812
817
dnl # needs to be entirely independent.
813
818
dnl #
814
819
AC_DEFUN ( [ ZFS_LINUX_TEST_SRC] , [
815
- ZFS_LINUX_CONFTEST_C([ ZFS_LINUX_TEST_PROGRAM([ [ $2 ] ] , [ [ $3 ] ] ,
816
- [ [ "Dual BSD/GPL"] ] )] , [ $1 ] )
817
- ZFS_LINUX_CONFTEST_MAKEFILE([ $1 ] , [ yes] , [ $4 ] )
818
-
819
- AS_IF ( [ test -n "$5 " ] , [
820
- ZFS_LINUX_CONFTEST_C([ ZFS_LINUX_TEST_PROGRAM(
821
- [ [ $2 ] ] , [ [ $3 ] ] , [ [ $5 ] ] )] , [ $1 _license] )
822
- ZFS_LINUX_CONFTEST_MAKEFILE([ $1 _license] , [ yes] , [ $4 ] )
820
+ cachevar="zfs_cv_kernel_[ $1 ] _$_zfs_linux_cache_checksum"
821
+ eval "cacheval=\$$cachevar"
822
+ AS_IF ( [ test "x$cacheval" = "x"] , [
823
+ ZFS_LINUX_CONFTEST_C([ ZFS_LINUX_TEST_PROGRAM([ [ $2 ] ] , [ [ $3 ] ] ,
824
+ [ [ "Dual BSD/GPL"] ] )] , [ $1 ] )
825
+ ZFS_LINUX_CONFTEST_MAKEFILE([ $1 ] , [ yes] , [ $4 ] )
826
+
827
+ AS_IF ( [ test -n "$5 " ] , [
828
+ ZFS_LINUX_CONFTEST_C([ ZFS_LINUX_TEST_PROGRAM(
829
+ [ [ $2 ] ] , [ [ $3 ] ] , [ [ $5 ] ] )] , [ $1 _license] )
830
+ ZFS_LINUX_CONFTEST_MAKEFILE([ $1 _license] , [ yes] , [ $4 ] )
831
+ ] )
823
832
] )
824
833
] )
825
834
@@ -831,14 +840,23 @@ dnl # $2 - run on success (valid .ko generated)
831
840
dnl # $3 - run on failure (unable to compile)
832
841
dnl #
833
842
AC_DEFUN ( [ ZFS_LINUX_TEST_RESULT] , [
834
- AS_IF ( [ test -d build/$1 ] , [
835
- AS_IF ( [ test -f build/$1 /$1 .ko] , [ $2 ] , [ $3 ] )
836
- ] , [
837
- AC_MSG_ERROR ( [
843
+ cachevar="zfs_cv_kernel_[ $1 ] _$_zfs_linux_cache_checksum"
844
+ AC_CACHE_VAL ( [ $cachevar] , [
845
+ AS_IF ( [ test -d build/$1 ] , [
846
+ AS_IF ( [ test -f build/$1 /$1 .ko] , [
847
+ eval "$cachevar=yes"
848
+ ] , [
849
+ eval "$cachevar=no"
850
+ ] )
851
+ ] , [
852
+ AC_MSG_ERROR ( [
838
853
*** No matching source for the "$1 " test, check that
839
854
*** both the test source and result macros refer to the same name.
855
+ ] )
840
856
] )
841
857
] )
858
+ eval "cacheval=\$$cachevar"
859
+ AS_IF ( [ test "x$cacheval" = "xyes"] , [ $2 ] , [ $3 ] )
842
860
] )
843
861
844
862
dnl #
@@ -867,15 +885,24 @@ dnl # verify symbol exports, unless --enable-linux-builtin was provided to
867
885
dnl # configure.
868
886
dnl #
869
887
AC_DEFUN ( [ ZFS_LINUX_TEST_RESULT_SYMBOL] , [
870
- AS_IF ( [ ! test -f build/$1 /$1 .ko] , [
871
- $5
872
- ] , [
873
- AS_IF ( [ test "x$enable_linux_builtin" != "xyes"] , [
874
- ZFS_CHECK_SYMBOL_EXPORT([ $2 ] , [ $3 ] , [ $4 ] , [ $5 ] )
888
+ cachevar="zfs_cv_kernel_[ $1 ] _$_zfs_linux_cache_checksum"
889
+ AC_CACHE_VAL ( [ $cachevar] , [
890
+ AS_IF ( [ ! test -f build/$1 /$1 .ko] , [
891
+ eval "$cachevar=no"
875
892
] , [
876
- $4
893
+ AS_IF ( [ test "x$enable_linux_builtin" != "xyes"] , [
894
+ ZFS_CHECK_SYMBOL_EXPORT([ $2 ] , [ $3 ] , [
895
+ eval "$cachevar=yes"
896
+ ] , [
897
+ eval "$cachevar=no"
898
+ ] )
899
+ ] , [
900
+ eval "$cacheval=yes"
901
+ ] )
877
902
] )
878
903
] )
904
+ eval "cacheval=\$$cachevar"
905
+ AS_IF ( [ test "x$cacheval" = "xyes"] , [ $4 ] , [ $5 ] )
879
906
] )
880
907
881
908
dnl #
0 commit comments