scripts/build/tools/libelf.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Feb 17 22:08:06 2008 +0000 (2008-02-17)
changeset 431 8bde4c6ea47a
permissions -rw-r--r--
Robert P. J. DAY says:

apparently, the patchset for gcc 4.2.1 applies properly to the
source for gcc 4.2.2 and gcc 4.2.3. so, if you want, you can simply
add support for those last two just by augmenting menuconfig and
adding a couple symlinks for those two directories. seems like a
cheap way to add a couple new versions.
yann@245
     1
# Build script for libelf
yann@245
     2
yann@245
     3
is_enabled="${CT_LIBELF}"
yann@245
     4
yann@245
     5
do_print_filename() {
yann@245
     6
    [ "{CT_LIBELF}" = "y" ] || return 0
yann@245
     7
    echo "libelf-${CT_LIBELF_VERSION}"
yann@245
     8
}
yann@245
     9
yann@245
    10
do_tools_libelf_get() {
yann@245
    11
    # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
yann@245
    12
    # error code if we try to download a file that does not exists there.
yann@245
    13
    # So we have to request the file with an explicit extension.
yann@245
    14
    CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
yann@245
    15
}
yann@245
    16
yann@245
    17
do_tools_libelf_extract() {
yann@245
    18
    CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
yann@245
    19
}
yann@245
    20
yann@245
    21
do_tools_libelf_build() {
yann@245
    22
    CT_DoStep INFO "Installing libelf"
yann@245
    23
    mkdir -p "${CT_BUILD_DIR}/build-libelf"
yann@245
    24
    CT_Pushd "${CT_BUILD_DIR}/build-libelf"
yann@245
    25
yann@245
    26
    CT_DoLog EXTRA "Configuring libelf"
yann@245
    27
    CC="${CT_TARGET}-gcc"                                   \
yann@245
    28
    "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
yann@245
    29
        --build=${CT_BUILD}                                 \
yann@245
    30
        --host=${CT_TARGET}                                 \
yann@245
    31
        --target=${CT_TARGET}                               \
yann@245
    32
        --prefix=/usr                                       \
yann@245
    33
        --enable-compat                                     \
yann@245
    34
        --enable-elf64                                      \
yann@245
    35
        --enable-shared                                     \
yann@245
    36
        --enable-extended-format                            \
yann@245
    37
        --enable-static                                     2>&1 |CT_DoLog ALL
yann@245
    38
yann@245
    39
    CT_DoLog EXTRA "Building libelf"
yann@245
    40
    make    2>&1 |CT_DoLog ALL
yann@245
    41
yann@245
    42
    CT_DoLog EXTRA "Installing libelf"
yann@245
    43
    make instroot="${CT_SYSROOT_DIR}" install   2>&1 |CT_DoLog ALL
yann@245
    44
yann@245
    45
    CT_Popd
yann@245
    46
    CT_EndStep
yann@245
    47
}
yann@245
    48