diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-02 04:51:29 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-02 04:51:29 +0000 |
| commit | b8e653bfbfeee7797e631d6d47cd9cddb7658e4b (patch) | |
| tree | 7a0553a4184856af422e57dabbaec68bbe271502 /Makefile | |
| parent | cd2663f15e74274619dd97dc382bb858ac255872 (diff) | |
| download | busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.tar.gz busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.tar.bz2 busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.zip | |
Reinstate CONFIG_CROSS_COMPILE_PREFIX
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 38 |
1 files changed, 26 insertions, 12 deletions
| @@ -142,17 +142,6 @@ VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) | |||
| 142 | export srctree objtree VPATH TOPDIR | 142 | export srctree objtree VPATH TOPDIR |
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | # SUBARCH tells the usermode build what the underlying arch is. That is set | ||
| 146 | # first, and if a usermode build is happening, the "ARCH=um" on the command | ||
| 147 | # line overrides the setting of ARCH below. If a native build is happening, | ||
| 148 | # then ARCH is assigned, getting whatever value it gets normally, and | ||
| 149 | # SUBARCH is subsequently ignored. | ||
| 150 | |||
| 151 | SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | ||
| 152 | -e s/arm.*/arm/ -e s/sa110/arm/ \ | ||
| 153 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | ||
| 154 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ ) | ||
| 155 | |||
| 156 | # Cross compiling and selecting different set of gcc/bin-utils | 145 | # Cross compiling and selecting different set of gcc/bin-utils |
| 157 | # --------------------------------------------------------------------------- | 146 | # --------------------------------------------------------------------------- |
| 158 | # | 147 | # |
| @@ -172,8 +161,33 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | |||
| 172 | # Default value for CROSS_COMPILE is not to prefix executables | 161 | # Default value for CROSS_COMPILE is not to prefix executables |
| 173 | # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile | 162 | # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile |
| 174 | 163 | ||
| 175 | ARCH ?= $(SUBARCH) | ||
| 176 | CROSS_COMPILE ?= | 164 | CROSS_COMPILE ?= |
| 165 | # bbox: we may have CONFIG_CROSS_COMPILER_PREFIX in .config, | ||
| 166 | # and it has not been included yet... thus using an awkward syntax. | ||
| 167 | ifeq ($(CROSS_COMPILE),) | ||
| 168 | CROSS_COMPILE := $(shell grep ^CONFIG_CROSS_COMPILER_PREFIX .config 2>/dev/null) | ||
| 169 | CROSS_COMPILE := $(subst CONFIG_CROSS_COMPILER_PREFIX=,,$(CROSS_COMPILE)) | ||
| 170 | CROSS_COMPILE := $(subst ",,$(CROSS_COMPILE)) | ||
| 171 | endif | ||
| 172 | |||
| 173 | # SUBARCH tells the usermode build what the underlying arch is. That is set | ||
| 174 | # first, and if a usermode build is happening, the "ARCH=um" on the command | ||
| 175 | # line overrides the setting of ARCH below. If a native build is happening, | ||
| 176 | # then ARCH is assigned, getting whatever value it gets normally, and | ||
| 177 | # SUBARCH is subsequently ignored. | ||
| 178 | |||
| 179 | ifneq ($(CROSS_COMPILE),) | ||
| 180 | SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1) | ||
| 181 | else | ||
| 182 | SUBARCH := $(shell uname -m) | ||
| 183 | endif | ||
| 184 | SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | ||
| 185 | -e s/arm.*/arm/ -e s/sa110/arm/ \ | ||
| 186 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | ||
| 187 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ ) | ||
| 188 | |||
| 189 | ARCH ?= $(SUBARCH) | ||
| 190 | $(warning ARCH=$(ARCH) SUBARCH=$(SUBARCH)) | ||
| 177 | 191 | ||
| 178 | # Architecture as present in compile.h | 192 | # Architecture as present in compile.h |
| 179 | UTS_MACHINE := $(ARCH) | 193 | UTS_MACHINE := $(ARCH) |
