2018-12-22 20:46:13 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
|
|
|
|
2009-03-18 12:02:53 +00:00
|
|
|
set -e
|
|
|
|
|
2011-03-20 22:48:48 +00:00
|
|
|
# setup initial directorys (relative to root)
|
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 21:01:08 +00:00
|
|
|
CONFIG=config
|
|
|
|
SCRIPTS=scripts
|
|
|
|
PACKAGES=packages
|
2017-12-21 14:12:40 +00:00
|
|
|
SOURCES=${SOURCES_DIR:-$ROOT/sources}
|
2019-06-17 17:49:58 +00:00
|
|
|
BUILD_ROOT=${BUILD_DIR:-$ROOT}
|
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 21:01:08 +00:00
|
|
|
BUILD_BASE=build
|
2017-12-21 14:12:40 +00:00
|
|
|
TARGET_IMG=${TARGET_DIR:-$ROOT/target}
|
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 21:01:08 +00:00
|
|
|
ADDONS=addons
|
|
|
|
|
2011-03-20 22:48:48 +00:00
|
|
|
# include ARCH specific options
|
2012-01-30 22:13:30 +00:00
|
|
|
if [ -f config/arch.$TARGET_ARCH ]; then
|
|
|
|
. config/arch.$TARGET_ARCH
|
|
|
|
fi
|
2011-03-20 22:48:48 +00:00
|
|
|
|
2017-10-09 05:18:29 +00:00
|
|
|
[ -z "${HOST_NAME}" ] && export HOST_NAME="$($LOCAL_CC -dumpmachine)"
|
2016-03-11 21:31:41 +00:00
|
|
|
TARGET_NAME=$TARGET_GCC_ARCH-libreelec-linux-gnu${TARGET_ABI}
|
2009-12-19 16:47:50 +00:00
|
|
|
|
2019-06-17 17:49:58 +00:00
|
|
|
BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${LIBREELEC_VERSION}
|
|
|
|
if [ "${LIBREELEC_VERSION}" = "devel" ] ; then
|
|
|
|
BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${OS_VERSION}-${LIBREELEC_VERSION}
|
2015-05-14 16:33:23 +00:00
|
|
|
fi
|
|
|
|
|
2015-01-14 19:42:59 +00:00
|
|
|
if [ -n "$BUILD_SUFFIX" ]; then
|
|
|
|
BUILD=$BUILD-$BUILD_SUFFIX
|
|
|
|
fi
|
|
|
|
|
2019-02-08 17:17:43 +00:00
|
|
|
THREAD_CONTROL=${BUILD}/.threads
|
|
|
|
|
2010-07-19 16:51:57 +00:00
|
|
|
TARGET_ADDONS="$TARGET_IMG/$ADDONS/$ADDON_PATH"
|
2010-07-21 16:43:52 +00:00
|
|
|
ADDON_BUILD="$BUILD/$ADDONS/$1"
|
2010-03-11 00:53:00 +00:00
|
|
|
STAMPS=$BUILD/.stamps
|
2010-11-11 16:05:47 +00:00
|
|
|
STAMPS_INSTALL=$BUILD/image/.stamps
|
2009-03-18 12:02:53 +00:00
|
|
|
DOCS=DOCS
|
|
|
|
TOOLCHAIN=$BUILD/toolchain
|
2017-02-17 06:40:16 +00:00
|
|
|
SYSROOT_PREFIX=$TOOLCHAIN/$TARGET_NAME/sysroot
|
2009-03-18 12:02:53 +00:00
|
|
|
LIB_PREFIX=$SYSROOT_PREFIX/usr
|
2017-02-17 06:40:16 +00:00
|
|
|
TARGET_PREFIX=$TOOLCHAIN/bin/$TARGET_NAME-
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2019-04-03 20:07:18 +00:00
|
|
|
# use ARM toolchain on 64/32 split builds
|
2019-04-03 19:58:32 +00:00
|
|
|
if [ -z "$KERNEL_TOOLCHAIN" -a "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then
|
2020-01-12 21:23:36 +00:00
|
|
|
KERNEL_TOOLCHAIN="aarch64-none-linux-gnu"
|
2018-06-14 05:42:40 +00:00
|
|
|
fi
|
2019-04-03 19:58:32 +00:00
|
|
|
if [ -n "$KERNEL_TOOLCHAIN" ]; then
|
2019-04-03 20:07:18 +00:00
|
|
|
TARGET_KERNEL_PREFIX=$TOOLCHAIN/lib/gcc-arm-$KERNEL_TOOLCHAIN/bin/$KERNEL_TOOLCHAIN-
|
2018-02-14 12:31:57 +00:00
|
|
|
else
|
2018-06-14 05:42:40 +00:00
|
|
|
TARGET_KERNEL_PREFIX=$TARGET_PREFIX
|
2018-02-14 12:31:57 +00:00
|
|
|
fi
|
|
|
|
|
2017-02-17 18:22:41 +00:00
|
|
|
FAKEROOT_SCRIPT=$BUILD/.fakeroot
|
2010-01-15 07:15:35 +00:00
|
|
|
|
2013-07-17 04:12:14 +00:00
|
|
|
if [ -z "$INSTALL" ]; then
|
|
|
|
INSTALL=$BUILD/image/system
|
|
|
|
fi
|
|
|
|
|
2010-12-16 12:44:14 +00:00
|
|
|
. config/sources
|
|
|
|
|
2017-02-17 06:40:16 +00:00
|
|
|
MAKE="$TOOLCHAIN/bin/make"
|
2009-03-18 12:02:53 +00:00
|
|
|
|
|
|
|
XORG_PATH_DRI=/usr/lib/dri
|
|
|
|
XORG_PATH_XKB=/usr/share/X11/xkb
|
|
|
|
XORG_PATH_XKB_OUTPUT=/var/lib/xkb
|
|
|
|
XORG_PATH_RGB=/usr/lib/X11/rgb
|
|
|
|
XORG_PATH_MODULES=/usr/lib/xorg/modules
|
2009-05-18 02:56:09 +00:00
|
|
|
XORG_PATH_DRIVERS=/usr/lib/xorg/modules/drivers
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2011-03-21 20:39:29 +00:00
|
|
|
. config/optimize
|
|
|
|
|
2012-06-06 10:11:30 +00:00
|
|
|
if [ -z "$CCACHE_DIR" ]; then
|
2017-02-17 06:40:16 +00:00
|
|
|
export CCACHE_DIR=$BUILD/.ccache
|
2012-06-06 10:11:30 +00:00
|
|
|
fi
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2017-05-10 21:29:02 +00:00
|
|
|
if [[ -z "$PATH" || ( "$PATH" != "$TOOLCHAIN/bin:$TOOLCHAIN/sbin" && "$PATH" = "${PATH#$TOOLCHAIN/bin:$TOOLCHAIN/sbin:}" ) ]]; then
|
|
|
|
export PATH="$TOOLCHAIN/bin:$TOOLCHAIN/sbin${PATH:+":$PATH"}"
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
|
2018-12-18 03:43:28 +00:00
|
|
|
# redirect formatted output
|
2019-02-08 17:17:43 +00:00
|
|
|
export BUILD_INDENT_SIZE=4
|
|
|
|
SILENT_OUT=3
|
|
|
|
VERBOSE_OUT=4
|
|
|
|
|
|
|
|
if [ "$VERBOSE" = yes ]; then
|
|
|
|
exec 3>&1
|
|
|
|
exec 4>&1
|
|
|
|
else
|
|
|
|
exec 3>&2
|
|
|
|
exec 4>/dev/null
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
2013-07-23 18:28:17 +00:00
|
|
|
|
2018-12-18 03:43:28 +00:00
|
|
|
unset LD_LIBRARY_PATH
|
2017-12-18 11:09:55 +00:00
|
|
|
|
2013-07-23 18:28:17 +00:00
|
|
|
# multilib? nah
|
|
|
|
unset CONFIG_SITE
|
2014-03-05 21:01:34 +00:00
|
|
|
|
2020-04-17 03:08:43 +00:00
|
|
|
# Ignore custom python installs...
|
|
|
|
unset PYTHONHOME PYTHONPATH PYTHONSTARTUP
|
|
|
|
export PYTHONNOUSERSITE=yes #disable PEP 370
|