scripts/build/companion_libs/cloog.sh
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 2757 f070d922facf
child 2854 a70abdbfa342
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@1380
     1
# This file adds the functions to build the CLooG library
yann@1380
     2
# Copyright 2009 Yann E. MORIN
yann@1380
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1380
     4
yann@1380
     5
do_cloog_get() { :; }
yann@1380
     6
do_cloog_extract() { :; }
yann@1380
     7
do_cloog() { :; }
yann@1380
     8
yann@1380
     9
# Overide functions depending on configuration
yann@1808
    10
if [ "${CT_CLOOG}" = "y" ]; then
yann@1380
    11
yann@1380
    12
# Download CLooG
yann@1380
    13
do_cloog_get() {
yann@1380
    14
    CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}"  \
yann@1380
    15
        ftp://gcc.gnu.org/pub/gcc/infrastructure
yann@1380
    16
}
yann@1380
    17
yann@1380
    18
# Extract CLooG
yann@1380
    19
do_cloog_extract() {
yann@1530
    20
    local _t
yann@1530
    21
yann@1530
    22
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1530
    23
    # while versions 0.15.4 onward do have the version in the dirname.
yann@2757
    24
    # But, because the infrastructure properly creates the extracted
yann@2757
    25
    # directories (with tar's --strip-components), we can live safely...
yann@2757
    26
    CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
yann@2757
    27
    CT_Patch "cloog-ppl" "${CT_CLOOG_VERSION}"
yann@2757
    28
yann@2758
    29
    if [ "${CT_CLOOG_NEEDS_AUTORECONF}" = "y" ]; then
yann@2757
    30
        CT_Pushd "${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
yann@2704
    31
        CT_DoExecLog CFG ./autogen.sh
yann@2757
    32
        CT_Popd
yann@2262
    33
    fi
yann@1380
    34
}
yann@1380
    35
yann@1380
    36
do_cloog() {
yann@2757
    37
    local cloog_src_dir="${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
yann@1537
    38
yann@1380
    39
    mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    40
    cd "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    41
yann@1380
    42
    CT_DoStep INFO "Installing CLooG/ppl"
yann@1380
    43
yann@1380
    44
    CT_DoLog EXTRA "Configuring CLooG/ppl"
yann@1892
    45
yann@2349
    46
    CT_DoExecLog CFG                            \
yann@1537
    47
    CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
yann@2381
    48
    LDFLAGS="-lm"                               \
yann@2757
    49
    "${cloog_src_dir}/configure"                \
yann@1537
    50
        --build=${CT_BUILD}                     \
yann@1537
    51
        --host=${CT_HOST}                       \
yann@1893
    52
        --prefix="${CT_COMPLIBS_DIR}"           \
yann@1893
    53
        --with-gmp="${CT_COMPLIBS_DIR}"         \
yann@1893
    54
        --with-ppl="${CT_COMPLIBS_DIR}"         \
yann@1892
    55
        --with-bits=gmp                         \
yann@2381
    56
        --with-host-libstdcxx='-lstdc++'        \
yann@2381
    57
        --disable-shared                        \
yann@2381
    58
        --enable-static
yann@1380
    59
yann@1380
    60
    CT_DoLog EXTRA "Building CLooG/ppl"
yann@2275
    61
    CT_DoExecLog ALL make ${JOBSFLAGS} libcloog.la
yann@1380
    62
yann@1890
    63
    if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
yann@1380
    64
        CT_DoLog EXTRA "Checking CLooG/ppl"
yann@2275
    65
        CT_DoExecLog ALL make ${JOBSFLAGS} -s check
yann@1380
    66
    fi
yann@1380
    67
yann@1380
    68
    CT_DoLog EXTRA "Installing CLooG/ppl"
yann@2199
    69
    CT_DoExecLog ALL make install-libLTLIBRARIES install-pkgincludeHEADERS
yann@1397
    70
yann@1380
    71
    CT_EndStep
yann@1380
    72
}
yann@1380
    73
yann@1808
    74
fi # CT_CLOOG