diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk index 7b3edf4731..8302d56a9f 100644 --- a/package/linux-headers/linux-headers.mk +++ b/package/linux-headers/linux-headers.mk @@ -26,6 +26,20 @@ LINUX_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO # This results in seemingly errors like: # [...]/scripts/gcc-version.sh: line 26: arc-linux-uclibc-gcc: command not found # Those can be safely ignored. + +# This step is required to have a separate linux headers location for +# uClibc building. This way uClibc doesn't modify linux headers on installation +# of "its" headers +define LINUX_HEADERS_CONFIGURE_CMDS + (cd $(@D); \ + $(TARGET_MAKE_ENV) $(MAKE) \ + ARCH=$(KERNEL_ARCH) \ + HOSTCC="$(HOSTCC)" \ + HOSTCFLAGS="$(HOSTCFLAGS)" \ + HOSTCXX="$(HOSTCXX)" \ + headers_install) +endef + define LINUX_HEADERS_INSTALL_STAGING_CMDS (cd $(@D); \ $(TARGET_MAKE_ENV) $(MAKE) \ diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk index 717cf53a88..144f993bd5 100644 --- a/package/uclibc/uclibc.mk +++ b/package/uclibc/uclibc.mk @@ -418,7 +418,7 @@ define UCLIBC_SETUP_DOT_CONFIG $(call UCLIBC_OPT_SET,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)) $(call UCLIBC_OPT_SET,TARGET_$(UCLIBC_TARGET_ARCH),y,$(@D)) $(call UCLIBC_OPT_SET,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)) - $(call UCLIBC_OPT_SET,KERNEL_HEADERS,"$(STAGING_DIR)/usr/include",$(@D)) + $(call UCLIBC_OPT_SET,KERNEL_HEADERS,"$(LINUX_HEADERS_DIR)/usr/include",$(@D)) $(call UCLIBC_OPT_SET,RUNTIME_PREFIX,"/",$(@D)) $(call UCLIBC_OPT_SET,DEVEL_PREFIX,"/usr",$(@D)) $(call UCLIBC_OPT_SET,SHARED_LIB_LOADER_PREFIX,"/lib",$(@D))