]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix retrieving of kernel header version.
authorUlrich Drepper <drepper@redhat.com>
Sun, 4 Apr 2010 08:02:09 +0000 (01:02 -0700)
committerPetr Baudis <pasky@ucw.cz>
Wed, 12 May 2010 01:21:09 +0000 (03:21 +0200)
(cherry picked from commit 9e37946dba22b53c5108eef777e867f93c894502)

ChangeLog
csu/Makefile

index 75bd6b87b7c325d69f031582f3a8524a3f82f8bd..4ccc115930ecf0e5fd564450ac3b4eb75d01c2a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-04  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #11287]
+       * csu/Makefile ($(objpfx)version-info.h): Handle newer kernel headers
+       which don't define UTS_RELEASE.
+
 2010-04-04  H.J. Lu  <hongjiu.lu@intel.com>
            Ulrich Drepper  <drepper@redhat.com>
 
index 0e2ae07cf76e151603dfeb0a1c065abb35ae9154..69e07c71cf2324054490b71517ae39701cc4f31e 100644 (file)
@@ -1,5 +1,5 @@
 # Makefile for csu code for GNU C library.
-# Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1995-2004, 2005, 2006, 2010 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -209,8 +209,19 @@ $(objpfx)version-info.h: $(common-objpfx)config.make $(all-Banner-files)
           linux*) version=`(printf '%s\n%s\n' \
                                    '#include <linux/version.h>' \
                                    UTS_RELEASE \
-                            | $(CC) $(CPPFLAGS) -E -P - -DNOT_IN_libc=1 | \
+                            | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 | \
                             sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\
+                  if [ -z "$$version" ]; then \
+                    version=`(printf '%s\n%s\n' \
+                                     '#include <linux/version.h>' \
+                                      LINUX_VERSION_CODE \
+                              | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 \
+                              | sed -n -e '/^[123456789].*/p' \
+                              | awk '{v=$$1; \
+                                      printf("%d.%d.%d\n", \
+                                             v/65535, v/256%256, v%256)}') \
+                               2>/dev/null`; \
+                  fi; \
                   if [ -z "$$version" ]; then \
                     if [ -r /proc/version ]; then \
                       version=`sed 's/.*Linux version \([^ ]*\) .*/>>\1<</' \