check for kernel support

Ian Wienand <[email protected]>
Newsgroups gmane.comp.lib.phil
Message-ID <[email protected]>
Hello,

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
incorrect.

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

-i
[email protected]
http://www.gelato.unsw.edu.au
configure.in.diff (text/plain, 2 KB)
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"
+fi
+
+if test -n "$sysheaders"; then
+  OLD_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
+fi
+
+#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
+[!defined CLONE_THREAD || !defined CLONE_PARENT_SETTID
+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)
+AC_MSG_RESULT($nptl_kernel_uptodate)
+
+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.])
+fi
+
+#reset cpp flags
+if test -n "$sysheaders"; then
+  CPPFLAGS=$OLD_CPPFLAGS
+fi
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.