2009-03-18 13:02:53 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2011-01-09 21:26:03 +01:00
|
|
|
################################################################################
|
|
|
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
2012-02-29 13:11:22 +01:00
|
|
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
2011-01-09 21:26:03 +01:00
|
|
|
#
|
|
|
|
|
# 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
|
2012-02-29 13:11:22 +01:00
|
|
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
2011-01-09 21:26:03 +01:00
|
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
################################################################################
|
|
|
|
|
|
2010-07-21 18:54:45 +02:00
|
|
|
. config/options $1
|
2009-03-18 13:02:53 +01:00
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
|
echo "usage: $0 package_name"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 22:01:08 +01:00
|
|
|
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
|
2009-03-18 13:02:53 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
unset INSTALL
|
|
|
|
|
|
|
|
|
|
mkdir -p $STAMPS/$1
|
|
|
|
|
STAMP=$STAMPS/$1/build
|
|
|
|
|
|
|
|
|
|
$SCRIPTS/unpack $1
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 22:01:08 +01:00
|
|
|
|
2009-03-18 13:02:53 +01:00
|
|
|
if [ -f $STAMP -a -f $PKG_DIR/need_build ]; then
|
|
|
|
|
$PKG_DIR/need_build $@
|
|
|
|
|
fi
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 22:01:08 +01:00
|
|
|
|
2009-03-18 13:02:53 +01:00
|
|
|
if [ -f $STAMP -a $PKG_DIR/build -nt $STAMP ]; then
|
|
|
|
|
rm -f $STAMP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! -f $STAMP ]; then
|
|
|
|
|
rm -f $STAMP
|
|
|
|
|
|
2012-07-10 17:45:35 +02:00
|
|
|
printf "%${INDENT}c BUILD $1\n" ' '>&$SILENT_OUT
|
2009-03-18 13:02:53 +01:00
|
|
|
export INDENT=$((${INDENT:-1}+$INDENT_SIZE))
|
|
|
|
|
|
2010-07-21 21:31:32 +02:00
|
|
|
for p in $PKG_BUILD_DEPENDS; do
|
|
|
|
|
$SCRIPTS/build $p
|
|
|
|
|
done
|
|
|
|
|
|
2010-11-25 18:30:01 +01:00
|
|
|
[ -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
|
|
|
|
|
|
2009-03-18 13:02:53 +01:00
|
|
|
if [ -f $PKG_DIR/build ]; then
|
|
|
|
|
$PKG_DIR/build $@ >&$VERBOSE_OUT
|
2011-10-15 02:22:29 +02:00
|
|
|
if [ ! "$DEBUG" = yes ]; then
|
2010-05-21 11:00:32 +02:00
|
|
|
$STRIP `find $BUILD/$1* -name "*.so"` 2>/dev/null || \
|
2009-05-18 04:11:55 +02:00
|
|
|
echo "Information: no *.so libs found"
|
2010-05-21 11:00:32 +02:00
|
|
|
$STRIP `find $BUILD/$1* -name "*.so.[0-9]*"` 2>/dev/null ||\
|
2009-05-18 04:11:55 +02:00
|
|
|
echo "Information: no *.so.[0-9]* libs found"
|
2009-05-17 23:13:56 +02:00
|
|
|
fi
|
2009-03-18 13:02:53 +01:00
|
|
|
for i in `find $SYSROOT_PREFIX/usr/lib/ -name "*.la"`; do \
|
|
|
|
|
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
|
|
|
|
|
done
|
2009-05-16 23:35:27 +02:00
|
|
|
elif [ -f $PKG_BUILD/Makefile ]; then
|
2009-03-18 13:02:53 +01:00
|
|
|
$SCRIPTS/build toolchain
|
2009-05-16 23:35:27 +02:00
|
|
|
make -C $PKG_BUILD >&$VERBOSE_OUT
|
2009-03-18 13:02:53 +01:00
|
|
|
for i in `find $SYSROOT_PREFIX/usr/lib/ -name "*.la"`; do \
|
|
|
|
|
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
|
|
|
|
|
done
|
2009-05-16 23:35:27 +02:00
|
|
|
elif [ -f $PKG_BUILD/$1.c ]; then
|
2009-03-18 13:02:53 +01:00
|
|
|
$SCRIPTS/build toolchain
|
2009-05-16 23:35:27 +02:00
|
|
|
make -C $PKG_BUILD $1 >&$VERBOSE_OUT
|
2009-03-18 13:02:53 +01:00
|
|
|
fi
|
|
|
|
|
|
2009-12-19 01:35:31 +01:00
|
|
|
for i in `sed -n "s/^\([^#].*\)=\".*$/\1/p" $PROJECT_DIR/$PROJECT/options | grep -v "#"`; do
|
2009-03-18 13:02:53 +01:00
|
|
|
eval val=\$$i
|
|
|
|
|
echo "STAMP_$i=\"$val\"" >> $STAMP
|
|
|
|
|
done
|
|
|
|
|
fi
|