Lines Matching +full:build +full:- +full:in
6 dnl # Setup the kernel build environment.
34 dnl # which interfaces are available. By invoking the kernel build system
35 dnl # only once the compilation can be done in parallel significantly
137 case "$host_cpu" in
255 case "$host_cpu" in
267 dnl # Detect name used for Module.symvers file in kernel
272 AS_IF([test "x$enable_linux_builtin" != xyes -a -f "$modpost"], [
273 AS_IF([grep -q Modules.symvers $modpost], [
279 AS_IF([test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"], [
283 *** the kernel is configured, built, and the '--with-linux=PATH'
298 dnl # source (source) and prebuilt (build) files. Additionally, there are
299 dnl # `source` and `build` symlinks in `/lib/modules/$(KERNEL_VERSION)`
302 dnl # - `configure` command line values if both `--with-linux` and
303 dnl # `--with-linux-obj` were defined
305 dnl # - If only `--with-linux` was defined, `--with-linux-obj` is assumed
306 dnl # to have the same value as `--with-linux`
308 dnl # - If neither `--with-linux` nor `--with-linux-obj` were defined
311 dnl # - `/lib/modules/$(uname -r)/{source,build}` respectively, if exist.
313 dnl # - If only `/lib/modules/$(uname -r)/build` exists, it is assumed
314 dnl # to be both source and build directory.
316 dnl # - The first directory in `/lib/modules` with the highest version
317 dnl # number according to `sort -V` which contains both `source` and
318 dnl # `build` symlinks/directories. If module directory contains only
319 dnl # `build` component, it is assumed to be both source and build
322 dnl # - Last resort: the first directory matching `/usr/src/kernels/*`
323 dnl # and `/usr/src/linux-*` with the highest version number according
324 dnl # to `sort -V` is assumed to be both source and build directory.
328 AS_HELP_STRING([--with-linux=PATH],
332 AC_ARG_WITH(linux-obj,
333 AS_HELP_STRING([--with-linux-obj=PATH],
334 [Path to kernel build objects]),
337 AC_MSG_CHECKING([kernel source and build directories])
338 AS_IF([test -n "$kernelsrc" && test -z "$kernelbuild"], [
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"
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
354 build="$d/build"
358 if test -e "$d/build"; then
359 src="$d/build"
360 build="$d/build"
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"
373 AS_IF([test -n "$src" && test -e "$src"], [
374 kernelsrc=$(readlink -e "$src")
378 AS_IF([test -n "$build" && test -e "$build"], [
379 kernelbuild=$(readlink -e "$build")
393 AC_MSG_CHECKING([kernel build directory])
395 AS_IF([test ! -d "$kernelsrc" || test ! -d "$kernelbuild"], [
399 *** location of the kernel source and build with the '--with-linux=PATH' and
400 *** '--with-linux-obj=PATH' options respectively.])
407 AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
409 ], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
411 ], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
415 AS_IF([test -n "$utsrelease"], [
417 AS_IF([test -z "$kernsrcver"], [
440 *** Cannot build against kernel version $kernsrcver.
445 AC_ARG_ENABLE([linux-experimental],
446 AS_HELP_STRING([--enable-linux-experimental],
465 *** Cannot build against kernel version $kernsrcver.
480 dnl # version and path. this is included in the cache key below,
482 _zfs_linux_cache_checksum=$(echo ${kernelsrc} {$kernelbuild} ${kernsrcver} | cksum | cut -f1 -d' ')
493 Even if it appears to build and run correctly, there may be bugs that
513 dnl # https://01.org/intel-quickassist-technology
516 dnl # 2) Start QAT driver in your system:
518 dnl # 3) Enable QAT in ZFS, e.g.:
519 dnl # ./configure --with-qat=<qat-driver-path>/QAT1.6
521 dnl # 4) Set GZIP compression in ZFS dataset:
525 dnl # automatically, and de-compressed by QAT when read from the pool.
534 AS_HELP_STRING([--with-qat=PATH],
537 AC_MSG_ERROR([--with-qat=PATH requires a PATH]),
540 AC_ARG_WITH([qat-obj],
541 AS_HELP_STRING([--with-qat-obj=PATH],
542 [Path to qat build objects]),
545 AS_IF([test ! -z "${qatsrc}"], [
549 AS_IF([ test ! -e "$QAT_SRC/include/cpa.h"], [
553 *** '--with-qat=PATH' option then try again. Failed to
554 *** find cpa.h in:
559 AS_IF([test ! -z "${qatsrc}"], [
560 AC_MSG_CHECKING([qat build directory])
561 AS_IF([test -z "$qatbuild"], [
562 qatbuild="${qatsrc}/build"
567 AS_IF([ ! test -e "$QAT_OBJ/icp_qa_al.ko" && ! test -e "$QAT_OBJ/qat_api.ko"], [
570 *** Failed to find icp_qa_al.ko or qat_api.ko in:
584 AS_IF([test ! -z "${qatsrc}"], [
588 AS_IF([test -r $QAT_SYMBOLS], [
594 *** Failed to find Module.symvers in:
605 test -d build/$2 || mkdir -p build/$2
606 cat - <<_ACEOF >build/$2/$2.h
615 test -d build/$2 || mkdir -p build/$2
616 cat confdefs.h - <<_ACEOF >build/$2/$2.c
624 dnl # $1 - test case name
625 dnl # $2 - add to top-level Makefile
626 dnl # $3 - additional build flags
629 test -d build || mkdir -p build
630 test -d build/$1 || mkdir -p build/$1
632 file=build/$1/Makefile
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
639 ccflags-y := -Werror $FRAME_LARGER_THAN
643 m4_ifval($3, [echo "ccflags-y += $3" >>$file], [])
646 echo "obj-m := $1.o" >>$file
648 AS_IF([test "x$2" = "xyes"], [echo "obj-m += $1/" >>build/Makefile], [])
668 MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
678 test -d build/$1 && rm -Rf build/$1
679 test -f build/Makefile && sed '/$1/d' build/Makefile
685 dnl # $1 - build dir
686 dnl # $2 - test command
687 dnl # $3 - pass command
688 dnl # $4 - fail command
689 dnl # $5 - set KBUILD_MODPOST_NOFINAL='yes'
690 dnl # $6 - set KBUILD_MODPOST_WARN='yes'
700 build kernel modules with LLVM/CLANG toolchain])
703 AC_ARG_VAR([KERNEL_ARCH], [Architecture to build kernel modules for])
706 make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
708 CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
711 -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
721 ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [
723 mv $2/build.log $2/build.log.$1
734 dnl # be an incremental build if the objects have already been built.
737 ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [
739 cat $2/build.log >>build/build.log.$1
747 dnl # Perform the compilation of the test cases in two phases.
749 dnl # Phase 1) attempt to build the object files for all of the tests
756 dnl # This allows us efficiently build the test cases in parallel while
757 dnl # remaining resilient to build failures which are expected when
764 dnl # Phase 1 - Compilation only, final linking is skipped.
765 ZFS_LINUX_TEST_COMPILE([$1], [build])
768 dnl # Phase 2 - When building external modules disable test cases
773 dnl # to ensure that a single incompatibility does not result in the
778 dnl # When configuring for builtin (--enable-linux-builtin)
785 for dir in $(awk '/^obj-m/ { print [$]3 }' \
786 build/Makefile.compile.$1); do
788 AS_IF([test -f build/$name/$name.o], [
791 [build/$name])
792 echo "obj-n += $dir" >>build/Makefile
794 echo "obj-m += $dir" >>build/Makefile
797 echo "obj-n += $dir" >>build/Makefile
801 ZFS_LINUX_TEST_MODPOST([$1], [build])
803 for dir in $(awk '/^obj-m/ { print [$]3 }' \
804 build/Makefile.compile.$1); do
806 AS_IF([test -f build/$name/$name.o], [
807 touch build/$name/$name.ko
816 dnl # $1 - name
817 dnl # $2 - global
818 dnl # $3 - source
819 dnl # $4 - extra cflags
820 dnl # $5 - check license-compatibility
825 dnl # N.B because all of the test cases are compiled in parallel they
837 AS_IF([ test -n "$5" ], [
848 dnl # $1 - name of a test source (ZFS_LINUX_TEST_SRC)
849 dnl # $2 - run on success (valid .ko generated)
850 dnl # $3 - run on failure (unable to compile)
855 AS_IF([test -d build/$1], [
856 AS_IF([test -f build/$1/$1.ko], [
886 *** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX
894 dnl # verify symbol exports, unless --enable-linux-builtin was provided to
900 AS_IF([ ! test -f build/$1/$1.ko], [
929 [m4_ifvaln([$5], [-I$PWD/build/conftest], [])])
930 ZFS_LINUX_COMPILE([build/conftest], [$2], [$3], [$4], [], [])
936 dnl # $1 - global
937 dnl # $2 - source
938 dnl # $3 - run on success (valid .ko generated)
939 dnl # $4 - run on failure (unable to compile)
941 dnl # When configuring as builtin (--enable-linux-builtin) for kernels
950 [test -f build/conftest/conftest.o], [$3], [$4])
955 [test -f build/conftest/conftest.ko], [$3], [$4])
966 grep -q -E '[[[:space:]]]$1[[[:space:]]]' \
969 if test $rc -ne 0; then
971 for file in $2; do
972 grep -q -E "EXPORT_SYMBOL.*($1)" \
975 if test $rc -eq 0; then
980 if test $export -eq 0; then :
994 dnl # to verify symbol exports, unless --enable-linux-builtin was provided
999 if test $rc -ne 0; then :
1005 if test $rc -ne 0; then :
1023 [test -f build/conftest/conftest.o], [$3], [$4], [$5])
1028 [test -f build/conftest/conftest.ko], [$3], [$4], [$5])
1035 dnl # AS_VERSION_COMPARE_LE (version-1, version-2, [action-if-less-or-equal], [action-if-greater])
1057 *** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX