[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

check for kernel support


It was pointed out to me that changes required for NPTL have been
backported, so a general check for kernel version > x.y.z is

Attached for consideration is a patch to check for a few pieces of
kernel support required to run NPTL.

ianw gelato unsw edu au

diff -Nu ../nptl/sysdeps/unix/sysv/linux/configure.in nptl/sysdeps/unix/sysv/linux/configure.in
--- ../nptl/sysdeps/unix/sysv/linux/configure.in	1970-01-01 10:00:00.000000000 +1000
+++ nptl/sysdeps/unix/sysv/linux/configure.in	2003-03-14 15:50:16.000000000 +1100
@@ -0,0 +1,48 @@
+# Local configure fragment for nptl/sysdeps/unix/sysv/linux.
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# The Linux kernel headers can be found in
+#   /lib/modules/$(uname -r)/build/include
+# Check whether this directory is available.
+# If the user uses --with-headers, the sysheaders
+# variable is set to this.
+if test -z "$sysheaders" &&
+   test "x$cross_compiling" = xno &&
+   test -d /lib/modules/`uname -r`/build/include; then
+  sysheaders="/lib/modules/`uname -r`/build/include"
+  ccheaders=`$CC -print-file-name=include`
+  dnl We don't have to use -nostdinc.  We just want one more directory
+  dnl to be used.
+  SYSINCLUDES="-I $sysheaders"
+if test -n "$sysheaders"; then
+#check for a few choice requirements of NPTL
+AC_EGREP_CPP([eat flaming death], [#include <linux/unistd.h>
+#include <linux/sched.h>
+#if !defined __NR_exit_group || !defined __NR_tid_set_address || ]dnl
+eat flaming death
+#endif], nptl_kernel_uptodate='TOO OLD!', nptl_kernel_uptodate=ok)
+#I put this here because the AC_EGREP_CPP checks for egrep and 
+#thus if inbetween the below lines, AC_EGREP_CPP screws up the output.
+AC_MSG_CHECKING(for kernel support for NPTL)
+if test "$nptl_kernel_uptodate" = 'TOO OLD!'; then
+   AC_MSG_ERROR([dnl
+*** Current kernel headers insufficient for NPTL.
+*** NPTL requires extensive kernel support found only in later
+*** 2.5 series kernels or earier versions with specific back ports.])
+#reset cpp flags
+if test -n "$sysheaders"; then

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]