derive system from hostcc to allow building inside a chroot
authorJohn Crispin <john@openwrt.org>
Wed, 22 Aug 2012 15:07:32 +0000 (15:07 +0000)
committerJohn Crispin <john@openwrt.org>
Wed, 22 Aug 2012 15:07:32 +0000 (15:07 +0000)
SVN-Revision: 33228

target/imagebuilder/Makefile
target/sdk/Makefile
target/toolchain/Makefile

index 5d7b7ab5ed8871f45e032f047185272a64d60f08..a9480ef848385b76bffa92a8198fb83dc01f8c9d 100644 (file)
@@ -12,8 +12,8 @@ include $(INCLUDE_DIR)/version.mk
 
 override MAKEFLAGS=
 
-PKG_OS:=$(shell uname -s)
-PKG_CPU:=$(shell uname -m | sed "s/ //g")
+PKG_OS:=$(word 2,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
+PKG_CPU:=$(word 1,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
 
 IB_NAME:=OpenWrt-ImageBuilder-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))-for-$(PKG_OS)-$(PKG_CPU)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME)
index 99177984e2c05a5d5791d97e521be2f666c8748e..51bf47b420eae89741b284d460f4072e23f404a7 100644 (file)
@@ -11,8 +11,8 @@ include $(INCLUDE_DIR)/host.mk
 
 override MAKEFLAGS=
 
-PKG_OS:=$(shell uname -s)
-PKG_CPU:=$(shell uname -m)
+PKG_OS:=$(word 2,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
+PKG_CPU:=$(word 1,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
 
 SDK_NAME:=OpenWrt-SDK-$(BOARD)-for-$(PKG_OS)-$(PKG_CPU)-gcc-$(GCCV)_$(LIBC)-$(LIBCV)
 SDK_BUILD_DIR:=$(BUILD_DIR)/$(SDK_NAME)
index 0db18d1ac1bcb12f628272c3b3fcf7d0e761314f..20f753a271c79a6c138ae90efa03bb6f919544f8 100644 (file)
@@ -13,8 +13,8 @@ include $(INCLUDE_DIR)/host.mk
 
 override MAKEFLAGS=
 
-PKG_OS:=$(shell uname -s)
-PKG_CPU:=$(shell uname -m)
+PKG_OS:=$(word 2,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
+PKG_CPU:=$(word 1,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
 
 TOOLCHAIN_NAME:=OpenWrt-Toolchain-$(BOARD)-for-$(ARCH)$(ARCH_SUFFIX)-gcc-$(GCCV)$(DIR_SUFFIX)
 TOOLCHAIN_BUILD_DIR:=$(BUILD_DIR)/$(TOOLCHAIN_NAME)