1.1 --- a/config/config.in Fri Oct 10 08:46:29 2008 +0000
1.2 +++ b/config/config.in Fri Oct 10 14:30:44 2008 +0000
1.3 @@ -6,5 +6,5 @@
1.4 source config/binutils.in
1.5 source config/cc.in
1.6 source config/libc.in
1.7 -source config.gen/tools.in
1.8 -source config.gen/debug.in
1.9 +source config/tools.in
1.10 +source config/debug.in
2.1 --- a/config/debug/dmalloc.in Fri Oct 10 08:46:29 2008 +0000
2.2 +++ b/config/debug/dmalloc.in Fri Oct 10 14:30:44 2008 +0000
2.3 @@ -1,12 +1,7 @@
2.4 # dmalloc debug facility
2.5
2.6 -menuconfig DMALLOC
2.7 +config DEBUG_dmalloc
2.8 bool
2.9 - prompt "dmalloc"
2.10 - default n
2.11 - depends on ! BARE_METAL
2.12 -
2.13 -if DMALLOC
2.14
2.15 choice
2.16 bool
2.17 @@ -31,5 +26,3 @@
2.18 default "5.5.2" if DMALLOC_V_5_5_2
2.19 # CT_INSERT_VERSION_STRING_ABOVE
2.20 # Don't remove above line!
2.21 -
2.22 -endif
3.1 --- a/config/debug/duma.in Fri Oct 10 08:46:29 2008 +0000
3.2 +++ b/config/debug/duma.in Fri Oct 10 14:30:44 2008 +0000
3.3 @@ -1,17 +1,11 @@
3.4 # D.U.M.A. - Detect Unintended Memory Access - Memory checker
3.5
3.6 -menuconfig DUMA
3.7 - bool
3.8 - prompt "D.U.M.A."
3.9 - default n
3.10 - depends on ! BARE_METAL
3.11 +config DEBUG_duma
3.12 help
3.13 D.U.M.A. - Detect Unintended Memory Access
3.14 A memory bound checker, with additional features.
3.15 Formerly known as Electric Fence.
3.16
3.17 -if DUMA
3.18 -
3.19 config DUMA_A
3.20 bool
3.21 prompt "Build a static library"
3.22 @@ -55,5 +49,3 @@
3.23 default "2_5_14" if DUMA_V_2_5_14
3.24 # CT_INSERT_VERSION_STRING_ABOVE
3.25 # Don't remove above line!
3.26 -
3.27 -endif
4.1 --- a/config/debug/gdb.in Fri Oct 10 08:46:29 2008 +0000
4.2 +++ b/config/debug/gdb.in Fri Oct 10 14:30:44 2008 +0000
4.3 @@ -1,14 +1,9 @@
4.4 # GDB menu
4.5
4.6 -menuconfig GDB
4.7 - bool
4.8 - prompt "gdb"
4.9 - default n
4.10 +config DEBUG_gdb
4.11 help
4.12 Enable gdb for the target
4.13
4.14 -if GDB
4.15 -
4.16 config GDB_CROSS
4.17 bool
4.18 prompt "Cross-gdb"
4.19 @@ -167,5 +162,3 @@
4.20 default "5.6" if NCURSES_V_5_6
4.21
4.22 endif # GDB_NATIVE --> ncurses
4.23 -
4.24 -endif
5.1 --- a/config/debug/ltrace.in Fri Oct 10 08:46:29 2008 +0000
5.2 +++ b/config/debug/ltrace.in Fri Oct 10 14:30:44 2008 +0000
5.3 @@ -1,20 +1,14 @@
5.4 +# EXPERIMENTAL
5.5 # ltrace
5.6
5.7 -menuconfig LTRACE
5.8 - bool
5.9 - prompt "ltrace (EXPERIMENTAL)"
5.10 - default n
5.11 - depends on EXPERIMENTAL
5.12 - depends on ! BARE_METAL
5.13 - select LIBELF
5.14 +config DEBUG_ltrace
5.15 + select TOOL_libelf
5.16 help
5.17 ltrace is currently BROKEN! It depends on libelf, and I don't
5.18 know how to configure/compile that so that ltrace can successfully
5.19 use it. If you manage to build ltrace (and libelf!), please be so
5.20 kind as to tell me! Thank you!
5.21
5.22 -if LTRACE
5.23 -
5.24 choice
5.25 bool
5.26 prompt "ltrace version"
5.27 @@ -38,5 +32,3 @@
5.28 default "0.4" if LTRACE_V_0_4
5.29 # CT_INSERT_VERSION_STRING_ABOVE
5.30 # # Don't remove above line!
5.31 -
5.32 -endif
6.1 --- a/config/debug/strace.in Fri Oct 10 08:46:29 2008 +0000
6.2 +++ b/config/debug/strace.in Fri Oct 10 14:30:44 2008 +0000
6.3 @@ -1,12 +1,6 @@
6.4 # strace
6.5
6.6 -menuconfig STRACE
6.7 - bool
6.8 - prompt "strace"
6.9 - default n
6.10 - depends on ! BARE_METAL
6.11 -
6.12 -if STRACE
6.13 +config DEBUG_strace
6.14
6.15 choice
6.16 bool
6.17 @@ -42,5 +36,3 @@
6.18 default "4.5.16" if STRACE_V_4_5_16
6.19 # CT_INSERT_VERSION_STRING_ABOVE
6.20 # # Don't remove above line!
6.21 -
6.22 -endif
7.1 --- a/config/tools/libelf.in Fri Oct 10 08:46:29 2008 +0000
7.2 +++ b/config/tools/libelf.in Fri Oct 10 14:30:44 2008 +0000
7.3 @@ -1,11 +1,7 @@
7.4 +# EXPERIMENTAL
7.5 # libelf config file
7.6
7.7 -menuconfig LIBELF
7.8 - bool
7.9 - prompt "libelf (BROKEN)"
7.10 - default n
7.11 - depends on EXPERIMENTAL
7.12 - depends on ! BARE_METAL
7.13 +config TOOL_libelf
7.14 help
7.15 libelf lets you read, modify or create ELF files in an
7.16 architecture-independent way.
7.17 @@ -14,8 +10,6 @@
7.18 please be so kind as to tell me. (By working, I mean it is
7.19 useable at least by ltrace.) Thank you!
7.20
7.21 -if LIBELF
7.22 -
7.23 choice
7.24 bool
7.25 prompt "libelf version"
7.26 @@ -44,5 +38,3 @@
7.27 default "0.8.10" if LIBELF_V_0_8_10
7.28 # CT_INSERT_VERSION_STRING_ABOVE
7.29 # Don't remove above line!
7.30 -
7.31 -endif
8.1 --- a/config/tools/sstrip.in Fri Oct 10 08:46:29 2008 +0000
8.2 +++ b/config/tools/sstrip.in Fri Oct 10 14:30:44 2008 +0000
8.3 @@ -1,16 +1,10 @@
8.4 # Configuration file for sstrip tool facility
8.5
8.6 -menuconfig SSTRIP
8.7 - bool
8.8 - prompt "sstrip"
8.9 - depends on ! BARE_METAL
8.10 - default n
8.11 +config TOOL_sstrip
8.12 help
8.13 The sstrip utility, to maximise the striping of ELF binaries
8.14 (executables and libraries).
8.15
8.16 -if SSTRIP
8.17 -
8.18 choice
8.19 bool
8.20 prompt "Use sstrip from:"
8.21 @@ -44,5 +38,3 @@
8.22 default "2.0a"
8.23
8.24 endif
8.25 -
8.26 -endif
9.1 --- a/kconfig/kconfig.mk Fri Oct 10 08:46:29 2008 +0000
9.2 +++ b/kconfig/kconfig.mk Fri Oct 10 14:30:44 2008 +0000
9.3 @@ -22,19 +22,21 @@
9.4 ARCH_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/arch/*.in)
9.5 KERNEL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/kernel/*.in)
9.6 DEBUG_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/debug/*.in)
9.7 -TOOLS_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in)
9.8 +TOOL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in)
9.9
9.10 STATIC_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config -type f -name '*.in')
9.11 -GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/arch.in \
9.12 - $(CT_TOP_DIR)/config.gen/kernel.in \
9.13 - $(CT_TOP_DIR)/config.gen/debug.in \
9.14 - $(CT_TOP_DIR)/config.gen/tools.in
9.15 +GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/arch.in \
9.16 + $(CT_TOP_DIR)/config.gen/kernel.in \
9.17 + $(CT_TOP_DIR)/config.gen/tools.in \
9.18 + $(CT_TOP_DIR)/config.gen/debug.in
9.19
9.20 CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
9.21
9.22 # Build list of items
9.23 ARCHS = $(patsubst $(CT_LIB_DIR)/config/arch/%.in,%,$(ARCH_CONFIG_FILES))
9.24 KERNELS = $(patsubst $(CT_LIB_DIR)/config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
9.25 +DEBUGS = $(patsubst $(CT_LIB_DIR)/config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
9.26 +TOOLS = $(patsubst $(CT_LIB_DIR)/config/tools/%.in,%,$(TOOL_CONFIG_FILES))
9.27
9.28 $(GEN_CONFIG_FILES): $(CT_TOP_DIR)/config.gen \
9.29 $(CT_LIB_DIR)/kconfig/kconfig.mk
9.30 @@ -84,27 +86,45 @@
9.31 $(CT_TOP_DIR)/config.gen/kernel.in: $(KERNEL_CONFIG_FILES)
9.32 $(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Kernel,KERNEL,config/kernel,$(KERNELS))
9.33
9.34 +# Function build_gen_menu_in:
9.35 +# $1 : destination file
9.36 +# $2 : name of entries family (eg. Tools, Debug...)
9.37 +# $3 : prefix for the menu entries (eg. TOOL, DEBUG)
9.38 +# $4 : base directory containing config files
9.39 +# $5 : list of config entries (eg. for tools: "libelf sstrip"..., and for
9.40 +# debug: "dmalloc duma gdb"...)
9.41 +# Example to build the tools generated config file:
9.42 +# $(call build_gen_menu_in,config.gen/tools.in,Tools,TOOL,config/tools,$(TOOLS))
9.43 +define build_gen_menu_in
9.44 + @echo ' IN $(1)'
9.45 + @(echo "# $(2) facilities menu"; \
9.46 + echo "# Generated file, do not edit!!!"; \
9.47 + echo ""; \
9.48 + for entry in $(5); do \
9.49 + file="$(4)/$${entry}.in"; \
9.50 + _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \
9.51 + echo "menuconfig $(3)_$${_entry}"; \
9.52 + echo " bool"; \
9.53 + printf " prompt \"$${entry}"; \
9.54 + if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \
9.55 + echo " (EXPERIMENTAL)\""; \
9.56 + echo " depends on EXPERIMENTAL"; \
9.57 + else \
9.58 + echo "\""; \
9.59 + fi; \
9.60 + echo "if $(3)_$${_entry}"; \
9.61 + echo "source $${file}"; \
9.62 + echo "endif"; \
9.63 + echo ""; \
9.64 + done; \
9.65 + ) >$(1)
9.66 +endef
9.67 +
9.68 +$(CT_TOP_DIR)/config.gen/tools.in: $(TOOL_CONFIG_FILES)
9.69 + $(call build_gen_menu_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Tools,TOOL,config/tools,$(TOOLS))
9.70 +
9.71 $(CT_TOP_DIR)/config.gen/debug.in: $(DEBUG_CONFIG_FILES)
9.72 - @echo ' IN config.gen/debug.in'
9.73 - @(echo "# Debug facilities menu"; \
9.74 - echo "# Generated file, do not edit!!!"; \
9.75 - echo "menu \"Debug facilities\""; \
9.76 - for f in $(patsubst $(CT_LIB_DIR)/%,%,$(DEBUG_CONFIG_FILES)); do \
9.77 - echo "source $${f}"; \
9.78 - done; \
9.79 - echo "endmenu"; \
9.80 - ) >$@
9.81 -
9.82 -$(CT_TOP_DIR)/config.gen/tools.in: $(TOOLS_CONFIG_FILES)
9.83 - @echo ' IN config.gen/tools.in'
9.84 - @(echo "# Tools facilities menu"; \
9.85 - echo "# Generated file, do not edit!!!"; \
9.86 - echo "menu \"Tools facilities\""; \
9.87 - for f in $(patsubst $(CT_LIB_DIR)/%,%,$(TOOLS_CONFIG_FILES)); do \
9.88 - echo "source $${f}"; \
9.89 - done; \
9.90 - echo "endmenu"; \
9.91 - ) >$@
9.92 + $(call build_gen_menu_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Debug,DEBUG,config/debug,$(DEBUGS))
9.93
9.94 config menuconfig oldconfig defoldconfig: $(KCONFIG_TOP)
9.95
10.1 --- a/scripts/build/debug.sh Fri Oct 10 08:46:29 2008 +0000
10.2 +++ b/scripts/build/debug.sh Fri Oct 10 14:30:44 2008 +0000
10.3 @@ -3,11 +3,15 @@
10.4 # List all debug facilities, and parse their scripts
10.5 CT_DEBUG_FACILITY_LIST=
10.6 for f in "${CT_LIB_DIR}/scripts/build/debug/"*.sh; do
10.7 - is_enabled=
10.8 - . "${f}"
10.9 - f=$(basename "${f}" .sh)
10.10 - if [ "${is_enabled}" = "y" ]; then
10.11 - CT_DEBUG_FACILITY_LIST="${CT_DEBUG_FACILITY_LIST} ${f#???-}"
10.12 + _f="$(basename "${f}" .sh)"
10.13 + _f="${_f#???-}"
10.14 + __f="CT_DEBUG_${_f}"
10.15 + if [ "${!__f}" = "y" ]; then
10.16 + CT_DoLog DEBUG "Enabling debug '${_f}'"
10.17 + . "${f}"
10.18 + CT_DEBUG_FACILITY_LIST="${CT_DEBUG_FACILITY_LIST} ${_f}"
10.19 + else
10.20 + CT_DoLog DEBUG "Disabling debug '${_f}'"
10.21 fi
10.22 done
10.23
11.1 --- a/scripts/build/debug/000-template.sh Fri Oct 10 08:46:29 2008 +0000
11.2 +++ b/scripts/build/debug/000-template.sh Fri Oct 10 14:30:44 2008 +0000
11.3 @@ -1,19 +1,12 @@
11.4 # Template file for a debug utility
11.5
11.6 -# Check here wether your debug tool is enabled or not.
11.7 -# This will get redefined over and over again for each tool, so don't
11.8 -# count on it in the functions below.
11.9 -is_enabled="${CT_FOOBAR}"
11.10 -
11.11 # Small function to print the filename
11.12 # Note that this function gets redefined over and over for each tool
11.13 # It's of no use when building the toolchain proper, but shows all its
11.14 # usefullness when saving the toolchain and building the tarball.
11.15 -# You shall not echo anything if you're not enabled!
11.16 # Echo the name of the file, without the extension, below.
11.17 do_print_filename() {
11.18 # For example:
11.19 - # [ "${CT_FOOBAR}" = "y" ] || return 0
11.20 # echo "foobar-${CT_FOOBAR_VERSION}"
11.21 :
11.22 }
12.1 --- a/scripts/build/debug/100-dmalloc.sh Fri Oct 10 08:46:29 2008 +0000
12.2 +++ b/scripts/build/debug/100-dmalloc.sh Fri Oct 10 14:30:44 2008 +0000
12.3 @@ -1,9 +1,6 @@
12.4 # Build script for the dmalloc debug library facility
12.5
12.6 -is_enabled="${CT_DMALLOC}"
12.7 -
12.8 do_print_filename() {
12.9 - [ "${CT_DMALLOC}" = "y" ] || return 0
12.10 echo "dmalloc-${CT_DMALLOC_VERSION}"
12.11 }
12.12
13.1 --- a/scripts/build/debug/200-duma.sh Fri Oct 10 08:46:29 2008 +0000
13.2 +++ b/scripts/build/debug/200-duma.sh Fri Oct 10 14:30:44 2008 +0000
13.3 @@ -1,9 +1,6 @@
13.4 # Build script for D.U.M.A.
13.5
13.6 -is_enabled="${CT_DUMA}"
13.7 -
13.8 do_print_filename() {
13.9 - [ "${CT_DUMA}" = "y" ] || return 0
13.10 echo "duma_${CT_DUMA_VERSION}"
13.11 }
13.12
14.1 --- a/scripts/build/debug/300-gdb.sh Fri Oct 10 08:46:29 2008 +0000
14.2 +++ b/scripts/build/debug/300-gdb.sh Fri Oct 10 14:30:44 2008 +0000
14.3 @@ -1,9 +1,6 @@
14.4 # Build script for the gdb debug facility
14.5
14.6 -is_enabled="${CT_GDB}"
14.7 -
14.8 do_print_filename() {
14.9 - [ "${CT_GDB}" = "y" ] || return 0
14.10 echo "gdb$(do_debug_gdb_suffix)"
14.11 if [ "${CT_GDB_NATIVE}" = "y" ]; then
14.12 echo "ncurses-${CT_NCURSES_VERSION}"
15.1 --- a/scripts/build/debug/400-ltrace.sh Fri Oct 10 08:46:29 2008 +0000
15.2 +++ b/scripts/build/debug/400-ltrace.sh Fri Oct 10 14:30:44 2008 +0000
15.3 @@ -1,9 +1,6 @@
15.4 # Build script for ltrace
15.5
15.6 -is_enabled="${CT_LTRACE}"
15.7 -
15.8 do_print_filename() {
15.9 - [ "${CT_LTRACE}" = "y" ] || return 0
15.10 echo "ltrace-${CT_LTRACE_VERSION}.orig"
15.11 }
15.12
16.1 --- a/scripts/build/debug/500-strace.sh Fri Oct 10 08:46:29 2008 +0000
16.2 +++ b/scripts/build/debug/500-strace.sh Fri Oct 10 14:30:44 2008 +0000
16.3 @@ -1,9 +1,6 @@
16.4 # Build script for strace
16.5
16.6 -is_enabled="${CT_STRACE}"
16.7 -
16.8 do_print_filename() {
16.9 - [ "${CT_STRACE}" = "y" ] || return 0
16.10 echo "strace-${CT_STRACE_VERSION}"
16.11 }
16.12
17.1 --- a/scripts/build/tools.sh Fri Oct 10 08:46:29 2008 +0000
17.2 +++ b/scripts/build/tools.sh Fri Oct 10 14:30:44 2008 +0000
17.3 @@ -3,11 +3,15 @@
17.4 # List all tools facilities, and parse their scripts
17.5 CT_TOOLS_FACILITY_LIST=
17.6 for f in "${CT_LIB_DIR}/scripts/build/tools/"*.sh; do
17.7 - is_enabled=
17.8 - . "${f}"
17.9 - f=$(basename "${f}" .sh)
17.10 - if [ "${is_enabled}" = "y" ]; then
17.11 - CT_TOOLS_FACILITY_LIST="${CT_TOOLS_FACILITY_LIST} ${f#???-}"
17.12 + _f="$(basename "${f}" .sh)"
17.13 + _f="${_f#???-}"
17.14 + __f="CT_TOOL_${_f}"
17.15 + if [ "${!__f}" = "y" ]; then
17.16 + CT_DoLog DEBUG "Enabling tool '${_f}'"
17.17 + . "${f}"
17.18 + CT_TOOLS_FACILITY_LIST="${CT_TOOLS_FACILITY_LIST} ${_f}"
17.19 + else
17.20 + CT_DoLog DEBUG "Disabling tool '${_f}'"
17.21 fi
17.22 done
17.23
18.1 --- a/scripts/build/tools/000-template.sh Fri Oct 10 08:46:29 2008 +0000
18.2 +++ b/scripts/build/tools/000-template.sh Fri Oct 10 14:30:44 2008 +0000
18.3 @@ -1,19 +1,12 @@
18.4 # Template file for a tool utility
18.5
18.6 -# Check here wether your tool is enabled or not.
18.7 -# This will get redefined over and over again for each tool, so don't
18.8 -# count on it in the functions below.
18.9 -is_enabled="${CT_FOOBAR}"
18.10 -
18.11 # Small function to print the filename
18.12 # Note that this function gets redefined over and over again for each tool.
18.13 # It's of no use when building the toolchain proper, but shows all its
18.14 # usefullness when saving the toolchain and building the tarball.
18.15 -# You shall not echo anything if you're not enabled!
18.16 # Echo the name of the file, without the extension, below.
18.17 do_print_filename() {
18.18 # For example:
18.19 - # [ "{CT_FOOBAR}" = "y" ] || return 0
18.20 # echo "foobar-${CT_FOOBAR_VERSION}"
18.21 :
18.22 }
19.1 --- a/scripts/build/tools/100-libelf.sh Fri Oct 10 08:46:29 2008 +0000
19.2 +++ b/scripts/build/tools/100-libelf.sh Fri Oct 10 14:30:44 2008 +0000
19.3 @@ -1,9 +1,6 @@
19.4 # Build script for libelf
19.5
19.6 -is_enabled="${CT_LIBELF}"
19.7 -
19.8 do_print_filename() {
19.9 - [ "{CT_LIBELF}" = "y" ] || return 0
19.10 echo "libelf-${CT_LIBELF_VERSION}"
19.11 }
19.12
20.1 --- a/scripts/build/tools/200-sstrip.sh Fri Oct 10 08:46:29 2008 +0000
20.2 +++ b/scripts/build/tools/200-sstrip.sh Fri Oct 10 14:30:44 2008 +0000
20.3 @@ -1,7 +1,5 @@
20.4 # This will build and install sstrip to run on host and sstrip target files
20.5
20.6 -is_enabled="${CT_SSTRIP}"
20.7 -
20.8 case "${CT_SSTRIP_FROM}" in
20.9 ELFkickers)
20.10 do_print_filename() {
21.1 --- a/scripts/crosstool.sh Fri Oct 10 08:46:29 2008 +0000
21.2 +++ b/scripts/crosstool.sh Fri Oct 10 14:30:44 2008 +0000
21.3 @@ -362,8 +362,8 @@
21.4 . "${CT_LIB_DIR}/scripts/build/binutils.sh"
21.5 . "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
21.6 . "${CT_LIB_DIR}/scripts/build/cc/${CT_CC}.sh"
21.7 +. "${CT_LIB_DIR}/scripts/build/tools.sh"
21.8 . "${CT_LIB_DIR}/scripts/build/debug.sh"
21.9 -. "${CT_LIB_DIR}/scripts/build/tools.sh"
21.10
21.11 if [ -z "${CT_RESTART}" ]; then
21.12 CT_DoStep INFO "Retrieving needed toolchain components' tarballs"