1 dnl ######################################################################
2 dnl ensure that linux kernel headers match running kernel
3 AC_DEFUN([AMU_LINUX_HEADERS],
5 # test sanity of running kernel vs. kernel headers
6 AC_MSG_CHECKING("host headers version")
9 host_header_version="bad"
10 AMU_EXPAND_RUN_STRING(
13 #include <linux/version.h>
18 printf("%s", UTS_RELEASE);
20 # define AMU_MA(a) ((a) >> 16)
21 # define AMU_MI(a) (((a) & 0xffff) >> 8)
22 # define AMU_PL(a) ((a) & 0xff)
23 printf("%d.%d.%d", AMU_MA(LINUX_VERSION_CODE), AMU_MI(LINUX_VERSION_CODE), AMU_PL(LINUX_VERSION_CODE));
26 [ host_header_version=$value ],
28 AC_MSG_ERROR([cannot find UTS_RELEASE in <linux/version.h>.
29 This Linux system may be misconfigured or unconfigured!])
32 * ) host_header_version=$host_os_version ;;
34 AC_DEFINE_UNQUOTED(HOST_HEADER_VERSION, "$host_header_version")
35 AC_MSG_RESULT($host_header_version)
39 if test "$host_os_version" != $host_header_version
41 AC_MSG_WARN([Linux kernel $host_os_version mismatch with $host_header_version headers!])
45 dnl cache these two for debugging purposes
46 ac_cv_os_version=$host_os_version
47 ac_cv_header_version=$host_header_version
49 dnl ======================================================================