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.
3 is_enabled="${CT_DUMA}"
6 [ "${CT_DUMA}" = "y" ] || return 0
7 echo "duma_${CT_DUMA_VERSION}"
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
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\=*
24 do_debug_duma_extract() {
25 CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
27 rm -f "duma-${CT_DUMA_VERSION}"
28 ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
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"
38 [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
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)
45 [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
46 [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
48 CT_DoLog EXTRA "Building libraries '${libs}'"
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}" \
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"