scripts/build/tools/100-libelf.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Jun 11 21:45:57 2008 +0000 (2008-06-11)
changeset 554 be6197b5b33b
child 663 3c8d3ef50106
permissions -rw-r--r--
Include the full version number in the directory paths installed.
Change the version string so that it does not break 'make', and so that it has no '/' (it would be a hell if installed directories would mirror the SVN branches... :-/ )
Do not use implicit rules for the Makefile.
Simplify and enc=hance the --local test to refuse (un)installing.
Double-quotes variables, they are based on user input.
Eye-candy in the 'compile' and install messages.

/trunk/configure | 26 14 12 0 ++++++++++---------
/trunk/Makefile.in | 83 45 38 0 +++++++++++++++++++++++++++++++++---------------------------
2 files changed, 59 insertions(+), 50 deletions(-)
     1 # Build script for libelf
     2 
     3 is_enabled="${CT_LIBELF}"
     4 
     5 do_print_filename() {
     6     [ "{CT_LIBELF}" = "y" ] || return 0
     7     echo "libelf-${CT_LIBELF_VERSION}"
     8 }
     9 
    10 do_tools_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_tools_libelf_extract() {
    18     CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
    19 }
    20 
    21 do_tools_libelf_build() {
    22     CT_DoStep INFO "Installing libelf"
    23     mkdir -p "${CT_BUILD_DIR}/build-libelf"
    24     CT_Pushd "${CT_BUILD_DIR}/build-libelf"
    25 
    26     CT_DoLog EXTRA "Configuring libelf"
    27     CC="${CT_TARGET}-gcc"                                   \
    28     "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
    29         --build=${CT_BUILD}                                 \
    30         --host=${CT_TARGET}                                 \
    31         --target=${CT_TARGET}                               \
    32         --prefix=/usr                                       \
    33         --enable-compat                                     \
    34         --enable-elf64                                      \
    35         --enable-shared                                     \
    36         --enable-extended-format                            \
    37         --enable-static                                     2>&1 |CT_DoLog ALL
    38 
    39     CT_DoLog EXTRA "Building libelf"
    40     make    2>&1 |CT_DoLog ALL
    41 
    42     CT_DoLog EXTRA "Installing libelf"
    43     make instroot="${CT_SYSROOT_DIR}" install   2>&1 |CT_DoLog ALL
    44 
    45     CT_Popd
    46     CT_EndStep
    47 }
    48