scripts/build/companion_libs/libelf.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jan 03 23:40:22 2011 +0100 (2011-01-03)
changeset 2267 7af68e6083aa
parent 2216 81b4c0efa46f
child 2332 cc0587459152
permissions -rw-r--r--
libc-glibc: remove 2.3.6

This is an obsolete version which is no longer used by any sample (the only
user, the ia64 sample, has been removed).

It also makes the code path a bit complex, with twists just to accomodate
that version. Removing the version will make those twists go away, and
will ease commonalisation of glibc and eglibc in the future (hopefully!).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     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 do_libelf() {
    25     local -a libelf_opts
    26 
    27     CT_DoStep INFO "Installing libelf"
    28     mkdir -p "${CT_BUILD_DIR}/build-libelf"
    29     CT_Pushd "${CT_BUILD_DIR}/build-libelf"
    30 
    31     CT_DoLog EXTRA "Configuring libelf"
    32 
    33     if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    34         libelf_opts+=( --enable-shared --disable-static )
    35     else
    36         libelf_opts+=( --disable-shared --enable-static )
    37     fi
    38 
    39     CC="${CT_HOST}-gcc"                                     \
    40     CFLAGS="-fPIC"                                          \
    41     CT_DoExecLog CFG                                        \
    42     "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    43         --build=${CT_BUILD}                                 \
    44         --host=${CT_HOST}                                   \
    45         --target=${CT_TARGET}                               \
    46         --prefix="${CT_COMPLIBS_DIR}"                       \
    47         --enable-compat                                     \
    48         --enable-elf64                                      \
    49         --enable-extended-format                            \
    50         "${libelf_opts[@]}"
    51 
    52     CT_DoLog EXTRA "Building libelf"
    53     CT_DoExecLog ALL make
    54 
    55     CT_DoLog EXTRA "Installing libelf"
    56     CT_DoExecLog ALL make install
    57 
    58     CT_Popd
    59     CT_EndStep
    60 }
    61 
    62 fi # CT_LIBELF
    63 
    64 if [ "${CT_LIBELF_TARGET}" = "y" ]; then
    65 
    66 do_libelf_target() {
    67     CT_DoStep INFO "Installing libelf for the target"
    68     mkdir -p "${CT_BUILD_DIR}/build-libelf-for-target"
    69     CT_Pushd "${CT_BUILD_DIR}/build-libelf-for-target"
    70 
    71     CT_DoLog EXTRA "Configuring libelf"
    72     CC="${CT_TARGET}-gcc"                                   \
    73     CFLAGS="-fPIC"                                          \
    74     CT_DoExecLog ALL                                        \
    75     "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    76         --build=${CT_BUILD}                                 \
    77         --host=${CT_TARGET}                                 \
    78         --target=${CT_TARGET}                               \
    79         --prefix=/usr                                       \
    80         --enable-compat                                     \
    81         --enable-elf64                                      \
    82         --enable-shared                                     \
    83         --enable-extended-format                            \
    84         --enable-static
    85 
    86     CT_DoLog EXTRA "Building libelf"
    87     CT_DoExecLog ALL make
    88 
    89     CT_DoLog EXTRA "Installing libelf"
    90     CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
    91 
    92     CT_Popd
    93     CT_EndStep
    94 }
    95 
    96 fi # CT_LIBELF_TARGET
    97 
    98 fi # CT_LIBELF || CT_LIBELF_TARGET