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