diff options
author | Cy Schubert <cy@FreeBSD.org> | 2016-08-31 00:08:49 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2016-08-31 00:08:49 +0000 |
commit | ca57057f598bfc7119f79f71bf38ec88244ab396 (patch) | |
tree | 051f78ef258707b493cc7cb21569b6949915f6c7 /m4/macros/linux_headers.m4 | |
parent | e66b16bf080ead1c51f321eaf56710c771778706 (diff) | |
download | src-ca57057f598bfc7119f79f71bf38ec88244ab396.tar.gz src-ca57057f598bfc7119f79f71bf38ec88244ab396.zip |
Import am-utils 6.2,vendor/amd/6.2vendor/amd
Suggested by: pfg@
Obtained from: ftp://ftp.am-utils.org/pub/am-utils/
Notes
Notes:
svn path=/vendor/amd/dist/; revision=305100
svn path=/vendor/amd/6.2/; revision=305101; tag=vendor/amd/6.2
Diffstat (limited to 'm4/macros/linux_headers.m4')
-rw-r--r-- | m4/macros/linux_headers.m4 | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/m4/macros/linux_headers.m4 b/m4/macros/linux_headers.m4 new file mode 100644 index 000000000000..63c5d6a05acd --- /dev/null +++ b/m4/macros/linux_headers.m4 @@ -0,0 +1,49 @@ +dnl ###################################################################### +dnl ensure that linux kernel headers match running kernel +AC_DEFUN([AMU_LINUX_HEADERS], +[ +# test sanity of running kernel vs. kernel headers + AC_MSG_CHECKING("host headers version") + case ${host_os} in + linux ) + host_header_version="bad" + AMU_EXPAND_RUN_STRING( +[ +#include <stdio.h> +#include <linux/version.h> +], +[ +if (argc > 1) +#ifdef UTS_RELEASE + printf("%s", UTS_RELEASE); +#else +# define AMU_MA(a) ((a) >> 16) +# define AMU_MI(a) (((a) & 0xffff) >> 8) +# define AMU_PL(a) ((a) & 0xff) + printf("%d.%d.%d", AMU_MA(LINUX_VERSION_CODE), AMU_MI(LINUX_VERSION_CODE), AMU_PL(LINUX_VERSION_CODE)); +#endif +], +[ host_header_version=$value ], +[ echo + AC_MSG_ERROR([cannot find UTS_RELEASE in <linux/version.h>. + This Linux system may be misconfigured or unconfigured!]) +]) + ;; + * ) host_header_version=$host_os_version ;; + esac + AC_DEFINE_UNQUOTED(HOST_HEADER_VERSION, "$host_header_version") + AC_MSG_RESULT($host_header_version) + + case ${host_os} in + linux ) + if test "$host_os_version" != $host_header_version + then + AC_MSG_WARN([Linux kernel $host_os_version mismatch with $host_header_version headers!]) + fi + ;; +esac +dnl cache these two for debugging purposes +ac_cv_os_version=$host_os_version +ac_cv_header_version=$host_header_version +]) +dnl ====================================================================== |