Improve consistency of --enable-kernel and default builds

Joseph S. Myers joseph@codesourcery.com
Mon May 14 15:40:00 GMT 2012


If the user passes --enable-kernel, that version (or the
architecture-specific minimum, if the --enable-kernel version was too
old) is always used to set __LINUX_KERNEL_VERSION and
__ABI_TAG_VERSION.  If the user does not, those are set only if the
architecture's minimum is greater than the global minimum (currently
2.2.0).  This works as long as patches removing old kernel support do
what my pre-2.2-removal patch did and remove every conditional on the
old kernel version; it doesn't allow multi-stage removal of support
for old kernel versions (first increase the default, then gradually
remove the conditionals).

I propose this patch to make things simpler and more consistent by
always setting minimum_kernel (and so those two macros, and so causing
the ABI tags always to give the configured minimum kernel whether or
not it's the global minimum).  Tested x86.

2012-05-14  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/configure.in (minimum_kernel): Always
	set if not set by the user.  Do not allow for being unset.
	* sysdeps/unix/sysv/linux/configure: Regenerated.

diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 1ce14f2..72fbe84 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -87,29 +87,25 @@ if test -n "$minimum_kernel"; then
     minimum_kernel=$arch_minimum_kernel
   fi
 else
-  if test $arch_minimum_kernel != '2.2.0'; then
-    minimum_kernel=$arch_minimum_kernel
-  fi
+  minimum_kernel=$arch_minimum_kernel
 fi
 
-if test -n "$minimum_kernel"; then
-  AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
+AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
 changequote(,)dnl
-  decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
-  abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
 changequote([,])dnl
-  AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
+AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
 #if LINUX_VERSION_CODE < $decnum
 eat flaming death
 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
-  AC_MSG_RESULT($libc_minimum_kernel)
-  if test "$libc_minimum_kernel" = ok; then
-    AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
-    AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
-  else
-    AC_MSG_ERROR([*** The available kernel headers are older than the requested
+AC_MSG_RESULT($libc_minimum_kernel)
+if test "$libc_minimum_kernel" = ok; then
+  AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
+  AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
+else
+  AC_MSG_ERROR([*** The available kernel headers are older than the requested
 *** compatible kernel version])
-  fi
 fi
 
 # The result of the above test for the use of the FDE code is invalid if

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list