scripts/build/debug/400-ltrace.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 2345 7ac35671d133
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@479
     1
# Build script for ltrace
yann@479
     2
yann@479
     3
do_debug_ltrace_get() {
yann@1687
     4
    CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" .tar.gz               \
yann@1687
     5
               {ftp,http}://ftp.de.debian.org/debian/pool/main/l/ltrace/
yann@479
     6
    # Create a link so that the following steps are easier to do:
yann@1688
     7
    CT_Pushd "${CT_TARBALLS_DIR}"
yann@523
     8
    ltrace_ext=$(CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig")
yann@1687
     9
    ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}"              \
yann@1687
    10
           "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
yann@1688
    11
    CT_Popd
yann@479
    12
}
yann@479
    13
yann@479
    14
do_debug_ltrace_extract() {
yann@1126
    15
    CT_Extract "ltrace-${CT_LTRACE_VERSION}"
yann@1901
    16
    CT_Patch "ltrace" "${CT_LTRACE_VERSION}"
yann@479
    17
}
yann@479
    18
yann@479
    19
do_debug_ltrace_build() {
yann@1820
    20
    local ltrace_host
yann@1820
    21
yann@479
    22
    CT_DoStep INFO "Installing ltrace"
yann@479
    23
yann@973
    24
    CT_DoLog EXTRA "Copying sources to build dir"
yann@1678
    25
    CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}" \
yann@1678
    26
                            "${CT_BUILD_DIR}/build-ltrace"
yann@1678
    27
    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
yann@973
    28
yann@479
    29
    CT_DoLog EXTRA "Configuring ltrace"
jocke@1685
    30
    # ltrace-0.5.3, and later, don't use GNU Autotools configure script anymore
jocke@1685
    31
    if [ "${CT_LTRACE_0_5_3_or_later}" = "y" ]; then
yann@1820
    32
        case "${CT_ARCH}:${CT_ARCH_BITNESS}" in
yann@1821
    33
            x86:32)     ltrace_host="i386";;
yann@1821
    34
            x86:64)     ltrace_host="x86_64";;
yann@1821
    35
            powerpc:*)  ltrace_host="ppc";;
horst@2253
    36
            mips:*)     ltrace_host="mipsel";;
yann@1821
    37
            *)          ltrace_host="${CT_ARCH}";;
yann@1820
    38
        esac
yann@2345
    39
        CT_DoExecLog CFG                \
yann@1820
    40
        CC="${CT_TARGET}-${CT_CC}"      \
titus@2630
    41
        AR="${CT_TARGET}-ar"            \
yann@1820
    42
        HOST="${ltrace_host}"           \
titus@2630
    43
        HOST_OS="${CT_TARGET_KERNEL}"   \
yann@1820
    44
        CFLAGS="${CT_TARGET_CFLAGS}"    \
yann@2345
    45
        ./configure --prefix=/usr
jocke@1685
    46
    else
anthony@2154
    47
        CT_DoExecLog CFG        \
jocke@1685
    48
        ./configure             \
jocke@1685
    49
            --build=${CT_BUILD} \
jocke@1685
    50
            --host=${CT_TARGET} \
jocke@1685
    51
            --prefix=/usr
jocke@1685
    52
    fi
yann@479
    53
yann@479
    54
    CT_DoLog EXTRA "Building ltrace"
yann@669
    55
    CT_DoExecLog ALL make
yann@479
    56
yann@479
    57
    CT_DoLog EXTRA "Installing ltrace"
yann@1219
    58
    CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
yann@479
    59
yann@479
    60
    CT_Popd
yann@479
    61
    CT_EndStep
yann@479
    62
}
yann@479
    63