scripts/build/companion_libs/libelf.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Apr 11 11:10:06 2010 +0200 (2010-04-11)
changeset 1893 f5dab3c43abf
parent 1892 af092b4bf65c
child 1901 bdb3a98e064b
permissions -rw-r--r--
complibs: don't install in toolchain dir when built as static
     1 # Build script for libelf
     2 
     3 do_libelf_get() { :; }
     4 do_libelf_extract() { :; }
     5 do_libelf() { :; }
     6 do_libelf_target() { :; }
     7 
     8 if [ "${CT_LIBELF}" = "y" -o "${CT_LIBELF_TARGET}" = "y" ]; then
     9 
    10 do_libelf_get() {
    11     # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
    12     # error code if we try to download a file that does not exists there.
    13     # So we have to request the file with an explicit extension.
    14     CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
    15 }
    16 
    17 do_libelf_extract() {
    18     CT_Extract "libelf-${CT_LIBELF_VERSION}"
    19     CT_Patch "libelf-${CT_LIBELF_VERSION}"
    20 }
    21 
    22 if [ "${CT_LIBELF}" = "y" ]; then
    23 
    24 # Uncomment when we need it for gcc-4.5
    25 # WARNING! This function is absolutely UNTESTED yet!
    26 do_libelf() {
    27     : # Remove this line! and uncomment the following lines
    28 #    local -a libelf_opts
    29 #
    30 #    CT_DoStep INFO "Installing libelf"
    31 #    mkdir -p "${CT_BUILD_DIR}/build-libelf"
    32 #    CT_Pushd "${CT_BUILD_DIR}/build-libelf"
    33 #
    34 #    CT_DoLog EXTRA "Configuring libelf"
    35 #
    36 #    if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    37 #        libelf_opts+=( --enable-shared --disable-static )
    38 #    else
    39 #        libelf_opts+=( --disable-shared --enable-static )
    40 #    fi
    41 #
    42 #    CC="${CT_TARGET}-gcc"                                   \
    43 #    CT_DoExecLog ALL                                        \
    44 #    "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    45 #        --build=${CT_BUILD}                                 \
    46 #        --host=${CT_HOST}                                   \
    47 #        --target=${CT_TARGET}                               \
    48 #        --prefix="${CT_COMPLIBS_DIR}"                       \
    49 #        --enable-compat                                     \
    50 #        --enable-elf64                                      \
    51 #        --enable-extended-format                            \
    52 #        "${libelf_opts[@]}"
    53 #
    54 #    CT_DoLog EXTRA "Building libelf"
    55 #    CT_DoExecLog ALL make
    56 #
    57 #    CT_DoLog EXTRA "Installing libelf"
    58 #    CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
    59 #
    60 #    CT_Popd
    61 #    CT_EndStep
    62 }
    63 
    64 fi # CT_LIBELF
    65 
    66 if [ "${CT_LIBELF_TARGET}" = "y" ]; then
    67 
    68 do_libelf_target() {
    69     CT_DoStep INFO "Installing libelf for the target"
    70     mkdir -p "${CT_BUILD_DIR}/build-libelf"
    71     CT_Pushd "${CT_BUILD_DIR}/build-libelf"
    72 
    73     CT_DoLog EXTRA "Configuring libelf"
    74     CC="${CT_TARGET}-gcc"                                   \
    75     CT_DoExecLog ALL                                        \
    76     "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    77         --build=${CT_BUILD}                                 \
    78         --host=${CT_TARGET}                                 \
    79         --target=${CT_TARGET}                               \
    80         --prefix=/usr                                       \
    81         --enable-compat                                     \
    82         --enable-elf64                                      \
    83         --enable-shared                                     \
    84         --enable-extended-format                            \
    85         --enable-static
    86 
    87     CT_DoLog EXTRA "Building libelf"
    88     CT_DoExecLog ALL make
    89 
    90     CT_DoLog EXTRA "Installing libelf"
    91     CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
    92 
    93     CT_Popd
    94     CT_EndStep
    95 }
    96 
    97 fi # CT_LIBELF_TARGET
    98 
    99 fi # CT_LIBELF || CT_LIBELF_TARGET