Lakka/scripts/build
Stephan Raue 071b9cc1be scripts/build: fix stripping of symbols
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2011-10-15 02:22:29 +02:00

91 lines
2.9 KiB
Bash
Executable File

#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. config/options $1
if [ -z "$1" ]; then
echo "usage: $0 package_name"
exit 1
fi
if [ -n "$PKG_ARCH" -a ! "$PKG_ARCH" = "any" ]; then
echo "$PKG_ARCH" | grep -q "$TARGET_ARCH" || exit 0
echo "$PKG_ARCH" | grep -q "\-$TARGET_ARCH" && exit 0
fi
unset INSTALL
mkdir -p $STAMPS/$1
STAMP=$STAMPS/$1/build
$SCRIPTS/unpack $1
if [ -f $STAMP -a -f $PKG_DIR/need_build ]; then
$PKG_DIR/need_build $@
fi
if [ -f $STAMP -a $PKG_DIR/build -nt $STAMP ]; then
rm -f $STAMP
fi
if [ ! -f $STAMP ]; then
rm -f $STAMP
printf "%${INDENT}c BUILD $1\n" >&$SILENT_OUT
export INDENT=$((${INDENT:-1}+$INDENT_SIZE))
for p in $PKG_BUILD_DEPENDS; do
$SCRIPTS/build $p
done
[ -d $BUILD/${PKG_NAME}[-_.]${PKG_VERSION} ] && PKG_BUILD=`ls -d $BUILD/${PKG_NAME}[-_.]${PKG_VERSION}`
[ -d $BUILD/${PKG_NAME}${PKG_VERSION} ] && PKG_BUILD=`ls -d $BUILD/${PKG_NAME}${PKG_VERSION}`
[ "$PKG_AUTORECONF" = yes ] && $SCRIPTS/autoreconf $1
if [ -f $PKG_DIR/build ]; then
$PKG_DIR/build $@ >&$VERBOSE_OUT
if [ ! "$DEBUG" = yes ]; then
$STRIP `find $BUILD/$1* -name "*.so"` 2>/dev/null || \
echo "Information: no *.so libs found"
$STRIP `find $BUILD/$1* -name "*.so.[0-9]*"` 2>/dev/null ||\
echo "Information: no *.so.[0-9]* libs found"
fi
for i in `find $SYSROOT_PREFIX/usr/lib/ -name "*.la"`; do \
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
done
elif [ -f $PKG_BUILD/Makefile ]; then
$SCRIPTS/build toolchain
make -C $PKG_BUILD >&$VERBOSE_OUT
for i in `find $SYSROOT_PREFIX/usr/lib/ -name "*.la"`; do \
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
done
elif [ -f $PKG_BUILD/$1.c ]; then
$SCRIPTS/build toolchain
make -C $PKG_BUILD $1 >&$VERBOSE_OUT
fi
for i in `sed -n "s/^\([^#].*\)=\".*$/\1/p" $PROJECT_DIR/$PROJECT/options | grep -v "#"`; do
eval val=\$$i
echo "STAMP_$i=\"$val\"" >> $STAMP
done
fi