1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| VALGRIND_VER=3.2.0
# Plateforme sur laquelle ce script est execute
HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"
[...]
install_valgrind()
{
#install
cd ${SOURCES}
rm -fr ${SOURCES}/valgrind-${VALGRIND_VER}
bzcat ${DOWNLOADS}/valgrind-${VALGRIND_VER}.tar.bz2 | tar -xvf -
# patch
cd ${SOURCES}/valgrind-${VALGRIND_VER}
mv configure configure.old
sed -e "s@kernel=\`uname -r\`@kernel=\"${KERNEL_VER}\"@g" configure.old > configure
chmod 755 configure
# configure
./configure \
--prefix=${SYSROOT}/usr \
--build=${HOST} \
--host=powerpc-linux \
--enable-only32bit \
--enable-tls \
--without-x
for i in cachegrind/Makefile callgrind/Makefile coregrind/Makefile helgrind/Makefile lackey/Makefile massif/Makefile memcheck/Makefile none/Makefile; do
mv $i $i.old
sed -e 's@for f in \$(noinst_LIBRARIES)@for f in dummy \$(noinst_LIBRARIES)@g' $i.old > $i
done
# build & install
make all install
# little hack to have valgrind to work
cd ${SYSROOT}/
if [ ! -d ./${PREFIX} ]; then
mkdir -p ./${PREFIX}
fi
cd ./${PREFIX}
ln -s / ${TARGET}
#clean
if [ ${CLEAN} == "yes" ]; then
cd ${WORK}
rm -fr ${SOURCES}/valgrind-${VALGRIND_VER}
fi
} |