scripts/build/debug/200-duma.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Sep 30 18:19:18 2008 +0000 (2008-09-30)
changeset 892 187d34a9adf4
parent 669 ca740b4c4262
child 916 68af6b83ff7e
permissions -rw-r--r--
Better handle the second pass core gcc build, differentiating between gcc prior to 4.3 with gcc from 4.3.
Simplify detecting wether gcc is 4.3 and later, or older than 4.3 (we already know from .config).

/trunk/scripts/build/cc/gcc.sh | 22 13 9 0 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
     1 # Build script for D.U.M.A.
     2 
     3 is_enabled="${CT_DUMA}"
     4 
     5 do_print_filename() {
     6     [ "${CT_DUMA}" = "y" ] || return 0
     7     echo "duma_${CT_DUMA_VERSION}"
     8 }
     9 
    10 do_debug_duma_get() {
    11     CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
    12     # D.U.M.A. doesn't separate its name from its version with a dash,
    13     # but with an underscore. Create a link so that crosstool-NG can
    14     # work correctly:
    15     CT_Pushd "${CT_TARBALLS_DIR}"
    16     duma_ext=$(CT_GetFileExtension "duma_${CT_DUMA_VERSION}")
    17     rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
    18     ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
    19     # Downloading from sourceforge leaves garbage, cleanup
    20     rm -f showfiles.php\?group_id\=*
    21     CT_Popd
    22 }
    23 
    24 do_debug_duma_extract() {
    25     CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
    26     cd "${CT_SRC_DIR}"
    27     rm -f "duma-${CT_DUMA_VERSION}"
    28     ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
    29 }
    30 
    31 do_debug_duma_build() {
    32     CT_DoStep INFO "Installing D.U.M.A."
    33     CT_DoLog EXTRA "Copying sources"
    34     cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
    35     CT_Pushd "${CT_BUILD_DIR}/build-duma"
    36 
    37     DUMA_CPP=
    38     [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
    39 
    40     # The shared library needs some love: some version have libduma.so.0.0,
    41     # while others have libduma.so.0.0.0
    42     duma_so=$(make -n -p 2>&1 |egrep '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
    43 
    44     libs=
    45     [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
    46     [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
    47     libs="${libs# }"
    48     CT_DoLog EXTRA "Building libraries '${libs}'"
    49     CT_DoExecLog ALL                    \
    50     make HOSTCC="${CT_CC_NATIVE}"       \
    51          HOSTCXX="${CT_CC_NATIVE}"      \
    52          CC="${CT_TARGET}-gcc"          \
    53          CXX="${CT_TARGET}-gcc"         \
    54          RANLIB="${CT_TARGET}-ranlib"   \
    55          DUMA_CPP="${DUMA_CPP}"         \
    56          ${libs}
    57     CT_DoLog EXTRA "Installing libraries '${libs}'"
    58     CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
    59     if [ "${CT_DUMA_SO}" = "y" ]; then
    60         CT_DoLog EXTRA "Installing shared library link"
    61         ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
    62         CT_DoLog EXTRA "Installing wrapper script"
    63         mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
    64         # Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
    65         sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;'   \
    66             "${CT_LIB_DIR}/scripts/build/debug/duma.in"                     \
    67             >"${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
    68         chmod 755 "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
    69     fi
    70 
    71     CT_Popd
    72     CT_EndStep
    73 }
    74