scripts/scripts.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 1618 7f52e1cca71e
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@1101
     1
# Makefile for the scripts/ sub-directory
yann@1101
     2
yann@1101
     3
# Here, we can update the config.* scripts.
yann@1101
     4
# If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those
yann@1101
     5
# scripts for later inclusion mainline. If CT_LIB_DIR != CT_TOP_DIR, then those
yann@1101
     6
# scripts are downloaded only for use in CT_TOP_DIR.
yann@1101
     7
yann@1101
     8
# ----------------------------------------------------------
yann@1101
     9
# The tools help entry
yann@1101
    10
yann@1101
    11
help-distrib::
yann@1101
    12
	@echo  '  updatetools        - Update the config tools'
yann@1101
    13
yann@1101
    14
# ----------------------------------------------------------
yann@1101
    15
# Where to get tools from, and where to store them into
yann@1101
    16
# The tools are: config.guess and config.sub
yann@1101
    17
yann@1101
    18
CONFIG_SUB_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
yann@1101
    19
CONFIG_SUB_DEST=scripts/config.sub
yann@1101
    20
CONFIG_GUESS_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
yann@1101
    21
CONFIG_GUESS_DEST=scripts/config.guess
yann@1101
    22
yann@1101
    23
PHONY += updatetools
yann@1101
    24
updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST)
yann@1101
    25
yann@1101
    26
# ----------------------------------------------------------
yann@1101
    27
# How to retrieve the tools
yann@1101
    28
yann@1101
    29
wget_opt=-o /dev/null
yann@1101
    30
ifeq ($(strip $(V)),2)
yann@1101
    31
  wget_opt=
yann@1101
    32
endif
yann@1101
    33
yann@1101
    34
PHONY += scripts
yann@1101
    35
scripts:
yann@1620
    36
	@$(ECHO) '  MKDIR $@'
yann@1620
    37
	$(SILENT)mkdir -p $@
yann@1101
    38
yann@1618
    39
$(CONFIG_SUB_DEST): scripts FORCE
yann@1101
    40
	@$(ECHO) '  WGET  $@'
yann@1101
    41
	$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_SUB_SRC)
yann@1101
    42
	$(SILENT)chmod u+rwx,go+rx-w $@
yann@1101
    43
yann@1618
    44
$(CONFIG_GUESS_DEST): scripts FORCE
yann@1101
    45
	@$(ECHO) '  WGET  $@'
yann@1101
    46
	$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_GUESS_SRC)
yann@1101
    47
	$(SILENT)chmod u+rwx,go+rx-w $@
yann@1101
    48
yann@1101
    49
# ----------------------------------------------------------
yann@1101
    50
# Clean up the mess
yann@1101
    51
yann@1101
    52
distclean::
yann@1101
    53
	@$(ECHO) "  CLEAN scripts"
yann@1101
    54
	$(SILENT)[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/scripts