2003-09-14 13:38:35 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Setup the kernel headers. I include a generic package of
|
|
|
|
# kernel headers here, so you shouldn't need to include your
|
|
|
|
# own. Be aware these kernel headers _will_ get blown away
|
|
|
|
# by a 'make clean' so don't put anything sacred in here...
|
|
|
|
#
|
|
|
|
#############################################################
|
2005-02-11 21:52:06 +01:00
|
|
|
DEFAULT_KERNEL_HEADERS:=$(strip $(subst ",, $(BR2_DEFAULT_KERNEL_HEADERS)))
|
|
|
|
#"
|
|
|
|
|
2003-09-14 13:38:35 +02:00
|
|
|
ifneq ($(filter $(TARGETS),kernel-headers),)
|
2004-09-03 02:49:43 +02:00
|
|
|
DEFAULT_KERNEL_HEADERS:=$(strip $(DEFAULT_KERNEL_HEADERS))
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2004-10-05 09:16:53 +02:00
|
|
|
LINUX_HEADERS_SITE:=127.0.0.1
|
|
|
|
LINUX_HEADERS_SOURCE:=unspecified-kernel-headers
|
2004-09-03 02:49:43 +02:00
|
|
|
|
|
|
|
ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.25")
|
|
|
|
VERSION:=2
|
|
|
|
PATCHLEVEL:=4
|
|
|
|
SUBLEVEL:=25
|
2004-10-05 09:16:53 +02:00
|
|
|
LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
|
|
|
|
LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.25.tar.bz2
|
|
|
|
LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.25
|
2004-09-22 19:07:07 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.27")
|
|
|
|
VERSION:=2
|
|
|
|
PATCHLEVEL:=4
|
2005-02-11 21:52:06 +01:00
|
|
|
SUBLEVEL:=27
|
2004-10-05 09:16:53 +02:00
|
|
|
LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
|
|
|
|
LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.27.tar.bz2
|
|
|
|
LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.27
|
2004-09-03 02:49:43 +02:00
|
|
|
endif
|
2004-05-07 08:11:55 +02:00
|
|
|
|
2005-02-11 21:52:06 +01:00
|
|
|
ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.29")
|
|
|
|
VERSION:=2
|
|
|
|
PATCHLEVEL:=4
|
|
|
|
SUBLEVEL:=29
|
|
|
|
LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
|
|
|
|
LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.29.tar.bz2
|
|
|
|
LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.29
|
|
|
|
endif
|
|
|
|
|
2005-03-18 11:23:50 +01:00
|
|
|
ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.9")
|
2004-09-03 02:49:43 +02:00
|
|
|
VERSION:=2
|
|
|
|
PATCHLEVEL:=6
|
2005-03-18 11:23:50 +01:00
|
|
|
SUBLEVEL:=9
|
2004-10-05 09:16:53 +02:00
|
|
|
LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
|
2005-03-18 11:23:50 +01:00
|
|
|
LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.9.1.tar.bz2
|
|
|
|
LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.9.1
|
2004-09-03 02:49:43 +02:00
|
|
|
endif
|
2004-05-07 08:11:55 +02:00
|
|
|
|
2005-03-18 11:23:50 +01:00
|
|
|
ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.10")
|
2004-09-03 02:49:43 +02:00
|
|
|
VERSION:=2
|
|
|
|
PATCHLEVEL:=6
|
2005-03-18 11:23:50 +01:00
|
|
|
SUBLEVEL:=10
|
2004-10-05 09:16:53 +02:00
|
|
|
LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
|
2005-03-18 11:23:50 +01:00
|
|
|
LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.10.0.tar.bz2
|
|
|
|
LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.10.0
|
2004-10-25 23:23:18 +02:00
|
|
|
endif
|
|
|
|
|
2005-03-18 11:23:50 +01:00
|
|
|
ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.11")
|
2004-10-25 23:23:18 +02:00
|
|
|
VERSION:=2
|
|
|
|
PATCHLEVEL:=6
|
2005-03-18 11:23:50 +01:00
|
|
|
SUBLEVEL:=11
|
2004-10-25 23:23:18 +02:00
|
|
|
LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
|
2005-03-18 11:23:50 +01:00
|
|
|
LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.11.0.tar.bz2
|
|
|
|
LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.11.0
|
2004-09-03 02:49:43 +02:00
|
|
|
endif
|
2004-05-07 08:11:55 +02:00
|
|
|
|
2004-09-03 02:49:43 +02:00
|
|
|
LINUX_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)
|
2004-05-07 08:11:55 +02:00
|
|
|
|
2004-10-05 09:10:07 +02:00
|
|
|
LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2004-10-05 09:16:53 +02:00
|
|
|
$(DL_DIR)/$(LINUX_HEADERS_SOURCE):
|
2004-09-03 02:49:43 +02:00
|
|
|
mkdir -p $(DL_DIR)
|
2004-10-05 09:16:53 +02:00
|
|
|
$(WGET) -P $(DL_DIR) $(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE)
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2004-10-05 09:16:53 +02:00
|
|
|
$(LINUX_HEADERS_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
|
2005-06-24 01:25:25 +02:00
|
|
|
rm -rf $(LINUX_HEADERS_DIR)
|
2003-11-19 20:29:00 +01:00
|
|
|
mkdir -p $(TOOL_BUILD_DIR)
|
2004-10-11 16:01:07 +02:00
|
|
|
bzcat $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
2004-10-05 09:16:53 +02:00
|
|
|
ifneq ($(LINUX_HEADERS_UNPACK_DIR),$(LINUX_HEADERS_DIR))
|
|
|
|
mv $(LINUX_HEADERS_UNPACK_DIR) $(LINUX_HEADERS_DIR)
|
2004-05-07 08:11:55 +02:00
|
|
|
endif
|
2004-10-05 09:10:07 +02:00
|
|
|
touch $(LINUX_HEADERS_DIR)/.unpacked
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2004-10-05 09:10:07 +02:00
|
|
|
$(LINUX_HEADERS_DIR)/.patched: $(LINUX_HEADERS_DIR)/.unpacked
|
2005-06-24 10:36:13 +02:00
|
|
|
toolchain/patch-kernel.sh $(LINUX_HEADERS_DIR) toolchain/kernel-headers linux-libc-headers-$(LINUX_VERSION)\*.patch
|
2004-10-05 09:10:07 +02:00
|
|
|
touch $(LINUX_HEADERS_DIR)/.patched
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2004-10-05 09:10:07 +02:00
|
|
|
$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_DIR)/.patched
|
|
|
|
rm -f $(LINUX_HEADERS_DIR)/include/asm
|
|
|
|
@if [ ! -f $(LINUX_HEADERS_DIR)/Makefile ] ; then \
|
2004-05-07 08:11:55 +02:00
|
|
|
echo -e "VERSION = $(VERSION)\nPATCHLEVEL = $(PATCHLEVEL)\n" > \
|
2004-10-05 09:10:07 +02:00
|
|
|
$(LINUX_HEADERS_DIR)/Makefile; \
|
2004-06-24 23:44:15 +02:00
|
|
|
echo -e "SUBLEVEL = $(SUBLEVEL)\nEXTRAVERSION =\n" >> \
|
2004-10-05 09:10:07 +02:00
|
|
|
$(LINUX_HEADERS_DIR)/Makefile; \
|
2004-04-21 22:03:39 +02:00
|
|
|
echo -e "KERNELRELEASE=\$$(VERSION).\$$(PATCHLEVEL).\$$(SUBLEVEL)\$$(EXTRAVERSION)" >> \
|
2004-10-05 09:10:07 +02:00
|
|
|
$(LINUX_HEADERS_DIR)/Makefile; \
|
2004-04-21 22:03:39 +02:00
|
|
|
fi;
|
2003-09-14 13:38:35 +02:00
|
|
|
@if [ "$(ARCH)" = "powerpc" ];then \
|
2004-10-05 09:10:07 +02:00
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-ppc$(NOMMU) asm;) \
|
2003-09-14 13:38:35 +02:00
|
|
|
elif [ "$(ARCH)" = "mips" ];then \
|
2004-10-05 09:10:07 +02:00
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
|
2003-11-25 00:23:16 +01:00
|
|
|
elif [ "$(ARCH)" = "mipsel" ];then \
|
2004-10-05 09:10:07 +02:00
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
|
2003-09-14 13:38:35 +02:00
|
|
|
elif [ "$(ARCH)" = "arm" ];then \
|
2004-10-05 09:10:07 +02:00
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-arm$(NOMMU) asm; \
|
2003-09-14 13:38:35 +02:00
|
|
|
cd asm; \
|
|
|
|
if [ ! -L proc ] ; then \
|
|
|
|
ln -fs proc-armv proc; \
|
|
|
|
ln -fs arch-ebsa285 arch; fi); \
|
2004-09-03 03:24:18 +02:00
|
|
|
elif [ "$(ARCH)" = "armeb" ];then \
|
2004-10-05 09:10:07 +02:00
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-arm$(NOMMU) asm; \
|
2004-09-03 03:24:18 +02:00
|
|
|
cd asm; \
|
|
|
|
if [ ! -L proc ] ; then \
|
|
|
|
ln -fs proc-armv proc; \
|
|
|
|
ln -fs arch-ebsa285 arch; fi); \
|
2003-09-14 13:38:35 +02:00
|
|
|
elif [ "$(ARCH)" = "cris" ];then \
|
2004-10-05 09:10:07 +02:00
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-cris asm;) \
|
2004-12-11 10:56:58 +01:00
|
|
|
elif [ "$(ARCH)" = "sh3" ];then \
|
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
|
|
|
|
cd asm; \
|
|
|
|
ln -s cpu-sh3 cpu) \
|
|
|
|
elif [ "$(ARCH)" = "sh3eb" ];then \
|
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
|
|
|
|
cd asm; \
|
|
|
|
ln -s cpu-sh3 cpu) \
|
2004-10-08 17:28:30 +02:00
|
|
|
elif [ "$(ARCH)" = "sh4" ];then \
|
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
|
|
|
|
cd asm; \
|
|
|
|
ln -s cpu-sh4 cpu) \
|
2004-12-11 10:56:58 +01:00
|
|
|
elif [ "$(ARCH)" = "sh4eb" ];then \
|
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
|
|
|
|
cd asm; \
|
|
|
|
ln -s cpu-sh4 cpu) \
|
2003-09-14 13:38:35 +02:00
|
|
|
else \
|
2004-10-05 09:10:07 +02:00
|
|
|
(cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-$(ARCH)$(NOMMU) asm;) \
|
2003-09-14 13:38:35 +02:00
|
|
|
fi
|
2004-10-05 09:10:07 +02:00
|
|
|
touch $(LINUX_HEADERS_DIR)/include/linux/autoconf.h;
|
|
|
|
touch $(LINUX_HEADERS_DIR)/.configured
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2004-10-05 09:10:07 +02:00
|
|
|
$(LINUX_KERNEL): $(LINUX_HEADERS_DIR)/.configured
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2004-10-05 09:10:07 +02:00
|
|
|
kernel-headers: $(LINUX_HEADERS_DIR)/.configured
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2004-10-05 09:16:53 +02:00
|
|
|
kernel-headers-source: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
|
2003-11-12 10:31:12 +01:00
|
|
|
|
|
|
|
kernel-headers-clean: clean
|
2003-09-14 13:38:35 +02:00
|
|
|
rm -f $(LINUX_KERNEL)
|
2004-10-05 09:10:07 +02:00
|
|
|
rm -rf $(LINUX_HEADERS_DIR)
|
2003-09-14 13:38:35 +02:00
|
|
|
|
2003-11-12 10:31:12 +01:00
|
|
|
kernel-headers-dirclean:
|
2004-10-05 09:10:07 +02:00
|
|
|
rm -rf $(LINUX_HEADERS_DIR)
|
2003-09-14 13:38:35 +02:00
|
|
|
|
|
|
|
endif
|