scripts/build/binutils/elf2flt.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 02 18:26:53 2011 +0200 (2011-08-02)
changeset 2592 4908eb2b6f17
parent 2466 b7df125a1c78
child 2923 60f5ceb1b413
permissions -rw-r--r--
scripts/functions: cvs retrieval first tries the mirror for tarballs

The cvs download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via cvs.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard cvs retrieval will kick in.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 # This file adds functions to build elf2flt
     2 # Copyright 2009 John Williams
     3 # Copyright 2007 Yann E. MORIN
     4 # Licensed under the GPL v2. See COPYING in the root of this package
     5 
     6 # Default: do nothing
     7 do_elf2flt_get()     { :; }
     8 do_elf2flt_extract() { :; }
     9 do_elf2flt()         { :; }
    10 
    11 if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
    12 
    13 # Download elf2flt
    14 do_elf2flt_get() {
    15     CT_GetCVS "elf2flt-cvs-${CT_ELF2FLT_VERSION}"           \
    16               ":pserver:anonymous@cvs.uclinux.org:/var/cvs" \
    17               "elf2flt"                                     \
    18               "" \
    19               "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
    20 }
    21 
    22 # Extract elf2flt
    23 do_elf2flt_extract() {
    24     CT_Extract "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
    25     CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
    26 }
    27 
    28 # Build elf2flt
    29 do_elf2flt() {
    30     mkdir -p "${CT_BUILD_DIR}/build-elf2flt"
    31     cd "${CT_BUILD_DIR}/build-elf2flt"
    32 
    33     CT_DoStep INFO "Installing elf2flt"
    34 
    35     elf2flt_opts=
    36     binutils_bld=${CT_BUILD_DIR}/build-binutils
    37     binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}
    38 
    39     CT_DoLog EXTRA "Configuring elf2flt"
    40     CT_DoExecLog CFG                                            \
    41     CFLAGS="${CT_CFLAGS_FOR_HOST}"                              \
    42     "${CT_SRC_DIR}/elf2flt-cvs-${CT_ELF2FLT_VERSION}/configure" \
    43         --build=${CT_BUILD}                                     \
    44         --host=${CT_HOST}                                       \
    45         --target=${CT_TARGET}                                   \
    46         --prefix=${CT_PREFIX_DIR}                               \
    47         --with-bfd-include-dir=${binutils_bld}/bfd              \
    48         --with-binutils-include-dir=${binutils_src}/include     \
    49         --with-libbfd=${binutils_bld}/bfd/libbfd.a              \
    50         --with-libiberty=${binutils_bld}/libiberty/libiberty.a  \
    51         ${elf2flt_opts}                                         \
    52         "${CT_ELF2FLT_EXTRA_CONFIG_ARRAY[@]}"
    53 
    54     CT_DoLog EXTRA "Building elf2flt"
    55     CT_DoExecLog ALL make ${JOBSFLAGS}
    56 
    57     CT_DoLog EXTRA "Installing elf2flt"
    58     CT_DoExecLog ALL make install
    59 
    60     # Make those new tools available to the core C compilers to come.
    61     # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
    62     # well. Create that.
    63     mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
    64     mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
    65     mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
    66     mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
    67     for t in elf2flt flthdr; do
    68         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
    69         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
    70         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
    71         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
    72     done 2>&1 |CT_DoLog ALL
    73 
    74     CT_EndStep
    75 }
    76 
    77 fi # CT_ARCH_BINFMT_FLAT