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 5d7b7ab..a9480ef 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 9917798..51bf47b 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 0db18d1..20f753a 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)