Merge pull request #547 from stilor/separate-canadian-crosses-instdir

Simplify the pre-build actions a bit
This commit is contained in:
Alexey Neyman 2017-01-24 14:54:42 -08:00 committed by GitHub
commit b5d0e396d9
75 changed files with 144 additions and 346 deletions

1
.gitignore vendored
View File

@ -11,7 +11,6 @@ paths.*
!paths.in
config.gen/
.config
.config.2
# Temporaries
.*.swp

View File

@ -157,7 +157,7 @@ uninstall: real-uninstall
build-bin: $(PROG_NAME) \
scripts/crosstool-NG.sh \
scripts/saveSample.sh \
scripts/showTuple.sh
scripts/showConfig.sh
@chmod 755 $^
build-lib: config/configure.in \
@ -262,8 +262,8 @@ clean-bin:
@rm -f scripts/crosstool-NG.sh
@echo " RM 'scripts/saveSample.sh'"
@rm -f scripts/saveSample.sh
@echo " RM 'scripts/showTuple.sh'"
@rm -f scripts/showTuple.sh
@echo " RM 'scripts/showConfig.sh'"
@rm -f scripts/showConfig.sh
clean-lib:
@echo " RM 'paths'"

View File

@ -5,8 +5,7 @@ comment "Logging"
choice
bool
prompt "Maximum log level to see:"
default LOG_INFO if !DEBUG_CT
default LOG_DEBUG if DEBUG_CT
default LOG_EXTRA
config LOG_ERROR
bool

View File

@ -5,7 +5,7 @@ comment "Paths"
config LOCAL_TARBALLS_DIR
string
prompt "Local tarballs directory" if ! BACKEND
default ""
default "${HOME}/src"
help
If you have previously downloaded the tarballs, enter the PATH where
you stored them here.
@ -14,7 +14,7 @@ config SAVE_TARBALLS
bool
prompt "Save new tarballs" if ! BACKEND
depends on LOCAL_TARBALLS_DIR != "" || BACKEND
default y if BACKEND
default y
help
If you say 'y' here, new downloaded tarballs will be saved in the
directory you entered above.
@ -40,10 +40,14 @@ config WORK_DIR
Do *NOT* change it if you don't know better.
config BUILD_TOP_DIR
string
default "${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
config PREFIX_DIR
string
prompt "Prefix directory" if ! BACKEND
default "${HOME}/x-tools/${CT_TARGET}"
default "${CT_PREFIX:-${HOME}/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
help
This is the path the toolchain will run from.

View File

@ -136,19 +136,14 @@ help-env::
@echo "or configure an existing sample."
@false
.config.2: .config
$(SILENT)$(sed) -r -e 's/^([^=]+_ARRAY)="(.*)"$$/\1=( \2 )/;' \
-e '/^[^=]+_ARRAY=/s/\\(.)/\1/g;' \
$< >$@
show-tuple: .config.2
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showTuple.sh
show-tuple: .config
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_TARGET}'
# Actual build
source: .config.2
source: .config
$(SILENT)CT_SOURCE=y $(CT_LIB_DIR)/scripts/crosstool-NG.sh
build: .config.2
build: .config
$(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh
build.%:

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-a53"
CT_ARCH_64=y
CT_ARCH_arm=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_arm=y
CT_TARGET_VENDOR=""

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="ev56"
CT_ARCH_ALPHA_EV56=y
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="ev67"
CT_ARCH_ALPHA_EV67=y
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-m3"
CT_ARCH_FLOAT_SW=y
CT_ARCH_arm=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-a15"
CT_ARCH_FPU="neon-vfpv4"
CT_ARCH_FLOAT_HW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-a8"
CT_ARCH_FLOAT_SW=y
CT_ARCH_arm=y

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-a5"
CT_ARCH_FPU="vfpv4-d16"
CT_ARCH_FLOAT_HW=y

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-a9"
CT_ARCH_FPU="neon"
CT_ARCH_FLOAT_HW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_arm=y
CT_MULTILIB=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_arm=y
CT_LIBC_NEWLIB_IO_C99FMT=y

View File

@ -1,7 +1,4 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
# CT_REMOVE_DOCS is not set
CT_LOG_EXTRA=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_arm=y
CT_KERNEL_linux=y

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_arm=y
CT_KERNEL_linux=y
CT_BINUTILS_LINKER_LD_GOLD=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="arm926ej-s"
CT_ARCH_FLOAT_SW=y
CT_ARCH_arm=y

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="arm926ej-s"
CT_ARCH_FLOAT_HW=y
CT_ARCH_arm=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_BE=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_arm=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_ARCH="armv5te"
CT_ARCH_BE=y
CT_ARCH_FLOAT_SW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="xscale"
CT_ARCH_BE=y
CT_ARCH_FLOAT_SW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="arm1176jzf-s"
CT_ARCH_FPU="vfp"
CT_ARCH_arm=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-a7"
CT_ARCH_FPU="neon-vfpv4"
CT_ARCH_FLOAT_HW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cortex-a53"
CT_ARCH_FPU="neon-vfpv4"
CT_ARCH_FLOAT_HW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_avr=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_ARCH="pentium-mmx"
CT_ARCH_x86=y
CT_TARGET_VENDOR="geode"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_ARCH="i686"
CT_ARCH_x86=y
CT_TARGET_VENDOR="nptl"

View File

@ -1,8 +1,5 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
# CT_REMOVE_DOCS is not set
CT_LOG_EXTRA=y
CT_ARCH_nios2=y
CT_STATIC_TOOLCHAIN=y
CT_TOOLCHAIN_BUGURL="https://bitbucket.org/netzimme/eax-gcc/issues?status=new&status=open"

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_ARCH="i686"
CT_ARCH_x86=y
CT_TARGET_VENDOR="w64"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="cpu32"
CT_ARCH_m68k=y
CT_ARCH_BINFMT_FLAT=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_m68k=y
CT_KERNEL_linux=y
CT_THREADS_LT=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_ARCH="4kc"
CT_ARCH_TUNE="4kc"
CT_ARCH_FLOAT_SW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_mips=y
CT_TARGET_VENDOR="malta"
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_mips=y
CT_LIBC_none=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_ARCH="mips1"
CT_ARCH_FLOAT_SW=y
CT_ARCH_mips=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_LE=y
CT_ARCH_64=y
CT_ARCH_FLOAT_SW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_LE=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_mips=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_LE=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_mips=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_ARCH="mips1"
CT_ARCH_LE=y
CT_ARCH_FLOAT_SW=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="405"
CT_ARCH_FLOAT_SW=y
CT_ARCH_powerpc=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="860"
CT_ARCH_FLOAT_SW=y
CT_ARCH_powerpc=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="e300c3"
CT_ARCH_powerpc=y
CT_TARGET_VENDOR="e300c3"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="8548"
CT_ARCH_FLOAT_SW=y
CT_TARGET_CFLAGS="-mfloat-gprs=double -Wa,-me500x2"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_powerpc=y
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_powerpc=y
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_powerpc=y
CT_TARGET_VENDOR="unknown_nofpu"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_powerpc=y
CT_MULTILIB=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_powerpc=y
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_LE=y
CT_ARCH_64=y
CT_ARCH_powerpc=y

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_s390=y
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_s390=y
CT_KERNEL_linux=y

View File

@ -26,7 +26,7 @@ help-samples::
@echo ' show-<sample> - show a brief overview of <sample> (list with list-samples)'
@echo ' <sample> - preconfigure crosstool-NG with <sample> (list with list-samples)'
@echo ' build-all[.#] - Build *all* samples (list with list-samples) and install in'
@echo ' $${CT_PREFIX} (which you must set)'
@echo ' $${CT_PREFIX} (set to ~/x-tools by default)'
help-distrib::
@echo ' check-samples - Verify if samples need updates due to Kconfig changes'
@ -177,14 +177,7 @@ $(CT_SAMPLES): config_files
# ----------------------------------------------------------
# Some helper functions
# Construct a CT_PREFIX_DIR path from the sample name. Sample names use
# comma as a separator between host and target triplets in canadian cross
# configurations, but ct-ng does not allow commas in the path. Substitute
# with = (equal sign).
# $1: sample
__comma = ,
prefix_dir = $(CT_PREFIX)/$(subst $(__comma),=,$(1))
host_triplet = $(if $(findstring $(__comma),$(1)),$(firstword $(subst $(__comma), ,$(1))))
target_triplet = $(if $(findstring $(__comma),$(1)),$(word 2,$(subst $(__comma), ,$(1))),$(1))
@ -193,16 +186,15 @@ target_triplet = $(if $(findstring $(__comma),$(1)),$(word 2,$(subst $(__comma),
define build_sample
@$(CT_ECHO) ' CONF $(1)'
$(SILENT)$(CONF) -s --defconfig=$(call sample_dir,$(1))/crosstool.config $(KCONFIG_TOP)
$(SILENT)$(sed) -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$(call prefix_dir,$(1))":;' .config
$(SILENT)[ -n "$(CT_PREFIX)" ] && $(sed) -i -r -e 's:^(CT_PREFIX=).*$$:\1"$(CT_PREFIX)":;' .config || :
$(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config
$(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config
$(SILENT)$(sed) -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config
$(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config
$(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config
$(SILENT)$(CONF) -s --oldconfig $(KCONFIG_TOP)
@$(CT_ECHO) ' BUILD $(1)'
$(SILENT)if [ ! -z "$(call host_triplet,$(1))" -a -d "$(call prefix_dir,$(call host_triplet,$(1)))" ]; then \
PATH="$$PATH:$(call prefix_dir,$(call host_triplet,$(1)))/bin"; \
$(SILENT)h=$(call host_triplet,$(1)); \
if [ -n "$${h}" -a -r ".build-all/PASS/$${h}/prefix" ]; then \
PATH=`cat .build-all/PASS/$${h}/prefix`/bin:$${PATH}; \
fi; \
if $(MAKE) -rf $(CT_NG) V=0 build; then \
status=PASS; \
@ -214,7 +206,12 @@ define build_sample
printf '\r %-5s %s\n' $$status '$(1)'; \
mkdir -p .build-all/$$status/$(1); \
bzip2 < build.log > .build-all/$$status/$(1)/build.log.bz2; \
[ "$$status" = PASS -a -z "$(CT_PRESERVE_PASSED_BUILDS)" ] && rm -rf .build/$(call target_triplet,$(1)) || :
if [ "$$status" = PASS ]; then \
blddir=`$(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_BUILD_TOP_DIR}'`; \
[ -z "$(CT_PRESERVE_PASSED_BUILDS)" ] && rm -rf $${blddir}; \
$(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_PREFIX_DIR}' > .build-all/PASS/$(1)/prefix; \
fi; \
:
endef
# ----------------------------------------------------------
@ -224,10 +221,6 @@ endef
ifneq ($(strip $(MAKECMDGOALS)),)
ifneq ($(strip $(filter $(patsubst %,build-%,$(CT_SAMPLES)) build-all,$(MAKECMDGOALS))),)
ifeq ($(strip $(CT_PREFIX)),)
$(error Please set 'CT_PREFIX' to where you want to install generated toolchain samples!)
endif
endif # MAKECMDGOALS contains a build sample rule
endif # MAKECMDGOALS != ""

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_sh=y
CT_ARCH_SH_SH4=y
CT_TARGET_VENDOR="multilib"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_sh=y
CT_ARCH_SH_SH4=y
CT_TARGET_VENDOR="multilib"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_sh=y
CT_ARCH_SH_SH4=y
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_CPU="leon"
CT_ARCH_TUNE="leon"
CT_ARCH_FLOAT_SW=y

View File

@ -1,5 +1,2 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_sparc=y
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_sparc=y
CT_MULTILIB=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_x86=y
CT_MULTILIB=y

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_x86=y
CT_MULTILIB=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_powerpc=y
CT_TARGET_VENDOR=""
CT_CANADIAN=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_x86=y
CT_MULTILIB=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_x86=y
CT_KERNEL_linux=y

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_x86=y
CT_KERNEL_linux=y

View File

@ -1,8 +1,5 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
# CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES is not set
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_x86=y
CT_TARGET_VENDOR="pc"

View File

@ -1,7 +1,4 @@
CT_EXPERIMENTAL=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_64=y
CT_ARCH_x86=y
CT_TARGET_VENDOR="w64"

View File

@ -1,6 +1,3 @@
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_LOG_EXTRA=y
CT_ARCH_BE=y
CT_TARGET_CFLAGS="-mlongcalls -mtext-section-literals"
CT_ARCH_xtensa=y

2
scripts/.gitignore vendored
View File

@ -1,3 +1,3 @@
crosstool-NG.sh
saveSample.sh
showTuple.sh
showConfig.sh

View File

@ -17,13 +17,13 @@
# most notably:
# - set trap handler on errors,
# - don't hash commands lookups,
# - initialise logging.
. "${CT_LIB_DIR}/scripts/functions"
# Parse the configuration file
# It has some info about the logging facility, so include it early
. .config.2
# Read the sample settings
CT_LoadConfig
# Yes! We can do full logging from now on!
CT_LogEnable
# Check running as root
if [ -z "${CT_ALLOW_BUILD_AS_ROOT_SURE}" ]; then
@ -126,8 +126,6 @@ CT_STAR_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
# Log real begining of build, now
CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
# We really need to extract from ,config and not .config.2, as we
# do want the kconfig's values, not our mangled config with arrays.
CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config
CT_EndStep
@ -138,26 +136,6 @@ export MAKEFLAGS
CT_DoLog INFO "Building environment variables"
# Include sub-scripts instead of calling them: that way, we do not have to
# export any variable, nor re-parse the configuration and functions files.
. "${CT_LIB_DIR}/scripts/build/internals.sh"
. "${CT_LIB_DIR}/scripts/build/arch.sh"
. "${CT_LIB_DIR}/scripts/build/companion_tools.sh"
. "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
. "${CT_LIB_DIR}/scripts/build/companion_libs.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/${CT_BINUTILS}.sh"
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
. "${CT_LIB_DIR}/scripts/build/cc.sh"
. "${CT_LIB_DIR}/scripts/build/debug.sh"
. "${CT_LIB_DIR}/scripts/build/test_suite.sh"
# Target tuple: CT_TARGET needs a little love:
CT_DoBuildTargetTuple
# Kludge: If any of the configured options needs CT_TARGET,
# then rescan the options file now:
. .config.2
# Sanity check some directories
CT_TestAndAbort "'CT_PREFIX_DIR' is not set: where should I install?" -z "${CT_PREFIX_DIR}"
@ -178,8 +156,8 @@ CT_PKGVERSION="crosstool-NG ${CT_VERSION}${CT_TOOLCHAIN_PKGVERSION:+ - ${CT_TOOL
# Compute the working directories names
CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
CT_SRC_DIR="${CT_WORK_DIR}/src"
CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build"
CT_BUILDTOOLS_PREFIX_DIR="${CT_WORK_DIR}/${CT_TARGET}/buildtools"
CT_BUILD_DIR="${CT_BUILD_TOP_DIR}/build"
CT_BUILDTOOLS_PREFIX_DIR="${CT_BUILD_TOP_DIR}/buildtools"
CT_STATE_DIR="${CT_WORK_DIR}/${CT_TARGET}/state"
# Note about HOST_COMPLIBS_DIR: it's always gonna be in the buildtools dir, or a
# sub-dir. So we won't have to save/restore it, not even create it.
@ -310,7 +288,6 @@ if [ -z "${CT_RESTART}" ]; then
BINUTILS_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
CC_CORE_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
CC_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
LIBC_SYSROOT_ARG=""
# glibc's prefix must be exactly /usr, else --with-sysroot'd gcc will get
# confused when $sysroot/usr/include is not present.
# Note: --prefix=/usr is magic!
@ -329,7 +306,6 @@ if [ -z "${CT_RESTART}" ]; then
# building libgcc, and you'll have no profiling
CC_CORE_SYSROOT_ARG="--without-headers"
CC_SYSROOT_ARG="--with-headers=${CT_HEADERS_DIR}"
LIBC_SYSROOT_ARG="prefix="
fi
CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_DEBUGROOT_DIR}"
@ -591,8 +567,6 @@ if [ -z "${CT_RESTART}" ]; then
fi
rm -f "${testc}"
# We need to save the real .config with kconfig's value,
# not our mangled .config.2 with arrays.
CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration"
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin"
CT_DoExecLog DEBUG ${install} -m 0755 "${CT_LIB_DIR}/scripts/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
@ -691,12 +665,12 @@ CT_DoEnd INFO
# From now-on, it can become impossible to log any time, because
# either we're compressing the log file, or it can become RO any
# moment... Restore original stdout, stderr and stdin
# moment...
CT_DoLog INFO "Finishing installation (may take a few seconds)..."
exec >&6 2>&7 <&8
CT_LogDisable
rm -f ${CT_PREFIX_DIR}/build.log.bz2
if [ "${CT_LOG_TO_FILE}" = "y" ]; then
cp "${tmp_log_file}" "${CT_PREFIX_DIR}/build.log"
cp "${CT_BUILD_LOG}" "${CT_PREFIX_DIR}/build.log"
if [ "${CT_LOG_FILE_COMPRESS}" = y ]; then
bzip2 -9 "${CT_PREFIX_DIR}/build.log"
fi

View File

@ -4,6 +4,56 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
CT_LoadConfig() {
local o
# Parse the configuration file
# It has some info about the logging facility, so include it early
# It also sets KERNEL/ARCH/... for file inclusion below. Does not handle
# recursive definitions yet. We don't need arrays at this point.
CT_TestOrAbort "Configuration file not found. Please create one." -r .config
. .config
# Include sub-scripts instead of calling them: that way, we do not have to
# export any variable, nor re-parse the configuration and functions files.
. "${CT_LIB_DIR}/scripts/build/internals.sh"
. "${CT_LIB_DIR}/scripts/build/arch.sh"
. "${CT_LIB_DIR}/scripts/build/companion_tools.sh"
. "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
. "${CT_LIB_DIR}/scripts/build/companion_libs.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/${CT_BINUTILS}.sh"
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
. "${CT_LIB_DIR}/scripts/build/cc.sh"
. "${CT_LIB_DIR}/scripts/build/debug.sh"
. "${CT_LIB_DIR}/scripts/build/test_suite.sh"
# Target tuple: CT_TARGET needs a little love:
CT_DoBuildTargetTuple
# Kludge: If any of the configured options needs CT_TARGET,
# then rescan the options file now. This also handles recursive variables;
# but we don't want to loop forever if there's a circular reference.
oldvals=""
try=0
while [ "$try" -le 10 ]; do
. .config
vals=`set | ${grep} -E '^CT_'`
if [ "$oldvals" = "$vals" ]; then
break
fi
oldvals="$vals"
try=$[ try + 1 ]
done
if [ "$try" -gt 10 ]; then
CT_Abort "Variables in .config recurse too deep."
fi
# Double eval: first eval substitutes option name, second eval unescapes quotes
# and whitespace.
for o in `set | sed -rn 's/^(CT_[A-Za-z0-9_]*_ARRAY)=.*/\1/p'`; do
eval "eval $o=(\"\$$o\")"
done
}
# Prepare the fault handler
CT_OnError() {
local ret=$?
@ -48,7 +98,7 @@ CT_OnError() {
old_trap="$(trap -p ERR)"
trap -- ERR
(
exec >&6 2>&7 <&8
CT_LogDisable # In this subshell
printf "\r \n\nCurrent command"
if [ -n "${cur_cmd}" ]; then
printf ":\n %s\n" "${cur_cmd}"
@ -132,12 +182,22 @@ set +o hashall
# Log policy:
# - first of all, save stdout so we can see the live logs: fd #6
# (also save stdin and stderr for use by CT_DEBUG_INTERACTIVE)
exec 6>&1 7>&2 8<&0
# - then point stdout to the log file
tmp_log_file="${CT_TOP_DIR}/build.log"
rm -f "${tmp_log_file}"
exec >>"${tmp_log_file}"
# (also save stdin and stderr for use by CT_DEBUG_INTERACTIVE)
# FIXME: it doesn't look like anyone is overriding stdin/stderr. Do we need
# to save/restore them?
CT_LogEnable() {
exec 6>&1 7>&2 8<&0
CT_BUILD_LOG="${CT_TOP_DIR}/build.log"
CT_LOG_ENABLED=y
rm -f "${CT_BUILD_LOG}"
exec >>"${CT_BUILD_LOG}"
}
# Restore original stdout, stderr and stdin
CT_LogDisable() {
exec >&6 2>&7 <&8
CT_LOG_ENABLED=
}
# The different log levels:
CT_LOG_LEVEL_ERROR=0
@ -197,14 +257,20 @@ CT_DoLog() {
*) cur_L="${LEVEL}"; cur_l="${level}";;
esac
# There will always be a log file (stdout, fd #1), be it /dev/null
printf "[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}"
if [ ${cur_l} -le ${max_level} ]; then
# Only print to console (fd #6) if log level is high enough.
printf "${CT_LOG_PROGRESS_BAR:+\r}[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}" >&6
fi
if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${_prog_bar[$((_prog_bar_cpt/10))]}" >&6
_prog_bar_cpt=$(((_prog_bar_cpt+1)%40))
if [ -n "${CT_LOG_ENABLED}" ]; then
printf "[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}"
# If log file has been set up, fd#6 is console and it only
# gets the most important messages.
if [ ${cur_l} -le ${max_level} ]; then
# Only print to console (fd #6) if log level is high enough.
printf "${CT_LOG_PROGRESS_BAR:+\r}[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}" >&6
fi
if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${_prog_bar[$((_prog_bar_cpt/10))]}" >&6
_prog_bar_cpt=$(((_prog_bar_cpt+1)%40))
fi
elif [ ${cur_l} -le ${CT_LOG_LEVEL_WARN} ]; then
printf "[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}"
fi
done
)

View File

@ -10,29 +10,14 @@
# Parse the tools' paths configuration
. "${CT_LIB_DIR}/paths.sh"
# We'll need the stdout later, save it
exec 7>&1
. "${CT_LIB_DIR}/scripts/functions"
# Don't care about any log file
exec >/dev/null
rm -f "${tmp_log_file}"
# Parse the configuration file
# Don't use CT_TestOrAbort, it prints the test string to [DEBUG]
# Note: we just need the non-mangled .config, not .config.2
if [ ! -f .config ]; then
CT_Abort "Configuration file not found. Please create one."
fi
. .config
CT_LoadConfig
# We can not reliably save a sample which either uses local patches
# and/or custom Linux kernel headers. Warn the user about this issue
# and continue if he/she confirms sving the sample.
if [ "${CT_CUSTOM_PATCH}" = "y" ]; then
exec >&7
echo "You are using local patches."
echo "You will not be able to (easily) share this sample in this case."
read -p "Press Ctrl-C to stop now, or Enter to continue..."
@ -41,17 +26,6 @@ fi
# Do not use a progress bar
unset CT_LOG_PROGRESS_BAR
# Parse architecture and kernel specific functions
. "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh"
. "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
# Target tuple: CT_TARGET needs a little love:
CT_DoBuildTargetTuple
# Kludge: if any of the config options needs either CT_TARGET or CT_TOP_DIR,
# re-parse them:
. .config
# Override log options
unset CT_LOG_PROGRESS_BAR CT_LOG_ERROR CT_LOG_INFO CT_LOG_EXTRA CT_LOG_DEBUG LOG_ALL
CT_LOG_WARN=y
@ -66,16 +40,17 @@ esac
samp_dir="samples/${samp_name}"
mkdir -p "${samp_dir}"
# Tweak the .config file
# We need to be based on the real .config with kconfig's values,
# not our mangled .config.2 with shell arrays
cp .config .defconfig
"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \
-e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \
-e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \
-e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;' \
<.config \
>.defconfig
# Tweak the .config file: remove the options that we want to keep
# at default setting in samples.
force_default_opts=( \
PREFIX_DIR LOG_TO_FILE LOG_FILE_COMPRESS \
LOCAL_TARBALLS_DIR SAVE_TARBALLS \
LOG_ERROR LOG_WARN LOG_INFO LOG_EXTRA LOG_ALL LOG_DEBUG \
LOG_PROGRESS_BAR
)
regexp=${force_default_opts[*]}
regexp=${regexp// /|}
grep -v -E '^(# )?CT_('"${regexp}"')' .config > .defconfig
# Function to copy a file to the sample directory
# Needed in case the file is already there (think of a previously available sample)
@ -114,9 +89,6 @@ export KCONFIG_CONFIG="$(pwd)/.defconfig"
${CONF} --savedefconfig="${samp_dir}/crosstool.config" "${KCONFIG_TOP}"
rm -f .defconfig
# Restore stdout now, to be interactive
exec >&7
# Fill-in the reported-by info
[ -f "${samp_dir}/reported.by" ] && . "${samp_dir}/reported.by"
old_name="${reporter_name}"

15
scripts/showConfig.sh.in Normal file
View File

@ -0,0 +1,15 @@
#!@@CT_bash@@
# What we need:
# - the .config file
# Parse the tools' paths configuration
. "${CT_LIB_DIR}/paths.sh"
# Parse the common functions
. "${CT_LIB_DIR}/scripts/functions"
# Read the sample settings
CT_LoadConfig
eval "echo \"$1\""

View File

@ -1,30 +0,0 @@
#!@@CT_bash@@
# What we need:
# - the .config file
# Parse the tools' paths configuration
. "${CT_LIB_DIR}/paths.sh"
# We'll need the stdout later, save it
exec 9>&1
# Parse the common functions
. "${CT_LIB_DIR}/scripts/functions"
# Don't care about any log file
exec >/dev/null
rm -f "${tmp_log_file}"
# Parse the configuration file
. .config.2
# Parse architecture and kernel specific functions
. "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh"
. "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
# Build CT_TARGET
CT_DoBuildTargetTuple
# All this for this single echo... :-( Sigh, I'll have to re-arrange things...
echo "${CT_TARGET}" >&9