Index: toolchain/make/target/uclibc/uclibc.mk
===================================================================
--- toolchain/make/target/uclibc/uclibc.mk (revision 6140)
+++ toolchain/make/target/uclibc/uclibc.mk (working copy)
@@ -10,8 +10,7 @@
UCLIBC_SOURCE_SITE:=http://www.uclibc.org/downloads/old-releases
endif
-UCLIBC_KERNEL_SOURCE_DIR:=$(KERNEL_SOURCE_DIR)
-UCLIBC_KERNEL_HEADERS_DIR:=$(KERNEL_HEADERS_DIR)
+UCLIBC_KERNEL_HEADERS_DIR:=$(KERNEL_HEADERS_DEVEL_DIR)
UCLIBC_DEVEL_SUBDIR:=uClibc_dev
@@ -50,9 +49,9 @@
$(UCLIBC_DIR)/.config: $(UCLIBC_DIR)/.unpacked
cp $(TOOLCHAIN_DIR)/make/target/uclibc/Config.$(TARGET_TOOLCHAIN_UCLIBC_REF).$(UCLIBC_VERSION) $(UCLIBC_DIR)/.config
ifeq ($(strip $(UCLIBC_VERSION)),0.9.28)
- $(SED) -i -e 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(shell pwd)/$(UCLIBC_KERNEL_SOURCE_DIR)\",g' $(UCLIBC_DIR)/.config
+ $(SED) -i -e 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(UCLIBC_KERNEL_HEADERS_DIR)\",g' $(UCLIBC_DIR)/.config
else
- $(SED) -i -e 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(shell pwd)/$(UCLIBC_KERNEL_HEADERS_DIR)\",g' $(UCLIBC_DIR)/.config
+ $(SED) -i -e 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(UCLIBC_KERNEL_HEADERS_DIR)/include\",g' $(UCLIBC_DIR)/.config
endif
$(SED) -i -e 's,^CROSS=.*,CROSS=$(TARGET_MAKE_PATH)/$(TARGET_CROSS),g' $(UCLIBC_DIR)/Rules.mak
ifeq ($(strip $(FREETZ_TARGET_IPV6_SUPPORT)),y)
@@ -65,6 +64,7 @@
else
$(SED) -i -e 's,.*UCLIBC_HAS_LFS.*,# UCLIBC_HAS_LFS is not set,g' $(UCLIBC_DIR)/.config
endif
+ifneq ($(strip $(UCLIBC_VERSION)),0.9.28)
ifeq ($(strip $(FREETZ_TARGET_ARCH_LE)),y)
$(SED) -i -e 's,.*ARCH_BIG_ENDIAN.*,ARCH_LITTLE_ENDIAN=y,g' $(UCLIBC_DIR)/.config
$(SED) -i -e 's,.*ARCH_WANTS_BIG_ENDIAN.*,# ARCH_WANTS_BIG_ENDIAN is not set,g' $(UCLIBC_DIR)/.config
@@ -74,6 +74,7 @@
$(SED) -i -e 's,.*ARCH_WANTS_BIG_ENDIAN.*,ARCH_WANTS_BIG_ENDIAN=y,g' $(UCLIBC_DIR)/.config
$(SED) -i -e 's,.*ARCH_WANTS_LITTLE_ENDIAN.*,# ARCH_WANTS_LITTLE_ENDIAN is not set,g' $(UCLIBC_DIR)/.config
endif
+endif
$(SED) -i -e '/.*UCLIBC_HAS_FOPEN_LARGEFILE_MODE.*/d' $(UCLIBC_DIR)/.config
echo "# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set" >> $(UCLIBC_DIR)/.config
$(SED) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR)/.config
@@ -94,7 +95,8 @@
define UCLIBC_INSTALL_KERNEL_HEADERS
# install kernel headers to $(2)/usr/include if necessary
if [ ! -f $(2)/usr/include/linux/version.h ] ; then \
- cp -pLR $(1)/{asm,asm-generic,linux} $(2)/usr/include/; \
+ mkdir -p $(2)/usr/include/; \
+ cp -pLR $(1)/include/* $(2)/usr/include/; \
fi;
endef
@@ -106,7 +108,7 @@
RUNTIME_PREFIX=$(TARGET_TOOLCHAIN_DIR)/$(UCLIBC_DEVEL_SUBDIR)/ \
HOSTCC="$(HOSTCC)" headers \
$(if $(FREETZ_TARGET_UCLIBC_VERSION_0_9_28),install_dev,install_headers)
- $(call UCLIBC_INSTALL_KERNEL_HEADERS,$(UCLIBC_KERNEL_HEADERS_DIR),$(TARGET_TOOLCHAIN_DIR)/$(UCLIBC_DEVEL_SUBDIR))
+ $(call UCLIBC_INSTALL_KERNEL_HEADERS,$(UCLIBC_KERNEL_HEADERS_DIR),$(TARGET_TOOLCHAIN_STAGING_DIR))
touch $@
uclibc-menuconfig: $(UCLIBC_DIR)/.config
@@ -148,7 +150,7 @@
DEVEL_PREFIX=$(TARGET_TOOLCHAIN_STAGING_DIR)/usr/ \
RUNTIME_PREFIX=$(TARGET_TOOLCHAIN_STAGING_DIR)/usr/ \
install_runtime install_dev
- $(call UCLIBC_INSTALL_KERNEL_HEADERS,$(UCLIBC_KERNEL_HEADERS_DIR),$(TARGET_TOOLCHAIN_STAGING_DIR))
+ #$(call UCLIBC_INSTALL_KERNEL_HEADERS,$(UCLIBC_KERNEL_HEADERS_DIR),$(TARGET_TOOLCHAIN_STAGING_DIR))
# Copy some files to make mklibs happy
ifneq ($(strip $(UCLIBC_VERSION)),0.9.28)
for f in libc_pic.a libpthread_pic.a; do \
@@ -229,7 +231,7 @@
for f in libc.so.0 ld-uClibc.so.0; do \
ln -fs /lib/$$f $(TARGET_UTILS_DIR)/usr/lib/; \
done
- $(call UCLIBC_INSTALL_KERNEL_HEADERS,$(TARGET_TOOLCHAIN_STAGING_DIR)/usr/include,$(TARGET_UTILS_DIR))
+ $(call UCLIBC_INSTALL_KERNEL_HEADERS,$(TARGET_TOOLCHAIN_STAGING_DIR)/usr,$(TARGET_UTILS_DIR))
$(call REMOVE_DOC_NLS_DIRS,$(TARGET_UTILS_DIR))
touch -c $@
Index: make/linux/Makefile.in
===================================================================
--- make/linux/Makefile.in (revision 6140)
+++ make/linux/Makefile.in (working copy)
@@ -4,6 +4,7 @@
AVM_VERSION:=$(strip $(subst ",, $(FREETZ_AVM_VERSION_STRING)))
KERNEL_DIR:=$(SOURCE_DIR_ROOT)/kernel/ref-$(KERNEL_LAYOUT)-$(KERNEL_REF)-$(AVM_VERSION)
KERNEL_SOURCE_DIR:=$(KERNEL_DIR)/linux
+KERNEL_HEADERS_DEVEL_DIR:=$(TARGET_TOOLCHAIN_DIR)/linux-dev
KERNEL_HEADERS_DIR:=$(KERNEL_SOURCE_DIR)/include
KERNEL_TARGET_DIR:=kernel
KERNEL_MODULES_DIR:=$(KERNEL_TARGET_DIR)/modules-$(KERNEL_LAYOUT)-$(KERNEL_REF)-$(AVM_VERSION)
Index: make/linux/kernel.mk
===================================================================
--- make/linux/kernel.mk (revision 6140)
+++ make/linux/kernel.mk (working copy)
@@ -131,7 +131,20 @@
oldconfig
touch $@
+$(KERNEL_DIR)/.headers_installed: $(KERNEL_DIR)/.configured
+ $(SUBMAKE) -C $(KERNEL_BUILD_ROOT_DIR) \
+ CROSS_COMPILE="$(KERNEL_CROSS)" \
+ ARCH=$(KERNEL_ARCH) \
+ INSTALL_HDR_PATH=$(KERNEL_HEADERS_DEVEL_DIR) \
+ headers_install
+ touch $@
+
+# Install the kernel headers to the toolchain dir if necessary
+ifeq ($(strip $(FREETZ_BUILD_TOOLCHAIN)),y)
+$(KERNEL_DIR)/.depend_done: $(KERNEL_DIR)/.headers_installed
+else
$(KERNEL_DIR)/.depend_done: $(KERNEL_DIR)/.configured
+endif
$(SUBMAKE) -C $(KERNEL_BUILD_ROOT_DIR) \
CROSS_COMPILE="$(KERNEL_CROSS)" \
KERNEL_MAKE_PATH="$(KERNEL_MAKE_PATH):$(PATH)" \