1dnl # 2dnl # Default ZFS kernel configuration 3dnl # 4AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ 5 AM_COND_IF([BUILD_LINUX], [ 6 dnl # Setup the kernel build environment. 7 ZFS_AC_KERNEL 8 ZFS_AC_QAT 9 10 dnl # Sanity checks for module building and CONFIG_* defines 11 ZFS_AC_KERNEL_CONFIG_DEFINED 12 ZFS_AC_MODULE_SYMVERS 13 14 dnl # Sequential ZFS_LINUX_TRY_COMPILE tests 15 ZFS_AC_KERNEL_FPU_HEADER 16 ZFS_AC_KERNEL_OBJTOOL_HEADER 17 ZFS_AC_KERNEL_MISC_MINOR 18 ZFS_AC_KERNEL_DECLARE_EVENT_CLASS 19 20 dnl # Parallel ZFS_LINUX_TEST_SRC / ZFS_LINUX_TEST_RESULT tests 21 ZFS_AC_KERNEL_TEST_SRC 22 ZFS_AC_KERNEL_TEST_RESULT 23 24 AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ 25 KERNEL_MAKE="$KERNEL_MAKE O=$LINUX_OBJ" 26 ]) 27 28 AC_SUBST(KERNEL_MAKE) 29 ]) 30]) 31 32dnl # 33dnl # Generate and compile all of the kernel API test cases to determine 34dnl # which interfaces are available. By invoking the kernel build system 35dnl # only once the compilation can be done in parallel significantly 36dnl # speeding up the process. 37dnl # 38AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ 39 ZFS_AC_KERNEL_SRC_TYPES 40 ZFS_AC_KERNEL_SRC_OBJTOOL 41 ZFS_AC_KERNEL_SRC_ACCESS_OK_TYPE 42 ZFS_AC_KERNEL_SRC_PDE_DATA 43 ZFS_AC_KERNEL_SRC_GENERIC_FADVISE 44 ZFS_AC_KERNEL_SRC_SCHED 45 ZFS_AC_KERNEL_SRC_USLEEP_RANGE 46 ZFS_AC_KERNEL_SRC_VMALLOC_PAGE_KERNEL 47 ZFS_AC_KERNEL_SRC_INODE_TIMES 48 ZFS_AC_KERNEL_SRC_PROC_OPERATIONS 49 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS 50 ZFS_AC_KERNEL_SRC_BIO 51 ZFS_AC_KERNEL_SRC_BLKDEV 52 ZFS_AC_KERNEL_SRC_BLK_QUEUE 53 ZFS_AC_KERNEL_SRC_GENHD_FLAGS 54 ZFS_AC_KERNEL_SRC_REVALIDATE_DISK 55 ZFS_AC_KERNEL_SRC_GET_DISK_RO 56 ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY 57 ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE 58 ZFS_AC_KERNEL_SRC_XATTR 59 ZFS_AC_KERNEL_SRC_ACL 60 ZFS_AC_KERNEL_SRC_INODE_SETATTR 61 ZFS_AC_KERNEL_SRC_INODE_GETATTR 62 ZFS_AC_KERNEL_SRC_SHOW_OPTIONS 63 ZFS_AC_KERNEL_SRC_SHRINKER 64 ZFS_AC_KERNEL_SRC_MKDIR 65 ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS 66 ZFS_AC_KERNEL_SRC_CREATE 67 ZFS_AC_KERNEL_SRC_PERMISSION 68 ZFS_AC_KERNEL_SRC_TMPFILE 69 ZFS_AC_KERNEL_SRC_AUTOMOUNT 70 ZFS_AC_KERNEL_SRC_COMMIT_METADATA 71 ZFS_AC_KERNEL_SRC_SETATTR_PREPARE 72 ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED 73 ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE 74 ZFS_AC_KERNEL_SRC_SECURITY_INODE 75 ZFS_AC_KERNEL_SRC_FST_MOUNT 76 ZFS_AC_KERNEL_SRC_SB_DYING 77 ZFS_AC_KERNEL_SRC_SET_NLINK 78 ZFS_AC_KERNEL_SRC_SGET 79 ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO 80 ZFS_AC_KERNEL_SRC_VFS_READ_FOLIO 81 ZFS_AC_KERNEL_SRC_VFS_MIGRATE_FOLIO 82 ZFS_AC_KERNEL_SRC_VFS_MIGRATEPAGE 83 ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS 84 ZFS_AC_KERNEL_SRC_VFS_READPAGES 85 ZFS_AC_KERNEL_SRC_VFS_WRITEPAGE 86 ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS 87 ZFS_AC_KERNEL_SRC_VFS_IOV_ITER 88 ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE 89 ZFS_AC_KERNEL_SRC_VFS_SPLICE_COPY_FILE_RANGE 90 ZFS_AC_KERNEL_SRC_VFS_REMAP_FILE_RANGE 91 ZFS_AC_KERNEL_SRC_VFS_CLONE_FILE_RANGE 92 ZFS_AC_KERNEL_SRC_VFS_DEDUPE_FILE_RANGE 93 ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS 94 ZFS_AC_KERNEL_SRC_KMAP_LOCAL_PAGE 95 ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE 96 ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN 97 ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT 98 ZFS_AC_KERNEL_SRC_FPU 99 ZFS_AC_KERNEL_SRC_FMODE_T 100 ZFS_AC_KERNEL_SRC_KUIDGID_T 101 ZFS_AC_KERNEL_SRC_KUID_HELPERS 102 ZFS_AC_KERNEL_SRC_RENAME 103 ZFS_AC_KERNEL_SRC_TOTALRAM_PAGES_FUNC 104 ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES 105 ZFS_AC_KERNEL_SRC_PERCPU 106 ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR 107 ZFS_AC_KERNEL_SRC_MKNOD 108 ZFS_AC_KERNEL_SRC_SYMLINK 109 ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS 110 ZFS_AC_KERNEL_SRC_SIGINFO 111 ZFS_AC_KERNEL_SRC_SYSFS 112 ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG 113 ZFS_AC_KERNEL_SRC_STRLCPY 114 ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT 115 ZFS_AC_KERNEL_SRC_PAGEMAP_READAHEAD_PAGE 116 ZFS_AC_KERNEL_SRC_ADD_DISK 117 ZFS_AC_KERNEL_SRC_KTHREAD 118 ZFS_AC_KERNEL_SRC_ZERO_PAGE 119 ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC 120 ZFS_AC_KERNEL_SRC_IDMAP_MNT_API 121 ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS 122 ZFS_AC_KERNEL_SRC_IATTR_VFSID 123 ZFS_AC_KERNEL_SRC_WRITEPAGE_T 124 ZFS_AC_KERNEL_SRC_RECLAIMED 125 ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE 126 ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ 127 ZFS_AC_KERNEL_SRC_PROC_HANDLER_CTL_TABLE_CONST 128 ZFS_AC_KERNEL_SRC_COPY_SPLICE_READ 129 ZFS_AC_KERNEL_SRC_SYNC_BDEV 130 ZFS_AC_KERNEL_SRC_MM_PAGE_FLAGS 131 ZFS_AC_KERNEL_SRC_MM_PAGE_SIZE 132 ZFS_AC_KERNEL_SRC_MM_PAGE_MAPPING 133 ZFS_AC_KERNEL_SRC_FILE 134 ZFS_AC_KERNEL_SRC_PIN_USER_PAGES 135 ZFS_AC_KERNEL_SRC_TIMER 136 ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR 137 case "$host_cpu" in 138 powerpc*) 139 ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE 140 ZFS_AC_KERNEL_SRC_FLUSH_DCACHE_PAGE 141 ;; 142 riscv*) 143 ZFS_AC_KERNEL_SRC_FLUSH_DCACHE_PAGE 144 ;; 145 esac 146 147 AC_MSG_CHECKING([for available kernel interfaces]) 148 ZFS_LINUX_TEST_COMPILE_ALL([kabi]) 149 AC_MSG_RESULT([done]) 150]) 151 152dnl # 153dnl # Check results of kernel interface tests. 154dnl # 155AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ 156 ZFS_AC_KERNEL_TYPES 157 ZFS_AC_KERNEL_ACCESS_OK_TYPE 158 ZFS_AC_KERNEL_OBJTOOL 159 ZFS_AC_KERNEL_PDE_DATA 160 ZFS_AC_KERNEL_GENERIC_FADVISE 161 ZFS_AC_KERNEL_SCHED 162 ZFS_AC_KERNEL_USLEEP_RANGE 163 ZFS_AC_KERNEL_VMALLOC_PAGE_KERNEL 164 ZFS_AC_KERNEL_INODE_TIMES 165 ZFS_AC_KERNEL_PROC_OPERATIONS 166 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS 167 ZFS_AC_KERNEL_BIO 168 ZFS_AC_KERNEL_BLKDEV 169 ZFS_AC_KERNEL_BLK_QUEUE 170 ZFS_AC_KERNEL_GENHD_FLAGS 171 ZFS_AC_KERNEL_REVALIDATE_DISK 172 ZFS_AC_KERNEL_GET_DISK_RO 173 ZFS_AC_KERNEL_DISCARD_GRANULARITY 174 ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE 175 ZFS_AC_KERNEL_XATTR 176 ZFS_AC_KERNEL_ACL 177 ZFS_AC_KERNEL_INODE_SETATTR 178 ZFS_AC_KERNEL_INODE_GETATTR 179 ZFS_AC_KERNEL_SHOW_OPTIONS 180 ZFS_AC_KERNEL_SHRINKER 181 ZFS_AC_KERNEL_MKDIR 182 ZFS_AC_KERNEL_LOOKUP_FLAGS 183 ZFS_AC_KERNEL_CREATE 184 ZFS_AC_KERNEL_PERMISSION 185 ZFS_AC_KERNEL_TMPFILE 186 ZFS_AC_KERNEL_AUTOMOUNT 187 ZFS_AC_KERNEL_COMMIT_METADATA 188 ZFS_AC_KERNEL_SETATTR_PREPARE 189 ZFS_AC_KERNEL_INSERT_INODE_LOCKED 190 ZFS_AC_KERNEL_TRUNCATE_SETSIZE 191 ZFS_AC_KERNEL_SECURITY_INODE 192 ZFS_AC_KERNEL_FST_MOUNT 193 ZFS_AC_KERNEL_SB_DYING 194 ZFS_AC_KERNEL_SET_NLINK 195 ZFS_AC_KERNEL_SGET 196 ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO 197 ZFS_AC_KERNEL_VFS_READ_FOLIO 198 ZFS_AC_KERNEL_VFS_MIGRATE_FOLIO 199 ZFS_AC_KERNEL_VFS_MIGRATEPAGE 200 ZFS_AC_KERNEL_VFS_FSYNC_2ARGS 201 ZFS_AC_KERNEL_VFS_READPAGES 202 ZFS_AC_KERNEL_VFS_WRITEPAGE 203 ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS 204 ZFS_AC_KERNEL_VFS_IOV_ITER 205 ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE 206 ZFS_AC_KERNEL_VFS_SPLICE_COPY_FILE_RANGE 207 ZFS_AC_KERNEL_VFS_REMAP_FILE_RANGE 208 ZFS_AC_KERNEL_VFS_CLONE_FILE_RANGE 209 ZFS_AC_KERNEL_VFS_DEDUPE_FILE_RANGE 210 ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS 211 ZFS_AC_KERNEL_KMAP_LOCAL_PAGE 212 ZFS_AC_KERNEL_FOLLOW_DOWN_ONE 213 ZFS_AC_KERNEL_MAKE_REQUEST_FN 214 ZFS_AC_KERNEL_GENERIC_IO_ACCT 215 ZFS_AC_KERNEL_FPU 216 ZFS_AC_KERNEL_FMODE_T 217 ZFS_AC_KERNEL_KUIDGID_T 218 ZFS_AC_KERNEL_KUID_HELPERS 219 ZFS_AC_KERNEL_RENAME 220 ZFS_AC_KERNEL_TOTALRAM_PAGES_FUNC 221 ZFS_AC_KERNEL_TOTALHIGH_PAGES 222 ZFS_AC_KERNEL_PERCPU 223 ZFS_AC_KERNEL_GENERIC_FILLATTR 224 ZFS_AC_KERNEL_MKNOD 225 ZFS_AC_KERNEL_SYMLINK 226 ZFS_AC_KERNEL_BIO_MAX_SEGS 227 ZFS_AC_KERNEL_SIGINFO 228 ZFS_AC_KERNEL_SYSFS 229 ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG 230 ZFS_AC_KERNEL_STRLCPY 231 ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT 232 ZFS_AC_KERNEL_PAGEMAP_READAHEAD_PAGE 233 ZFS_AC_KERNEL_ADD_DISK 234 ZFS_AC_KERNEL_KTHREAD 235 ZFS_AC_KERNEL_ZERO_PAGE 236 ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC 237 ZFS_AC_KERNEL_IDMAP_MNT_API 238 ZFS_AC_KERNEL_IDMAP_NO_USERNS 239 ZFS_AC_KERNEL_IATTR_VFSID 240 ZFS_AC_KERNEL_WRITEPAGE_T 241 ZFS_AC_KERNEL_RECLAIMED 242 ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE 243 ZFS_AC_KERNEL_REGISTER_SYSCTL_SZ 244 ZFS_AC_KERNEL_PROC_HANDLER_CTL_TABLE_CONST 245 ZFS_AC_KERNEL_COPY_SPLICE_READ 246 ZFS_AC_KERNEL_SYNC_BDEV 247 ZFS_AC_KERNEL_MM_PAGE_FLAGS 248 ZFS_AC_KERNEL_MM_PAGE_SIZE 249 ZFS_AC_KERNEL_MM_PAGE_MAPPING 250 ZFS_AC_KERNEL_1ARG_ASSIGN_STR 251 ZFS_AC_KERNEL_FILE 252 ZFS_AC_KERNEL_PIN_USER_PAGES 253 ZFS_AC_KERNEL_TIMER 254 ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR 255 case "$host_cpu" in 256 powerpc*) 257 ZFS_AC_KERNEL_CPU_HAS_FEATURE 258 ZFS_AC_KERNEL_FLUSH_DCACHE_PAGE 259 ;; 260 riscv*) 261 ZFS_AC_KERNEL_FLUSH_DCACHE_PAGE 262 ;; 263 esac 264]) 265 266dnl # 267dnl # Detect name used for Module.symvers file in kernel 268dnl # 269AC_DEFUN([ZFS_AC_MODULE_SYMVERS], [ 270 modpost=$LINUX/scripts/Makefile.modpost 271 AC_MSG_CHECKING([kernel file name for module symbols]) 272 AS_IF([test "x$enable_linux_builtin" != xyes -a -f "$modpost"], [ 273 AS_IF([grep -q Modules.symvers $modpost], [ 274 LINUX_SYMBOLS=Modules.symvers 275 ], [ 276 LINUX_SYMBOLS=Module.symvers 277 ]) 278 279 AS_IF([test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"], [ 280 AC_MSG_ERROR([ 281 *** Please make sure the kernel devel package for your distribution 282 *** is installed. If you are building with a custom kernel, make sure 283 *** the kernel is configured, built, and the '--with-linux=PATH' 284 *** configure option refers to the location of the kernel source. 285 ]) 286 ]) 287 ], [ 288 LINUX_SYMBOLS=NONE 289 ]) 290 AC_MSG_RESULT($LINUX_SYMBOLS) 291 AC_SUBST(LINUX_SYMBOLS) 292]) 293 294dnl # 295dnl # Detect the kernel to be built against 296dnl # 297dnl # Most modern Linux distributions have separate locations for bare 298dnl # source (source) and prebuilt (build) files. Additionally, there are 299dnl # `source` and `build` symlinks in `/lib/modules/$(KERNEL_VERSION)` 300dnl # pointing to them. The directory search order is now: 301dnl # 302dnl # - `configure` command line values if both `--with-linux` and 303dnl # `--with-linux-obj` were defined 304dnl # 305dnl # - If only `--with-linux` was defined, `--with-linux-obj` is assumed 306dnl # to have the same value as `--with-linux` 307dnl # 308dnl # - If neither `--with-linux` nor `--with-linux-obj` were defined 309dnl # autodetection is used: 310dnl # 311dnl # - `/lib/modules/$(uname -r)/{source,build}` respectively, if exist. 312dnl # 313dnl # - If only `/lib/modules/$(uname -r)/build` exists, it is assumed 314dnl # to be both source and build directory. 315dnl # 316dnl # - The first directory in `/lib/modules` with the highest version 317dnl # number according to `sort -V` which contains both `source` and 318dnl # `build` symlinks/directories. If module directory contains only 319dnl # `build` component, it is assumed to be both source and build 320dnl # directory. 321dnl # 322dnl # - Last resort: the first directory matching `/usr/src/kernels/*` 323dnl # and `/usr/src/linux-*` with the highest version number according 324dnl # to `sort -V` is assumed to be both source and build directory. 325dnl # 326AC_DEFUN([ZFS_AC_KERNEL], [ 327 AC_ARG_WITH([linux], 328 AS_HELP_STRING([--with-linux=PATH], 329 [Path to kernel source]), 330 [kernelsrc="$withval"]) 331 332 AC_ARG_WITH(linux-obj, 333 AS_HELP_STRING([--with-linux-obj=PATH], 334 [Path to kernel build objects]), 335 [kernelbuild="$withval"]) 336 337 AC_MSG_CHECKING([kernel source and build directories]) 338 AS_IF([test -n "$kernelsrc" && test -z "$kernelbuild"], [ 339 kernelbuild="$kernelsrc" 340 ], [test -z "$kernelsrc"], [ 341 AS_IF([test -e "/lib/modules/$(uname -r)/source" && \ 342 test -e "/lib/modules/$(uname -r)/build"], [ 343 src="/lib/modules/$(uname -r)/source" 344 build="/lib/modules/$(uname -r)/build" 345 ], [test -e "/lib/modules/$(uname -r)/build"], [ 346 build="/lib/modules/$(uname -r)/build" 347 src="$build" 348 ], [ 349 src= 350 351 for d in $(ls -1d /lib/modules/* 2>/dev/null | sort -Vr); do 352 if test -e "$d/source" && test -e "$d/build"; then 353 src="$d/source" 354 build="$d/build" 355 break 356 fi 357 358 if test -e "$d/build"; then 359 src="$d/build" 360 build="$d/build" 361 break 362 fi 363 done 364 365 # the least reliable method 366 if test -z "$src"; then 367 src=$(ls -1d /usr/src/kernels/* /usr/src/linux-* \ 368 2>/dev/null | grep -v obj | sort -Vr | head -1) 369 build="$src" 370 fi 371 ]) 372 373 AS_IF([test -n "$src" && test -e "$src"], [ 374 kernelsrc=$(readlink -e "$src") 375 ], [ 376 kernelsrc="[Not found]" 377 ]) 378 AS_IF([test -n "$build" && test -e "$build"], [ 379 kernelbuild=$(readlink -e "$build") 380 ], [ 381 kernelbuild="[Not found]" 382 ]) 383 ], [ 384 AS_IF([test "$kernelsrc" = "NONE"], [ 385 kernsrcver=NONE 386 ]) 387 withlinux=yes 388 ]) 389 390 AC_MSG_RESULT([done]) 391 AC_MSG_CHECKING([kernel source directory]) 392 AC_MSG_RESULT([$kernelsrc]) 393 AC_MSG_CHECKING([kernel build directory]) 394 AC_MSG_RESULT([$kernelbuild]) 395 AS_IF([test ! -d "$kernelsrc" || test ! -d "$kernelbuild"], [ 396 AC_MSG_ERROR([ 397 *** Please make sure the kernel devel package for your distribution 398 *** is installed and then try again. If that fails, you can specify the 399 *** location of the kernel source and build with the '--with-linux=PATH' and 400 *** '--with-linux-obj=PATH' options respectively.]) 401 ]) 402 403 AC_MSG_CHECKING([kernel source version]) 404 utsrelease1=$kernelbuild/include/linux/version.h 405 utsrelease2=$kernelbuild/include/linux/utsrelease.h 406 utsrelease3=$kernelbuild/include/generated/utsrelease.h 407 AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [ 408 utsrelease=$utsrelease1 409 ], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [ 410 utsrelease=$utsrelease2 411 ], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [ 412 utsrelease=$utsrelease3 413 ]) 414 415 AS_IF([test -n "$utsrelease"], [ 416 kernsrcver=$($AWK '/UTS_RELEASE/ { gsub(/"/, "", $[3]); print $[3] }' $utsrelease) 417 AS_IF([test -z "$kernsrcver"], [ 418 AC_MSG_RESULT([Not found]) 419 AC_MSG_ERROR([ 420 *** Cannot determine kernel version. 421 ]) 422 ]) 423 ], [ 424 AC_MSG_RESULT([Not found]) 425 if test "x$enable_linux_builtin" != xyes; then 426 AC_MSG_ERROR([ 427 *** Cannot find UTS_RELEASE definition. 428 ]) 429 else 430 AC_MSG_ERROR([ 431 *** Cannot find UTS_RELEASE definition. 432 *** Please run 'make prepare' inside the kernel source tree.]) 433 fi 434 ]) 435 436 AC_MSG_RESULT([$kernsrcver]) 437 438 AX_COMPARE_VERSION([$kernsrcver], [ge], [$ZFS_META_KVER_MIN], [], [ 439 AC_MSG_ERROR([ 440 *** Cannot build against kernel version $kernsrcver. 441 *** The minimum supported kernel version is $ZFS_META_KVER_MIN. 442 ]) 443 ]) 444 445 AC_ARG_ENABLE([linux-experimental], 446 AS_HELP_STRING([--enable-linux-experimental], 447 [Allow building against some unsupported kernel versions])) 448 449 AX_COMPARE_VERSION([$kernsrcver], [ge], [$ZFS_META_KVER_MAX], [ 450 AX_COMPARE_VERSION([$kernsrcver], [eq2], [$ZFS_META_KVER_MAX], [ 451 kern_max_version_ok=yes 452 ], [ 453 kern_max_version_ok=no 454 ]) 455 ], [ 456 kern_max_version_ok=yes 457 ]) 458 459 AS_IF([test "x$kern_max_version_ok" != "xyes"], [ 460 AS_IF([test "x$enable_linux_experimental" == "xyes"], [ 461 AC_DEFINE(HAVE_LINUX_EXPERIMENTAL, 1, 462 [building against unsupported kernel version]) 463 ], [ 464 AC_MSG_ERROR([ 465 *** Cannot build against kernel version $kernsrcver. 466 *** The maximum supported kernel version is $ZFS_META_KVER_MAX. 467 ]) 468 ]) 469 ]) 470 471 LINUX=${kernelsrc} 472 LINUX_OBJ=${kernelbuild} 473 LINUX_VERSION=${kernsrcver} 474 475 AC_SUBST(LINUX) 476 AC_SUBST(LINUX_OBJ) 477 AC_SUBST(LINUX_VERSION) 478 479 dnl # create a relatively unique numeric checksum based on the kernel 480 dnl # version and path. this is included in the cache key below, 481 dnl # allowing different cached values for different kernels 482 _zfs_linux_cache_checksum=$(echo ${kernelsrc} {$kernelbuild} ${kernsrcver} | cksum | cut -f1 -d' ') 483]) 484 485AC_DEFUN([ZFS_AC_KERNEL_VERSION_WARNING], [ 486 AS_IF([test "x$enable_linux_experimental" = "xyes" && \ 487 test "x$kern_max_version_ok" != "xyes"], [ 488 AC_MSG_WARN([ 489 490 You are building OpenZFS against Linux version $kernsrcver. 491 492 This combination is considered EXPERIMENTAL by the OpenZFS project. 493 Even if it appears to build and run correctly, there may be bugs that 494 can cause SERIOUS DATA LOSS. 495 496 YOU HAVE BEEN WARNED! 497 498 If you choose to continue, we'd appreciate if you could report your 499 results on the OpenZFS issue tracker at: 500 501 https://github.com/openzfs/zfs/issues/new 502 503 Your feedback will help us prepare a new OpenZFS release that supports 504 this version of Linux. 505 ]) 506 ]) 507]) 508 509dnl # 510dnl # Detect the QAT module to be built against, QAT provides hardware 511dnl # acceleration for data compression: 512dnl # 513dnl # https://01.org/intel-quickassist-technology 514dnl # 515dnl # 1) Download and install QAT driver from the above link 516dnl # 2) Start QAT driver in your system: 517dnl # service qat_service start 518dnl # 3) Enable QAT in ZFS, e.g.: 519dnl # ./configure --with-qat=<qat-driver-path>/QAT1.6 520dnl # make 521dnl # 4) Set GZIP compression in ZFS dataset: 522dnl # zfs set compression = gzip <dataset> 523dnl # 524dnl # Then the data written to this ZFS pool is compressed by QAT accelerator 525dnl # automatically, and de-compressed by QAT when read from the pool. 526dnl # 527dnl # 1) Get QAT hardware statistics with: 528dnl # cat /proc/icp_dh895xcc_dev/qat 529dnl # 2) To disable QAT: 530dnl # insmod zfs.ko zfs_qat_disable=1 531dnl # 532AC_DEFUN([ZFS_AC_QAT], [ 533 AC_ARG_WITH([qat], 534 AS_HELP_STRING([--with-qat=PATH], 535 [Path to qat source]), 536 AS_IF([test "$withval" = "yes"], 537 AC_MSG_ERROR([--with-qat=PATH requires a PATH]), 538 [qatsrc="$withval"])) 539 540 AC_ARG_WITH([qat-obj], 541 AS_HELP_STRING([--with-qat-obj=PATH], 542 [Path to qat build objects]), 543 [qatbuild="$withval"]) 544 545 AS_IF([test ! -z "${qatsrc}"], [ 546 AC_MSG_CHECKING([qat source directory]) 547 AC_MSG_RESULT([$qatsrc]) 548 QAT_SRC="${qatsrc}/quickassist" 549 AS_IF([ test ! -e "$QAT_SRC/include/cpa.h"], [ 550 AC_MSG_ERROR([ 551 *** Please make sure the qat driver package is installed 552 *** and specify the location of the qat source with the 553 *** '--with-qat=PATH' option then try again. Failed to 554 *** find cpa.h in: 555 ${QAT_SRC}/include]) 556 ]) 557 ]) 558 559 AS_IF([test ! -z "${qatsrc}"], [ 560 AC_MSG_CHECKING([qat build directory]) 561 AS_IF([test -z "$qatbuild"], [ 562 qatbuild="${qatsrc}/build" 563 ]) 564 565 AC_MSG_RESULT([$qatbuild]) 566 QAT_OBJ=${qatbuild} 567 AS_IF([ ! test -e "$QAT_OBJ/icp_qa_al.ko" && ! test -e "$QAT_OBJ/qat_api.ko"], [ 568 AC_MSG_ERROR([ 569 *** Please make sure the qat driver is installed then try again. 570 *** Failed to find icp_qa_al.ko or qat_api.ko in: 571 $QAT_OBJ]) 572 ]) 573 574 AC_SUBST(QAT_SRC) 575 AC_SUBST(QAT_OBJ) 576 577 AC_DEFINE(HAVE_QAT, 1, 578 [qat is enabled and existed]) 579 ]) 580 581 dnl # 582 dnl # Detect the name used for the QAT Module.symvers file. 583 dnl # 584 AS_IF([test ! -z "${qatsrc}"], [ 585 AC_MSG_CHECKING([qat file for module symbols]) 586 QAT_SYMBOLS=$QAT_SRC/lookaside/access_layer/src/Module.symvers 587 588 AS_IF([test -r $QAT_SYMBOLS], [ 589 AC_MSG_RESULT([$QAT_SYMBOLS]) 590 AC_SUBST(QAT_SYMBOLS) 591 ],[ 592 AC_MSG_ERROR([ 593 *** Please make sure the qat driver is installed then try again. 594 *** Failed to find Module.symvers in: 595 $QAT_SYMBOLS 596 ]) 597 ]) 598 ]) 599]) 600 601dnl # 602dnl # ZFS_LINUX_CONFTEST_H 603dnl # 604AC_DEFUN([ZFS_LINUX_CONFTEST_H], [ 605test -d build/$2 || mkdir -p build/$2 606cat - <<_ACEOF >build/$2/$2.h 607$1 608_ACEOF 609]) 610 611dnl # 612dnl # ZFS_LINUX_CONFTEST_C 613dnl # 614AC_DEFUN([ZFS_LINUX_CONFTEST_C], [ 615test -d build/$2 || mkdir -p build/$2 616cat confdefs.h - <<_ACEOF >build/$2/$2.c 617$1 618_ACEOF 619]) 620 621dnl # 622dnl # ZFS_LINUX_CONFTEST_MAKEFILE 623dnl # 624dnl # $1 - test case name 625dnl # $2 - add to top-level Makefile 626dnl # $3 - additional build flags 627dnl # 628AC_DEFUN([ZFS_LINUX_CONFTEST_MAKEFILE], [ 629 test -d build || mkdir -p build 630 test -d build/$1 || mkdir -p build/$1 631 632 file=build/$1/Makefile 633 634 dnl # Example command line to manually build source. 635 cat - <<_ACEOF >$file 636# Example command line to manually build source 637# make modules -C $LINUX_OBJ $ARCH_UM M=$PWD/build/$1 638 639ccflags-y := -Werror $FRAME_LARGER_THAN 640_ACEOF 641 642 dnl # Additional custom CFLAGS as requested. 643 m4_ifval($3, [echo "ccflags-y += $3" >>$file], []) 644 645 dnl # Test case source 646 echo "obj-m := $1.o" >>$file 647 648 AS_IF([test "x$2" = "xyes"], [echo "obj-m += $1/" >>build/Makefile], []) 649]) 650 651dnl # 652dnl # ZFS_LINUX_TEST_PROGRAM(C)([PROLOGUE], [BODY]) 653dnl # 654m4_define([ZFS_LINUX_TEST_PROGRAM], [ 655#include <linux/module.h> 656$1 657 658int 659main (void) 660{ 661$2 662 ; 663 return 0; 664} 665 666MODULE_DESCRIPTION("conftest"); 667MODULE_AUTHOR(ZFS_META_AUTHOR); 668MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE); 669MODULE_LICENSE($3); 670]) 671 672dnl # 673dnl # ZFS_LINUX_TEST_REMOVE 674dnl # 675dnl # Removes the specified test source and results. 676dnl # 677AC_DEFUN([ZFS_LINUX_TEST_REMOVE], [ 678 test -d build/$1 && rm -Rf build/$1 679 test -f build/Makefile && sed '/$1/d' build/Makefile 680]) 681 682dnl # 683dnl # ZFS_LINUX_COMPILE 684dnl # 685dnl # $1 - build dir 686dnl # $2 - test command 687dnl # $3 - pass command 688dnl # $4 - fail command 689dnl # $5 - set KBUILD_MODPOST_NOFINAL='yes' 690dnl # $6 - set KBUILD_MODPOST_WARN='yes' 691dnl # 692dnl # Used internally by ZFS_LINUX_TEST_{COMPILE,MODPOST} 693dnl # 694AC_DEFUN([ZFS_LINUX_COMPILE], [ 695 AC_ARG_VAR([KERNEL_CC], [C compiler for 696 building kernel modules]) 697 AC_ARG_VAR([KERNEL_LD], [Linker for 698 building kernel modules]) 699 AC_ARG_VAR([KERNEL_LLVM], [Binary option to 700 build kernel modules with LLVM/CLANG toolchain]) 701 AC_ARG_VAR([KERNEL_CROSS_COMPILE], [Cross compile prefix 702 for kernel module builds]) 703 AC_ARG_VAR([KERNEL_ARCH], [Architecture to build kernel modules for]) 704 AC_TRY_COMMAND([ 705 KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6" 706 make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC} 707 ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM} 708 CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES 709 ${KERNEL_CROSS_COMPILE:+CROSS_COMPILE=$KERNEL_CROSS_COMPILE} 710 ${KERNEL_ARCH:+ARCH=$KERNEL_ARCH} 711 -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1]) 712 AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4]) 713]) 714 715dnl # 716dnl # ZFS_LINUX_TEST_COMPILE 717dnl # 718dnl # Perform a full compile excluding the final modpost phase. 719dnl # 720AC_DEFUN([ZFS_LINUX_TEST_COMPILE], [ 721 ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [ 722 mv $2/Makefile $2/Makefile.compile.$1 723 mv $2/build.log $2/build.log.$1 724 ],[ 725 AC_MSG_ERROR([ 726 *** Unable to compile test source to determine kernel interfaces.]) 727 ], [yes], []) 728]) 729 730dnl # 731dnl # ZFS_LINUX_TEST_MODPOST 732dnl # 733dnl # Perform a full compile including the modpost phase. This may 734dnl # be an incremental build if the objects have already been built. 735dnl # 736AC_DEFUN([ZFS_LINUX_TEST_MODPOST], [ 737 ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [ 738 mv $2/Makefile $2/Makefile.modpost.$1 739 cat $2/build.log >>build/build.log.$1 740 ],[ 741 AC_MSG_ERROR([ 742 *** Unable to modpost test source to determine kernel interfaces.]) 743 ], [], [yes]) 744]) 745 746dnl # 747dnl # Perform the compilation of the test cases in two phases. 748dnl # 749dnl # Phase 1) attempt to build the object files for all of the tests 750dnl # defined by the ZFS_LINUX_TEST_SRC macro. But do not 751dnl # perform the final modpost stage. 752dnl # 753dnl # Phase 2) disable all tests which failed the initial compilation, 754dnl # then invoke the final modpost step for the remaining tests. 755dnl # 756dnl # This allows us efficiently build the test cases in parallel while 757dnl # remaining resilient to build failures which are expected when 758dnl # detecting the available kernel interfaces. 759dnl # 760dnl # The maximum allowed parallelism can be controlled by setting the 761dnl # TEST_JOBS environment variable. Otherwise, it default to $(nproc). 762dnl # 763AC_DEFUN([ZFS_LINUX_TEST_COMPILE_ALL], [ 764 dnl # Phase 1 - Compilation only, final linking is skipped. 765 ZFS_LINUX_TEST_COMPILE([$1], [build]) 766 767 dnl # 768 dnl # Phase 2 - When building external modules disable test cases 769 dnl # which failed to compile and invoke modpost to verify the 770 dnl # final linking. 771 dnl # 772 dnl # Test names suffixed with '_license' call modpost independently 773 dnl # to ensure that a single incompatibility does not result in the 774 dnl # modpost phase exiting early. This check is not performed on 775 dnl # every symbol since the majority are compatible and doing so 776 dnl # would significantly slow down this phase. 777 dnl # 778 dnl # When configuring for builtin (--enable-linux-builtin) 779 dnl # fake the linking step artificially create the expected .ko 780 dnl # files for tests which did compile. This is required for 781 dnl # kernels which do not have loadable module support or have 782 dnl # not yet been built. 783 dnl # 784 AS_IF([test "x$enable_linux_builtin" = "xno"], [ 785 for dir in $(awk '/^obj-m/ { print [$]3 }' \ 786 build/Makefile.compile.$1); do 787 name=${dir%/} 788 AS_IF([test -f build/$name/$name.o], [ 789 AS_IF([test "${name##*_}" = "license"], [ 790 ZFS_LINUX_TEST_MODPOST([$1], 791 [build/$name]) 792 echo "obj-n += $dir" >>build/Makefile 793 ], [ 794 echo "obj-m += $dir" >>build/Makefile 795 ]) 796 ], [ 797 echo "obj-n += $dir" >>build/Makefile 798 ]) 799 done 800 801 ZFS_LINUX_TEST_MODPOST([$1], [build]) 802 ], [ 803 for dir in $(awk '/^obj-m/ { print [$]3 }' \ 804 build/Makefile.compile.$1); do 805 name=${dir%/} 806 AS_IF([test -f build/$name/$name.o], [ 807 touch build/$name/$name.ko 808 ]) 809 done 810 ]) 811]) 812 813dnl # 814dnl # ZFS_LINUX_TEST_SRC 815dnl # 816dnl # $1 - name 817dnl # $2 - global 818dnl # $3 - source 819dnl # $4 - extra cflags 820dnl # $5 - check license-compatibility 821dnl # 822dnl # Check if the test source is buildable at all and then if it is 823dnl # license compatible. 824dnl # 825dnl # N.B because all of the test cases are compiled in parallel they 826dnl # must never depend on the results of previous tests. Each test 827dnl # needs to be entirely independent. 828dnl # 829AC_DEFUN([ZFS_LINUX_TEST_SRC], [ 830 cachevar="zfs_cv_kernel_[$1]_$_zfs_linux_cache_checksum" 831 eval "cacheval=\$$cachevar" 832 AS_IF([test "x$cacheval" = "x"], [ 833 ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]], 834 [["Dual BSD/GPL"]])], [$1]) 835 ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4]) 836 837 AS_IF([ test -n "$5" ], [ 838 ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM( 839 [[$2]], [[$3]], [[$5]])], [$1_license]) 840 ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4]) 841 ]) 842 ]) 843]) 844 845dnl # 846dnl # ZFS_LINUX_TEST_RESULT 847dnl # 848dnl # $1 - name of a test source (ZFS_LINUX_TEST_SRC) 849dnl # $2 - run on success (valid .ko generated) 850dnl # $3 - run on failure (unable to compile) 851dnl # 852AC_DEFUN([ZFS_LINUX_TEST_RESULT], [ 853 cachevar="zfs_cv_kernel_[$1]_$_zfs_linux_cache_checksum" 854 AC_CACHE_VAL([$cachevar], [ 855 AS_IF([test -d build/$1], [ 856 AS_IF([test -f build/$1/$1.ko], [ 857 eval "$cachevar=yes" 858 ], [ 859 eval "$cachevar=no" 860 ]) 861 ], [ 862 AC_MSG_ERROR([ 863 *** No matching source for the "$1" test, check that 864 *** both the test source and result macros refer to the same name. 865 ]) 866 ]) 867 ]) 868 eval "cacheval=\$$cachevar" 869 AS_IF([test "x$cacheval" = "xyes"], [$2], [$3]) 870]) 871 872dnl # 873dnl # ZFS_LINUX_TEST_ERROR 874dnl # 875dnl # Generic error message which can be used when none of the expected 876dnl # kernel interfaces were detected. 877dnl # 878AC_DEFUN([ZFS_LINUX_TEST_ERROR], [ 879 AC_MSG_ERROR([ 880 *** None of the expected "$1" interfaces were detected. 881 *** This may be because your kernel version is newer than what is 882 *** supported, or you are using a patched custom kernel with 883 *** incompatible modifications. 884 *** 885 *** ZFS Version: $ZFS_META_ALIAS 886 *** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX 887 ]) 888]) 889 890dnl # 891dnl # ZFS_LINUX_TEST_RESULT_SYMBOL 892dnl # 893dnl # Like ZFS_LINUX_TEST_RESULT except ZFS_CHECK_SYMBOL_EXPORT is called to 894dnl # verify symbol exports, unless --enable-linux-builtin was provided to 895dnl # configure. 896dnl # 897AC_DEFUN([ZFS_LINUX_TEST_RESULT_SYMBOL], [ 898 cachevar="zfs_cv_kernel_[$1]_$_zfs_linux_cache_checksum" 899 AC_CACHE_VAL([$cachevar], [ 900 AS_IF([ ! test -f build/$1/$1.ko], [ 901 eval "$cachevar=no" 902 ], [ 903 AS_IF([test "x$enable_linux_builtin" != "xyes"], [ 904 ZFS_CHECK_SYMBOL_EXPORT([$2], [$3], [ 905 eval "$cachevar=yes" 906 ], [ 907 eval "$cachevar=no" 908 ]) 909 ], [ 910 eval "$cachevar=yes" 911 ]) 912 ]) 913 ]) 914 eval "cacheval=\$$cachevar" 915 AS_IF([test "x$cacheval" = "xyes"], [$4], [$5]) 916]) 917 918dnl # 919dnl # ZFS_LINUX_COMPILE_IFELSE 920dnl # 921AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [ 922 ZFS_LINUX_TEST_REMOVE([conftest]) 923 924 m4_ifvaln([$1], [ZFS_LINUX_CONFTEST_C([$1], [conftest])]) 925 m4_ifvaln([$5], [ZFS_LINUX_CONFTEST_H([$5], [conftest])], 926 [ZFS_LINUX_CONFTEST_H([], [conftest])]) 927 928 ZFS_LINUX_CONFTEST_MAKEFILE([conftest], [no], 929 [m4_ifvaln([$5], [-I$PWD/build/conftest], [])]) 930 ZFS_LINUX_COMPILE([build/conftest], [$2], [$3], [$4], [], []) 931]) 932 933dnl # 934dnl # ZFS_LINUX_TRY_COMPILE 935dnl # 936dnl # $1 - global 937dnl # $2 - source 938dnl # $3 - run on success (valid .ko generated) 939dnl # $4 - run on failure (unable to compile) 940dnl # 941dnl # When configuring as builtin (--enable-linux-builtin) for kernels 942dnl # without loadable module support (CONFIG_MODULES=n) only the object 943dnl # file is created. See ZFS_LINUX_TEST_COMPILE_ALL for details. 944dnl # 945AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [ 946 AS_IF([test "x$enable_linux_builtin" = "xyes"], [ 947 ZFS_LINUX_COMPILE_IFELSE( 948 [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], 949 [[ZFS_META_LICENSE]])], 950 [test -f build/conftest/conftest.o], [$3], [$4]) 951 ], [ 952 ZFS_LINUX_COMPILE_IFELSE( 953 [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], 954 [[ZFS_META_LICENSE]])], 955 [test -f build/conftest/conftest.ko], [$3], [$4]) 956 ]) 957]) 958 959dnl # 960dnl # ZFS_CHECK_SYMBOL_EXPORT 961dnl # 962dnl # Check if a symbol is exported on not by consulting the symbols 963dnl # file, or optionally the source code. 964dnl # 965AC_DEFUN([ZFS_CHECK_SYMBOL_EXPORT], [ 966 grep -q -E '[[[:space:]]]$1[[[:space:]]]' \ 967 $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null 968 rc=$? 969 if test $rc -ne 0; then 970 export=0 971 for file in $2; do 972 grep -q -E "EXPORT_SYMBOL.*($1)" \ 973 "$LINUX/$file" 2>/dev/null 974 rc=$? 975 if test $rc -eq 0; then 976 export=1 977 break; 978 fi 979 done 980 if test $export -eq 0; then : 981 $4 982 else : 983 $3 984 fi 985 else : 986 $3 987 fi 988]) 989 990dnl # 991dnl # ZFS_LINUX_TRY_COMPILE_SYMBOL 992dnl # 993dnl # Like ZFS_LINUX_TRY_COMPILER except ZFS_CHECK_SYMBOL_EXPORT is called 994dnl # to verify symbol exports, unless --enable-linux-builtin was provided 995dnl # to configure. 996dnl # 997AC_DEFUN([ZFS_LINUX_TRY_COMPILE_SYMBOL], [ 998 ZFS_LINUX_TRY_COMPILE([$1], [$2], [rc=0], [rc=1]) 999 if test $rc -ne 0; then : 1000 $6 1001 else 1002 if test "x$enable_linux_builtin" != xyes; then 1003 ZFS_CHECK_SYMBOL_EXPORT([$3], [$4], [rc=0], [rc=1]) 1004 fi 1005 if test $rc -ne 0; then : 1006 $6 1007 else : 1008 $5 1009 fi 1010 fi 1011]) 1012 1013dnl # 1014dnl # ZFS_LINUX_TRY_COMPILE_HEADER 1015dnl # like ZFS_LINUX_TRY_COMPILE, except the contents conftest.h are 1016dnl # provided via the fifth parameter 1017dnl # 1018AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [ 1019 AS_IF([test "x$enable_linux_builtin" = "xyes"], [ 1020 ZFS_LINUX_COMPILE_IFELSE( 1021 [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], 1022 [[ZFS_META_LICENSE]])], 1023 [test -f build/conftest/conftest.o], [$3], [$4], [$5]) 1024 ], [ 1025 ZFS_LINUX_COMPILE_IFELSE( 1026 [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], 1027 [[ZFS_META_LICENSE]])], 1028 [test -f build/conftest/conftest.ko], [$3], [$4], [$5]) 1029 ]) 1030]) 1031 1032dnl # 1033dnl # AS_VERSION_COMPARE_LE 1034dnl # like AS_VERSION_COMPARE_LE, but runs $3 if (and only if) $1 <= $2 1035dnl # AS_VERSION_COMPARE_LE (version-1, version-2, [action-if-less-or-equal], [action-if-greater]) 1036dnl # 1037AC_DEFUN([AS_VERSION_COMPARE_LE], [ 1038 AS_VERSION_COMPARE([$1], [$2], [$3], [$3], [$4]) 1039]) 1040 1041dnl # 1042dnl # ZFS_LINUX_REQUIRE_API 1043dnl # like ZFS_LINUX_TEST_ERROR, except only fails if the kernel is 1044dnl # at least some specified version. 1045dnl # 1046AC_DEFUN([ZFS_LINUX_REQUIRE_API], [ 1047 AS_VERSION_COMPARE_LE([$2], [$kernsrcver], [ 1048 AC_MSG_ERROR([ 1049 *** None of the expected "$1" interfaces were detected. This 1050 *** interface is expected for kernels version "$2" and above. 1051 *** This may be because your kernel version is newer than what is 1052 *** supported, or you are using a patched custom kernel with 1053 *** incompatible modifications. Newer kernels may have incompatible 1054 *** APIs. 1055 *** 1056 *** ZFS Version: $ZFS_META_ALIAS 1057 *** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX 1058 ]) 1059 ], [ 1060 AC_MSG_RESULT(no) 1061 ]) 1062]) 1063