scripts/build/companion_libs/libelf.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Aug 23 14:32:16 2010 +0200 (2010-08-23)
changeset 2100 f9fcfc002c8a
parent 1917 7a489a7b5d55
child 2154 250cdcc86441
permissions -rw-r--r--
debug/gdb: install dependable libs in a generic target static libs dir

For now, ncurses is the only dependable target library built for gdb.
But expat is coming, and there's no reason to install each library in
its own place.

So, install ncurses in a generic directory, where other dependable
libraries can be installed as well.

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     CT_DoExecLog ALL                                        \
    40     "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    41         --build=${CT_BUILD}                                 \
    42         --host=${CT_HOST}                                   \
    43         --target=${CT_TARGET}                               \
    44         --prefix="${CT_COMPLIBS_DIR}"                       \
    45         --enable-compat                                     \
    46         --enable-elf64                                      \
    47         --enable-extended-format                            \
    48         "${libelf_opts[@]}"
    49 
    50     CT_DoLog EXTRA "Building libelf"
    51     CT_DoExecLog ALL make
    52 
    53     CT_DoLog EXTRA "Installing libelf"
    54     CT_DoExecLog ALL make install
    55 
    56     CT_Popd
    57     CT_EndStep
    58 }
    59 
    60 fi # CT_LIBELF
    61 
    62 if [ "${CT_LIBELF_TARGET}" = "y" ]; then
    63 
    64 do_libelf_target() {
    65     CT_DoStep INFO "Installing libelf for the target"
    66     mkdir -p "${CT_BUILD_DIR}/build-libelf-for-target"
    67     CT_Pushd "${CT_BUILD_DIR}/build-libelf-for-target"
    68 
    69     CT_DoLog EXTRA "Configuring libelf"
    70     CC="${CT_TARGET}-gcc"                                   \
    71     CT_DoExecLog ALL                                        \
    72     "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    73         --build=${CT_BUILD}                                 \
    74         --host=${CT_TARGET}                                 \
    75         --target=${CT_TARGET}                               \
    76         --prefix=/usr                                       \
    77         --enable-compat                                     \
    78         --enable-elf64                                      \
    79         --enable-shared                                     \
    80         --enable-extended-format                            \
    81         --enable-static
    82 
    83     CT_DoLog EXTRA "Building libelf"
    84     CT_DoExecLog ALL make
    85 
    86     CT_DoLog EXTRA "Installing libelf"
    87     CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
    88 
    89     CT_Popd
    90     CT_EndStep
    91 }
    92 
    93 fi # CT_LIBELF_TARGET
    94 
    95 fi # CT_LIBELF || CT_LIBELF_TARGET