]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kbuild: introduce utsrelease.h
authorSam Ravnborg <sam@mars.ravnborg.org>
Mon, 3 Jul 2006 21:30:54 +0000 (23:30 +0200)
committerSam Ravnborg <sam@mars.ravnborg.org>
Mon, 3 Jul 2006 21:30:54 +0000 (23:30 +0200)
include/linux/version.h contained both actual KERNEL version
and UTS_RELEASE that contains a subset from git SHA1 for when
kernel was compiled as part of a git repository.
This had the unfortunate side-effect that all files including version.h
would be recompiled when some git changes was made due to changes SHA1.
Split it out so we keep independent parts in separate files.

Also update checkversion.pl script to no longer check for UTS_RELEASE.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
14 files changed:
Makefile
arch/alpha/boot/bootp.c
arch/alpha/boot/bootpz.c
arch/alpha/boot/main.c
arch/frv/kernel/setup.c
arch/i386/boot/setup.S
arch/powerpc/platforms/chrp/setup.c
arch/powerpc/platforms/powermac/bootx_init.c
arch/ppc/syslib/btext.c
arch/x86_64/boot/setup.S
drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c
include/linux/vermagic.h
init/version.c
scripts/checkversion.pl

index 1cc793ff42d434b326a7a0b6ef691112307cc1d5..b36aeb617bd26d928a3cc95dd13681df12a61ff3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -812,8 +812,8 @@ endif
 # prepare2 creates a makefile if using a separate output directory
 prepare2: prepare3 outputmakefile
 
-prepare1: prepare2 include/linux/version.h include/asm \
-                   include/config/auto.conf
+prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
+                   include/asm include/config/auto.conf
 ifneq ($(KBUILD_MODULES),)
        $(Q)mkdir -p $(MODVERDIR)
        $(Q)rm -f $(MODVERDIR)/*
@@ -848,21 +848,26 @@ include/asm:
 # needs to be updated, so this check is forced on all builds
 
 uts_len := 64
+define filechk_utsrelease.h
+       if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
+         echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2;    \
+         exit 1;                                                         \
+       fi;                                                               \
+       (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
+endef
 
 define filechk_version.h
-       if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
-         echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
-         exit 1; \
-       fi; \
-       (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
-         echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
-        echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
-       )
+       (echo \#define LINUX_VERSION_CODE $(shell                             \
+       expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL));     \
+       echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
 endef
 
-include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE
+include/linux/version.h: $(srctree)/Makefile FORCE
        $(call filechk,version.h)
 
+include/linux/utsrelease.h: include/config/kernel.release FORCE
+       $(call filechk,utsrelease.h)
+
 # ---------------------------------------------------------------------------
 
 PHONY += depend dep
@@ -955,7 +960,8 @@ CLEAN_FILES +=      vmlinux System.map \
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include2
 MRPROPER_FILES += .config .config.old include/asm .version .old_version \
-                  include/linux/autoconf.h include/linux/version.h \
+                  include/linux/autoconf.h include/linux/version.h      \
+                  include/linux/utsrelease.h                            \
                  Module.symvers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
index ec53c28e33defeba74ff5140cc663856e5820628..3af21c78933943df7e3750b3d61d3fd391581b87 100644 (file)
@@ -9,7 +9,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
index a6657f2cf9bd81bec24548d31d24699bf71967ae..4307bde80a3527dc454f9c8fe58e9b4994f72ccb 100644 (file)
@@ -11,7 +11,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
index 78c9b0b6eea7cdb7e1758ccbcd4e97cfef76fae4..90ed55b662a85e32d91f1d8fb8dc5c0f9896232f 100644 (file)
@@ -7,7 +7,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
index 5db3d4eff9090585c8306b4520e31ff1fa075b6b..af08ccd4ed6e44bdaf085faf1007404c447557eb 100644 (file)
@@ -10,7 +10,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index 0a5a3be6d69cbb08ae4b752c938ca97e83e14321..d2b684cd620ae63888bbb54c06721d0b4fe8e5e5 100644 (file)
@@ -47,7 +47,7 @@
  */
 
 #include <asm/segment.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/compile.h>
 #include <asm/boot.h>
 #include <asm/e820.h>
index 1f1771b212b441b86b038d730ec57b3b72e799c4..9df9f2079e9b3846b180bc406083e487d6b895f5 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/pci.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/adb.h>
 #include <linux/module.h>
 #include <linux/delay.h>
index cb257aeb91f6249d4fb2132fbf022e9924e2c8a2..24f09e2a577540dbf5c2fda20d505747d02cb1ce 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/page.h>
index 51ab6e90fe258a6f5a0f20726da602d529c054a4..d11667046f21c732ee49b86ccad3d608f24af8d4 100644 (file)
@@ -6,7 +6,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 
 #include <asm/sections.h>
 #include <asm/bootx.h>
index 7de8b8fd168518ef303551f828f1dd406c7dc4ef..a50b631f4d2b017fbb5433726aaf727f4a10883b 100644 (file)
@@ -46,7 +46,7 @@
  */
 
 #include <asm/segment.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/compile.h>
 #include <asm/boot.h>
 #include <asm/e820.h>
index b3ffcf50131163453c73a348199dd460bbc64676..e386dcc32e8c395276bcfa5bc33f16f01d0d0884 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/netdevice.h>
 #include <linux/pci.h>
 #include <linux/string.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 
 
 static void bcm43xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
index dc7c621e464714b6e6646b9abcf48b6519c1856a..46919f9f5eb35b9d023e9c5a7818bc528b5fa2e5 100644 (file)
@@ -1,4 +1,4 @@
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/module.h>
 
 /* Simply sanity version stamp for modules. */
index 3ddc3ceec2fe702e75f0623747cba6104089f877..e290802c6bd2c4920245d82cbe7b549a78cd1593 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/uts.h>
 #include <linux/utsname.h>
+#include <linux/utsrelease.h>
 #include <linux/version.h>
 
 #define version(a) Version_ ## a
index 9f84e562318d68983c4cf4f6a9fb69670b7f3b3f..ec7d21161bdcb873ee38926c4097a23b44702880 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/perl
 #
-# checkversion find uses of LINUX_VERSION_CODE, KERNEL_VERSION, or
-# UTS_RELEASE without including <linux/version.h>, or cases of
+# checkversion find uses of LINUX_VERSION_CODE or KERNEL_VERSION
+# without including <linux/version.h>, or cases of
 # including <linux/version.h> that don't need it.
 # Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net>
 
@@ -41,8 +41,7 @@ foreach $file (@ARGV)
        }
 
        # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE
-       if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) ||
-               ($_ =~ /UTS_RELEASE/)) {
+       if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) {
            $fUseVersion = 1;
            last LINE if $iLinuxVersion;
        }