config/config.mk
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Thu Jul 28 22:09:31 2011 +0200 (2011-07-28)
changeset 2573 424fa2092ace
parent 2529 7e191964d8f2
child 2981 80151a249b85
permissions -rw-r--r--
scripts/libc: do not build add-ons by default

Currently, no --enable-add-ons option is passed to libc configure when
"$(do_libc_add_ons_list ,)" is empty, which makes configure automatically search
for present add-ons. In that case, all present add-ons are built, although
no add-on was selected by the user in the config. Moreover, this can make the
configure fail if some non-standard add-ons like eglibc-localedef are present.

This behavior also leads to an inconsistency from a user point of view between
the following cases:
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS="none" in the config,
which makes "$(do_libc_add_ons_list ,)" return "", so all present add-ons
are built.
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS!="none" in the
config, which makes "$(do_libc_add_ons_list ,)" return the add-on supporting
the chosen threading implementation, e.g. "nptl", so only this add-on is
built.

This patch disables the building of all add-ons in that case.

It is still possible to build all present add-ons by adding --enable-add-ons to
LIBC_GLIBC_EXTRA_CONFIG_ARRAY.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
yann@1
     1
# ===========================================================================
yann@945
     2
# crosstool-NG genererated config files
yann@1
     3
# These targets are used from top-level makefile
yann@1
     4
yann@926
     5
#-----------------------------------------------------------
yann@1001
     6
# List all config files, wether sourced or generated
yann@97
     7
yann@945
     8
# The top-level config file to be used be configurators
yann@945
     9
KCONFIG_TOP = config/config.in
yann@945
    10
yann@926
    11
# Build the list of all source config files
yann@1976
    12
STATIC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(shell find $(CT_LIB_DIR)/config -type f \( -name '*.in' -o -name '*.in.2' \) 2>/dev/null))
yann@926
    13
# ... and how to access them:
yann@926
    14
$(STATIC_CONFIG_FILES): config
yann@88
    15
yann@926
    16
# Build a list of per-component-type source config files
yann@1976
    17
ARCH_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
yann@1976
    18
ARCH_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in.2))
yann@1976
    19
KERNEL_CONFIG_FILES   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
yann@1976
    20
KERNEL_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2))
yann@1976
    21
CC_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
yann@1976
    22
CC_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in.2))
yann@1976
    23
LIBC_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
yann@1976
    24
LIBC_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in.2))
yann@1976
    25
DEBUG_CONFIG_FILES    = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
yann@182
    26
yann@926
    27
# Build the list of generated config files
yann@926
    28
GEN_CONFIG_FILES = config.gen/arch.in     \
yann@926
    29
                   config.gen/kernel.in   \
yann@926
    30
                   config.gen/cc.in       \
yann@926
    31
                   config.gen/libc.in     \
yann@926
    32
                   config.gen/debug.in
yann@926
    33
# ... and how to access them:
yann@2537
    34
# Generated files depends on the gen_in_frags script because it has the
yann@2537
    35
# functions needed to build the genrated files, and thus they might need
yann@2537
    36
# re-generation if it changes.
yann@2537
    37
# They also depends on config.mk (this file) because it has the dependency
yann@2537
    38
# rules, and thus they might need re-generation if the deps change.
yann@2537
    39
$(GEN_CONFIG_FILES): config.gen                             \
yann@2537
    40
                     $(CT_LIB_DIR)/scripts/gen_in_frags.sh  \
yann@945
    41
                     $(CT_LIB_DIR)/config/config.mk
yann@182
    42
yann@945
    43
# Helper entry for the configurators
yann@945
    44
PHONY += config_files
yann@945
    45
config_files: $(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
yann@182
    46
yann@926
    47
# Where to access to the source config files from
yann@926
    48
config:
yann@940
    49
	@$(ECHO) "  LN    config"
yann@940
    50
	$(SILENT)ln -s $(CT_LIB_DIR)/config config
yann@926
    51
yann@926
    52
# Where to store the generated config files into
yann@926
    53
config.gen:
yann@940
    54
	@$(ECHO) "  MKDIR config.gen"
yann@940
    55
	$(SILENT)mkdir -p config.gen
yann@926
    56
yann@926
    57
#-----------------------------------------------------------
yann@926
    58
# Build list of per-component-type items to easily build generated files
yann@926
    59
yann@926
    60
ARCHS   = $(patsubst config/arch/%.in,%,$(ARCH_CONFIG_FILES))
yann@926
    61
KERNELS = $(patsubst config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
yann@926
    62
CCS     = $(patsubst config/cc/%.in,%,$(CC_CONFIG_FILES))
yann@926
    63
LIBCS   = $(patsubst config/libc/%.in,%,$(LIBC_CONFIG_FILES))
yann@926
    64
DEBUGS  = $(patsubst config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
yann@926
    65
yann@926
    66
#-----------------------------------------------------------
yann@926
    67
# The rules for the generated config files
yann@916
    68
yann@1976
    69
# WARNING! If a .in file disapears between two runs, that will NOT be detected!
yann@1976
    70
yann@1976
    71
config.gen/arch.in: $(ARCH_CONFIG_FILES) $(ARCH_CONFIG_FILES_2)
yann@2537
    72
	@$(ECHO) '  IN    $(@)'
yann@2537
    73
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target Architecture" "ARCH" "config/arch" "Y" $(ARCHS)
yann@861
    74
yann@1976
    75
config.gen/kernel.in: $(KERNEL_CONFIG_FILES) $(KERNEL_CONFIG_FILES_2)
yann@2537
    76
	@$(ECHO) '  IN    $(@)'
yann@2537
    77
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target OS" "KERNEL" "config/kernel" "Y" $(KERNELS)
yann@182
    78
yann@1976
    79
config.gen/cc.in: $(CC_CONFIG_FILES) $(CC_CONFIG_FILES_2)
yann@2537
    80
	@$(ECHO) '  IN    $(@)'
yann@2537
    81
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C compiler" "CC" "config/cc" "N" $(CCS)
yann@926
    82
yann@1976
    83
config.gen/libc.in: $(LIBC_CONFIG_FILES) $(LIBC_CONFIG_FILES_2)
yann@2537
    84
	@$(ECHO) '  IN    $(@)'
yann@2537
    85
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C library" "LIBC" "config/libc" "Y" $(LIBCS)
yann@926
    86
yann@926
    87
config.gen/debug.in: $(DEBUG_CONFIG_FILES)
yann@2537
    88
	@$(ECHO) '  IN    $(@)'
yann@2537
    89
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh menu "$@" "Debug facilities" "DEBUG" "config/debug" $(DEBUGS)
yann@926
    90
yann@926
    91
#-----------------------------------------------------------
yann@926
    92
# Cleaning up the mess...
yann@926
    93
yann@1
    94
clean::
yann@940
    95
	@$(ECHO) "  CLEAN config"
yann@940
    96
	$(SILENT)rm -f config 2>/dev/null || true
yann@940
    97
	@$(ECHO) "  CLEAN config.gen"
yann@940
    98
	$(SILENT)rm -rf config.gen