buildroot: set SHELL instead of messing around with CONFIG_SHELL
Simply set SHELL to bash instead of adding CONFIG_SHELL to all shell invocations. CONFIG_SHELL is still set, as it is used by kconfig.
This commit is contained in:
parent
ae6011eb33
commit
69f8592407
30
Makefile
30
Makefile
@ -79,11 +79,15 @@ else
|
||||
Q=@
|
||||
endif
|
||||
|
||||
CONFIG_SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
|
||||
# we want bash as shell
|
||||
SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
|
||||
else if [ -x /bin/bash ]; then echo /bin/bash; \
|
||||
else echo sh; fi; fi)
|
||||
|
||||
export CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
|
||||
# kconfig uses CONFIG_SHELL
|
||||
CONFIG_SHELL:=$(SHELL)
|
||||
|
||||
export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
|
||||
|
||||
ifndef HOSTAR
|
||||
HOSTAR:=ar
|
||||
@ -113,17 +117,17 @@ endif
|
||||
ifndef HOSTNM
|
||||
HOSTNM:=nm
|
||||
endif
|
||||
HOSTAR:=$(shell $(CONFIG_SHELL) -c "which $(HOSTAR)" || type -p $(HOSTAR) || echo ar)
|
||||
HOSTAS:=$(shell $(CONFIG_SHELL) -c "which $(HOSTAS)" || type -p $(HOSTAS) || echo as)
|
||||
HOSTCC:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCC)" || type -p $(HOSTCC) || echo gcc)
|
||||
HOSTCXX:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCXX)" || type -p $(HOSTCXX) || echo g++)
|
||||
HOSTFC:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)" || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
|
||||
HOSTCPP:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCPP)" || type -p $(HOSTCPP) || echo cpp)
|
||||
HOSTLD:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)" || type -p $(HOSTLD) || echo ld)
|
||||
HOSTLN:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLN)" || type -p $(HOSTLN) || echo ln)
|
||||
HOSTNM:=$(shell $(CONFIG_SHELL) -c "which $(HOSTNM)" || type -p $(HOSTNM) || echo nm)
|
||||
HOST_GLIB_BIN:=`dirname $(shell $(CONFIG_SHELL) -c "which glib-genmarshal" || echo /usr/bin/glib-genmarshal)`
|
||||
HOST_GLIB:=$(shell $(CONFIG_SHELL) -c "dirname $(HOST_GLIB_BIN)" || echo /usr)
|
||||
HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
|
||||
HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
|
||||
HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
|
||||
HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
|
||||
HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
|
||||
HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
|
||||
HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
|
||||
HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
|
||||
HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
|
||||
HOST_GLIB_BIN:=`dirname $(shell which glib-genmarshal || echo /usr/bin/glib-genmarshal)`
|
||||
HOST_GLIB:=$(shell dirname $(HOST_GLIB_BIN) || echo /usr)
|
||||
|
||||
|
||||
ifndef CFLAGS_FOR_BUILD
|
||||
|
@ -127,7 +127,7 @@ TAR ?= tar
|
||||
# ACLOCAL="$(ACLOCAL)"
|
||||
|
||||
# Automatically detect tar --strip-path/components option
|
||||
TAR_STRIP_COMPONENTS := $(shell $(CONFIG_SHELL) -c '$(TAR) --help | grep strip-path > /dev/null ; if test $$? = 0 ; then echo '--strip-path' ; else echo '--strip-components' ; fi')
|
||||
TAR_STRIP_COMPONENTS := $(shell $(TAR) --help | grep strip-path > /dev/null ; if test $$? = 0 ; then echo '--strip-path' ; else echo '--strip-components' ; fi)
|
||||
|
||||
################################################################################
|
||||
# Implicit targets -- produce a stamp file for each step of a package build
|
||||
|
@ -4,7 +4,7 @@ endif
|
||||
ifndef HOSTMAKE
|
||||
HOSTMAKE=$(MAKE)
|
||||
endif
|
||||
HOSTMAKE :=$(shell $(CONFIG_SHELL) -c "which $(HOSTMAKE)" || type -p $(HOSTMAKE) || echo make)
|
||||
HOSTMAKE :=$(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
|
||||
|
||||
MAKE1:=$(HOSTMAKE) -j1
|
||||
MAKE:=$(HOSTMAKE) -j$(BR2_JLEVEL)
|
||||
@ -178,8 +178,8 @@ TARGET_STRIP=true -Not_stripping
|
||||
STRIPCMD=$(TARGET_STRIP)
|
||||
endif
|
||||
INSTALL=/usr/bin/install
|
||||
FLEX:=$(shell $(CONFIG_SHELL) -c 'which flex || type -p flex')
|
||||
BISON:=$(shell $(CONFIG_SHELL) -c 'which bison || type -p bison')
|
||||
FLEX:=$(shell which flex || type -p flex)
|
||||
BISON:=$(shell which bison || type -p bison)
|
||||
|
||||
HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
|
||||
-e 's/sparc.*/sparc/' \
|
||||
|
@ -112,7 +112,7 @@ $(BB_INITRAMFS_TARGET): host-fakeroot $(BR2_INITRAMFS_DIR)/bin/busybox
|
||||
rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
|
||||
(echo "chown -R 0:0 $(PROJECT_BUILD_DIR)/initramfs"; \
|
||||
echo "$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(PROJECT_BUILD_DIR)/initramfs"; \
|
||||
echo "$(CONFIG_SHELL) target/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(PROJECT_BUILD_DIR)/initramfs > $(BB_INITRAMFS_TARGET)"; \
|
||||
echo "$(SHELL) target/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(PROJECT_BUILD_DIR)/initramfs > $(BB_INITRAMFS_TARGET)"; \
|
||||
) > $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
|
||||
chmod +x $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
|
||||
$(STAGING_DIR)/usr/bin/fakeroot -- \
|
||||
|
@ -13,8 +13,8 @@ LZMA_TARGET_BINARY:=bin/lzma
|
||||
|
||||
# lzma binary for use on the host
|
||||
LZMA=$(TOOL_BUILD_DIR)/bin/lzma
|
||||
HOST_LZMA_BINARY=$(shell $(CONFIG_SHELL) package/lzma/lzmacheck.sh)
|
||||
HOST_LZMA_IF_ANY=$(shell $(CONFIG_SHELL) toolchain/dependencies/check-host-lzma.sh)
|
||||
HOST_LZMA_BINARY=$(shell package/lzma/lzmacheck.sh)
|
||||
HOST_LZMA_IF_ANY=$(shell toolchain/dependencies/check-host-lzma.sh)
|
||||
|
||||
|
||||
$(DL_DIR)/$(LZMA_SOURCE):
|
||||
|
@ -34,7 +34,7 @@ endif
|
||||
echo "$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \
|
||||
>> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET))
|
||||
# Use fakeroot so gen_initramfs_list.sh believes the previous fakery
|
||||
echo "$(CONFIG_SHELL) target/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(TARGET_DIR) > $(INITRAMFS_TARGET)" \
|
||||
echo "$(SHELL) target/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(TARGET_DIR) > $(INITRAMFS_TARGET)" \
|
||||
>> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET))
|
||||
chmod a+x $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET))
|
||||
$(STAGING_DIR)/usr/bin/fakeroot -- $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(TAR_TARGET))
|
||||
|
Loading…
Reference in New Issue
Block a user