scripts/build/binutils/elf2flt.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Apr 06 22:30:57 2011 +0200 (2011-04-06)
changeset 2381 0ca0f85a4b2a
parent 2323 ed0725c61fe6
child 2466 b7df125a1c78
permissions -rw-r--r--
complibs: disable building shared libs

Managing the shared version of the companion libraries
has become cumbersome.

Also, it will one day be possible to use the companion
libraries from the host distribution, and then we will
be able to easily use either shared or static libs.

As a side note, while working on the canadian-rework
series, it has become quite more complex to properly
handle shared companion libraries, as they need to be
built both for the build and gost systems. That's not
easy to handle. At all.

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}
    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