Lines Matching +full:- +full:- +full:build

6 		dnl # Setup the kernel build environment.
34 dnl # which interfaces are available. By invoking the kernel build system
280 AS_IF([test "x$enable_linux_builtin" != xyes -a -f "$modpost"], [
281 AS_IF([grep -q Modules.symvers $modpost], [
287 AS_IF([test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"], [
291 *** the kernel is configured, built, and the '--with-linux=PATH'
306 dnl # source (source) and prebuilt (build) files. Additionally, there are
307 dnl # `source` and `build` symlinks in `/lib/modules/$(KERNEL_VERSION)`
310 dnl # - `configure` command line values if both `--with-linux` and
311 dnl # `--with-linux-obj` were defined
313 dnl # - If only `--with-linux` was defined, `--with-linux-obj` is assumed
314 dnl # to have the same value as `--with-linux`
316 dnl # - If neither `--with-linux` nor `--with-linux-obj` were defined
319 dnl # - `/lib/modules/$(uname -r)/{source,build}` respectively, if exist.
321 dnl # - If only `/lib/modules/$(uname -r)/build` exists, it is assumed
322 dnl # to be both source and build directory.
324 dnl # - The first directory in `/lib/modules` with the highest version
325 dnl # number according to `sort -V` which contains both `source` and
326 dnl # `build` symlinks/directories. If module directory contains only
327 dnl # `build` component, it is assumed to be both source and build
330 dnl # - Last resort: the first directory matching `/usr/src/kernels/*`
331 dnl # and `/usr/src/linux-*` with the highest version number according
332 dnl # to `sort -V` is assumed to be both source and build directory.
336 AS_HELP_STRING([--with-linux=PATH],
340 AC_ARG_WITH(linux-obj,
341 AS_HELP_STRING([--with-linux-obj=PATH],
342 [Path to kernel build objects]),
345 AC_MSG_CHECKING([kernel source and build directories])
346 AS_IF([test -n "$kernelsrc" && test -z "$kernelbuild"], [
348 ], [test -z "$kernelsrc"], [
349 AS_IF([test -e "/lib/modules/$(uname -r)/source" && \
350 test -e "/lib/modules/$(uname -r)/build"], [
351 src="/lib/modules/$(uname -r)/source"
352 build="/lib/modules/$(uname -r)/build"
353 ], [test -e "/lib/modules/$(uname -r)/build"], [
354 build="/lib/modules/$(uname -r)/build"
355 src="$build"
359 for d in $(ls -1d /lib/modules/* 2>/dev/null | sort -Vr); do
360 if test -e "$d/source" && test -e "$d/build"; then
362 build="$d/build"
366 if test -e "$d/build"; then
367 src="$d/build"
368 build="$d/build"
374 if test -z "$src"; then
375 src=$(ls -1d /usr/src/kernels/* /usr/src/linux-* \
376 2>/dev/null | grep -v obj | sort -Vr | head -1)
377 build="$src"
381 AS_IF([test -n "$src" && test -e "$src"], [
382 kernelsrc=$(readlink -e "$src")
386 AS_IF([test -n "$build" && test -e "$build"], [
387 kernelbuild=$(readlink -e "$build")
401 AC_MSG_CHECKING([kernel build directory])
403 AS_IF([test ! -d "$kernelsrc" || test ! -d "$kernelbuild"], [
407 *** location of the kernel source and build with the '--with-linux=PATH' and
408 *** '--with-linux-obj=PATH' options respectively.])
415 AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
417 ], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
419 ], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
423 AS_IF([test -n "$utsrelease"], [
425 AS_IF([test -z "$kernsrcver"], [
448 *** Cannot build against kernel version $kernsrcver.
453 AC_ARG_ENABLE([linux-experimental],
454 AS_HELP_STRING([--enable-linux-experimental],
473 *** Cannot build against kernel version $kernsrcver.
490 _zfs_linux_cache_checksum=$(echo ${kernelsrc} {$kernelbuild} ${kernsrcver} | cksum | cut -f1 -d' ')
501 Even if it appears to build and run correctly, there may be bugs that
521 dnl # https://01.org/intel-quickassist-technology
527 dnl # ./configure --with-qat=<qat-driver-path>/QAT1.6
533 dnl # automatically, and de-compressed by QAT when read from the pool.
542 AS_HELP_STRING([--with-qat=PATH],
545 AC_MSG_ERROR([--with-qat=PATH requires a PATH]),
548 AC_ARG_WITH([qat-obj],
549 AS_HELP_STRING([--with-qat-obj=PATH],
550 [Path to qat build objects]),
553 AS_IF([test ! -z "${qatsrc}"], [
557 AS_IF([ test ! -e "$QAT_SRC/include/cpa.h"], [
561 *** '--with-qat=PATH' option then try again. Failed to
567 AS_IF([test ! -z "${qatsrc}"], [
568 AC_MSG_CHECKING([qat build directory])
569 AS_IF([test -z "$qatbuild"], [
570 qatbuild="${qatsrc}/build"
575 AS_IF([ ! test -e "$QAT_OBJ/icp_qa_al.ko" && ! test -e "$QAT_OBJ/qat_api.ko"], [
592 AS_IF([test ! -z "${qatsrc}"], [
596 AS_IF([test -r $QAT_SYMBOLS], [
613 test -d build/$2 || mkdir -p build/$2
614 cat - <<_ACEOF >build/$2/$2.h
623 test -d build/$2 || mkdir -p build/$2
624 cat confdefs.h - <<_ACEOF >build/$2/$2.c
632 dnl # $1 - test case name
633 dnl # $2 - add to top-level Makefile
634 dnl # $3 - additional build flags
637 test -d build || mkdir -p build
638 test -d build/$1 || mkdir -p build/$1
640 file=build/$1/Makefile
642 dnl # Example command line to manually build source.
643 cat - <<_ACEOF >$file
644 # Example command line to manually build source
645 # make modules -C $LINUX_OBJ $ARCH_UM M=$PWD/build/$1
647 ccflags-y := -Werror $FRAME_LARGER_THAN
651 m4_ifval($3, [echo "ccflags-y += $3" >>$file], [])
654 echo "obj-m := $1.o" >>$file
656 AS_IF([test "x$2" = "xyes"], [echo "obj-m += $1/" >>build/Makefile], [])
676 MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
686 test -d build/$1 && rm -Rf build/$1
687 test -f build/Makefile && sed '/$1/d' build/Makefile
693 dnl # $1 - build dir
694 dnl # $2 - test command
695 dnl # $3 - pass command
696 dnl # $4 - fail command
697 dnl # $5 - set KBUILD_MODPOST_NOFINAL='yes'
698 dnl # $6 - set KBUILD_MODPOST_WARN='yes'
708 build kernel modules with LLVM/CLANG toolchain])
711 AC_ARG_VAR([KERNEL_ARCH], [Architecture to build kernel modules for])
714 make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
716 CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
719 -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
729 ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [
731 mv $2/build.log $2/build.log.$1
742 dnl # be an incremental build if the objects have already been built.
745 ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [
747 cat $2/build.log >>build/build.log.$1
757 dnl # Phase 1) attempt to build the object files for all of the tests
764 dnl # This allows us efficiently build the test cases in parallel while
765 dnl # remaining resilient to build failures which are expected when
772 dnl # Phase 1 - Compilation only, final linking is skipped.
773 ZFS_LINUX_TEST_COMPILE([$1], [build])
776 dnl # Phase 2 - When building external modules disable test cases
786 dnl # When configuring for builtin (--enable-linux-builtin)
793 for dir in $(awk '/^obj-m/ { print [$]3 }' \
794 build/Makefile.compile.$1); do
796 AS_IF([test -f build/$name/$name.o], [
799 [build/$name])
800 echo "obj-n += $dir" >>build/Makefile
802 echo "obj-m += $dir" >>build/Makefile
805 echo "obj-n += $dir" >>build/Makefile
809 ZFS_LINUX_TEST_MODPOST([$1], [build])
811 for dir in $(awk '/^obj-m/ { print [$]3 }' \
812 build/Makefile.compile.$1); do
814 AS_IF([test -f build/$name/$name.o], [
815 touch build/$name/$name.ko
824 dnl # $1 - name
825 dnl # $2 - global
826 dnl # $3 - source
827 dnl # $4 - extra cflags
828 dnl # $5 - check license-compatibility
845 AS_IF([ test -n "$5" ], [
856 dnl # $1 - name of a test source (ZFS_LINUX_TEST_SRC)
857 dnl # $2 - run on success (valid .ko generated)
858 dnl # $3 - run on failure (unable to compile)
863 AS_IF([test -d build/$1], [
864 AS_IF([test -f build/$1/$1.ko], [
894 *** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX
902 dnl # verify symbol exports, unless --enable-linux-builtin was provided to
908 AS_IF([ ! test -f build/$1/$1.ko], [
937 [m4_ifvaln([$5], [-I$PWD/build/conftest], [])])
938 ZFS_LINUX_COMPILE([build/conftest], [$2], [$3], [$4], [], [])
944 dnl # $1 - global
945 dnl # $2 - source
946 dnl # $3 - run on success (valid .ko generated)
947 dnl # $4 - run on failure (unable to compile)
949 dnl # When configuring as builtin (--enable-linux-builtin) for kernels
958 [test -f build/conftest/conftest.o], [$3], [$4])
963 [test -f build/conftest/conftest.ko], [$3], [$4])
974 grep -q -E '[[[:space:]]]$1[[[:space:]]]' \
977 if test $rc -ne 0; then
980 grep -q -E "EXPORT_SYMBOL.*($1)" \
983 if test $rc -eq 0; then
988 if test $export -eq 0; then :
1002 dnl # to verify symbol exports, unless --enable-linux-builtin was provided
1007 if test $rc -ne 0; then :
1013 if test $rc -ne 0; then :
1031 [test -f build/conftest/conftest.o], [$3], [$4], [$5])
1036 [test -f build/conftest/conftest.ko], [$3], [$4], [$5])
1043 dnl # AS_VERSION_COMPARE_LE (version-1, version-2, [action-if-less-or-equal], [action-if-greater])
1065 *** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX