update external library scripts

This commit is contained in:
Taner Sener 2020-11-22 22:51:45 +00:00
parent 783a6b5b41
commit 4113f64817
232 changed files with 16736 additions and 10531 deletions

View File

@ -21,9 +21,9 @@ FFmpeg kit for applications. Supports Android, iOS, tvOS.
- Concurrent execution
- Exposes both FFmpeg library and FFmpegKit wrapper library capabilities
- Includes cross-compile instructions for 47 open-source libraries
- Includes cross-compile instructions for 48 open-source libraries
`chromaprint`, `expat`, `ffmpeg`, `fontconfig`, `freetype`, `fribidi`, `giflib`, `gmp`, `gnutls`, `kvazaar`, `lame`, `leptonica`, `libaom`, `libass`, `libiconv`, `libilbc`, `libjpeg`, `libjpeg-turbo`, `libogg`, `libpng`, `libsamplerate`, `libsndfile`, `libtheora`, `libuuid`, `libvorbis`, `libvpx`, `libwebp`, `libxml2`, `nettle`, `opencore-amr`, `openh264`, `opus`, `rubberband`, `sdl`, `shine`, `snappy`, `soxr`, `speex`, `tesseract`, `tiff`, `twolame`, `vid.stab`, `vo-amrwbenc`, `wavpack`, `x264`, `x265`, `xvidcore`
`chromaprint`, `expat`, `ffmpeg`, `fontconfig`, `freetype`, `fribidi`, `giflib`, `gmp`, `gnutls`, `harfbuzz`, `kvazaar`, `lame`, `leptonica`, `libaom`, `libass`, `libiconv`, `libilbc`, `libjpeg`, `libjpeg-turbo`, `libogg`, `libpng`, `libsamplerate`, `libsndfile`, `libtheora`, `libuuid`, `libvorbis`, `libvpx`, `libwebp`, `libxml2`, `nettle`, `opencore-amr`, `openh264`, `opus`, `rubberband`, `sdl`, `shine`, `snappy`, `soxr`, `speex`, `tesseract`, `tiff`, `twolame`, `vid.stab`, `vo-amrwbenc`, `wavpack`, `x264`, `x265`, `xvidcore`
- Licensed under LGPL 3.0, can be customized to support GPL v3.0
@ -141,12 +141,12 @@ Please remember that some parts of `FFmpeg` are licensed under the `GPL` and onl
@Override
public void apply(final long executionId, final int returnCode) {
if (rc == RETURN_CODE_SUCCESS) {
if (returnCode == RETURN_CODE_SUCCESS) {
Log.i(Config.TAG, "Async command execution completed successfully.");
} else if (rc == RETURN_CODE_CANCEL) {
} else if (returnCode == RETURN_CODE_CANCEL) {
Log.i(Config.TAG, "Async command execution cancelled by user.");
} else {
Log.i(Config.TAG, String.format("Async command execution failed with rc=%d.", rc));
Log.i(Config.TAG, String.format("Async command execution failed with returnCode=%d.", returnCode));
}
}
});

View File

@ -132,7 +132,7 @@ fi
# PROCESS FULL OPTION AS LAST OPTION
if [[ -n ${BUILD_FULL} ]]; then
for library in {0..57}; do
for library in {0..58}; do
if [ ${GPL_ENABLED} == "yes" ]; then
enable_library "$(get_library_name $library)" 1
else
@ -176,6 +176,9 @@ done
echo -n -e "\nDownloading sources: "
echo -e "INFO: Downloading source code of ffmpeg and enabled external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1
# DOWNLOAD GNU CONFIG
download_gnu_config
# DOWNLOAD LIBRARY SOURCES
downloaded_enabled_library_sources "${ENABLED_LIBRARIES[@]}"
@ -183,7 +186,7 @@ downloaded_enabled_library_sources "${ENABLED_LIBRARIES[@]}"
export ORIGINAL_API=${API}
# BUILD ENABLED LIBRARIES ON ENABLED ARCHITECTURES
for run_arch in {0..10}; do
for run_arch in {0..12}; do
if [[ ${ENABLED_ARCHITECTURES[$run_arch]} -eq 1 ]]; then
if [[ (${run_arch} -eq ${ARCH_ARM64_V8A} || ${run_arch} -eq ${ARCH_X86_64}) && ${API} -lt 21 ]]; then
@ -201,7 +204,7 @@ for run_arch in {0..10}; do
. "${BASEDIR}"/scripts/main-android.sh "${ENABLED_LIBRARIES[@]}" || exit 1
# CLEAR FLAGS
for library in {0..57}; do
for library in {0..58}; do
library_name=$(get_library_name ${library})
unset "$(echo "OK_${library_name}" | sed "s/\-/\_/g")"
unset "$(echo "DEPENDENCY_REBUILT_${library_name}" | sed "s/\-/\_/g")"
@ -272,7 +275,7 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then
fi
# COPY ANDROID ARCHIVE TO PREBUILT DIRECTORY
FFMPEG_KIT_AAR="${BASEDIR}"/prebuilt/android-aar/ffmpeg-kit
FFMPEG_KIT_AAR="${BASEDIR}/prebuilt/$(get_target_aar_directory)/ffmpeg-kit"
rm -rf "${FFMPEG_KIT_AAR}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_KIT_AAR}" 1>>"${BASEDIR}"/build.log 2>&1
cp "${BASEDIR}"/android/app/build/outputs/aar/ffmpeg-kit-release.aar "${FFMPEG_KIT_AAR}"/ffmpeg-kit.aar 1>>"${BASEDIR}"/build.log 2>&1

View File

@ -11,11 +11,22 @@ ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
MY_ARMV7_NEON := true
endif
endif
ifeq ($(TARGET_PLATFORM),android-16)
ifeq ($(MY_ARMV7_NEON), true)
FFMPEG_INCLUDES := $(MY_LOCAL_PATH)/../../prebuilt/android-$(TARGET_ARCH)-neon/ffmpeg/include
MY_BUILD_DIR := android-$(TARGET_ARCH)-neon-lts
else
FFMPEG_INCLUDES := $(MY_LOCAL_PATH)/../../prebuilt/android-$(TARGET_ARCH)/ffmpeg/include
MY_BUILD_DIR := android-$(TARGET_ARCH)-lts
endif
else
ifeq ($(MY_ARMV7_NEON), true)
MY_BUILD_DIR := android-$(TARGET_ARCH)-neon
else
MY_BUILD_DIR := android-$(TARGET_ARCH)
endif
endif
FFMPEG_INCLUDES := $(MY_LOCAL_PATH)/../../prebuilt/$(MY_BUILD_DIR)/ffmpeg/include
MY_ARM_MODE := arm
MY_ARM_NEON := false

View File

@ -1,8 +1,4 @@
ifeq ($(MY_ARMV7_NEON), true)
LOCAL_PATH := $(call my-dir)/../../../prebuilt/android-$(TARGET_ARCH)-neon/cpu-features/lib
else
LOCAL_PATH := $(call my-dir)/../../../prebuilt/android-$(TARGET_ARCH)/cpu-features/lib
endif
LOCAL_PATH := $(call my-dir)/../../../prebuilt/$(MY_BUILD_DIR)/cpu-features/lib
include $(CLEAR_VARS)
LOCAL_ARM_MODE := $(MY_ARM_MODE)

View File

@ -1,4 +1,8 @@
ifeq ($(TARGET_PLATFORM),android-16)
LOCAL_PATH := $(call my-dir)/../../../prebuilt/android-$(TARGET_ARCH)-lts/ffmpeg/lib
else
LOCAL_PATH := $(call my-dir)/../../../prebuilt/android-$(TARGET_ARCH)/ffmpeg/lib
endif
MY_ARM_MODE := arm

View File

@ -1,4 +1,8 @@
ifeq ($(TARGET_PLATFORM),android-16)
LOCAL_PATH := $(call my-dir)/../../../../prebuilt/android-$(TARGET_ARCH)-neon-lts/ffmpeg/lib
else
LOCAL_PATH := $(call my-dir)/../../../../prebuilt/android-$(TARGET_ARCH)-neon/ffmpeg/lib
endif
MY_ARM_MODE := arm
MY_ARM_NEON := true

View File

View File

View File

@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2020 Free Software Foundation, Inc.
timestamp='2020-01-01'
timestamp='2020-11-19'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -27,12 +27,12 @@ timestamp='2020-01-01'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to <config-patches@gnu.org>.
me=`echo "$0" | sed -e 's,.*/,,'`
me=$(echo "$0" | sed -e 's,.*/,,')
usage="\
Usage: $0 [OPTION]
@ -103,7 +103,7 @@ set_cc_for_build() {
test "$tmp" && return 0
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
@ -131,16 +131,14 @@ if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
case "$UNAME_SYSTEM" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
LIBC=unknown
set_cc_for_build
cat <<-EOF > "$dummy.c"
@ -149,18 +147,30 @@ Linux|GNU|GNU/*)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
#elif defined(__GLIBC__)
LIBC=gnu
#else
#include <stdarg.h>
/* First heuristic to detect musl libc. */
#ifdef __DEFINED_va_list
LIBC=musl
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
# If ldd exists, use it to detect musl libc.
if command -v ldd >/dev/null && \
ldd --version 2>&1 | grep -q ^musl
then
# Second heuristic to detect musl libc.
if [ "$LIBC" = unknown ] &&
command -v ldd >/dev/null &&
ldd --version 2>&1 | grep -q ^musl; then
LIBC=musl
fi
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
if [ "$LIBC" = unknown ]; then
LIBC=gnu
fi
;;
esac
@ -179,19 +189,20 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
"/sbin/$sysctl" 2>/dev/null || \
"/usr/sbin/$sysctl" 2>/dev/null || \
echo unknown)`
echo unknown))
case "$UNAME_MACHINE_ARCH" in
aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,')
endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p')
machine="${arch}${endian}"-unknown
;;
*) machine="$UNAME_MACHINE_ARCH"-unknown ;;
@ -222,7 +233,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
case "$UNAME_MACHINE_ARCH" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
;;
esac
# The OS release
@ -235,7 +246,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
release='-gnu'
;;
*)
release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2)
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
@ -244,15 +255,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo "$machine-${os}${release}${abi-}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
exit ;;
*:MidnightBSD:*:*)
@ -288,17 +299,17 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1)
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
@ -336,7 +347,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
@ -370,7 +381,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
if test "$( (/bin/universe) 2>/dev/null)" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
@ -383,17 +394,17 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
case $(/usr/bin/uname -p) in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux"$UNAME_RELEASE"
@ -404,7 +415,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
@ -412,30 +423,30 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
SUN_ARCH=x86_64
fi
fi
echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
case "$(/usr/bin/arch -k)" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
UNAME_RELEASE=$(uname -v)
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos"$UNAME_RELEASE"
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
case "$(/bin/arch)" in
sun3)
echo m68k-sun-sunos"$UNAME_RELEASE"
;;
@ -515,8 +526,8 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
SYSTEM_NAME=$("$dummy" "$dummyarg") &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos"$UNAME_RELEASE"
exit ;;
@ -543,11 +554,11 @@ EOF
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
UNAME_PROCESSOR=$(/usr/bin/uname -p)
if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
[ "$TARGET_BINARY_INTERFACE"x = x ]
if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
test "$TARGET_BINARY_INTERFACE"x = x
then
echo m88k-dg-dgux"$UNAME_RELEASE"
else
@ -571,17 +582,17 @@ EOF
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
if test -x /usr/bin/oslevel ; then
IBM_REV=$(/usr/bin/oslevel)
else
IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
@ -601,7 +612,7 @@ EOF
exit(0);
}
EOF
if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy")
then
echo "$SYSTEM_NAME"
else
@ -614,15 +625,15 @@ EOF
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
if test -x /usr/bin/lslpp ; then
IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
else
IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
@ -650,14 +661,14 @@ EOF
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
case "$UNAME_MACHINE" in
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
if test -x /usr/bin/getconf; then
sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null)
sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)
case "$sc_cpu_version" in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
@ -669,7 +680,7 @@ EOF
esac ;;
esac
fi
if [ "$HP_ARCH" = "" ]; then
if test "$HP_ARCH" = ""; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
@ -704,11 +715,11 @@ EOF
exit (0);
}
EOF
(CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
(CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy")
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ "$HP_ARCH" = hppa2.0w ]
if test "$HP_ARCH" = hppa2.0w
then
set_cc_for_build
@ -732,7 +743,7 @@ EOF
echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
@ -762,7 +773,7 @@ EOF
exit (0);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
@ -782,7 +793,7 @@ EOF
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
if test -x /usr/sbin/sysversion ; then
echo "$UNAME_MACHINE"-unknown-osf1mk
else
echo "$UNAME_MACHINE"-unknown-osf1
@ -831,14 +842,14 @@ EOF
echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)
FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@ -851,25 +862,25 @@ EOF
echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
exit ;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
UNAME_PROCESSOR=$(uname -p)
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
else
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
fi
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
UNAME_PROCESSOR=$(/usr/bin/uname -p)
case "$UNAME_PROCESSOR" in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
exit ;;
i*:CYGWIN*:*)
echo "$UNAME_MACHINE"-pc-cygwin
@ -905,15 +916,15 @@ EOF
echo x86_64-pc-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
*:GNU:*:*)
# the GNU system
echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
exit ;;
*:Minix:*:*)
echo "$UNAME_MACHINE"-unknown-minix
@ -926,7 +937,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@ -1035,7 +1046,7 @@ EOF
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
@ -1055,7 +1066,7 @@ EOF
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in
PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
*) echo hppa-unknown-linux-"$LIBC" ;;
@ -1095,7 +1106,17 @@ EOF
echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
set_cc_for_build
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
then
LIBCABI="$LIBC"x32
fi
fi
echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
exit ;;
xtensa*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@ -1135,7 +1156,7 @@ EOF
echo "$UNAME_MACHINE"-pc-msdosdjgpp
exit ;;
i*86:*:4.*:*)
UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
@ -1144,7 +1165,7 @@ EOF
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
case $(/bin/uname -X | grep "^Machine") in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
@ -1153,10 +1174,10 @@ EOF
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
UNAME_REL=$(sed -n 's/.*Version //p' </usr/options/cb.name)
echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //'))
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
@ -1206,7 +1227,7 @@ EOF
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
&& OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
@ -1217,7 +1238,7 @@ EOF
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
&& OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
@ -1250,7 +1271,7 @@ EOF
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
UNAME_MACHINE=$( (uname -p) 2>/dev/null)
echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
@ -1284,7 +1305,7 @@ EOF
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
if test -d /usr/nec; then
echo mips-nec-sysv"$UNAME_RELEASE"
else
echo mips-unknown-sysv"$UNAME_RELEASE"
@ -1332,8 +1353,11 @@ EOF
*:Rhapsody:*:*)
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
arm64:Darwin:*:*)
echo aarch64-apple-darwin"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p`
UNAME_PROCESSOR=$(uname -p)
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
@ -1346,7 +1370,7 @@ EOF
else
set_cc_for_build
fi
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
@ -1370,7 +1394,7 @@ EOF
echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
UNAME_PROCESSOR=$(uname -p)
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
@ -1438,10 +1462,10 @@ EOF
echo mips-sei-seiux"$UNAME_RELEASE"
exit ;;
*:DragonFly:*:*)
echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
UNAME_MACHINE=$( (uname -p) 2>/dev/null)
case "$UNAME_MACHINE" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@ -1451,7 +1475,7 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')"
exit ;;
i*86:rdos:*:*)
echo "$UNAME_MACHINE"-pc-rdos
@ -1509,7 +1533,7 @@ main ()
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null);
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
@ -1601,7 +1625,7 @@ main ()
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
@ -1626,9 +1650,15 @@ This script (version $timestamp), has failed to recognize the
operating system you are using. If your script is old, overwrite *all*
copies of config.guess and config.sub with the latest versions from:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
and
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
EOF
year=$(echo $timestamp | sed 's,-.*,,')
# shellcheck disable=SC2003
if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then
cat >&2 <<EOF
If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to
@ -1636,26 +1666,27 @@ provide the necessary information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
uname -m = $( (uname -m) 2>/dev/null || echo unknown)
uname -r = $( (uname -r) 2>/dev/null || echo unknown)
uname -s = $( (uname -s) 2>/dev/null || echo unknown)
uname -v = $( (uname -v) 2>/dev/null || echo unknown)
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
/bin/uname -X = $( (/bin/uname -X) 2>/dev/null)
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
hostinfo = $( (hostinfo) 2>/dev/null)
/bin/universe = $( (/bin/universe) 2>/dev/null)
/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null)
/bin/arch = $( (/bin/arch) 2>/dev/null)
/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null)
/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
UNAME_MACHINE = "$UNAME_MACHINE"
UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION"
EOF
fi
exit 1

File diff suppressed because it is too large Load Diff

View File

473
ios.sh
View File

@ -132,12 +132,12 @@ fi
# PROCESS FULL OPTION AS LAST OPTION
if [[ -n ${BUILD_FULL} ]]; then
for library in {0..57}; do
for library in {0..58}; do
if [ ${GPL_ENABLED} == "yes" ]; then
enable_library "$(get_library_name $library)" 1
enable_library "$(get_library_name "$library")" 1
else
if [[ $(is_gpl_licensed $library) -eq 1 ]]; then
enable_library "$(get_library_name $library)" 1
if [[ $(is_gpl_licensed "$library") -eq 1 ]]; then
enable_library "$(get_library_name "$library")" 1
fi
fi
done
@ -150,32 +150,42 @@ if [[ -n ${DISPLAY_HELP} ]]; then
fi
# DISABLE NOT SUPPORTED ARCHITECTURES
disable_architecture_not_supported_on_detected_sdk_version "${ARCH_ARMV7}" "${DETECTED_IOS_SDK_VERSION}"
disable_architecture_not_supported_on_detected_sdk_version "${ARCH_ARMV7S}" "${DETECTED_IOS_SDK_VERSION}"
disable_architecture_not_supported_on_detected_sdk_version "${ARCH_I386}" "${DETECTED_IOS_SDK_VERSION}"
disable_architecture_not_supported_on_detected_sdk_version "${ARCH_ARM64E}" "${DETECTED_IOS_SDK_VERSION}"
disable_architecture_not_supported_on_detected_sdk_version "${ARCH_X86_64_MAC_CATALYST}" "${DETECTED_IOS_SDK_VERSION}"
disable_ios_architecture_not_supported_on_detected_sdk_version "${ARCH_ARMV7}" "${DETECTED_IOS_SDK_VERSION}"
disable_ios_architecture_not_supported_on_detected_sdk_version "${ARCH_ARMV7S}" "${DETECTED_IOS_SDK_VERSION}"
disable_ios_architecture_not_supported_on_detected_sdk_version "${ARCH_I386}" "${DETECTED_IOS_SDK_VERSION}"
disable_ios_architecture_not_supported_on_detected_sdk_version "${ARCH_ARM64E}" "${DETECTED_IOS_SDK_VERSION}"
disable_ios_architecture_not_supported_on_detected_sdk_version "${ARCH_X86_64_MAC_CATALYST}" "${DETECTED_IOS_SDK_VERSION}"
disable_ios_architecture_not_supported_on_detected_sdk_version "${ARCH_ARM64_MAC_CATALYST}" "${DETECTED_IOS_SDK_VERSION}"
disable_ios_architecture_not_supported_on_detected_sdk_version "${ARCH_ARM64_SIMULATOR}" "${DETECTED_IOS_SDK_VERSION}"
# CHECK SOME RULES FOR .xcframework BUNDLES
# 1. DISABLE x86-64-mac-catalyst WHEN x86-64 IS ENABLED IN xcframework BUNDLES
if [[ -z ${FFMPEG_KIT_XCF_BUILD} ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_X86_64}]} -eq 1 ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_X86_64_MAC_CATALYST}]} -eq 1 ]]; then
echo -e "INFO: Disabled x86-64-mac-catalyst architecture which can not co-exist with x86-64 in a framework bundle / universal fat library.\n" 1>>"${BASEDIR}"/build.log 2>&1
disable_arch "x86-64-mac-catalyst"
fi
# 2. DISABLE arm64e WHEN arm64 IS ENABLED IN xcframework BUNDLES
if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_ARM64E}]} -eq 1 ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_ARM64}]} -eq 1 ]]; then
echo -e "INFO: Disabled arm64e architecture which can not co-exist with arm64 in an xcframework bundle.\n" 1>>"${BASEDIR}"/build.log 2>&1
disable_arch "arm64e"
fi
# 3. DO NOT ALLOW --lts AND --xcframework OPTIONS TOGETHER
# 1. DO NOT ALLOW --lts AND --xcframework OPTIONS TOGETHER
if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]] && [[ -n ${FFMPEG_KIT_LTS_BUILD} ]]; then
echo -e "\n(*) LTS packages does not support xcframework bundles.\n"
exit 1
fi
# CHECK SOME RULES FOR .framework BUNDLES
# 1. DISABLE arm64-mac-catalyst WHEN arm64 IS ENABLED IN framework BUNDLES
if [[ -z ${FFMPEG_KIT_XCF_BUILD} ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_ARM64}]} -eq 1 ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_ARM64_MAC_CATALYST}]} -eq 1 ]]; then
echo -e "INFO: Disabled arm64-mac-catalyst architecture which can not co-exist with arm64 in the same framework bundle.\n" 1>>"${BASEDIR}"/build.log 2>&1
disable_arch "arm64-mac-catalyst"
fi
# 2. DISABLE arm64-simulator WHEN arm64 IS ENABLED IN framework BUNDLES
if [[ -z ${FFMPEG_KIT_XCF_BUILD} ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_ARM64}]} -eq 1 ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_ARM64_SIMULATOR}]} -eq 1 ]]; then
echo -e "INFO: Disabled arm64-simulator architecture which can not co-exist with arm64 in the same framework bundle.\n" 1>>"${BASEDIR}"/build.log 2>&1
disable_arch "arm64-simulator"
fi
# 3. DISABLE x86-64-mac-catalyst WHEN x86-64 IS ENABLED IN framework BUNDLES
if [[ -z ${FFMPEG_KIT_XCF_BUILD} ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_X86_64}]} -eq 1 ]] && [[ ${ENABLED_ARCHITECTURES[${ARCH_X86_64_MAC_CATALYST}]} -eq 1 ]]; then
echo -e "INFO: Disabled x86-64-mac-catalyst architecture which can not co-exist with x86-64 in the same framework bundle.\n" 1>>"${BASEDIR}"/build.log 2>&1
disable_arch "x86-64-mac-catalyst"
fi
echo -e "\nBuilding ffmpeg-kit ${BUILD_TYPE_ID}static library for iOS\n"
echo -e -n "INFO: Building ffmpeg-kit ${BUILD_VERSION} ${BUILD_TYPE_ID}for iOS: " 1>>"${BASEDIR}"/build.log 2>&1
echo -e "$(date)\n" 1>>"${BASEDIR}"/build.log 2>&1
@ -190,7 +200,7 @@ print_redownload_requested_libraries
# VALIDATE GPL FLAGS
for gpl_library in {$LIBRARY_X264,$LIBRARY_XVIDCORE,$LIBRARY_X265,$LIBRARY_LIBVIDSTAB,$LIBRARY_RUBBERBAND}; do
if [[ ${ENABLED_LIBRARIES[$gpl_library]} -eq 1 ]]; then
library_name=$(get_library_name ${gpl_library})
library_name=$(get_library_name "${gpl_library}")
if [ ${GPL_ENABLED} != "yes" ]; then
echo -e "\n(*) Invalid configuration detected. GPL library ${library_name} enabled without --enable-gpl flag.\n"
@ -203,6 +213,9 @@ done
echo -n -e "\nDownloading sources: "
echo -e "INFO: Downloading source code of ffmpeg and enabled external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1
# DOWNLOAD GNU CONFIG
download_gnu_config
# DOWNLOAD LIBRARY SOURCES
downloaded_enabled_library_sources "${ENABLED_LIBRARIES[@]}"
@ -210,421 +223,51 @@ downloaded_enabled_library_sources "${ENABLED_LIBRARIES[@]}"
TARGET_ARCH_LIST=()
# BUILD ENABLED LIBRARIES ON ENABLED ARCHITECTURES
for run_arch in {0..10}; do
for run_arch in {0..12}; do
if [[ ${ENABLED_ARCHITECTURES[$run_arch]} -eq 1 ]]; then
export ARCH=$(get_arch_name $run_arch)
export TARGET_SDK=$(get_target_sdk)
export ARCH=$(get_arch_name "$run_arch")
export FULL_ARCH=$(get_full_arch_name "$run_arch")
export SDK_PATH=$(get_sdk_path)
export SDK_NAME=$(get_sdk_name)
export LIPO="$(xcrun --sdk "$(get_sdk_name)" -f lipo)"
# EXECUTE MAIN BUILD SCRIPT
. "${BASEDIR}"/scripts/main-ios.sh "${ENABLED_LIBRARIES[@]}"
case ${ARCH} in
x86-64)
TARGET_ARCH="x86_64"
;;
x86-64-mac-catalyst)
TARGET_ARCH="x86_64-mac-catalyst"
;;
*)
TARGET_ARCH="${ARCH}"
;;
esac
TARGET_ARCH_LIST+=("${TARGET_ARCH}")
TARGET_ARCH_LIST+=("${FULL_ARCH}")
# CLEAR FLAGS
for library in {0..57}; do
library_name=$(get_library_name ${library})
for library in {0..58}; do
library_name=$(get_library_name "${library}")
unset "$(echo "OK_${library_name}" | sed "s/\-/\_/g")"
unset "$(echo "DEPENDENCY_REBUILT_${library_name}" | sed "s/\-/\_/g")"
done
fi
done
FFMPEG_LIBS="libavcodec libavdevice libavfilter libavformat libavutil libswresample libswscale"
# BUILD STATIC LIBRARIES
BUILD_LIBRARY_EXTENSION="a"
# BUILD FFMPEG-KIT
if [[ -n ${TARGET_ARCH_LIST[0]} ]]; then
# INITIALIZE TARGET FOLDERS
initialize_prebuilt_ios_folders
# PREPARE PLATFORM ARCHITECTURE STRINGS
build_apple_architecture_variant_strings
if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]]; then
echo -e -n "\n\nCreating xcframeworks under prebuilt: "
echo -e -n "\n\nCreating universal libraries and xcframeworks under prebuilt: "
rm -rf "${BASEDIR}/prebuilt/ios-xcframework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${BASEDIR}/prebuilt/ios-xcframework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
create_universal_libraries_for_ios_xcframeworks
create_frameworks_for_ios_xcframeworks
create_ios_xcframeworks
else
echo -e -n "\n\nCreating frameworks and universal libraries under prebuilt: "
echo -e -n "\n\nCreating universal libraries and frameworks under prebuilt: "
rm -rf "${BASEDIR}/prebuilt/ios-universal" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${BASEDIR}/prebuilt/ios-universal" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
rm -rf "${BASEDIR}/prebuilt/ios-framework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${BASEDIR}/prebuilt/ios-framework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
create_universal_libraries_for_ios_default_frameworks
create_ios_default_frameworks
fi
# CREATE ENABLED LIBRARY PACKAGES. IT IS EITHER
# .framework and fat/universal library
# OR
# .xcframework
for library in {0..57}; do
if [[ ${ENABLED_LIBRARIES[$library]} -eq 1 ]]; then
library_name=$(get_library_name ${library})
package_config_file_name=$(get_package_config_file_name ${library})
# EACH ENABLED LIBRARY HAS TO HAVE A .pc FILE AND A VERSION
library_version=$(get_external_library_version "${package_config_file_name}")
if [[ -z ${library_version} ]]; then
echo -e "Failed to detect version for ${library_name} from ${package_config_file_name}.pc\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "failed\n"
exit 1
fi
echo -e "Creating external library package for ${library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1
# SOME CUSTOM CODE TO HANDLE LIBRARIES THAT PRODUCE MULTIPLE LIBRARY FILES
if [[ ${LIBRARY_LIBTHEORA} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libtheora" "libtheora.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libtheoraenc" "libtheoraenc.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libtheoradec" "libtheoradec.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_LIBVORBIS} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libvorbisfile" "libvorbisfile.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libvorbisenc" "libvorbisenc.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libvorbis" "libvorbis.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_LIBWEBP} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libwebpmux" "libwebpmux.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libwebpdemux" "libwebpdemux.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libwebp" "libwebp.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_OPENCOREAMR} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libopencore-amrnb" "libopencore-amrnb.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_NETTLE} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libnettle" "libnettle.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libhogweed" "libhogweed.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
else
# LIBRARIES WHICH HAVE ONLY ONE LIBRARY FILE ARE CREATED HERE
library_name=$(get_library_name $((library)))
static_archive_name=$(get_static_archive_name $((library)))
LIBRARY_CREATED=$(create_external_library_package $library "$library_name" "$static_archive_name" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
fi
fi
done
# CREATE FFMPEG & FFMPEG KIT PACKAGES
if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]]; then
# CREATE .xcframework BUNDLE IF ENABLED
# CREATE FFMPEG
for FFMPEG_LIB in ${FFMPEG_LIBS}; do
# INITIALIZE FFMPEG FRAMEWORK DIRECTORY
XCFRAMEWORK_PATH=${BASEDIR}/prebuilt/ios-xcframework/${FFMPEG_LIB}.xcframework
mkdir -p "${XCFRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
echo -e "Creating package for ${FFMPEG_LIB}\n" 1>>"${BASEDIR}"/build.log 2>&1
BUILD_COMMAND="xcodebuild -create-xcframework "
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
# arm64e NOT INCLUDED IN .xcframework BUNDLES
if [[ ${TARGET_ARCH} != "arm64e" ]]; then
FFMPEG_LIB_UPPERCASE=$(echo "${FFMPEG_LIB}" | tr '[a-z]' '[A-Z]')
FFMPEG_LIB_CAPITALCASE=$(to_capital_case "${FFMPEG_LIB}")
# EXTRACT FFMPEG VERSION
FFMPEG_LIB_MAJOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR" "${BASEDIR}/prebuilt/ios-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR//g;s/\ //g")
FFMPEG_LIB_MINOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR" "${BASEDIR}/prebuilt/ios-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR//g;s/\ //g")
FFMPEG_LIB_MICRO=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO" "${BASEDIR}/prebuilt/ios-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/version.h" | sed "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO//g;s/\ //g")
FFMPEG_LIB_VERSION="${FFMPEG_LIB_MAJOR}.${FFMPEG_LIB_MINOR}.${FFMPEG_LIB_MICRO}"
# INITIALIZE SUB-FRAMEWORK DIRECTORY
FFMPEG_LIB_FRAMEWORK_PATH=${BASEDIR}/prebuilt/ios-xcframework/.tmp/ios-${TARGET_ARCH}/${FFMPEG_LIB}.framework
rm -rf "${FFMPEG_LIB_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIB_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/ios-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/* ${FFMPEG_LIB_FRAMEWORK_PATH}/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${BASEDIR}/prebuilt/ios-${TARGET_ARCH}/ffmpeg/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_LIB_FRAMEWORK_PATH}/${FFMPEG_LIB}" 1>>"${BASEDIR}"/build.log 2>&1
# COPY THE LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}/LICENSE.GPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}/LICENSE.LGPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
fi
build_info_plist "${FFMPEG_LIB_FRAMEWORK_PATH}/Info.plist" "${FFMPEG_LIB}" "com.arthenica.ffmpegkit.${FFMPEG_LIB_CAPITALCASE}" "${FFMPEG_LIB_VERSION}" "${FFMPEG_LIB_VERSION}"
BUILD_COMMAND+=" -framework ${FFMPEG_LIB_FRAMEWORK_PATH}"
fi
done
BUILD_COMMAND+=" -output ${XCFRAMEWORK_PATH}"
# EXECUTE CREATE FRAMEWORK COMMAND
COMMAND_OUTPUT=$(${BUILD_COMMAND} 2>&1)
echo "${COMMAND_OUTPUT}" 1>>"${BASEDIR}"/build.log 2>&1
echo "" 1>>"${BASEDIR}"/build.log 2>&1
# DO NOT ALLOW EMPTY FRAMEWORKS
if [[ ${COMMAND_OUTPUT} == *"is empty in library"* ]]; then
echo -e "failed\n"
exit 1
fi
echo -e "Created ${FFMPEG_LIB} xcframework successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
done
# CREATE FFMPEG
# INITIALIZE FFMPEG KIT FRAMEWORK DIRECTORY
XCFRAMEWORK_PATH=${BASEDIR}/prebuilt/ios-xcframework/ffmpegkit.xcframework
mkdir -p "${XCFRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
BUILD_COMMAND="xcodebuild -create-xcframework "
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
# arm64e NOT INCLUDED IN .xcframework BUNDLES
if [[ ${TARGET_ARCH} != "arm64e" ]]; then
# INITIALIZE SUB-FRAMEWORK DIRECTORY
FFMPEG_KIT_FRAMEWORK_PATH="${BASEDIR}/prebuilt/ios-xcframework/.tmp/ios-${TARGET_ARCH}/ffmpegkit.framework"
rm -rf "${FFMPEG_KIT_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
build_modulemap "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules/module.modulemap"
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/ios-"${TARGET_ARCH}"/ffmpeg-kit/include/* "${FFMPEG_KIT_FRAMEWORK_PATH}"/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${BASEDIR}/prebuilt/ios-${TARGET_ARCH}/ffmpeg-kit/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_KIT_FRAMEWORK_PATH}/ffmpegkit" 1>>"${BASEDIR}"/build.log 2>&1
# COPY THE LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}/LICENSE.GPLv3" "${FFMPEG_KIT_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}/LICENSE.LGPLv3" "${FFMPEG_KIT_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
fi
BUILD_COMMAND+=" -framework ${FFMPEG_KIT_FRAMEWORK_PATH}"
fi
done
BUILD_COMMAND+=" -output ${XCFRAMEWORK_PATH}"
# EXECUTE CREATE FRAMEWORK COMMAND
COMMAND_OUTPUT=$(${BUILD_COMMAND} 2>&1)
echo "${COMMAND_OUTPUT}" 1>>"${BASEDIR}"/build.log 2>&1
echo "" 1>>"${BASEDIR}"/build.log 2>&1
# DO NOT ALLOW EMPTY FRAMEWORKS
if [[ ${COMMAND_OUTPUT} == *"is empty in library"* ]]; then
echo -e "failed\n"
exit 1
fi
echo -e "Created ffmpegkit xcframework successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "ok\n"
else
# CREATE .framework AND FAT/UNIVERSAL LIBRARY IF ENABLED
# CREATE FFMPEG
# INITIALIZE UNIVERSAL LIBRARY DIRECTORY
FFMPEG_UNIVERSAL="${BASEDIR}/prebuilt/ios-universal/ffmpeg-universal"
mkdir -p "${FFMPEG_UNIVERSAL}/include" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_UNIVERSAL}/lib" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/ios-"${TARGET_ARCH_LIST[0]}"/ffmpeg/include/* ${FFMPEG_UNIVERSAL}/include 1>>"${BASEDIR}"/build.log 2>&1
cp "${BASEDIR}"/prebuilt/ios-"${TARGET_ARCH_LIST[0]}"/ffmpeg/include/config.h "${FFMPEG_UNIVERSAL}/include" 1>>"${BASEDIR}"/build.log 2>&1
for FFMPEG_LIB in ${FFMPEG_LIBS}; do
LIPO_COMMAND="${LIPO} -create"
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
LIPO_COMMAND+=" "${BASEDIR}"/prebuilt/ios-${TARGET_ARCH}/ffmpeg/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}"
done
LIPO_COMMAND+=" -output ${FFMPEG_UNIVERSAL}/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}"
# EXECUTE CREATE UNIVERSAL LIBRARY COMMAND
${LIPO_COMMAND} 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -ne 0 ]; then
echo -e "failed\n"
exit 1
fi
FFMPEG_LIB_UPPERCASE=$(echo "${FFMPEG_LIB}" | tr '[a-z]' '[A-Z]')
FFMPEG_LIB_CAPITALCASE=$(to_capital_case "${FFMPEG_LIB}")
# EXTRACT FFMPEG VERSION
FFMPEG_LIB_MAJOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR" "${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR//g;s/\ //g")
FFMPEG_LIB_MINOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR" "${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR//g;s/\ //g")
FFMPEG_LIB_MICRO=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO" "${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/version.h" | sed "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO//g;s/\ //g")
FFMPEG_LIB_VERSION="${FFMPEG_LIB_MAJOR}.${FFMPEG_LIB_MINOR}.${FFMPEG_LIB_MICRO}"
# INITIALIZE FRAMEWORK DIRECTORY
FFMPEG_LIB_FRAMEWORK_PATH="${BASEDIR}/prebuilt/ios-framework/${FFMPEG_LIB}.framework"
rm -rf "${FFMPEG_LIB_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIB_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# COPY HEADER FILES
cp -r ${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/* ${FFMPEG_LIB_FRAMEWORK_PATH}/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${FFMPEG_UNIVERSAL}/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_LIB_FRAMEWORK_PATH}/${FFMPEG_LIB}" 1>>"${BASEDIR}"/build.log 2>&1
# COPY FRAMEWORK LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}/LICENSE.GPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}/LICENSE.LGPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
fi
build_info_plist "${FFMPEG_LIB_FRAMEWORK_PATH}/Info.plist" "${FFMPEG_LIB}" "com.arthenica.ffmpegkit.${FFMPEG_LIB_CAPITALCASE}" "${FFMPEG_LIB_VERSION}" "${FFMPEG_LIB_VERSION}"
echo -e "Created ${FFMPEG_LIB} framework successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
done
# COPY UNIVERSAL LIBRARY LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}"/LICENSE.GPLv3 "${FFMPEG_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}"/LICENSE.LGPLv3 "${FFMPEG_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
fi
# FFMPEG KIT
# INITIALIZE FRAMEWORK AND UNIVERSAL LIBRARY DIRECTORIES
FFMPEG_KIT_VERSION=$(get_ffmpeg_kit_version)
FFMPEG_KIT_UNIVERSAL="${BASEDIR}/prebuilt/ios-universal/ffmpeg-kit-universal"
FFMPEG_KIT_FRAMEWORK_PATH="${BASEDIR}/prebuilt/ios-framework/ffmpegkit.framework"
mkdir -p "${FFMPEG_KIT_UNIVERSAL}/include" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_KIT_UNIVERSAL}/lib" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
rm -rf "${FFMPEG_KIT_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
LIPO_COMMAND="${LIPO} -create"
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
LIPO_COMMAND+=" ${BASEDIR}/prebuilt/ios-${TARGET_ARCH}/ffmpeg-kit/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}"
done
LIPO_COMMAND+=" -output ${FFMPEG_KIT_UNIVERSAL}/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}"
# EXECUTE CREATE UNIVERSAL LIBRARY COMMAND
${LIPO_COMMAND} 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -ne 0 ]; then
echo -e "failed\n"
exit 1
fi
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/ios-"${TARGET_ARCH_LIST[0]}"/ffmpeg-kit/include/* "${FFMPEG_KIT_UNIVERSAL}"/include 1>>"${BASEDIR}"/build.log 2>&1
cp -r "${FFMPEG_KIT_UNIVERSAL}"/include/* "${FFMPEG_KIT_FRAMEWORK_PATH}"/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${FFMPEG_KIT_UNIVERSAL}/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_KIT_FRAMEWORK_PATH}/ffmpegkit" 1>>"${BASEDIR}"/build.log 2>&1
# COPY THE LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}"/LICENSE.GPLv3 "${FFMPEG_KIT_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
cp "${BASEDIR}"/LICENSE.GPLv3 "${FFMPEG_KIT_FRAMEWORK_PATH}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}"/LICENSE.LGPLv3 "${FFMPEG_KIT_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
cp "${BASEDIR}"/LICENSE.LGPLv3 "${FFMPEG_KIT_FRAMEWORK_PATH}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
fi
build_info_plist "${FFMPEG_KIT_FRAMEWORK_PATH}/Info.plist" "ffmpegkit" "com.arthenica.ffmpegkit.FFmpegKit" "${FFMPEG_KIT_VERSION}" "${FFMPEG_KIT_VERSION}"
build_modulemap "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules/module.modulemap"
echo -e "Created ffmpegkit.framework and universal library successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "ok\n"
fi
fi

421
macos.sh
View File

@ -82,7 +82,7 @@ while [ ! $# -eq 0 ]; do
FFMPEG_KIT_XCF_BUILD="1"
;;
-f | --force)
BUILD_FORCE="1"
export BUILD_FORCE="1"
;;
--reconf-*)
CONF_LIBRARY=$(echo $1 | sed -e 's/^--[A-Za-z]*-//g')
@ -132,12 +132,12 @@ fi
# PROCESS FULL OPTION AS LAST OPTION
if [[ -n ${BUILD_FULL} ]]; then
for library in {0..57}; do
for library in {0..58}; do
if [ ${GPL_ENABLED} == "yes" ]; then
enable_library "$(get_library_name $library)" 1
enable_library "$(get_library_name "$library")" 1
else
if [[ $(is_gpl_licensed $library) -eq 1 ]]; then
enable_library "$(get_library_name $library)" 1
if [[ $(is_gpl_licensed "$library") -eq 1 ]]; then
enable_library "$(get_library_name "$library")" 1
fi
fi
done
@ -149,6 +149,9 @@ if [[ -n ${DISPLAY_HELP} ]]; then
exit 0
fi
# DISABLE NOT SUPPORTED ARCHITECTURES
disable_macos_architecture_not_supported_on_detected_sdk_version "${ARCH_ARM64}" "${DETECTED_MACOS_SDK_VERSION}"
# CHECK SOME RULES FOR .xcframework BUNDLES
# 1. DO NOT ALLOW --lts AND --xcframework OPTIONS TOGETHER
@ -171,7 +174,7 @@ print_redownload_requested_libraries
# VALIDATE GPL FLAGS
for gpl_library in {$LIBRARY_X264,$LIBRARY_XVIDCORE,$LIBRARY_X265,$LIBRARY_LIBVIDSTAB,$LIBRARY_RUBBERBAND}; do
if [[ ${ENABLED_LIBRARIES[$gpl_library]} -eq 1 ]]; then
library_name=$(get_library_name ${gpl_library})
library_name=$(get_library_name "${gpl_library}")
if [ ${GPL_ENABLED} != "yes" ]; then
echo -e "\n(*) Invalid configuration detected. GPL library ${library_name} enabled without --enable-gpl flag.\n"
@ -184,6 +187,9 @@ done
echo -n -e "\nDownloading sources: "
echo -e "INFO: Downloading source code of ffmpeg and enabled external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1
# DOWNLOAD GNU CONFIG
download_gnu_config
# DOWNLOAD LIBRARY SOURCES
downloaded_enabled_library_sources "${ENABLED_LIBRARIES[@]}"
@ -191,410 +197,51 @@ downloaded_enabled_library_sources "${ENABLED_LIBRARIES[@]}"
TARGET_ARCH_LIST=()
# BUILD ENABLED LIBRARIES ON ENABLED ARCHITECTURES
for run_arch in {0..10}; do
for run_arch in {0..12}; do
if [[ ${ENABLED_ARCHITECTURES[$run_arch]} -eq 1 ]]; then
export ARCH=$(get_arch_name $run_arch)
export TARGET_SDK=$(get_target_sdk)
export ARCH=$(get_arch_name "$run_arch")
export FULL_ARCH=$(get_full_arch_name "$run_arch")
export SDK_PATH=$(get_sdk_path)
export SDK_NAME=$(get_sdk_name)
export LIPO="$(xcrun --sdk "$(get_sdk_name)" -f lipo)"
# EXECUTE MAIN BUILD SCRIPT
. "${BASEDIR}"/scripts/main-macos.sh "${ENABLED_LIBRARIES[@]}"
case ${ARCH} in
x86-64)
TARGET_ARCH="x86_64"
;;
*)
TARGET_ARCH="${ARCH}"
;;
esac
TARGET_ARCH_LIST+=("${TARGET_ARCH}")
TARGET_ARCH_LIST+=("${FULL_ARCH}")
# CLEAR FLAGS
for library in {0..57}; do
library_name=$(get_library_name ${library})
for library in {0..58}; do
library_name=$(get_library_name "${library}")
unset "$(echo "OK_${library_name}" | sed "s/\-/\_/g")"
unset "$(echo "DEPENDENCY_REBUILT_${library_name}" | sed "s/\-/\_/g")"
done
fi
done
FFMPEG_LIBS="libavcodec libavdevice libavfilter libavformat libavutil libswresample libswscale"
# BUILD STATIC LIBRARIES
BUILD_LIBRARY_EXTENSION="a"
# BUILD FFMPEG-KIT
if [[ -n ${TARGET_ARCH_LIST[0]} ]]; then
# INITIALIZE TARGET FOLDERS
initialize_prebuilt_macos_folders
# PREPARE PLATFORM ARCHITECTURE STRINGS
build_apple_architecture_variant_strings
if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]]; then
echo -e -n "\n\nCreating xcframeworks under prebuilt: "
echo -e -n "\n\nCreating universal libraries and xcframeworks under prebuilt: "
rm -rf "${BASEDIR}/prebuilt/macos-xcframework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${BASEDIR}/prebuilt/macos-xcframework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
create_universal_libraries_for_macos_xcframeworks
create_frameworks_for_macos_xcframeworks
create_macos_xcframeworks
else
echo -e -n "\n\nCreating frameworks and universal libraries under prebuilt: "
echo -e -n "\n\nCreating universal libraries and frameworks under prebuilt: "
rm -rf "${BASEDIR}/prebuilt/macos-universal" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${BASEDIR}/prebuilt/macos-universal" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
rm -rf "${BASEDIR}/prebuilt/macos-framework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${BASEDIR}/prebuilt/macos-framework" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
create_universal_libraries_for_macos_default_frameworks
create_macos_default_frameworks
fi
# CREATE ENABLED LIBRARY PACKAGES. IT IS EITHER
# .framework and fat/universal library
# OR
# .xcframework
for library in {0..57}; do
if [[ ${ENABLED_LIBRARIES[$library]} -eq 1 ]]; then
library_name=$(get_library_name ${library})
package_config_file_name=$(get_package_config_file_name ${library})
# EACH ENABLED LIBRARY HAS TO HAVE A .pc FILE AND A VERSION
library_version=$(get_external_library_version "${package_config_file_name}")
if [[ -z ${library_version} ]]; then
echo -e "Failed to detect version for ${library_name} from ${package_config_file_name}.pc\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "failed\n"
exit 1
fi
echo -e "Creating external library package for ${library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1
# SOME CUSTOM CODE TO HANDLE LIBRARIES THAT PRODUCE MULTIPLE LIBRARY FILES
if [[ ${LIBRARY_LIBTHEORA} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libtheora" "libtheora.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libtheoraenc" "libtheoraenc.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libtheoradec" "libtheoradec.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_LIBVORBIS} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libvorbisfile" "libvorbisfile.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libvorbisenc" "libvorbisenc.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libvorbis" "libvorbis.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_LIBWEBP} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libwebpmux" "libwebpmux.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libwebpdemux" "libwebpdemux.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libwebp" "libwebp.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_OPENCOREAMR} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libopencore-amrnb" "libopencore-amrnb.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
elif [[ ${LIBRARY_NETTLE} == "$library" ]]; then
LIBRARY_CREATED=$(create_external_library_package $library "libnettle" "libnettle.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
LIBRARY_CREATED=$(create_external_library_package $library "libhogweed" "libhogweed.a" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
else
# LIBRARIES WHICH HAVE ONLY ONE LIBRARY FILE ARE CREATED HERE
library_name=$(get_library_name $((library)))
static_archive_name=$(get_static_archive_name $((library)))
LIBRARY_CREATED=$(create_external_library_package $library "$library_name" "$static_archive_name" "${library_version}")
if [[ ${LIBRARY_CREATED} -ne 0 ]]; then
echo -e "failed\n"
exit 1
fi
fi
fi
done
# CREATE FFMPEG & FFMPEG KIT PACKAGES
if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]]; then
# CREATE .xcframework BUNDLE IF ENABLED
# CREATE FFMPEG
for FFMPEG_LIB in ${FFMPEG_LIBS}; do
# INITIALIZE FFMPEG FRAMEWORK DIRECTORY
XCFRAMEWORK_PATH=${BASEDIR}/prebuilt/macos-xcframework/${FFMPEG_LIB}.xcframework
mkdir -p "${XCFRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
echo -e "Creating package for ${FFMPEG_LIB}\n" 1>>"${BASEDIR}"/build.log 2>&1
BUILD_COMMAND="xcodebuild -create-xcframework "
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
FFMPEG_LIB_UPPERCASE=$(echo "${FFMPEG_LIB}" | tr '[a-z]' '[A-Z]')
FFMPEG_LIB_CAPITALCASE=$(to_capital_case "${FFMPEG_LIB}")
# EXTRACT FFMPEG VERSION
FFMPEG_LIB_MAJOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR" "${BASEDIR}/prebuilt/macos-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR//g;s/\ //g")
FFMPEG_LIB_MINOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR" "${BASEDIR}/prebuilt/macos-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR//g;s/\ //g")
FFMPEG_LIB_MICRO=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO" "${BASEDIR}/prebuilt/macos-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/version.h" | sed "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO//g;s/\ //g")
FFMPEG_LIB_VERSION="${FFMPEG_LIB_MAJOR}.${FFMPEG_LIB_MINOR}.${FFMPEG_LIB_MICRO}"
# INITIALIZE SUB-FRAMEWORK DIRECTORY
FFMPEG_LIB_FRAMEWORK_PATH=${BASEDIR}/prebuilt/macos-xcframework/.tmp/macos-${TARGET_ARCH}/${FFMPEG_LIB}.framework
rm -rf "${FFMPEG_LIB_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIB_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/macos-${TARGET_ARCH}/ffmpeg/include/${FFMPEG_LIB}/* ${FFMPEG_LIB_FRAMEWORK_PATH}/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${BASEDIR}/prebuilt/macos-${TARGET_ARCH}/ffmpeg/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_LIB_FRAMEWORK_PATH}/${FFMPEG_LIB}" 1>>"${BASEDIR}"/build.log 2>&1
# COPY THE LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}/LICENSE.GPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}/LICENSE.LGPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
fi
build_info_plist "${FFMPEG_LIB_FRAMEWORK_PATH}/Info.plist" "${FFMPEG_LIB}" "com.arthenica.ffmpegkit.${FFMPEG_LIB_CAPITALCASE}" "${FFMPEG_LIB_VERSION}" "${FFMPEG_LIB_VERSION}"
BUILD_COMMAND+=" -framework ${FFMPEG_LIB_FRAMEWORK_PATH}"
done
BUILD_COMMAND+=" -output ${XCFRAMEWORK_PATH}"
# EXECUTE CREATE FRAMEWORK COMMAND
COMMAND_OUTPUT=$(${BUILD_COMMAND} 2>&1)
echo "${COMMAND_OUTPUT}" 1>>"${BASEDIR}"/build.log 2>&1
echo "" 1>>"${BASEDIR}"/build.log 2>&1
# DO NOT ALLOW EMPTY FRAMEWORKS
if [[ ${COMMAND_OUTPUT} == *"is empty in library"* ]]; then
echo -e "failed\n"
exit 1
fi
echo -e "Created ${FFMPEG_LIB} xcframework successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
done
# CREATE FFMPEG
# INITIALIZE FFMPEG KIT FRAMEWORK DIRECTORY
XCFRAMEWORK_PATH=${BASEDIR}/prebuilt/macos-xcframework/ffmpegkit.xcframework
mkdir -p "${XCFRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
BUILD_COMMAND="xcodebuild -create-xcframework "
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
# INITIALIZE SUB-FRAMEWORK DIRECTORY
FFMPEG_KIT_FRAMEWORK_PATH="${BASEDIR}/prebuilt/macos-xcframework/.tmp/macos-${TARGET_ARCH}/ffmpegkit.framework"
rm -rf "${FFMPEG_KIT_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
build_modulemap "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules/module.modulemap"
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/macos-"${TARGET_ARCH}"/ffmpeg-kit/include/* "${FFMPEG_KIT_FRAMEWORK_PATH}"/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${BASEDIR}/prebuilt/macos-${TARGET_ARCH}/ffmpeg-kit/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_KIT_FRAMEWORK_PATH}/ffmpegkit" 1>>"${BASEDIR}"/build.log 2>&1
# COPY THE LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}/LICENSE.GPLv3" "${FFMPEG_KIT_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}/LICENSE.LGPLv3" "${FFMPEG_KIT_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
fi
BUILD_COMMAND+=" -framework ${FFMPEG_KIT_FRAMEWORK_PATH}"
done
BUILD_COMMAND+=" -output ${XCFRAMEWORK_PATH}"
# EXECUTE CREATE FRAMEWORK COMMAND
COMMAND_OUTPUT=$(${BUILD_COMMAND} 2>&1)
echo "${COMMAND_OUTPUT}" 1>>"${BASEDIR}"/build.log 2>&1
echo "" 1>>"${BASEDIR}"/build.log 2>&1
# DO NOT ALLOW EMPTY FRAMEWORKS
if [[ ${COMMAND_OUTPUT} == *"is empty in library"* ]]; then
echo -e "failed\n"
exit 1
fi
echo -e "Created ffmpegkit xcframework successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "ok\n"
else
# CREATE .framework AND FAT/UNIVERSAL LIBRARY IF ENABLED
# CREATE FFMPEG
# INITIALIZE UNIVERSAL LIBRARY DIRECTORY
FFMPEG_UNIVERSAL="${BASEDIR}/prebuilt/macos-universal/ffmpeg-universal"
mkdir -p "${FFMPEG_UNIVERSAL}/include" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_UNIVERSAL}/lib" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/macos-"${TARGET_ARCH_LIST[0]}"/ffmpeg/include/* ${FFMPEG_UNIVERSAL}/include 1>>"${BASEDIR}"/build.log 2>&1
cp "${BASEDIR}"/prebuilt/macos-"${TARGET_ARCH_LIST[0]}"/ffmpeg/include/config.h "${FFMPEG_UNIVERSAL}/include" 1>>"${BASEDIR}"/build.log 2>&1
for FFMPEG_LIB in ${FFMPEG_LIBS}; do
LIPO_COMMAND="${LIPO} -create"
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
LIPO_COMMAND+=" "${BASEDIR}"/prebuilt/macos-${TARGET_ARCH}/ffmpeg/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}"
done
LIPO_COMMAND+=" -output ${FFMPEG_UNIVERSAL}/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}"
# EXECUTE CREATE UNIVERSAL LIBRARY COMMAND
${LIPO_COMMAND} 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -ne 0 ]; then
echo -e "failed\n"
exit 1
fi
FFMPEG_LIB_UPPERCASE=$(echo "${FFMPEG_LIB}" | tr '[a-z]' '[A-Z]')
FFMPEG_LIB_CAPITALCASE=$(to_capital_case "${FFMPEG_LIB}")
# EXTRACT FFMPEG VERSION
FFMPEG_LIB_MAJOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR" "${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MAJOR//g;s/\ //g")
FFMPEG_LIB_MINOR=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR" "${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/version.h" | sed -e "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MINOR//g;s/\ //g")
FFMPEG_LIB_MICRO=$(grep "#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO" "${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/version.h" | sed "s/#define ${FFMPEG_LIB_UPPERCASE}_VERSION_MICRO//g;s/\ //g")
FFMPEG_LIB_VERSION="${FFMPEG_LIB_MAJOR}.${FFMPEG_LIB_MINOR}.${FFMPEG_LIB_MICRO}"
# INITIALIZE FRAMEWORK DIRECTORY
FFMPEG_LIB_FRAMEWORK_PATH="${BASEDIR}/prebuilt/macos-framework/${FFMPEG_LIB}.framework"
rm -rf "${FFMPEG_LIB_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIB_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# COPY HEADER FILES
cp -r ${FFMPEG_UNIVERSAL}/include/${FFMPEG_LIB}/* ${FFMPEG_LIB_FRAMEWORK_PATH}/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${FFMPEG_UNIVERSAL}/lib/${FFMPEG_LIB}.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_LIB_FRAMEWORK_PATH}/${FFMPEG_LIB}" 1>>"${BASEDIR}"/build.log 2>&1
# COPY FRAMEWORK LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}/LICENSE.GPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}/LICENSE.LGPLv3" "${FFMPEG_LIB_FRAMEWORK_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1
fi
build_info_plist "${FFMPEG_LIB_FRAMEWORK_PATH}/Info.plist" "${FFMPEG_LIB}" "com.arthenica.ffmpegkit.${FFMPEG_LIB_CAPITALCASE}" "${FFMPEG_LIB_VERSION}" "${FFMPEG_LIB_VERSION}"
echo -e "Created ${FFMPEG_LIB} framework successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
done
# COPY UNIVERSAL LIBRARY LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}"/LICENSE.GPLv3 "${FFMPEG_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}"/LICENSE.LGPLv3 "${FFMPEG_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
fi
# FFMPEG KIT
# INITIALIZE FRAMEWORK AND UNIVERSAL LIBRARY DIRECTORIES
FFMPEG_KIT_VERSION=$(get_ffmpeg_kit_version)
FFMPEG_KIT_UNIVERSAL="${BASEDIR}/prebuilt/macos-universal/ffmpeg-kit-universal"
FFMPEG_KIT_FRAMEWORK_PATH="${BASEDIR}/prebuilt/macos-framework/ffmpegkit.framework"
mkdir -p "${FFMPEG_KIT_UNIVERSAL}/include" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_KIT_UNIVERSAL}/lib" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
rm -rf "${FFMPEG_KIT_FRAMEWORK_PATH}" 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Headers" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
mkdir -p "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
LIPO_COMMAND="${LIPO} -create"
for TARGET_ARCH in "${TARGET_ARCH_LIST[@]}"; do
LIPO_COMMAND+=" ${BASEDIR}/prebuilt/macos-${TARGET_ARCH}/ffmpeg-kit/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}"
done
LIPO_COMMAND+=" -output ${FFMPEG_KIT_UNIVERSAL}/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}"
# EXECUTE CREATE UNIVERSAL LIBRARY COMMAND
${LIPO_COMMAND} 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -ne 0 ]; then
echo -e "failed\n"
exit 1
fi
# COPY HEADER FILES
cp -r "${BASEDIR}"/prebuilt/macos-"${TARGET_ARCH_LIST[0]}"/ffmpeg-kit/include/* "${FFMPEG_KIT_UNIVERSAL}"/include 1>>"${BASEDIR}"/build.log 2>&1
cp -r "${FFMPEG_KIT_UNIVERSAL}"/include/* "${FFMPEG_KIT_FRAMEWORK_PATH}"/Headers 1>>"${BASEDIR}"/build.log 2>&1
# COPY LIBRARY FILE
cp "${FFMPEG_KIT_UNIVERSAL}/lib/libffmpegkit.${BUILD_LIBRARY_EXTENSION}" "${FFMPEG_KIT_FRAMEWORK_PATH}/ffmpegkit" 1>>"${BASEDIR}"/build.log 2>&1
# COPY THE LICENSES
if [ ${GPL_ENABLED} == "yes" ]; then
cp "${BASEDIR}"/LICENSE.GPLv3 "${FFMPEG_KIT_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
cp "${BASEDIR}"/LICENSE.GPLv3 "${FFMPEG_KIT_FRAMEWORK_PATH}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
else
cp "${BASEDIR}"/LICENSE.LGPLv3 "${FFMPEG_KIT_UNIVERSAL}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
cp "${BASEDIR}"/LICENSE.LGPLv3 "${FFMPEG_KIT_FRAMEWORK_PATH}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1
fi
build_info_plist "${FFMPEG_KIT_FRAMEWORK_PATH}/Info.plist" "ffmpegkit" "com.arthenica.ffmpegkit.FFmpegKit" "${FFMPEG_KIT_VERSION}" "${FFMPEG_KIT_VERSION}"
build_modulemap "${FFMPEG_KIT_FRAMEWORK_PATH}/Modules/module.modulemap"
echo -e "Created ffmpegkit.framework and universal library successfully.\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "ok\n"
fi
fi

View File

@ -1,69 +1,30 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="chromaprint"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
CFLAGS=$(get_cflags ${LIB_NAME})
CXXFLAGS=$(get_cxxflags ${LIB_NAME})
LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
if [ -d "build" ]; then
rm -rf build
fi
mkdir build;
cd build
mkdir -p "${BUILD_DIR}" || return 1
cd "${BUILD_DIR}" || return 1
cmake -Wno-dev \
-DCMAKE_VERBOSE_MAKEFILE=0 \
-DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_SYSROOT="${ANDROID_SYSROOT}" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_SYSROOT}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
-DCMAKE_INSTALL_PREFIX="${LIB_INSTALL_PREFIX}" \
-DCMAKE_SYSTEM_NAME=Generic \
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_target_processor) \
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_system_processor) \
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
-DFFT_LIB=kissfft \
-DBUILD_SHARED_LIBS=0 .. || exit 1
-DBUILD_SHARED_LIBS=0 "${BASEDIR}"/src/"${LIB_NAME}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_chromaprint_package_config "1.5.0"
make install || exit 1
create_chromaprint_package_config "1.5.0" || return 1

View File

@ -1,14 +1,10 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
. "${BASEDIR}"/scripts/function-android.sh
$(android_ndk_cmake) -DBUILD_PIC=ON || return 1
LIB_NAME="cpu-features"
set_toolchain_paths ${LIB_NAME}
make -C "$(get_cmake_build_directory)" || return 1
cd "${BASEDIR}"/src/${LIB_NAME} || exit 1
make -C "$(get_cmake_build_directory)" install || return 1
$(android_ndk_cmake) -DBUILD_PIC=ON || exit 1
make -C "$(get_android_build_dir)" install || exit 1
create_cpufeatures_package_config
# CREATE PACKAGE CONFIG MANUALLY
create_cpufeatures_package_config "0.4.1.1" || return 1

View File

@ -1,41 +1,29 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="expat"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
cd "${LIB_NAME}" || return 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_expat} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/"${LIB_NAME}"/configure ]] || [[ ${RECONF_expat} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--without-docbook \
--without-xmlwf \
--enable-static \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./expat.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./expat.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,277 +1,291 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# FIND pkg-config PATH
HOST_PKG_CONFIG_PATH=$(command -v pkg-config)
if [ -z "${HOST_PKG_CONFIG_PATH}" ]; then
echo -e "\n(*) pkg-config command not found\n"
exit 1
fi
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="ffmpeg"
set_toolchain_paths ${LIB_NAME}
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-"${FFMPEG_KIT_BUILD_TYPE}".sh 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# PREPARE BUILD FLAGS
BUILD_HOST=$(get_build_host)
CFLAGS=$(get_cflags ${LIB_NAME})
CXXFLAGS=$(get_cxxflags ${LIB_NAME})
LDFLAGS=$(get_ldflags ${LIB_NAME})
LIB_NAME="ffmpeg"
echo -e "----------------------------------------------------------------" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "\nINFO: Building ${LIB_NAME} with the following environment variables\n" 1>>"${BASEDIR}"/build.log 2>&1
env 1>>"${BASEDIR}"/build.log 2>&1
echo -e "----------------------------------------------------------------\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "INFO: System information\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "INFO: $(uname -a)\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "----------------------------------------------------------------\n" 1>>"${BASEDIR}"/build.log 2>&1
FFMPEG_LIBRARY_PATH="${LIB_INSTALL_BASE}/${LIB_NAME}"
ANDROID_SYSROOT="${ANDROID_NDK_ROOT}"/toolchains/llvm/prebuilt/"${TOOLCHAIN}"/sysroot
# SET PATHS
set_toolchain_paths "${LIB_NAME}"
# SET BUILD FLAGS
HOST=$(get_host)
export CFLAGS=$(get_cflags "${LIB_NAME}")
export CXXFLAGS=$(get_cxxflags "${LIB_NAME}")
export LDFLAGS=$(get_ldflags "${LIB_NAME}")
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
# PREPARE BUILD OPTIONS
cd "${BASEDIR}"/src/"${LIB_NAME}" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# SET BUILD OPTIONS
TARGET_CPU=""
TARGET_ARCH=""
ARCH_OPTIONS=""
ASM_OPTIONS=""
case ${ARCH} in
arm-v7a)
TARGET_CPU="armv7-a"
TARGET_ARCH="armv7-a"
ARCH_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm"
ASM_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm"
;;
arm-v7a-neon)
TARGET_CPU="armv7-a"
TARGET_ARCH="armv7-a"
ARCH_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm --build-suffix=_neon"
ASM_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm --build-suffix=_neon"
;;
arm64-v8a)
TARGET_CPU="armv8-a"
TARGET_ARCH="aarch64"
ARCH_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm"
ASM_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm"
;;
x86)
TARGET_CPU="i686"
TARGET_ARCH="i686"
# asm disabled due to this ticket https://trac.ffmpeg.org/ticket/4928
ARCH_OPTIONS=" --disable-neon --disable-asm --disable-inline-asm"
ASM_OPTIONS=" --disable-neon --disable-asm --disable-inline-asm"
;;
x86-64)
TARGET_CPU="x86_64"
TARGET_ARCH="x86_64"
ARCH_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm"
ASM_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm"
;;
esac
CONFIGURE_POSTFIX=""
HIGH_PRIORITY_INCLUDES=""
# PREPARE CONFIGURE OPTIONS
# SET CONFIGURE OPTIONS
for library in {1..58}; do
if [[ ${!library} -eq 1 ]]; then
ENABLED_LIBRARY=$(get_library_name $((library - 1)))
echo -e "INFO: Enabling library ${ENABLED_LIBRARY}\n" 1>>"${BASEDIR}"/build.log 2>&1
case $ENABLED_LIBRARY in
case ${ENABLED_LIBRARY} in
chromaprint)
CFLAGS+=" $(pkg-config --cflags libchromaprint 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libchromaprint 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libchromaprint 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libchromaprint 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-chromaprint"
;;
cpu-features)
pkg-config --libs --static cpu-features 1>>"${BASEDIR}"/build.log 2>&1
pkg-config --libs --static cpu-features 2>>"${BASEDIR}"/build.log 1>/dev/null
if [[ $? -eq 1 ]]; then
echo -e "\nffmpeg: failed\n"
echo -e "ERROR: cpu-features was not found in the pkg-config search path\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "\nffmpeg: failed\n\nSee build.log for details\n"
exit 1
fi
;;
fontconfig)
CFLAGS+=" $(pkg-config --cflags fontconfig 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static fontconfig 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags fontconfig 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static fontconfig 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libfontconfig"
;;
freetype)
CFLAGS+=" $(pkg-config --cflags freetype2 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static freetype2 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags freetype2 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static freetype2 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libfreetype"
;;
fribidi)
CFLAGS+=" $(pkg-config --cflags fribidi 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static fribidi 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags fribidi 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static fribidi 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libfribidi"
;;
gmp)
CFLAGS+=" $(pkg-config --cflags gmp 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static gmp 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags gmp 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static gmp 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-gmp"
;;
gnutls)
CFLAGS+=" $(pkg-config --cflags gnutls 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static gnutls 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags gnutls 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static gnutls 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-gnutls"
;;
kvazaar)
CFLAGS+=" $(pkg-config --cflags kvazaar 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static kvazaar 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags kvazaar 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static kvazaar 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libkvazaar"
;;
lame)
CFLAGS+=" $(pkg-config --cflags libmp3lame 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libmp3lame 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libmp3lame 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libmp3lame 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libmp3lame"
;;
libaom)
CFLAGS+=" $(pkg-config --cflags aom 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static aom 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags aom 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static aom 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libaom"
;;
libass)
CFLAGS+=" $(pkg-config --cflags libass 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libass 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libass 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libass 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libass"
;;
libiconv)
CFLAGS+=" $(pkg-config --cflags libiconv 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libiconv 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libiconv 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libiconv 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-iconv"
HIGH_PRIORITY_INCLUDES+=" $(pkg-config --cflags libiconv 1>>"${BASEDIR}"/build.log 2>&1)"
HIGH_PRIORITY_INCLUDES+=" $(pkg-config --cflags libiconv 2>>"${BASEDIR}"/build.log)"
;;
libilbc)
CFLAGS+=" $(pkg-config --cflags libilbc 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libilbc 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libilbc 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libilbc 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libilbc"
;;
libtheora)
CFLAGS+=" $(pkg-config --cflags theora 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static theora 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags theora 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static theora 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libtheora"
;;
libvidstab)
CFLAGS+=" $(pkg-config --cflags vidstab 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static vidstab 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags vidstab 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static vidstab 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libvidstab --enable-gpl"
;;
libvorbis)
CFLAGS+=" $(pkg-config --cflags vorbis 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static vorbis 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags vorbis 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static vorbis 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libvorbis"
;;
libvpx)
CFLAGS+=" $(pkg-config --cflags vpx 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs vpx 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs cpu-features 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags vpx 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs vpx 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs cpu-features 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libvpx"
;;
libwebp)
CFLAGS+=" $(pkg-config --cflags libwebp 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libwebp 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libwebp 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libwebp 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libwebp"
;;
libxml2)
CFLAGS+=" $(pkg-config --cflags libxml-2.0 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libxml-2.0 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libxml-2.0 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libxml-2.0 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libxml2"
;;
opencore-amr)
CFLAGS+=" $(pkg-config --cflags opencore-amrnb 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static opencore-amrnb 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags opencore-amrnb 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static opencore-amrnb 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libopencore-amrnb"
;;
openh264)
FFMPEG_CFLAGS+=" $(pkg-config --cflags openh264 1>>"${BASEDIR}"/build.log 2>&1)"
FFMPEG_LDFLAGS+=" $(pkg-config --libs --static openh264 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags openh264 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static openh264 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libopenh264"
;;
opus)
CFLAGS+=" $(pkg-config --cflags opus 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static opus 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags opus 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static opus 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libopus"
;;
rubberband)
CFLAGS+=" $(pkg-config --cflags rubberband 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static rubberband 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags rubberband 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static rubberband 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-librubberband --enable-gpl"
;;
shine)
CFLAGS+=" $(pkg-config --cflags shine 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static shine 1>>"${BASEDIR}"/build.log 2>&1)"
CONFIGURE_POSTFIX+=" --enable-libshine"
;;
sdl)
CFLAGS+=" $(pkg-config --cflags sdl2 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static sdl2 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags sdl2 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static sdl2 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-sdl2"
;;
shine)
CFLAGS+=" $(pkg-config --cflags shine 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static shine 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libshine"
;;
snappy)
CFLAGS+=" $(pkg-config --cflags snappy 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static snappy 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags snappy 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static snappy 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libsnappy"
;;
soxr)
CFLAGS+=" $(pkg-config --cflags soxr 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static soxr 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags soxr 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static soxr 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libsoxr"
;;
speex)
CFLAGS+=" $(pkg-config --cflags speex 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static speex 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags speex 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static speex 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libspeex"
;;
tesseract)
CFLAGS+=" $(pkg-config --cflags tesseract 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static tesseract 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags giflib 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static giflib 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags tesseract 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static tesseract 2>>"${BASEDIR}"/build.log)"
CFLAGS+=" $(pkg-config --cflags giflib 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static giflib 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libtesseract"
;;
twolame)
CFLAGS+=" $(pkg-config --cflags twolame 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static twolame 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags twolame 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static twolame 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libtwolame"
;;
vo-amrwbenc)
CFLAGS+=" $(pkg-config --cflags vo-amrwbenc 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static vo-amrwbenc 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags vo-amrwbenc 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static vo-amrwbenc 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libvo-amrwbenc"
;;
wavpack)
CFLAGS+=" $(pkg-config --cflags wavpack 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static wavpack 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags wavpack 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static wavpack 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libwavpack"
;;
x264)
CFLAGS+=" $(pkg-config --cflags x264 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static x264 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags x264 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static x264 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libx264 --enable-gpl"
;;
x265)
CFLAGS+=" $(pkg-config --cflags x265 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static x265 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags x265 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static x265 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libx265 --enable-gpl"
;;
xvidcore)
CFLAGS+=" $(pkg-config --cflags xvidcore 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static xvidcore 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags xvidcore 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static xvidcore 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libxvid --enable-gpl"
;;
expat)
CFLAGS+=" $(pkg-config --cflags expat 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static expat 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags expat 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static expat 2>>"${BASEDIR}"/build.log)"
;;
libogg)
CFLAGS+=" $(pkg-config --cflags ogg 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static ogg 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags ogg 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static ogg 2>>"${BASEDIR}"/build.log)"
;;
libpng)
CFLAGS+=" $(pkg-config --cflags libpng 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static libpng 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags libpng 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static libpng 2>>"${BASEDIR}"/build.log)"
;;
libuuid)
CFLAGS+=" $(pkg-config --cflags uuid 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static uuid 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags uuid 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static uuid 2>>"${BASEDIR}"/build.log)"
;;
nettle)
CFLAGS+=" $(pkg-config --cflags nettle 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static nettle 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags hogweed 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static hogweed 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags nettle 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static nettle 2>>"${BASEDIR}"/build.log)"
CFLAGS+=" $(pkg-config --cflags hogweed 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static hogweed 2>>"${BASEDIR}"/build.log)"
;;
android-zlib)
CFLAGS+=" $(pkg-config --cflags zlib 1>>"${BASEDIR}"/build.log 2>&1)"
LDFLAGS+=" $(pkg-config --libs --static zlib 1>>"${BASEDIR}"/build.log 2>&1)"
CFLAGS+=" $(pkg-config --cflags zlib 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static zlib 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-zlib"
;;
android-media-codec)
@ -292,11 +306,11 @@ for library in {1..58}; do
fi
done
LDFLAGS+=" -L${ANDROID_NDK_ROOT}/platforms/android-${API}/arch-${TOOLCHAIN_ARCH}/usr/lib"
export LDFLAGS+=" -L${ANDROID_NDK_ROOT}/platforms/android-${API}/arch-${TOOLCHAIN_ARCH}/usr/lib"
# LINKING WITH ANDROID LTS SUPPORT LIBRARY IS NECESSARY FOR API < 18
if [[ -n ${FFMPEG_KIT_LTS_BUILD} ]] && [[ ${API} -lt 18 ]]; then
LDFLAGS+=" -Wl,--whole-archive ${BASEDIR}/android/app/src/main/cpp/libandroidltssupport.a -Wl,--no-whole-archive"
export LDFLAGS+=" -Wl,--whole-archive ${BASEDIR}/android/app/src/main/cpp/libandroidltssupport.a -Wl,--no-whole-archive"
fi
# ALWAYS BUILD SHARED LIBRARIES
@ -324,17 +338,13 @@ fi
echo -n -e "\n${LIB_NAME}: "
cd "${BASEDIR}"/src/${LIB_NAME} || exit 1
if [[ -z ${NO_WORKSPACE_CLEANUP_ffmpeg} ]]; then
echo -e "INFO: Cleaning workspace for ${LIB_NAME}\n" 1>>"${BASEDIR}"/build.log 2>&1
make distclean 2>/dev/null 1>/dev/null
fi
# SET BUILD FLAGS
# UPDATE BUILD FLAGS
export CFLAGS="${HIGH_PRIORITY_INCLUDES} ${CFLAGS}"
export CXXFLAGS="${CXXFLAGS}"
export LDFLAGS="${LDFLAGS}"
# USE HIGHER LIMITS FOR FFMPEG LINKING
ulimit -n 2048 1>>"${BASEDIR}"/build.log 2>&1
@ -342,23 +352,26 @@ ulimit -n 2048 1>>"${BASEDIR}"/build.log 2>&1
########################### CUSTOMIZATIONS #######################
# 1. Use thread local log levels
${SED_INLINE} 's/static int av_log_level/__thread int av_log_level/g' "${BASEDIR}"/src/${LIB_NAME}/libavutil/log.c 1>>"${BASEDIR}"/build.log 2>&1
${SED_INLINE} 's/static int av_log_level/__thread int av_log_level/g' "${BASEDIR}"/src/"${LIB_NAME}"/libavutil/log.c 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
###################################################################
./configure \
--cross-prefix="${BUILD_HOST}-" \
--sysroot="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
--prefix="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
--cross-prefix="${HOST}-" \
--sysroot="${ANDROID_SYSROOT}" \
--prefix="${FFMPEG_LIBRARY_PATH}" \
--pkg-config="${HOST_PKG_CONFIG_PATH}" \
--enable-version3 \
--arch="${TARGET_ARCH}" \
--cpu="${TARGET_CPU}" \
--cc="${CC}" \
--cxx="${CXX}" \
--extra-libs="$(pkg-config --libs --static cpu-features 1>>"${BASEDIR}"/build.log 2>&1)" \
--ranlib="${RANLIB}" \
--strip="${STRIP}" \
--nm="${NM}" \
--extra-libs="$(pkg-config --libs --static cpu-features)" \
--target-os=android \
${ARCH_OPTIONS} \
${ASM_OPTIONS} \
--enable-cross-compile \
--enable-pic \
--enable-jni \
@ -400,65 +413,68 @@ ${SED_INLINE} 's/static int av_log_level/__thread int av_log_level/g' "${BASEDIR
--disable-vdpau \
${CONFIGURE_POSTFIX} 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -ne 0 ]; then
echo "failed"
if [[ $? -ne 0 ]]; then
echo -e "failed\n\nSee build.log for details\n"
exit 1
fi
if [[ -z ${NO_OUTPUT_REDIRECTION} ]]; then
make -j$(get_cpu_count) 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -ne 0 ]; then
echo "failed"
if [[ $? -ne 0 ]]; then
echo -e "failed\n\nSee build.log for details\n"
exit 1
fi
else
echo -e "started\n"
make -j$(get_cpu_count) 1>>"${BASEDIR}"/build.log 2>&1
make -j$(get_cpu_count)
if [ $? -ne 0 ]; then
echo -n -e "\n${LIB_NAME}: failed\n"
if [[ $? -ne 0 ]]; then
echo -n -e "\n${LIB_NAME}: failed\n\nSee build.log for details\n"
exit 1
else
echo -n -e "\n${LIB_NAME}: "
fi
fi
rm -rf "${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}"
# DELETE THE PREVIOUS BUILD OF THE LIBRARY BEFORE INSTALLING
if [ -d "${FFMPEG_LIBRARY_PATH}" ]; then
rm -rf "${FFMPEG_LIBRARY_PATH}" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
fi
make install 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -ne 0 ]; then
echo "failed"
if [[ $? -ne 0 ]]; then
echo -e "failed\n\nSee build.log for details\n"
exit 1
fi
# MANUALLY ADD REQUIRED HEADERS
mkdir -p "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/x86
mkdir -p "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/arm
mkdir -p "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/aarch64
mkdir -p "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavcodec/x86
mkdir -p "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavcodec/arm
cp -f "${BASEDIR}"/src/ffmpeg/config.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include
cp -f "${BASEDIR}"/src/ffmpeg/libavcodec/mathops.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavcodec
cp -f "${BASEDIR}"/src/ffmpeg/libavcodec/x86/mathops.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavcodec/x86
cp -f "${BASEDIR}"/src/ffmpeg/libavcodec/arm/mathops.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavcodec/arm
cp -f "${BASEDIR}"/src/ffmpeg/libavformat/network.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavformat
cp -f "${BASEDIR}"/src/ffmpeg/libavformat/os_support.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavformat
cp -f "${BASEDIR}"/src/ffmpeg/libavformat/url.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavformat
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/internal.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/libm.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/reverse.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/thread.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/timer.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/x86/asm.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/x86
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/x86/timer.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/x86
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/arm/timer.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/arm
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/aarch64/timer.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/aarch64
cp -f "${BASEDIR}"/src/ffmpeg/libavutil/x86/emms.h "${BASEDIR}/prebuilt/android-$(get_target_build)"/ffmpeg/include/libavutil/x86
mkdir -p "${FFMPEG_LIBRARY_PATH}"/include/libavutil/x86 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIBRARY_PATH}"/include/libavutil/arm 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIBRARY_PATH}"/include/libavutil/aarch64 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIBRARY_PATH}"/include/libavcodec/x86 1>>"${BASEDIR}"/build.log 2>&1
mkdir -p "${FFMPEG_LIBRARY_PATH}"/include/libavcodec/arm 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/config.h "${FFMPEG_LIBRARY_PATH}"/include/config.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavcodec/mathops.h "${FFMPEG_LIBRARY_PATH}"/include/libavcodec/mathops.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavcodec/x86/mathops.h "${FFMPEG_LIBRARY_PATH}"/include/libavcodec/x86/mathops.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavcodec/arm/mathops.h "${FFMPEG_LIBRARY_PATH}"/include/libavcodec/arm/mathops.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavformat/network.h "${FFMPEG_LIBRARY_PATH}"/include/libavformat/network.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavformat/os_support.h "${FFMPEG_LIBRARY_PATH}"/include/libavformat/os_support.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavformat/url.h "${FFMPEG_LIBRARY_PATH}"/include/libavformat/url.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/internal.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/internal.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/libm.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/libm.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/reverse.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/reverse.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/thread.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/thread.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/timer.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/timer.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/x86/asm.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/x86/asm.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/x86/timer.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/x86/timer.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/arm/timer.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/arm/timer.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/aarch64/timer.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/aarch64/timer.h 1>>"${BASEDIR}"/build.log 2>&1
overwrite_file "${BASEDIR}"/src/ffmpeg/libavutil/x86/emms.h "${FFMPEG_LIBRARY_PATH}"/include/libavutil/x86/emms.h 1>>"${BASEDIR}"/build.log 2>&1
if [ $? -eq 0 ]; then
echo "ok"
else
echo "failed"
echo -e "failed\n\nSee build.log for details\n"
exit 1
fi

View File

@ -1,33 +1,18 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="fontconfig"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR=${INSTALL_PKG_CONFIG_DIR}
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_fontconfig} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_fontconfig} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-libiconv-prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/libiconv \
--with-expat=${BASEDIR}/prebuilt/android-$(get_target_build)/expat \
--with-libiconv-prefix="${LIB_INSTALL_BASE}"/libiconv \
--with-expat="${LIB_INSTALL_BASE}"/expat \
--without-libintl-prefix \
--enable-static \
--disable-shared \
@ -35,11 +20,11 @@ fi
--disable-rpath \
--disable-libxml2 \
--disable-docs \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_fontconfig_package_config "2.13.92"
make install || exit 1
create_fontconfig_package_config "2.13.92" || return 1

View File

@ -1,33 +1,25 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="freetype"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# UPDATE BUILD FLAGS
export LIBPNG_CFLAGS="-I${LIB_INSTALL_BASE}/libpng/include"
export LIBPNG_LIBS="-L${LIB_INSTALL_BASE}/libpng/lib"
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# OVERRIDE PKG-CONFIG
export LIBPNG_CFLAGS="-I${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/include"
export LIBPNG_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/lib"
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/builds/unix/configure ]] || [[ ${RECONF_freetype} -eq 1 ]]; then
# NOTE THAT FREETYPE DOES NOT SUPPORT AUTORECONF BUT IT COMES WITH AN autogen.sh
./autogen.sh || return 1
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-zlib \
--with-png \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--without-harfbuzz \
--without-bzip2 \
--without-fsref \
@ -38,11 +30,11 @@ export LIBPNG_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/lib
--disable-shared \
--disable-fast-install \
--disable-mmap \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_freetype_package_config "23.2.17"
make install || exit 1
create_freetype_package_config "23.2.17" || return 1

View File

@ -1,42 +1,30 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="fribidi"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_fribidi} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_fribidi} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--disable-debug \
--disable-deprecated \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
# WORKAROUND TO DISABLE BUILDING OF doc FOLDER (doc depends on c2man which is not available on all platforms)
$SED_INLINE 's/ doc / /g' "${BASEDIR}"/src/"${LIB_NAME}"/Makefile || return 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,60 +1,28 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="giflib"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})" -DS_IREAD=S_IRUSR -DS_IWRITE=S_IWUSR"
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# UPDATE BUILD FLAGS
export CFLAGS=$(get_cflags "${LIB_NAME}")" -DS_IREAD=S_IRUSR -DS_IWRITE=S_IWUSR"
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_giflib} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_giflib} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_giflib_package_config "5.1.4"
make install || exit 1
create_giflib_package_config "5.1.4" || return 1

View File

@ -1,61 +1,27 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="gmp"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_gmp} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_gmp} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-assembly \
--disable-shared \
--disable-fast-install \
--disable-maintainer-mode \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_gmp_package_config "6.2.0"
make install || exit 1
create_gmp_package_config "6.2.0" || return 1

View File

@ -1,77 +1,45 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
# UPDATE BUILD FLAGS
export CFLAGS="$(get_cflags ${LIB_NAME}) -I${LIB_INSTALL_BASE}/libiconv/include"
export CXXFLAGS=$(get_cxxflags "${LIB_NAME}")
export LDFLAGS="$(get_ldflags ${LIB_NAME}) -L${LIB_INSTALL_BASE}/libiconv/lib"
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
export NETTLE_CFLAGS="-I${LIB_INSTALL_BASE}/nettle/include"
export NETTLE_LIBS="-L${LIB_INSTALL_BASE}/nettle/lib -lnettle -L${LIB_INSTALL_BASE}/gmp/lib -lgmp"
export HOGWEED_CFLAGS="-I${LIB_INSTALL_BASE}/nettle/include"
export HOGWEED_LIBS="-L${LIB_INSTALL_BASE}/nettle/lib -lhogweed -L${LIB_INSTALL_BASE}/gmp/lib -lgmp"
export GMP_CFLAGS="-I${LIB_INSTALL_BASE}/gmp/include"
export GMP_LIBS="-L${LIB_INSTALL_BASE}/gmp/lib -lgmp"
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="gnutls"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
COMMON_CFLAGS=$(get_cflags ${LIB_NAME})
COMMON_CXXFLAGS=$(get_cxxflags ${LIB_NAME})
COMMON_LDFLAGS=$(get_ldflags ${LIB_NAME})
export CFLAGS="${COMMON_CFLAGS} -I${BASEDIR}/prebuilt/android-$(get_target_build)/libiconv/include"
export CXXFLAGS="${COMMON_CXXFLAGS}"
export LDFLAGS="${COMMON_LDFLAGS} -L${BASEDIR}/prebuilt/android-$(get_target_build)/libiconv/lib"
export NETTLE_CFLAGS="-I${BASEDIR}/prebuilt/android-$(get_target_build)/nettle/include"
export NETTLE_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/nettle/lib -lnettle -L${BASEDIR}/prebuilt/android-$(get_target_build)/gmp/lib -lgmp"
export HOGWEED_CFLAGS="-I${BASEDIR}/prebuilt/android-$(get_target_build)/nettle/include"
export HOGWEED_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/nettle/lib -lhogweed -L${BASEDIR}/prebuilt/android-$(get_target_build)/gmp/lib -lgmp"
export GMP_CFLAGS="-I${BASEDIR}/prebuilt/android-$(get_target_build)/gmp/include"
export GMP_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/gmp/lib -lgmp"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
HARDWARE_OPTIONS=""
# SET BUILD OPTIONS
ASM_OPTIONS=""
case ${ARCH} in
x86)
HARDWARE_OPTIONS="--disable-hardware-acceleration"
ASM_OPTIONS="--disable-hardware-acceleration"
;;
*)
HARDWARE_OPTIONS="--enable-hardware-acceleration"
ASM_OPTIONS="--enable-hardware-acceleration"
;;
esac
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_gnutls} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_gnutls} -eq 1 ]]; then
./bootstrap || return 1
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--with-included-libtasn1 \
--with-included-unistring \
--without-idn \
--without-p11-kit \
${HARDWARE_OPTIONS} \
${ASM_OPTIONS} \
--enable-static \
--disable-openssl-compatibility \
--disable-shared \
@ -83,11 +51,12 @@ fi
--disable-tests \
--disable-tools \
--disable-maintainer-mode \
--host=${BUILD_HOST} || exit 1
--disable-full-test-suite \
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_gnutls_package_config "3.6.13"
make install || exit 1
create_gnutls_package_config "3.6.15.1" || return 1

31
scripts/android/harfbuzz.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_harfbuzz} -eq 1 ]]; then
NOCONFIGURE=1 ./autogen.sh || return 1
fi
./configure \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot="${ANDROID_SYSROOT}" \
--with-glib=no \
--with-fontconfig=yes \
--with-freetype=yes \
--enable-static \
--disable-shared \
--disable-fast-install \
--host="${HOST}" || return 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./src/harfbuzz.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
# WORKAROUND TO REMOVE INSTALLED .la FILES
rm -f "${LIB_INSTALL_PREFIX}"/lib/*.la

View File

@ -1,36 +1,17 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="jpeg"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
if [ -d "build" ]; then
rm -rf build
fi
mkdir build || exit 1
cd build || exit 1
mkdir -p "${BUILD_DIR}" || return 1
cd "${BUILD_DIR}" || return 1
cmake -Wno-dev \
-DCMAKE_VERBOSE_MAKEFILE=0 \
-DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_SYSROOT="${ANDROID_SYSROOT}" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_SYSROOT}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
-DCMAKE_INSTALL_PREFIX="${LIB_INSTALL_PREFIX}" \
-DCMAKE_SYSTEM_NAME=Generic \
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CXX" \
@ -44,11 +25,12 @@ cmake -Wno-dev \
-DWITH_SIMD=1 \
-DWITH_TURBOJPEG=0 \
-DWITH_JAVA=0 \
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_target_processor) .. || exit 1
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_system_processor) \
"${BASEDIR}"/src/"${LIB_NAME}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ${BASEDIR}/src/${LIB_NAME}/build/pkgscripts/libjpeg.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp "${BUILD_DIR}"/pkgscripts/libjpeg.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,68 +1,37 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="kvazaar"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# ALWAYS RECONFIGURE
autoreconf_library ${LIB_NAME}
# LINKING WITH ANDROID LTS SUPPORT LIBRARY IS NECESSARY FOR API < 18
if [[ ! -z ${FFMPEG_KIT_LTS_BUILD} ]] && [[ ${API} < 18 ]]; then
ARCH_SPECIFIC_LIBS=" -Wl,--no-whole-archive ${BASEDIR}/android/app/src/main/cpp/libandroidltssupport.a -Wl,--no-whole-archive"
else
ARCH_SPECIFIC_LIBS=""
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_kvazaar} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
# DISABLE LINKING TO -lrt
${SED_INLINE} 's/\-lrt//g' ${BASEDIR}/src/${LIB_NAME}/configure
# UPDATE BUILD FLAGS
# LINKING WITH ANDROID LTS SUPPORT LIBRARY IS NECESSARY FOR API < 18
if [[ -n ${FFMPEG_KIT_LTS_BUILD} ]] && [[ ${API} -lt 18 ]]; then
LTS_SUPPORT_LIBS=" -Wl,--no-whole-archive ${BASEDIR}/android/app/src/main/cpp/libandroidltssupport.a -Wl,--no-whole-archive"
else
LTS_SUPPORT_LIBS=""
fi
LIBS="${ARCH_SPECIFIC_LIBS}" ./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
# WORKAROUND TO DISABLE LINKING TO -lrt
${SED_INLINE} 's/\-lrt//g' "${BASEDIR}"/src/"${LIB_NAME}"/configure || return 1
LIBS="${LTS_SUPPORT_LIBS}" ./configure \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make || exit 1
# NOTE THAT kvazaar DOES NOT SUPPORT PARALLEL EXECUTION
make || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./src/kvazaar.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./src/kvazaar.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,53 +1,20 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="lame"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
cd "${LIB_NAME}" || return 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_lame} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_lame} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-libiconv-prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/libiconv \
--with-sysroot="${ANDROID_SYSROOT}" \
--with-libiconv-prefix="${LIB_INSTALL_BASE}"/libiconv \
--enable-static \
--disable-shared \
--disable-fast-install \
@ -55,11 +22,11 @@ fi
--disable-frontend \
--disable-efence \
--disable-gtktest \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_libmp3lame_package_config "3.100"
make install || exit 1
create_libmp3lame_package_config "3.100" || return 1

View File

@ -1,66 +1,33 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="leptonica"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export CPPFLAGS="-I${BASEDIR}/prebuilt/android-$(get_target_build)/giflib/include"
export LDFLAGS="$(get_ldflags ${LIB_NAME}) -L${BASEDIR}/prebuilt/android-$(get_target_build)/giflib/lib -lgif"
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
# UPDATE BUILD FLAGS
HOST=$(get_host)
export CFLAGS=$(get_cflags "${LIB_NAME}")
export CXXFLAGS=$(get_cxxflags "${LIB_NAME}")
export CPPFLAGS="-I${LIB_INSTALL_BASE}/giflib/include"
export LDFLAGS="$(get_ldflags "${LIB_NAME}") -L${LIB_INSTALL_BASE}/giflib/lib -lgif"
export LIBPNG_CFLAGS="$(pkg-config --cflags libpng)"
export LIBPNG_LIBS="$(pkg-config --libs --static libpng)"
export LIBWEBP_CFLAGS="$(pkg-config --cflags libwebp)"
export LIBWEBP_LIBS="$(pkg-config --libs --static libwebp)"
export LIBTIFF_CFLAGS="$(pkg-config --cflags libtiff-4)"
export LIBTIFF_LIBS="$(pkg-config --libs --static libtiff-4)"
export ZLIB_CFLAGS="$(pkg-config --cflags zlib)"
export ZLIB_LIBS="$(pkg-config --libs --static zlib)"
export JPEG_CFLAGS="$(pkg-config --cflags libjpeg)"
export JPEG_LIBS="$(pkg-config --libs --static libjpeg)"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_leptonica} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_leptonica} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-zlib \
--with-libpng \
@ -72,11 +39,11 @@ fi
--disable-shared \
--disable-fast-install \
--disable-programs \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp lept.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp lept.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,65 +1,27 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libaom"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
CFLAGS=$(get_cflags ${LIB_NAME})
CXXFLAGS=$(get_cxxflags ${LIB_NAME})
LDFLAGS=$(get_ldflags ${LIB_NAME})
ARCH_OPTIONS=""
# SET BUILD OPTIONS
ASM_OPTIONS=""
case ${ARCH} in
arm-v7a)
ARCH_OPTIONS="-DARCH_ARM=1 -DENABLE_NEON=0 -DHAVE_NEON=0"
ASM_OPTIONS="-DARCH_ARM=1 -DENABLE_NEON=0 -DHAVE_NEON=0"
;;
arm-v7a-neon)
ARCH_OPTIONS="-DARCH_ARM=1 -DENABLE_NEON=1 -DHAVE_NEON=1"
ASM_OPTIONS="-DARCH_ARM=1 -DENABLE_NEON=1 -DHAVE_NEON=1"
;;
arm64-v8a)
ARCH_OPTIONS="-DARCH_ARM=1 -DENABLE_NEON=1 -DHAVE_NEON=1"
ASM_OPTIONS="-DARCH_ARM=1 -DENABLE_NEON=1 -DHAVE_NEON=1"
;;
x86)
ARCH_OPTIONS="-DENABLE_SSE=1 -DHAVE_SSE=1 -DENABLE_SSE3=1 -DHAVE_SSE3=1"
ASM_OPTIONS="-DENABLE_SSE=1 -DHAVE_SSE=1 -DENABLE_SSE3=1 -DHAVE_SSE3=1"
;;
x86-64)
ARCH_OPTIONS="-DENABLE_SSE4_2=1 -DHAVE_SSE4_2=1"
ASM_OPTIONS="-DENABLE_SSE4_2=1 -DHAVE_SSE4_2=1"
;;
esac
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
if [ -d "cmake-build" ]; then
rm -rf cmake-build
fi
mkdir cmake-build;
cd cmake-build
mkdir -p "${BUILD_DIR}" || return 1
cd "${BUILD_DIR}" || return 1
cmake -Wno-dev \
-DCMAKE_VERBOSE_MAKEFILE=0 \
@ -67,28 +29,28 @@ cmake -Wno-dev \
-DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_SYSROOT="${ANDROID_SYSROOT}" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_SYSROOT}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Generic \
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
-DCMAKE_INSTALL_PREFIX="${LIB_INSTALL_PREFIX}" \
-DCMAKE_CXX_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CXX" \
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
${ARCH_OPTIONS} \
${ASM_OPTIONS} \
-DENABLE_TESTS=0 \
-DENABLE_EXAMPLES=0 \
-DENABLE_TOOLS=0 \
-DCONFIG_UNIT_TESTS=0 \
-DAOM_TARGET_CPU=generic \
-DBUILD_SHARED_LIBS=0 .. || exit 1
-DBUILD_SHARED_LIBS=0 "${BASEDIR}"/src/"${LIB_NAME}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_libaom_package_config "1.0.0"
make install || exit 1
create_libaom_package_config "2.0.0" || return 1

View File

@ -1,60 +1,45 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libass"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libass} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
fi
# SET ARCH OPTIONS
ASM_FLAGS=""
# SET BUILD OPTIONS
ASM_OPTIONS=""
case ${ARCH} in
x86)
# please note that asm is disabled
# because enabling asm for x86 causes text relocations in libavfilter.so
ASM_FLAGS=" --disable-asm"
# enabling asm for x86 causes text relocations in libavfilter.so
ASM_OPTIONS=" --disable-asm"
;;
*)
ASM_FLAGS=" --enable-asm"
ASM_OPTIONS=" --enable-asm"
;;
esac
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libass} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--disable-libtool-lock \
--enable-static \
--disable-shared \
--disable-harfbuzz \
--disable-require-system-font-provider \
--disable-fast-install \
--disable-test \
--disable-profile \
--disable-coretext \
${ASM_FLAGS} \
--host=${BUILD_HOST} || exit 1
${ASM_OPTIONS} \
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,40 +1,29 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libiconv"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# PULL SUBMODULES
./gitsub.sh pull || return 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libiconv} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libiconv} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--disable-rpath \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_libiconv_package_config "1.16"
make install || exit 1
create_libiconv_package_config "1.16.2" || return 1

View File

@ -1,39 +1,25 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libilbc"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libilbc} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libilbc} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./libilbc.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./libilbc.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,59 +1,25 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libogg"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libogg} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libogg} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ogg.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ogg.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,78 +1,45 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libpng"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
ARCH_OPTIONS=""
# SET BUILD OPTIONS
ASM_OPTIONS=""
case ${ARCH} in
x86 | x86-64)
ARCH_OPTIONS="--enable-hardware-optimizations --enable-intel-sse=yes"
ASM_OPTIONS="--enable-hardware-optimizations --enable-intel-sse=yes"
;;
arm-v7a-neon | arm64-v8a)
ARCH_OPTIONS="--enable-hardware-optimizations --enable-arm-neon=yes"
ASM_OPTIONS="--enable-hardware-optimizations --enable-arm-neon=yes"
;;
arm-v7a)
# hardware-optimizations not enabled because
# when --enable-hardware-optimizations is added
# make tries to build arm-neon specific instructions, which breaks compilation
ARCH_OPTIONS="--enable-arm-neon=no"
ASM_OPTIONS="--enable-arm-neon=no"
;;
esac
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libpng} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libpng} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--disable-unversioned-libpng-pc \
--disable-unversioned-libpng-config \
${ARCH_OPTIONS} \
--host=${BUILD_HOST} || exit 1
${ASM_OPTIONS} \
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,64 +1,29 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libsamplerate"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# DISABLE building of examples manually
${SED_INLINE} 's/examples tests//g' ${BASEDIR}/src/${LIB_NAME}/Makefile*
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libsamplerate} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libsamplerate} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-fftw \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
# WORKAROUND TO DISABLE BUILDING OF EXAMPLES AND TESTS
${SED_INLINE} 's/examples tests//g' "${BASEDIR}"/src/"${LIB_NAME}"/Makefile* || return 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,51 +1,17 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libsndfile"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
if [[ ! -f ${BASEDIR}/src/${LIB_NAME}/configure ]] || [[ ${RECONF_libsndfile} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libsndfile} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
@ -53,11 +19,11 @@ fi
--disable-alsa \
--disable-full-suite \
--disable-external-libs \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,56 +1,26 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
# SET BUILD OPTIONS
if [[ -z ${FFMPEG_KIT_LTS_BUILD} ]]; then
ASM_OPTIONS="--enable-asm"
else
ASM_OPTIONS="--disable-asm"
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libtheora"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libtheora} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
fi
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libtheora} -eq 1 ]]; then
if [[ -z ${FFMPEG_KIT_LTS_BUILD} ]]; then
ASM_FLAGS="--enable-asm"
else
ASM_FLAGS="--disable-asm"
# WORKAROUND NOT TO RUN CONFIGURE AT THE END OF autogen.sh
$SED_INLINE 's/$srcdir\/configure/#$srcdir\/configure/g' "${BASEDIR}"/src/"${LIB_NAME}"/autogen.sh || return 1
./autogen.sh || return 1
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--enable-static \
--disable-shared \
@ -58,15 +28,15 @@ fi
--disable-examples \
--disable-telemetry \
--disable-sdltest \
${ASM_FLAGS} \
${ASM_OPTIONS} \
--disable-valgrind-testing \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp theoradec.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
cp theoraenc.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
cp theora.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp theoradec.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
cp theoraenc.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
cp theora.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,59 +1,25 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libuuid"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_libuuid} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libuuid} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
# AUTO-GENERATED PKG-CONFIG FILE IS WRONG. CREATING IT MANUALLY
create_uuid_package_config "1.0.3"
make install || return 1
make install || exit 1
# CREATE PACKAGE CONFIG MANUALLY
create_uuid_package_config "1.0.3" || return 1

View File

@ -1,66 +1,28 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libvidstab"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
CFLAGS=$(get_cflags ${LIB_NAME})
CXXFLAGS=$(get_cxxflags ${LIB_NAME})
LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
if [ -d "build" ]; then
rm -rf build
fi
mkdir build;
cd build
ASM_FLAGS=""
# SET BUILD OPTIONS
ASM_OPTIONS=""
case ${ARCH} in
arm-v7a | arm-v7a-neon | arm64-v8a)
ASM_FLAGS="-DSSE2_FOUND=0 -DSSE3_FOUND=0 -DSSSE3_FOUND=0 -DSSE4_1_FOUND=0"
ASM_OPTIONS="-DSSE2_FOUND=0 -DSSE3_FOUND=0 -DSSSE3_FOUND=0 -DSSE4_1_FOUND=0"
;;
*)
ASM_FLAGS=""
ASM_OPTIONS=""
;;
esac
mkdir -p "${BUILD_DIR}" || return 1
cd "${BUILD_DIR}" || return 1
cmake -Wno-dev \
-DCMAKE_VERBOSE_MAKEFILE=0 \
-DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
-DCMAKE_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
-DCMAKE_SYSROOT="${ANDROID_SYSROOT}" \
-DCMAKE_FIND_ROOT_PATH="${ANDROID_SYSROOT}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
-DCMAKE_INSTALL_PREFIX="${LIB_INSTALL_PREFIX}" \
-DCMAKE_SYSTEM_NAME=Generic \
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
@ -68,13 +30,13 @@ cmake -Wno-dev \
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
-DUSE_OMP=0 \
${ASM_FLAGS} \
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_target_processor) \
-DBUILD_SHARED_LIBS=0 .. || exit 1
${ASM_OPTIONS} \
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_system_processor) \
-DBUILD_SHARED_LIBS=0 "${BASEDIR}"/src/"${LIB_NAME}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp vidstab.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp vidstab.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,65 +1,34 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libvorbis"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# -mno-ieee-fp option is not compatible with clang. removing it
${SED_INLINE} 's/\-mno-ieee-fp//g' ${BASEDIR}/src/${LIB_NAME}/configure.ac
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libvorbis} -eq 1 ]]; then
# ALWAYS RECONFIGURE
autoreconf_library ${LIB_NAME}
# -mno-ieee-fp OPTION IS NOT COMPATIBLE WITH clang. REMOVING IT
${SED_INLINE} 's/\-mno-ieee-fp//g' "${BASEDIR}"/src/"${LIB_NAME}"/configure.ac || return 1
autoreconf_library "${LIB_NAME}"
fi
PKG_CONFIG= ./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-ogg-includes=${BASEDIR}/prebuilt/android-$(get_target_build)/libogg/include \
--with-ogg-libraries=${BASEDIR}/prebuilt/android-$(get_target_build)/libogg/lib \
--with-sysroot="${ANDROID_SYSROOT}" \
--with-ogg-includes="${LIB_INSTALL_BASE}"/libogg/include \
--with-ogg-libraries="${LIB_INSTALL_BASE}"/libogg/lib \
--enable-static \
--disable-shared \
--disable-fast-install \
--disable-docs \
--disable-examples \
--disable-oggtest \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_libvorbis_package_config "1.3.7"
make install || exit 1
create_libvorbis_package_config "1.3.7" || return 1

View File

@ -1,50 +1,18 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libvpx"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
export CFLAGS="$(get_cflags ${LIB_NAME}) -I${ANDROID_NDK_ROOT}/sources/android/cpufeatures"
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS="$(get_ldflags ${LIB_NAME})"
# RECOVER configure.sh
rm -f ${BASEDIR}/src/${LIB_NAME}/build/make/configure.sh
cp ${BASEDIR}/tools/make/configure.libvpx.android.sh ${BASEDIR}/src/${LIB_NAME}/build/make/configure.sh
# UPDATE BUILD FLAGS
export CFLAGS="$(get_cflags "${LIB_NAME}") -I${LIB_INSTALL_BASE}/cpu-features/include/ndk_compat"
# SET BUILD OPTIONS
TARGET_CPU=""
DISABLE_NEON_FLAG=""
ASM_OPTIONS=""
case ${ARCH} in
arm-v7a)
TARGET_CPU="armv7"
# NEON disabled explicitly because
# --enable-runtime-cpu-detect enables NEON for armv7 cpu
DISABLE_NEON_FLAG="--disable-neon"
ASM_OPTIONS="--disable-neon"
unset ASFLAGS
;;
arm-v7a-neon)
@ -59,17 +27,21 @@ case ${ARCH} in
;;
*)
# INTEL CPU EXTENSIONS ENABLED BY --enable-runtime-cpu-detect
TARGET_CPU="$(get_target_build)"
TARGET_CPU="$(get_target_cpu)"
export ASFLAGS="-D__ANDROID__"
;;
esac
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# NOTE THAT RECONFIGURE IS NOT SUPPORTED
# WORKAROUND TO FIX BUILD OPTIONS DEFINED IN configure.sh
overwrite_file "${BASEDIR}"/tools/patch/make/libvpx/configure.sh "${BASEDIR}"/src/"${LIB_NAME}"/build/make/configure.sh || return 1
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--target="${TARGET_CPU}-android-gcc" \
--extra-cflags="${CFLAGS}" \
--extra-cxxflags="${CXXFLAGS}" \
@ -81,7 +53,7 @@ make distclean 2>/dev/null 1>/dev/null
--enable-optimizations \
--enable-better-hw-compatibility \
--enable-runtime-cpu-detect \
${DISABLE_NEON_FLAG} \
${ASM_OPTIONS} \
--enable-vp8 \
--enable-vp9 \
--enable-multithread \
@ -105,11 +77,11 @@ make distclean 2>/dev/null 1>/dev/null
--disable-encode-perf-tests \
--disable-codec-srcs \
--disable-debug-libs \
--disable-internal-stats || exit 1
--disable-internal-stats || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,83 +1,53 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libwebp"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
ARCH_OPTIONS=""
# SET BUILD OPTIONS
ASM_OPTIONS=""
case ${ARCH} in
arm-v7a)
ARCH_OPTIONS="--disable-neon --disable-neon-rtcd"
ASM_OPTIONS="--disable-neon --disable-neon-rtcd"
;;
arm-v7a-neon | arm64-v8a)
ARCH_OPTIONS="--enable-neon --enable-neon-rtcd"
ASM_OPTIONS="--enable-neon --enable-neon-rtcd"
;;
*)
ARCH_OPTIONS="--enable-sse2 --enable-sse4.1"
ASM_OPTIONS="--enable-sse2 --enable-sse4.1"
;;
esac
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# ALWAYS RECONFIGURE
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libwebp} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-dependency-tracking \
--enable-libwebpmux \
${ARCH_OPTIONS} \
--with-pngincludedir="${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/include" \
--with-pnglibdir="${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/lib" \
--with-jpegincludedir="${BASEDIR}/prebuilt/android-$(get_target_build)/jpeg/include" \
--with-jpeglibdir="${BASEDIR}/prebuilt/android-$(get_target_build)/jpeg/lib" \
--with-gifincludedir="${BASEDIR}/prebuilt/android-$(get_target_build)/giflib/include" \
--with-giflibdir="${BASEDIR}/prebuilt/android-$(get_target_build)/giflib/lib" \
--with-tiffincludedir="${BASEDIR}/prebuilt/android-$(get_target_build)/tiff/include" \
--with-tifflibdir="${BASEDIR}/prebuilt/android-$(get_target_build)/tiff/lib" \
--host=${BUILD_HOST} || exit 1
${ASM_OPTIONS} \
--with-pngincludedir="${LIB_INSTALL_BASE}/libpng/include" \
--with-pnglibdir="${LIB_INSTALL_BASE}/libpng/lib" \
--with-jpegincludedir="${LIB_INSTALL_BASE}/jpeg/include" \
--with-jpeglibdir="${LIB_INSTALL_BASE}/jpeg/lib" \
--with-gifincludedir="${LIB_INSTALL_BASE}/giflib/include" \
--with-giflibdir="${LIB_INSTALL_BASE}/giflib/lib" \
--with-tiffincludedir="${LIB_INSTALL_BASE}/tiff/include" \
--with-tifflibdir="${LIB_INSTALL_BASE}/tiff/lib" \
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ${BASEDIR}/src/${LIB_NAME}/src/*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
cp ${BASEDIR}/src/${LIB_NAME}/src/demux/*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
cp ${BASEDIR}/src/${LIB_NAME}/src/mux/*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
cp ${BASEDIR}/src/${LIB_NAME}/src/*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
cp ${BASEDIR}/src/${LIB_NAME}/src/demux/*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
cp ${BASEDIR}/src/${LIB_NAME}/src/mux/*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
make install || exit 1
make install || return 1

View File

@ -1,58 +1,25 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="libxml2"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
export PKG_CONFIG_LIBDIR="${INSTALL_PKG_CONFIG_DIR}"
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
make distclean 2>/dev/null 1>/dev/null
# NOTE THAT PYTHON IS DISABLED DUE TO THE FOLLOWING ERROR
#
# .../include/python2.7/pyport.h:1029:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
# #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#
# ALWAYS RECONFIGURE
autoreconf_library ${LIB_NAME}
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libxml2} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--with-zlib \
--with-iconv=${BASEDIR}/prebuilt/android-$(get_target_build)/libiconv/lib \
--with-iconv="${LIB_INSTALL_BASE}/libiconv/lib" \
--with-sax1 \
--without-python \
--without-debug \
@ -60,11 +27,11 @@ autoreconf_library ${LIB_NAME}
--enable-static \
--disable-shared \
--disable-fast-install \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# CREATE PACKAGE CONFIG MANUALLY
create_libxml2_package_config "2.9.10"
make install || exit 1
create_libxml2_package_config "2.9.10" || return 1

View File

@ -1,75 +1,46 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="nettle"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
OPTIONAL_CPU_SUPPORT=""
# SET BUILD OPTIONS
ASM_OPTIONS=""
case ${ARCH} in
arm-v7a-neon | arm64-v8a)
OPTIONAL_CPU_SUPPORT="--enable-arm-neon"
ASM_OPTIONS="--enable-arm-neon"
;;
x86 | x86-64)
OPTIONAL_CPU_SUPPORT="--enable-x86-aesni"
ASM_OPTIONS="--enable-x86-aesni"
;;
esac
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_nettle} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_nettle} -eq 1 ]]; then
# WORKAROUND TO FIX BUILD SYSTEM COMPILER ON macOS
overwrite_file "${BASEDIR}"/tools/patch/make/nettle/aclocal.m4 "${BASEDIR}"/src/"${LIB_NAME}"/aclocal.m4
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--enable-pic \
--enable-static \
--with-include-path=${BASEDIR}/prebuilt/android-$(get_target_build)/gmp/include \
--with-lib-path=${BASEDIR}/prebuilt/android-$(get_target_build)/gmp/lib \
--with-include-path="${LIB_INSTALL_BASE}"/gmp/include \
--with-lib-path="${LIB_INSTALL_BASE}"/gmp/lib \
--disable-shared \
--disable-mini-gmp \
--disable-assembler \
--disable-openssl \
--disable-gcov \
--disable-documentation \
${OPTIONAL_CPU_SUPPORT} \
--host=${BUILD_HOST} || exit 1
${ASM_OPTIONS} \
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,60 +1,26 @@
#!/bin/bash
if [[ -z ${ANDROID_NDK_ROOT} ]]; then
echo -e "\n(*) ANDROID_NDK_ROOT not defined\n"
exit 1
fi
if [[ -z ${ARCH} ]]; then
echo -e "\n(*) ARCH not defined\n"
exit 1
fi
if [[ -z ${API} ]]; then
echo -e "\n(*) API not defined\n"
exit 1
fi
if [[ -z ${BASEDIR} ]]; then
echo -e "\n(*) BASEDIR not defined\n"
exit 1
fi
# ENABLE COMMON FUNCTIONS
. ${BASEDIR}/build/android-common.sh
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="opencore-amr"
set_toolchain_paths ${LIB_NAME}
# PREPARING FLAGS
BUILD_HOST=$(get_build_host)
export CFLAGS=$(get_cflags ${LIB_NAME})
export CXXFLAGS=$(get_cxxflags ${LIB_NAME})
export LDFLAGS=$(get_ldflags ${LIB_NAME})
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
# RECONFIGURE IF REQUESTED
if [[ ${RECONF_opencore_amr} -eq 1 ]]; then
autoreconf_library ${LIB_NAME}
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_opencore_amr} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
./configure \
--prefix=${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME} \
--prefix="${LIB_INSTALL_PREFIX}" \
--with-pic \
--with-sysroot=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot \
--with-sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-shared \
--disable-fast-install \
--disable-maintainer-mode \
--host=${BUILD_HOST} || exit 1
--host="${HOST}" || return 1
make -j$(get_cpu_count) || exit 1
make -j$(get_cpu_count) || return 1
make install || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp amrnb/*.pc ${INSTALL_PKG_CONFIG_DIR} || exit 1
make install || exit 1
cp amrnb/*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1

View File

@ -1,45 +1,36 @@
#!/bin/bash
# ENABLE COMMON FUNCTIONS
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
# UPDATE BUILD FLAGS
export CFLAGS="$CFLAGS $(pkg-config --cflags libiconv) $(pkg-config --cflags cpu-features)"
export LDFLAGS="$LDFLAGS $(pkg-config --libs --static libiconv) $(pkg-config --libs --static cpu-features)"
# PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR}
LIB_NAME="openh264"
set_toolchain_paths ${LIB_NAME}
# SET BUILD FLAGS
BUILD_HOST=$(get_build_host)
CFLAGS=$(get_cflags ${LIB_NAME})
CXXFLAGS=$(get_cxxflags ${LIB_NAME})
LDFLAGS=$(get_ldflags ${LIB_NAME})
# SET ARCH OPTIONS
# SET BUILD OPTIONS
case ${ARCH} in
arm-v7a-neon)
ARCH_OPTIONS=arm
ASM_OPTIONS=arm
CFLAGS+=" -DHAVE_NEON -DANDROID_NDK"
;;
arm64-v8a)
ARCH_OPTIONS=arm64
ASM_OPTIONS=arm64
CFLAGS+=" -DHAVE_NEON_AARCH64 -DANDROID_NDK"
;;
x86*)
ARCH_OPTIONS=x86
ASM_OPTIONS=x86
CFLAGS+=" -DHAVE_AVX2 -DANDROID_NDK"
;;
esac
cd ${BASEDIR}/src/${LIB_NAME} || exit 1
# ALWAYS CLEAN THE PREVIOUS BUILD
make clean 2>/dev/null 1>/dev/null
# revert ios changes
git checkout ${BASEDIR}/src/${LIB_NAME}/build 1>>"${BASEDIR}"/build.log 2>&1
git checkout ${BASEDIR}/src/${LIB_NAME}/codec 1>>"${BASEDIR}"/build.log 2>&1
# DISCARD APPLE WORKAROUNDS
git checkout "${BASEDIR}"/src/"${LIB_NAME}"/build || return 1
git checkout "${BASEDIR}"/src/"${LIB_NAME}"/codec || return 1
# comment out the piece that compiles cpu-features into libopenh264.a
${SED_INLINE} 's/^COMMON_OBJS +=/# COMMON_OBJS +=/' ${BASEDIR}/src/${LIB_NAME}/build/platform-android.mk
${SED_INLINE} 's/^COMMON_CFLAGS +=/# COMMON_CFLAGS +=/' ${BASEDIR}/src/${LIB_NAME}/build/platform-android.mk
# WORKAROUND TO DISABLE PARTS THAT COMPILE cpu-features INTO libopenh264.a
${SED_INLINE} 's/^COMMON_INCLUDES +=/# COMMON_INCLUDES +=/' "${BASEDIR}"/src/"${LIB_NAME}"/build/platform-android.mk
${SED_INLINE} 's/^COMMON_OBJS +=/# COMMON_OBJS +=/' "${BASEDIR}"/src/"${LIB_NAME}"/build/platform-android.mk
${SED_INLINE} 's/^COMMON_CFLAGS +=/# COMMON_CFLAGS +=/' "${BASEDIR}"/src/"${LIB_NAME}"/build/platform-android.mk
make -j$(get_cpu_count) \
ARCH="$(get_toolchain_arch)" \
@ -47,16 +38,15 @@ CC="$CC" \
CFLAGS="$CFLAGS" \
CXX="$CXX" \
CXXFLAGS="${CXXFLAGS}" \
LDFLAGS="$LDFLAGS" \
LDFLAGS="${LDFLAGS}" \
OS=android \
PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \
PREFIX="${LIB_INSTALL_PREFIX}" \
NDKLEVEL="${API}" \
NDKROOT="${ANDROID_NDK_ROOT}" \
NDK_TOOLCHAIN_VERSION=clang \
AR="$AR" \
ARCH_OPTIONS=${ARCH_OPTIONS} \
TARGET="android-${API}" \
install-static || exit 1
ASM_OPTIONS=${ASM_OPTIONS} \
TARGET="android-${API}" install-static || return 1
# MANUALLY COPY PKG-CONFIG FILES
cp ${BASEDIR}/src/${LIB_NAME}/openh264-static.pc ${INSTALL_PKG_CONFIG_DIR}/openh264.pc || exit 1
cp "${BASEDIR}"/src/"${LIB_NAME}"/openh264-static.pc "${INSTALL_PKG_CONFIG_DIR}"/openh264.pc || return 1

Some files were not shown because too many files have changed in this diff Show More