summaryrefslogtreecommitdiffstats
path: root/contrib/amd/m4/macros/linux_headers.m4
diff options
context:
space:
mode:
authormbr <mbr@FreeBSD.org>2003-09-02 15:27:38 +0000
committermbr <mbr@FreeBSD.org>2003-09-02 15:27:38 +0000
commit7d0df748b4c59651751f156e408f856a02073b69 (patch)
tree4674a9f108ae4334ed6a61634f703f67f6533f4d /contrib/amd/m4/macros/linux_headers.m4
parent532be24b7ef077cdfe0129dee60ab1f934c24181 (diff)
downloadFreeBSD-src-7d0df748b4c59651751f156e408f856a02073b69.zip
FreeBSD-src-7d0df748b4c59651751f156e408f856a02073b69.tar.gz
Virgin import of AMD (am-utils) 20030828 (6.0.9)
Diffstat (limited to 'contrib/amd/m4/macros/linux_headers.m4')
-rw-r--r--contrib/amd/m4/macros/linux_headers.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/contrib/amd/m4/macros/linux_headers.m4 b/contrib/amd/m4/macros/linux_headers.m4
new file mode 100644
index 0000000..8b8c514
--- /dev/null
+++ b/contrib/amd/m4/macros/linux_headers.m4
@@ -0,0 +1,42 @@
+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)
+ printf("%s", UTS_RELEASE);
+],
+[ 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 ======================================================================
OpenPOWER on IntegriCloud