linux/debian/patches/debian/kernelvariables.patch

61 lines
1.4 KiB
Diff
Raw Normal View History

Postpone architecture dependant definitions.
Makes it possible to overwrite arch, compiler and things like cflags in one
place.
--- a/Makefile
+++ b/Makefile
@@ -193,25 +193,6 @@
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
-# Architecture as present in compile.h
-UTS_MACHINE := $(ARCH)
-SRCARCH := $(ARCH)
-
-# Additional ARCH settings for x86
-ifeq ($(ARCH),i386)
- SRCARCH := x86
-endif
-ifeq ($(ARCH),x86_64)
- SRCARCH := x86
-endif
-
-# Where to locate arch specific headers
-ifeq ($(ARCH),sparc64)
- hdr-arch := sparc
-else
- hdr-arch := $(SRCARCH)
-endif
-
KCONFIG_CONFIG ?= .config
# SHELL used by kbuild
@@ -340,6 +326,27 @@
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+-include .kernelvariables
+
+# Architecture as present in compile.h
+UTS_MACHINE := $(ARCH)
+SRCARCH := $(ARCH)
+
+# Additional ARCH settings for x86
+ifeq ($(ARCH),i386)
+ SRCARCH := x86
+endif
+ifeq ($(ARCH),x86_64)
+ SRCARCH := x86
+endif
+
+# Where to locate arch specific headers
+ifeq ($(ARCH),sparc64)
+ hdr-arch := sparc
+else
+ hdr-arch := $(SRCARCH)
+endif
+
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE