scripts/build/debug/200-duma.sh
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Tue Jul 31 22:27:29 2012 +0200 (2012-07-31)
changeset 3018 7776e8369284
parent 2867 ef6dad58ab1c
child 3035 cb75966698d7
permissions -rw-r--r--
complibs/cloog: create missing m4 dir

Because we now patch configure.in and configure, the Makefile quicks
in a re-build rule as the source files are now more recent than the
bundled generated files, and that fails because the m4 directory
is missing, although on some systems where aclocal is not installed,
the re-build rule does nothing (except a warning).

Always create tht directory.

Reported-by: Per Arnold Blaasmo <per-arnold.blaasmo@atmel.com>
[Also thanks to Thomas De Schampheleire <patrickdepinguin@gmail.com>
for some digging works on this issue]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
yann@571
     1
# Build script for D.U.M.A.
yann@479
     2
yann@479
     3
do_debug_duma_get() {
yann@2992
     4
    local dl_base
yann@2992
     5
yann@2992
     6
    dl_base="http://dfn.dl.sourceforge.net/project/duma/duma"
yann@2992
     7
    dl_base+="/${CT_DUMA_VERSION//_/.}"
yann@2992
     8
yann@1489
     9
    # Downloading an non-existing file from sourceforge will give you an
yann@1489
    10
    # HTML file containing an error message, instead of returning a 404.
yann@1489
    11
    # Sigh...
yann@2992
    12
    CT_GetFile "duma_${CT_DUMA_VERSION}" .tar.gz "${dl_base}"
yann@1489
    13
    # Downloading from sourceforge may leave garbage, cleanup
yann@1126
    14
    CT_DoExecLog ALL rm -f "${CT_TARBALLS_DIR}/showfiles.php"*
yann@479
    15
}
yann@479
    16
yann@479
    17
do_debug_duma_extract() {
yann@1126
    18
    CT_Extract "duma_${CT_DUMA_VERSION}"
yann@1126
    19
    CT_Pushd "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}"
yann@1901
    20
    CT_Patch nochdir "duma" "${CT_DUMA_VERSION}"
yann@1126
    21
    CT_Popd
yann@479
    22
}
yann@479
    23
yann@479
    24
do_debug_duma_build() {
yann@479
    25
    CT_DoStep INFO "Installing D.U.M.A."
yann@479
    26
    CT_DoLog EXTRA "Copying sources"
yann@1125
    27
    cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
yann@479
    28
    CT_Pushd "${CT_BUILD_DIR}/build-duma"
yann@479
    29
yann@479
    30
    DUMA_CPP=
yann@479
    31
    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
yann@479
    32
yann@571
    33
    # The shared library needs some love: some version have libduma.so.0.0,
yann@571
    34
    # while others have libduma.so.0.0.0
yann@1247
    35
    duma_so=$(make -n -p 2>&1 |grep -E '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
yann@571
    36
yann@479
    37
    libs=
yann@479
    38
    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
yann@571
    39
    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
yann@571
    40
    libs="${libs# }"
yann@571
    41
    CT_DoLog EXTRA "Building libraries '${libs}'"
yann@669
    42
    CT_DoExecLog ALL                    \
yann@1041
    43
    make HOSTCC="${CT_BUILD}-gcc"       \
yann@571
    44
         CC="${CT_TARGET}-gcc"          \
yann@581
    45
         CXX="${CT_TARGET}-gcc"         \
yann@571
    46
         RANLIB="${CT_TARGET}-ranlib"   \
yann@571
    47
         DUMA_CPP="${DUMA_CPP}"         \
yann@669
    48
         ${libs}
yann@571
    49
    CT_DoLog EXTRA "Installing libraries '${libs}'"
yann@669
    50
    CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
yann@479
    51
    if [ "${CT_DUMA_SO}" = "y" ]; then
yann@571
    52
        CT_DoLog EXTRA "Installing shared library link"
yann@571
    53
        ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
yann@571
    54
        CT_DoLog EXTRA "Installing wrapper script"
yann@1219
    55
        mkdir -p "${CT_DEBUGROOT_DIR}/usr/bin"
yann@571
    56
        # Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
yann@635
    57
        sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;'   \
yann@635
    58
            "${CT_LIB_DIR}/scripts/build/debug/duma.in"                     \
yann@1219
    59
            >"${CT_DEBUGROOT_DIR}/usr/bin/duma"
yann@1219
    60
        chmod 755 "${CT_DEBUGROOT_DIR}/usr/bin/duma"
yann@479
    61
    fi
yann@479
    62
yann@571
    63
    CT_Popd
yann@479
    64
    CT_EndStep
yann@479
    65
}
yann@479
    66