config/config.mk
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
parent 2529 7e191964d8f2
child 2981 80151a249b85
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
(transplanted from 4cd9134739b594451794cf61a6e1b137422cdafd)
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