packages: use target_has_feature

This commit is contained in:
MilhouseVH 2017-10-17 22:56:34 +01:00
parent bae5a9d317
commit c863ecc017
7 changed files with 10 additions and 12 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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
}

View File

@ -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

View File

@ -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"

View File

@ -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"