scripts/build/companion_libs/libelf.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Feb 17 23:41:17 2010 +0100 (2010-02-17)
changeset 1811 35cf5e2f110a
parent 1126 scripts/build/tools/100-libelf.sh@1ab3d2e08c8b
child 1892 af092b4bf65c
permissions -rw-r--r--
comp-libs: make libelf a companion library

When gcc-4.5 is out, it will require libelf. So better make it a
companion library now rather than postponing the ineluctable.
     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!
    28 #    CT_DoStep INFO "Installing libelf"
    29 #    mkdir -p "${CT_BUILD_DIR}/build-libelf"
    30 #    CT_Pushd "${CT_BUILD_DIR}/build-libelf"
    31 #
    32 #    CT_DoLog EXTRA "Configuring libelf"
    33 #    CC="${CT_TARGET}-gcc"                                   \
    34 #    CT_DoExecLog ALL                                        \
    35 #    "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    36 #        --build=${CT_BUILD}                                 \
    37 #        --host=${CT_HOST}                                   \
    38 #        --target=${CT_TARGET}                               \
    39 #        --prefix="${CT_PREFIX_DIR}"                         \
    40 #        --enable-compat                                     \
    41 #        --enable-elf64                                      \
    42 #        --enable-static                                     \
    43 #        --enable-shared                                     \
    44 #        --enable-extended-format
    45 #
    46 #    CT_DoLog EXTRA "Building libelf"
    47 #    CT_DoExecLog ALL make
    48 #
    49 #    CT_DoLog EXTRA "Installing libelf"
    50 #    CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
    51 #
    52 #    CT_Popd
    53 #    CT_EndStep
    54 }
    55 
    56 fi # CT_LIBELF
    57 
    58 if [ "${CT_LIBELF_TARGET}" = "y" ]; then
    59 
    60 do_libelf_target() {
    61     CT_DoStep INFO "Installing libelf for the target"
    62     mkdir -p "${CT_BUILD_DIR}/build-libelf"
    63     CT_Pushd "${CT_BUILD_DIR}/build-libelf"
    64 
    65     CT_DoLog EXTRA "Configuring libelf"
    66     CC="${CT_TARGET}-gcc"                                   \
    67     CT_DoExecLog ALL                                        \
    68     "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    69         --build=${CT_BUILD}                                 \
    70         --host=${CT_TARGET}                                 \
    71         --target=${CT_TARGET}                               \
    72         --prefix=/usr                                       \
    73         --enable-compat                                     \
    74         --enable-elf64                                      \
    75         --enable-shared                                     \
    76         --enable-extended-format                            \
    77         --enable-static
    78 
    79     CT_DoLog EXTRA "Building libelf"
    80     CT_DoExecLog ALL make
    81 
    82     CT_DoLog EXTRA "Installing libelf"
    83     CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
    84 
    85     CT_Popd
    86     CT_EndStep
    87 }
    88 
    89 fi # CT_LIBELF_TARGET
    90 
    91 fi # CT_LIBELF || CT_LIBELF_TARGET