0fc9c4d5ec4a971f6d750d2113df02b66ce83fbd
[openafs.git] / src / cf / linux-checks.m4
1
2 AC_DEFUN([_OPENAFS_LINUX_CONFTEST_SETUP],[
3 # Add (sub-) architecture-specific paths needed by conftests
4 case $AFS_SYSNAME  in
5     *_umlinux26)
6         UMLINUX26_FLAGS="-I$LINUX_KERNEL_PATH/arch/um/include"
7         UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/tt/include"
8         UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/skas/include"
9         CPPFLAGS="$CPPFLAGS $UMLINUX26_FLAGS"
10 esac
11 ])
12
13 AC_DEFUN([_OPENAFS_LINUX_KBUILD_SETUP],[
14 if test "x$enable_debug_kernel" = "xno"; then
15     LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
16 fi
17 OPENAFS_GCC_SUPPORTS_MARCH
18 AC_SUBST(P5PLUS_KOPTS)
19 OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE
20 OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING
21 OPENAFS_GCC_SUPPORTS_NO_COMMON
22 OPENAFS_GCC_SUPPORTS_PIPE
23 AC_SUBST(LINUX_GCC_KOPTS)
24
25 dnl Setup the kernel build environment
26 LINUX_KBUILD_USES_EXTRA_CFLAGS
27 LINUX_KBUILD_SPARSE_CHECKS
28 LINUX_KERNEL_COMPILE_WORKS
29 ])
30
31 AC_DEFUN([OPENAFS_LINUX_MISC_DEFINES],[
32     if test "x$enable_linux_d_splice_alias_extra_iput" = xyes; then
33         AC_DEFINE(D_SPLICE_ALIAS_LEAK_ON_ERROR, 1, [for internal use])
34     fi
35     dnl Linux-only, but just enable always.
36     AC_DEFINE(AFS_CACHE_BYPASS, 1, [define to activate cache bypassing Unix client])
37 ])
38
39 AC_DEFUN([OPENAFS_LINUX_CHECKS],[
40 case $AFS_SYSNAME in *_linux* | *_umlinux*)
41     _OPENAFS_LINUX_CONFTEST_SETUP
42     if test "x$enable_kernel_module" = "xyes"; then
43         _OPENAFS_LINUX_KBUILD_SETUP
44         OPENAFS_LINUX_KERNEL_SIG_CHECKS
45         OPENAFS_LINUX_KERNEL_HEADER_CHECKS
46         OPENAFS_LINUX_KERNEL_TYPE_CHECKS
47         OPENAFS_LINUX_KERNEL_STRUCT_CHECKS
48         OPENAFS_LINUX_KERNEL_FUNC_CHECKS
49         OPENAFS_LINUX_KERNEL_ASSORTED_CHECKS
50         OPENAFS_LINUX_KERNEL_SYSCALL_PROBE_SETUP
51         OPENAFS_LINUX_KERNEL_PACKAGING_CHECKS
52         OPENAFS_LINUX_KERNEL_SYSCALL_PROBE_CHECKS
53         OPENAFS_LINUX_KERNEL_MORE_ASSORTED_CHECKS
54
55         OPENAFS_GCC_SUPPORTS_WNO_ERROR_FRAME_LARGER_THAN
56     fi
57     OPENAFS_LINUX_MISC_DEFINES
58 esac
59 ])