mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 21:56:42 +00:00
Merge pull request #2124 from MilhouseVH/le90_target_has_feature
buildsystem: add TARGET_FEATURES
This commit is contained in:
commit
3d6896f916
@ -191,7 +191,15 @@ get_pkg_variable() {
|
||||
|
||||
# return 0 if $2 in space-separated list $1, otherwise return 1
|
||||
listcontains() {
|
||||
if [ -n "$1" -a -n "$2" ]; then
|
||||
[[ ${1} =~ (^|[[:space:]])${2}($|[[:space:]]) ]] && return 0 || return 1
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
target_has_feature() {
|
||||
listcontains "$TARGET_FEATURES" "$1"
|
||||
}
|
||||
|
||||
install_binary_addon() {
|
||||
|
@ -32,14 +32,12 @@ PKG_AUTORECONF="yes"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="--disable-shared --enable-static --with-sysroot=$SYSROOT_PREFIX"
|
||||
|
||||
if echo "$TARGET_FPU" | grep -q '^neon'; then
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-neon"
|
||||
elif [ "$TARGET_ARCH" = aarch64 ]; then
|
||||
if target_has_feature neon; then
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-neon"
|
||||
elif [ "$TARGET_ARCH" = x86_64 ]; then
|
||||
if echo "$PROJECT_CFLAGS" | grep -q '\-mssse3'; then
|
||||
if target_has_feature ssse3; then
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-ssse3"
|
||||
elif echo "$PROJECT_CFLAGS" | grep -q '\-msse2'; then
|
||||
elif target_has_feature sse2; then
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-sse2"
|
||||
else
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-uint64"
|
||||
|
@ -42,7 +42,7 @@ PKG_CONFIGURE_OPTS_TARGET="--enable-static \
|
||||
--with-ogg=$SYSROOT_PREFIX/usr \
|
||||
--with-gnu-ld"
|
||||
|
||||
if [ $TARGET_ARCH = "x86_64" ]; then
|
||||
if target_has_feature sse; then
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-sse"
|
||||
else
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --disable-sse"
|
||||
|
@ -44,7 +44,7 @@ else
|
||||
fi
|
||||
|
||||
# PulseAudio fails to build on aarch64 when NEON is enabled, so don't enable NEON for aarch64 until upstream supports it
|
||||
if echo "$TARGET_FPU" | grep -q '^neon'; then
|
||||
if [ "$TARGET_ARCH" = "arm" ] && target_has_feature neon; then
|
||||
PULSEAUDIO_NEON="--enable-neon-opt"
|
||||
else
|
||||
PULSEAUDIO_NEON="--disable-neon-opt"
|
||||
|
@ -36,7 +36,7 @@ PKG_LIBPATH="$PKG_LIBNAME"
|
||||
PKG_LIBVAR="DINOTHAWR_LIB"
|
||||
|
||||
pre_make_target() {
|
||||
if echo "$TARGET_FPU" | grep -q '^neon'; then
|
||||
if target_has_feature neon; then
|
||||
export HAVE_NEON=1
|
||||
fi
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ PKG_AUTORECONF="no"
|
||||
PKG_IS_ADDON="yes"
|
||||
PKG_ADDON_TYPE="kodi.gameclient"
|
||||
|
||||
if [ "$DEVICE" == "RPi" ]; then
|
||||
echo "RPi doesn't support neon"
|
||||
if ! target_has_feature neon; then
|
||||
echo "${DEVICE:-${PROJECT}} doesn't support neon"
|
||||
exit 0
|
||||
fi
|
||||
|
@ -154,7 +154,7 @@ else
|
||||
KODI_SSH="-DENABLE_SSH=OFF"
|
||||
fi
|
||||
|
||||
if echo "$TARGET_FPU" | grep -q '^neon' || [[ "$TARGET_ARCH" = "aarch64" ]]; then
|
||||
if target_has_feature neon; then
|
||||
KODI_NEON="-DENABLE_NEON=ON"
|
||||
else
|
||||
KODI_NEON="-DENABLE_NEON=OFF"
|
||||
|
@ -67,7 +67,7 @@ case "$TARGET_ARCH" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if echo "$TARGET_FPU" | grep -q '^neon' || [[ "$TARGET_ARCH" = "aarch64" ]]; then
|
||||
if target_has_feature neon; then
|
||||
FFMPEG_FPU="--enable-neon"
|
||||
else
|
||||
FFMPEG_FPU="--disable-neon"
|
||||
|
@ -11,6 +11,7 @@
|
||||
# (Intel CPUs) atom core2 nocona
|
||||
#
|
||||
TARGET_CPU="x86-64"
|
||||
TARGET_FEATURES="64bit"
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -46,6 +47,7 @@
|
||||
|
||||
# Project CFLAGS
|
||||
PROJECT_CFLAGS="-mmmx -msse -msse2 -mfpmath=sse"
|
||||
TARGET_FEATURES+=" mmx sse sse2"
|
||||
|
||||
# SquashFS compression method (gzip / lzo / xz)
|
||||
SQUASHFS_COMPRESSION="gzip"
|
||||
|
@ -20,6 +20,7 @@
|
||||
#
|
||||
TARGET_CPU="cortex-a53"
|
||||
TARGET_CPU_FLAGS="+crc+fp+simd"
|
||||
TARGET_FEATURES="64bit neon"
|
||||
;;
|
||||
arm)
|
||||
TARGET_KERNEL_ARCH="arm64"
|
||||
@ -28,6 +29,7 @@
|
||||
TARGET_CPU="cortex-a53"
|
||||
TARGET_CPU_FLAGS="+crc"
|
||||
TARGET_FPU="neon-fp-armv8"
|
||||
TARGET_FEATURES="32bit neon"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -38,8 +38,10 @@
|
||||
|
||||
if [ "$DEVICE" = "RPi" -o "$DEVICE" = "Slice" ]; then
|
||||
TARGET_FPU="vfp"
|
||||
TARGET_FEATURES="32bit"
|
||||
elif [ "$DEVICE" = "RPi2" -o "$DEVICE" = "Slice3" ]; then
|
||||
TARGET_FPU="neon-vfpv4"
|
||||
TARGET_FEATURES="32bit neon"
|
||||
fi
|
||||
|
||||
;;
|
||||
|
@ -32,6 +32,7 @@
|
||||
# vfpv3xd vfpv3xd-fp16 neon neon-fp16 vfpv4 vfpv4-d16 fpv4-sp-d16
|
||||
# neon-vfpv4.
|
||||
TARGET_FPU="neon-fp16"
|
||||
TARGET_FEATURES="32bit neon"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#
|
||||
TARGET_CPU="cortex-a53"
|
||||
TARGET_CPU_FLAGS="+crc+fp+simd"
|
||||
TARGET_FEATURES="64bit neon"
|
||||
;;
|
||||
arm)
|
||||
TARGET_KERNEL_ARCH="arm64"
|
||||
@ -28,6 +29,7 @@
|
||||
TARGET_CPU="cortex-a53"
|
||||
TARGET_CPU_FLAGS="+crc"
|
||||
TARGET_FPU="neon-fp-armv8"
|
||||
TARGET_FEATURES="32bit neon"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
# vfpv3xd vfpv3xd-fp16 neon neon-fp16 vfpv4 vfpv4-d16 fpv4-sp-d16
|
||||
# neon-vfpv4.
|
||||
TARGET_FPU="neon-fp16"
|
||||
TARGET_FEATURES="32bit neon"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#
|
||||
TARGET_CPU="cortex-a53"
|
||||
TARGET_CPU_FLAGS="+crc+fp+simd"
|
||||
TARGET_FEATURES="64bit neon"
|
||||
;;
|
||||
arm)
|
||||
TARGET_KERNEL_ARCH="arm64"
|
||||
@ -28,6 +29,7 @@
|
||||
TARGET_CPU="cortex-a53"
|
||||
TARGET_CPU_FLAGS="+crc"
|
||||
TARGET_FPU="neon-fp-armv8"
|
||||
TARGET_FEATURES="32bit neon"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
TARGET_CPU="cortex-a9"
|
||||
TARGET_FLOAT="hard"
|
||||
TARGET_FPU="neon"
|
||||
TARGET_FEATURES="32bit neon"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user