From 724cef607cd9fd9bddcebce2f8f594a00a40bd3d Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 25 Nov 2010 18:27:02 +0100 Subject: [PATCH] config/functions: add functions: 'do_autoreconf', 'strip_lto', 'strip_gold', 'strip_linker_plugin' Signed-off-by: Stephan Raue --- config/functions | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/config/functions b/config/functions index 45daaefd9c..3cbdfd7009 100644 --- a/config/functions +++ b/config/functions @@ -5,6 +5,8 @@ setup_toolchain() { fi if [ "$1" = target ]; then + export DESTIMAGE="target" + export CC=$TARGET_CC export CXX=$TARGET_CXX export LD=$TARGET_LD @@ -26,6 +28,8 @@ setup_toolchain() { export CMAKE_CONF=$ROOT/$TOOLCHAIN/etc/cmake-$TARGET_NAME.conf elif [ "$1" = host ]; then + export DESTIMAGE="host" + export AWK=$HOST_AWK export CC=$HOST_CC export CXX=$HOST_CXX @@ -110,3 +114,42 @@ get_version() { TARGET_VERSION="$PROJECT.$TARGET_ARCH-$OPENELEC_VERSION" } + +do_autoreconf() { + if [ -e $ROOT/$TOOLCHAIN/bin/autoreconf ] && + [ -e $ROOT/$TOOLCHAIN/bin/autoconf ] && + [ -e $ROOT/$TOOLCHAIN/bin/automake ] && + [ -e $ROOT/$TOOLCHAIN/bin/libtoolize ] && + [ -e $ROOT/$TOOLCHAIN/bin/intltoolize ]; then + export LIBTOOL=$ROOT/$TOOLCHAIN/bin/libtool + export LIBTOOLIZE=$ROOT/$TOOLCHAIN/bin/libtoolize + export AUTOMAKE=$ROOT/$TOOLCHAIN/bin/automake + export ACLOCAL_DIR=$SYSROOT_PREFIX/usr/share/aclocal + export ACLOCAL="$ROOT/$TOOLCHAIN/bin/aclocal -I $ACLOCAL_DIR" + export AUTOCONF=$ROOT/$TOOLCHAIN/bin/autoconf + export AUTOHEADER=$ROOT/$TOOLCHAIN/bin/autoheader + export AUTORECONF="$ROOT/$TOOLCHAIN/bin/autoreconf -v -f -i -I $ACLOCAL_DIR" + + mkdir -p $ACLOCAL_DIR + autoreconf --verbose --force --install -I $ACLOCAL_DIR $@ + fi +} + +strip_lto() { + # strip out LTO optimization from *FLAGS + CFLAGS=`echo $CFLAGS | sed -e "s|-flto||" -e "s|-fuse-linker-plugin||"` + CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-flto||" -e "s|-fuse-linker-plugin||"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||" -e "s|-fuse-linker-plugin||"` +} + +strip_gold() { + # strip out usage from GOLD linker + LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||"` +} + +strip_linker_plugin() { + # strip out usage from linker plugin + CFLAGS=`echo $CFLAGS | sed -e "s|-fuse-linker-plugin||"` + CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-fuse-linker-plugin||"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-linker-plugin||"` +}