mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
Merge pull request #3053 from antonlacon/buildsystem-to-merge
config: Buildsystem cleanup
This commit is contained in:
commit
dc17f6488a
@ -10,7 +10,7 @@
|
|||||||
TARGET_KERNEL_ARCH=x86
|
TARGET_KERNEL_ARCH=x86
|
||||||
|
|
||||||
# setup ARCH specific *FLAGS
|
# setup ARCH specific *FLAGS
|
||||||
TARGET_CFLAGS="-march=$TARGET_CPU -m64"
|
TARGET_CFLAGS="-march=$TARGET_CPU -m64 -mmmx -msse -msse2 -mfpmath=sse"
|
||||||
TARGET_LDFLAGS="-march=$TARGET_CPU -m64"
|
TARGET_LDFLAGS="-march=$TARGET_CPU -m64"
|
||||||
|
|
||||||
# build with SIMD support ( yes / no )
|
# build with SIMD support ( yes / no )
|
||||||
|
@ -456,19 +456,6 @@ init_package_cache() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_path() {
|
|
||||||
local dashes="===========================" path_err_msg
|
|
||||||
if [ "${PWD##/usr}" != "${PWD}" ]; then
|
|
||||||
path_err_msg="\n $dashes$dashes$dashes"
|
|
||||||
path_err_msg="${path_err_msg}\n ERROR: Detected building inside /usr"
|
|
||||||
path_err_msg="${path_err_msg}\n $dashes$dashes$dashes"
|
|
||||||
path_err_msg="${path_err_msg}\n This is not supported with our buildsystem."
|
|
||||||
path_err_msg="${path_err_msg}\n Please use another dir (for example your \$HOME) to build ${DISTRONAME}"
|
|
||||||
|
|
||||||
die "${path_err_msg}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
load_build_config() {
|
load_build_config() {
|
||||||
if [ -d "${1}" -a -f ${1}/.build.conf ]; then
|
if [ -d "${1}" -a -f ${1}/.build.conf ]; then
|
||||||
source ${1}/.build.conf
|
source ${1}/.build.conf
|
||||||
@ -486,6 +473,19 @@ save_build_config() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_path() {
|
||||||
|
local dashes="===========================" path_err_msg
|
||||||
|
if [ "${PWD##/usr}" != "${PWD}" ]; then
|
||||||
|
path_err_msg="\n $dashes$dashes$dashes"
|
||||||
|
path_err_msg="${path_err_msg}\n ERROR: Detected building inside /usr"
|
||||||
|
path_err_msg="${path_err_msg}\n $dashes$dashes$dashes"
|
||||||
|
path_err_msg="${path_err_msg}\n This is not supported with our buildsystem."
|
||||||
|
path_err_msg="${path_err_msg}\n Please use another dir (for example your \$HOME) to build ${DISTRONAME}"
|
||||||
|
|
||||||
|
die "${path_err_msg}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_distro() {
|
check_distro() {
|
||||||
local dashes="===========================" distro_err_msg
|
local dashes="===========================" distro_err_msg
|
||||||
if [ -z "${DISTRO}" -o ! -d "${DISTRO_DIR}/${DISTRO}" ]; then
|
if [ -z "${DISTRO}" -o ! -d "${DISTRO_DIR}/${DISTRO}" ]; then
|
||||||
@ -557,6 +557,7 @@ check_arch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_config() {
|
check_config() {
|
||||||
|
check_path
|
||||||
check_distro
|
check_distro
|
||||||
check_project
|
check_project
|
||||||
check_device
|
check_device
|
||||||
|
116
config/options
116
config/options
@ -1,93 +1,74 @@
|
|||||||
# Do not build as root. Ever.
|
# Do not build as root. Ever.
|
||||||
if [[ $EUID -eq 0 ]]; then
|
if [[ "${EUID}" -eq 0 ]]; then
|
||||||
echo "Building as the root user is NOT supported. Use a regular user account for the build." 1>&2
|
echo "Building as the root user is NOT supported. Use a regular user account for the build." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set default language for buildsystem
|
# set default language for buildsystem
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
|
# set default independent variables
|
||||||
|
ROOT="${PWD}"
|
||||||
|
DISTRO_DIR="${ROOT}/distributions"
|
||||||
|
PROJECT_DIR="${ROOT}/projects"
|
||||||
|
|
||||||
# determines DISTRO, if not forced by user
|
# determines DISTRO, if not forced by user
|
||||||
# default is LibreELEC
|
DISTRO="${DISTRO:-LibreELEC}"
|
||||||
if [ -z "$DISTRO" ]; then
|
|
||||||
DISTRO="LibreELEC"
|
|
||||||
else
|
|
||||||
DISTRO="$DISTRO"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# determines PROJECT, if not forced by user
|
# determines PROJECT, if not forced by user
|
||||||
# default is Generic
|
PROJECT="${PROJECT:-Generic}"
|
||||||
if [ -z "$PROJECT" ]; then
|
|
||||||
PROJECT="Generic"
|
|
||||||
else
|
|
||||||
PROJECT="$PROJECT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# determines TARGET_ARCH, if not forced by user (x86_64 / arm)
|
# determines TARGET_ARCH, if not forced by user
|
||||||
# default is x86_64
|
ARCH="${ARCH:-x86_64}"
|
||||||
if [ -z "$ARCH" ]; then
|
TARGET_ARCH="${ARCH}"
|
||||||
TARGET_ARCH="x86_64"
|
|
||||||
else
|
|
||||||
TARGET_ARCH="$ARCH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ROOT="${PWD}"
|
|
||||||
DISTRO_DIR="$ROOT/distributions"
|
|
||||||
PROJECT_DIR="$ROOT/projects"
|
|
||||||
|
|
||||||
# include helper functions
|
# include helper functions
|
||||||
. config/functions
|
. config/functions
|
||||||
|
|
||||||
# include versioning
|
# read DISTRO version information
|
||||||
. config/version
|
. "${DISTRO_DIR}/${DISTRO}/version" || die "\nERROR: No distro version present\n"
|
||||||
|
|
||||||
# read distro versioning if available
|
# read DISTRO options if available
|
||||||
if [ -f "$DISTRO_DIR/$DISTRO/version" ]; then
|
if [ -f "${DISTRO_DIR}/${DISTRO}/options" ]; then
|
||||||
. $DISTRO_DIR/$DISTRO/version
|
. "${DISTRO_DIR}/${DISTRO}/options"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# read distro options if available
|
# read PROJECT options if available
|
||||||
if [ -f "$DISTRO_DIR/$DISTRO/options" ]; then
|
if [ -f "${PROJECT_DIR}/${PROJECT}/options" ]; then
|
||||||
. $DISTRO_DIR/$DISTRO/options
|
. "${PROJECT_DIR}/${PROJECT}/options"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# read project options if available
|
# read DEVICE options if available
|
||||||
if [ -f "$PROJECT_DIR/$PROJECT/options" ]; then
|
if [ -f "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/options" ]; then
|
||||||
. $PROJECT_DIR/$PROJECT/options
|
. "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/options"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# read board options if available
|
|
||||||
if [ -f "$PROJECT_DIR/$PROJECT/devices/$DEVICE/options" ]; then
|
|
||||||
. $PROJECT_DIR/$PROJECT/devices/$DEVICE/options
|
|
||||||
fi
|
|
||||||
|
|
||||||
# projects can set KERNEL_NAME (kernel.img)
|
# projects can set KERNEL_NAME (kernel.img)
|
||||||
[ -z "$KERNEL_NAME" ] && KERNEL_NAME="KERNEL"
|
KERNEL_NAME="${KERNEL_NAME:-KERNEL}"
|
||||||
|
|
||||||
LINUX_DEPENDS="$PROJECT_DIR/$PROJECT/linux $PROJECT_DIR/$PROJECT/patches/linux $PROJECT_DIR/$PROJECT/packages/linux $ROOT/packages/linux"
|
LINUX_DEPENDS="${PROJECT_DIR}/${PROJECT}/linux ${PROJECT_DIR}/${PROJECT}/patches/linux ${PROJECT_DIR}/${PROJECT}/packages/linux ${ROOT}/packages/linux"
|
||||||
[ -n "$DEVICE" ] && LINUX_DEPENDS+=" $PROJECT_DIR/$PROJECT/devices/$DEVICE/linux $PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/linux $PROJECT_DIR/$PROJECT/devices/$DEVICE/packages/linux"
|
[ -n "${DEVICE}" ] && LINUX_DEPENDS+=" ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/linux ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/patches/linux ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/packages/linux"
|
||||||
[ "$TARGET_ARCH" = "x86_64" ] && LINUX_DEPENDS+=" $ROOT/packages/linux-firmware/intel-ucode $ROOT/packages/linux-firmware/kernel-firmware"
|
[ "${TARGET_ARCH}" = "x86_64" ] && LINUX_DEPENDS+=" ${ROOT}/packages/linux-firmware/intel-ucode ${ROOT}/packages/linux-firmware/kernel-firmware"
|
||||||
|
|
||||||
# Need to point to your actual cc
|
# Need to point to your actual cc
|
||||||
# If you have ccache installed, take care that LOCAL_CC don't point to it
|
# If you have ccache installed, take care that LOCAL_CC does not point to it
|
||||||
[ -z "${LOCAL_CC}" ] && export LOCAL_CC="$(command -v gcc)"
|
[ -z "${LOCAL_CC}" ] && export LOCAL_CC="$(command -v gcc)"
|
||||||
|
|
||||||
if [ -z "$LOCAL_CC" ] ; then
|
if [ -z "${LOCAL_CC}" ]; then
|
||||||
echo "***** Please install gcc *****"
|
die "***** Please install gcc *****" "127"
|
||||||
exit 127
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Need to point to your actual g++
|
# Need to point to your actual g++
|
||||||
# If you have ccache installed, take care that LOCAL_CXX don't point to it
|
# If you have ccache installed, take care that LOCAL_CXX does not point to it
|
||||||
[ -z "${LOCAL_CXX}" ] && export LOCAL_CXX="$(command -v g++)"
|
[ -z "${LOCAL_CXX}" ] && export LOCAL_CXX="$(command -v g++)"
|
||||||
|
|
||||||
# verbose compilation mode (yes/no)
|
# verbose compilation mode (yes/no)
|
||||||
VERBOSE="${VERBOSE:-yes}"
|
VERBOSE="${VERBOSE:-yes}"
|
||||||
|
|
||||||
# Concurrency make level (-j option)
|
# Concurrency make level (-j option)
|
||||||
# Try values between 1 and number of processor cores present.
|
# Try values between 1 and number of processor cores present.
|
||||||
# default: use all cores
|
# default: use all cores
|
||||||
[ -z "${CONCURRENCY_MAKE_LEVEL}" ] && export CONCURRENCY_MAKE_LEVEL=$(nproc)
|
[ -z "${CONCURRENCY_MAKE_LEVEL}" ] && export CONCURRENCY_MAKE_LEVEL=$(nproc)
|
||||||
|
|
||||||
# cache size for ccache
|
# cache size for ccache
|
||||||
# Set the maximum size of the files stored in the cache. You can specify a
|
# Set the maximum size of the files stored in the cache. You can specify a
|
||||||
@ -95,22 +76,21 @@ fi
|
|||||||
# value. The default is gigabytes. The actual value stored is rounded down to
|
# value. The default is gigabytes. The actual value stored is rounded down to
|
||||||
# the nearest multiple of 16 kilobytes. Keep in mind this per project .ccache
|
# the nearest multiple of 16 kilobytes. Keep in mind this per project .ccache
|
||||||
# directory.
|
# directory.
|
||||||
CCACHE_CACHE_SIZE="10G"
|
CCACHE_CACHE_SIZE="10G"
|
||||||
|
|
||||||
# read options from $HOME if available
|
# read options from $HOME if available
|
||||||
if [ -f "$HOME/.libreelec/options" ]; then
|
if [ -f "${HOME}/.libreelec/options" ]; then
|
||||||
. $HOME/.libreelec/options
|
. "${HOME}/.libreelec/options"
|
||||||
fi
|
|
||||||
|
|
||||||
# overwrite OEM_SUPPORT via commandline
|
|
||||||
if [ "$OEM" = yes -o "$OEM" = no ]; then
|
|
||||||
OEM_SUPPORT=$OEM
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z ${_DEBUG_DEPENDS_LIST+x} ] && set_debug_depends
|
# overwrite OEM_SUPPORT via commandline
|
||||||
|
if [ "${OEM}" = "yes" -o "${OEM}" = "no" ]; then
|
||||||
|
OEM_SUPPORT="${OEM}"
|
||||||
|
fi
|
||||||
|
|
||||||
check_path >&2
|
[ -z "${_DEBUG_DEPENDS_LIST+x}" ] && set_debug_depends
|
||||||
check_config >&2
|
|
||||||
|
check_config
|
||||||
|
|
||||||
. config/graphic
|
. config/graphic
|
||||||
. config/path $1
|
. config/path $1
|
||||||
|
@ -129,32 +129,33 @@ show_config() {
|
|||||||
config_message="$config_message\n - Install HFS Tools:\t\t\t $HFSTOOLS"
|
config_message="$config_message\n - Install HFS Tools:\t\t\t $HFSTOOLS"
|
||||||
|
|
||||||
# Kodi configuration
|
# Kodi configuration
|
||||||
|
if [ ! "$MEDIACENTER" = "no" ]; then
|
||||||
|
config_message="$config_message\n\n Kodi configuration:"
|
||||||
|
config_message="$config_message\n $dashes$dashes"
|
||||||
|
|
||||||
config_message="$config_message\n\n Kodi configuration:"
|
config_message="$config_message\n - Kodi version:\t\t\t $MEDIACENTER"
|
||||||
config_message="$config_message\n $dashes$dashes"
|
config_message="$config_message\n - Kodi Blu-Ray support:\t\t $KODI_BLURAY_SUPPORT"
|
||||||
|
if [ "$KODI_BLURAY_SUPPORT" = "yes" ] ; then
|
||||||
|
config_message="$config_message\n - Bluray BD+ support:\t\t $BLURAY_BDPLUS_SUPPORT"
|
||||||
|
config_message="$config_message\n - Bluray AACS support:\t\t $BLURAY_AACS_SUPPORT"
|
||||||
|
fi
|
||||||
|
config_message="$config_message\n - Kodi DVDCSS support:\t\t\t $KODI_DVDCSS_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi Airplay support:\t\t $KODI_AIRPLAY_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi Airtunes support:\t\t $KODI_AIRTUNES_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi NFS support:\t\t\t $KODI_NFS_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi MySQL support:\t\t\t $KODI_MYSQL_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi Optical Drive support:\t\t $KODI_OPTICAL_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi SAMBA client support:\t\t $KODI_SAMBA_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi UPNP support:\t\t\t $KODI_UPNP_SUPPORT"
|
||||||
|
config_message="$config_message\n - Kodi Webserver support:\t\t $KODI_WEBSERVER_SUPPORT"
|
||||||
|
|
||||||
config_message="$config_message\n - Kodi version:\t\t\t $MEDIACENTER"
|
for config_skin in $SKINS; do
|
||||||
config_message="$config_message\n - Kodi Blu-Ray support:\t\t $KODI_BLURAY_SUPPORT"
|
config_message="$config_message\n - Include Skin:\t\t\t $config_skin"
|
||||||
if [ "$KODI_BLURAY_SUPPORT" = "yes" ] ; then
|
done
|
||||||
config_message="$config_message\n - Bluray BD+ support:\t\t $BLURAY_BDPLUS_SUPPORT"
|
|
||||||
config_message="$config_message\n - Bluray AACS support:\t\t $BLURAY_AACS_SUPPORT"
|
config_message="$config_message\n - Default Skin:\t\t\t $SKIN_DEFAULT"
|
||||||
|
config_message="$config_message\n - Include extra fonts:\t\t\t $KODI_EXTRA_FONTS"
|
||||||
fi
|
fi
|
||||||
config_message="$config_message\n - Kodi DVDCSS support:\t\t\t $KODI_DVDCSS_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi Airplay support:\t\t $KODI_AIRPLAY_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi Airtunes support:\t\t $KODI_AIRTUNES_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi NFS support:\t\t\t $KODI_NFS_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi MySQL support:\t\t\t $KODI_MYSQL_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi Optical Drive support:\t\t $KODI_OPTICAL_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi SAMBA client support:\t\t $KODI_SAMBA_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi UPNP support:\t\t\t $KODI_UPNP_SUPPORT"
|
|
||||||
config_message="$config_message\n - Kodi Webserver support:\t\t $KODI_WEBSERVER_SUPPORT"
|
|
||||||
|
|
||||||
for config_skin in $SKINS; do
|
|
||||||
config_message="$config_message\n - Include Skin:\t\t\t $config_skin"
|
|
||||||
done
|
|
||||||
|
|
||||||
config_message="$config_message\n - Default Skin:\t\t\t $SKIN_DEFAULT"
|
|
||||||
config_message="$config_message\n - Include extra fonts:\t\t\t $KODI_EXTRA_FONTS"
|
|
||||||
|
|
||||||
if [ "$(type -t show_distro_config)" = "function" ]; then
|
if [ "$(type -t show_distro_config)" = "function" ]; then
|
||||||
show_distro_config
|
show_distro_config
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
# Sourceforge download site
|
# Sourceforge download site
|
||||||
SOURCEFORGE_SRC="http://prdownloads.sourceforge.net"
|
SOURCEFORGE_SRC="https://prdownloads.sourceforge.net"
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Project CFLAGS
|
# Project CFLAGS
|
||||||
PROJECT_CFLAGS="-mmmx -msse -msse2 -mfpmath=sse"
|
PROJECT_CFLAGS=""
|
||||||
|
|
||||||
# SquashFS compression method (gzip / lzo / xz / zstd)
|
# SquashFS compression method (gzip / lzo / xz / zstd)
|
||||||
SQUASHFS_COMPRESSION="gzip"
|
SQUASHFS_COMPRESSION="gzip"
|
||||||
|
@ -289,7 +289,7 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ]
|
|||||||
cp $ROOT/CHANGELOG* $RELEASE_DIR
|
cp $ROOT/CHANGELOG* $RELEASE_DIR
|
||||||
echo "$TARGET_VERSION" > $RELEASE_DIR/RELEASE
|
echo "$TARGET_VERSION" > $RELEASE_DIR/RELEASE
|
||||||
|
|
||||||
if [ -n "$MEDIACENTER" ]; then
|
if [ ! "$MEDIACENTER" = "no" ]; then
|
||||||
echo "Kodi commit: $(get_pkg_version $MEDIACENTER)" >> $RELEASE_DIR/RELEASE
|
echo "Kodi commit: $(get_pkg_version $MEDIACENTER)" >> $RELEASE_DIR/RELEASE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user