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(-)
yann@479
     1
# Build script for libelf
yann@479
     2
yann@479
     3
is_enabled="${CT_LIBELF}"
yann@479
     4
yann@479
     5
do_print_filename() {
yann@479
     6
    [ "{CT_LIBELF}" = "y" ] || return 0
yann@479
     7
    echo "libelf-${CT_LIBELF_VERSION}"
yann@479
     8
}
yann@479
     9
yann@479
    10
do_tools_libelf_get() {
yann@479
    11
    # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
yann@479
    12
    # error code if we try to download a file that does not exists there.
yann@479
    13
    # So we have to request the file with an explicit extension.
yann@479
    14
    CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
yann@479
    15
}
yann@479
    16
yann@479
    17
do_tools_libelf_extract() {
yann@479
    18
    CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
yann@479
    19
}
yann@479
    20
yann@479
    21
do_tools_libelf_build() {
yann@479
    22
    CT_DoStep INFO "Installing libelf"
yann@479
    23
    mkdir -p "${CT_BUILD_DIR}/build-libelf"
yann@479
    24
    CT_Pushd "${CT_BUILD_DIR}/build-libelf"
yann@479
    25
yann@479
    26
    CT_DoLog EXTRA "Configuring libelf"
yann@479
    27
    CC="${CT_TARGET}-gcc"                                   \
yann@479
    28
    "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
yann@479
    29
        --build=${CT_BUILD}                                 \
yann@479
    30
        --host=${CT_TARGET}                                 \
yann@479
    31
        --target=${CT_TARGET}                               \
yann@479
    32
        --prefix=/usr                                       \
yann@479
    33
        --enable-compat                                     \
yann@479
    34
        --enable-elf64                                      \
yann@479
    35
        --enable-shared                                     \
yann@479
    36
        --enable-extended-format                            \
yann@479
    37
        --enable-static                                     2>&1 |CT_DoLog ALL
yann@479
    38
yann@479
    39
    CT_DoLog EXTRA "Building libelf"
yann@479
    40
    make    2>&1 |CT_DoLog ALL
yann@479
    41
yann@479
    42
    CT_DoLog EXTRA "Installing libelf"
yann@479
    43
    make instroot="${CT_SYSROOT_DIR}" install   2>&1 |CT_DoLog ALL
yann@479
    44
yann@479
    45
    CT_Popd
yann@479
    46
    CT_EndStep
yann@479
    47
}
yann@479
    48