4 VPX_URL
:= http
://github.com
/webmproject
/libvpx
/archive
/v
${VPX_VERSION}.
tar.gz
7 ifeq ($(call need_pkg
,"vpx >= 1.5.0"),)
11 $(TARBALLS
)/libvpx-
$(VPX_VERSION
).
tar.gz
:
12 $(call download_pkg
,$(VPX_URL
),vpx
)
14 .sum-vpx
: libvpx-
$(VPX_VERSION
).
tar.gz
16 libvpx
: libvpx-
$(VPX_VERSION
).
tar.gz .sum-vpx
18 $(APPLY
) $(SRC
)/vpx
/libvpx-ios.patch
20 $(APPLY
) $(SRC
)/vpx
/libvpx-android.patch
21 cp
"${ANDROID_NDK}"/sources
/android
/cpufeatures
/cpu-features.c
$(UNPACK_DIR
)/vpx_ports
22 cp
"${ANDROID_NDK}"/sources
/android
/cpufeatures
/cpu-features.h
$(UNPACK_DIR
)
25 ifeq ($(ARCH
),aarch64
)
26 $(APPLY
) $(SRC
)/vpx
/libvpx-darwin-aarch64.patch
29 # Disable automatic addition of -fembed-bitcode for iOS
30 # as it is enabled through --extra-cflags if necessary.
31 $(APPLY
) $(SRC
)/vpx
/libvpx-remove-bitcode.patch
37 DEPS_vpx
+= pthreads
$(DEPS_pthreads
)
40 ifdef HAVE_CROSS_COMPILE
46 VPX_LDFLAGS
:= $(LDFLAGS
)
50 else ifeq ($(ARCH
),i386
)
52 else ifeq ($(ARCH
),mips
)
54 else ifeq ($(ARCH
),ppc
)
56 else ifeq ($(ARCH
),ppc64
)
58 else ifeq ($(ARCH
),sparc
)
60 else ifeq ($(ARCH
),x86_64
)
62 else ifeq ($(ARCH
),aarch64
)
70 else ifdef HAVE_DARWIN_OS
72 ifeq ($(ARCH
),$(filter $(ARCH
), arm aarch64
))
77 else ifdef HAVE_SOLARIS
79 else ifdef HAVE_WIN64
# must be before WIN32
87 VPX_TARGET
:= generic-gnu
90 VPX_TARGET
:= $(VPX_ARCH
)-$(VPX_OS
)-gcc
97 --disable-unit-tests \
98 --disable-install-bins \
99 --disable-install-docs \
100 --disable-dependency-tracking \
101 --enable-vp9-highbitdepth \
104 ifneq ($(filter arm aarch64
, $(ARCH
)),)
105 # Only enable runtime cpu detect on architectures other than arm/aarch64
106 # when building for Windows and Darwin
108 ifndef HAVE_DARWIN_OS
109 VPX_CONF
+= --enable-runtime-cpu-detect
114 ifndef BUILD_ENCODERS
115 VPX_CONF
+= --disable-vp8-encoder
--disable-vp9-encoder
119 VPX_CONF
+= --enable-pic
121 VPX_CONF
+= --extra-cflags
="-mstackrealign"
124 VPX_CONF
+= --extra-cflags
="$(CFLAGS) $(EXTRA_CFLAGS)"
127 VPX_CONF
+= --enable-vp8-decoder
--disable-tools
128 VPX_CONF
+= --extra-cflags
="$(CFLAGS) $(EXTRA_CFLAGS)"
130 VPX_LDFLAGS
:= -L
$(IOS_SDK
)/usr
/lib
-isysroot
$(IOS_SDK
) -mtvos-version-min
=9.0
132 VPX_LDFLAGS
:= -L
$(IOS_SDK
)/usr
/lib
-isysroot
$(IOS_SDK
) -miphoneos-version-min
=8.4
134 ifeq ($(ARCH
),aarch64
)
135 VPX_LDFLAGS
+= -arch arm64
138 VPX_LDFLAGS
+= -arch
$(ARCH
)
143 ifneq ($(filter i386 x86_64
,$(ARCH
)),)
144 # broken text relocations or invalid register for .seh_savexmm with gcc8
145 VPX_CONF
+= --disable-mmx
148 ifdef WITH_OPTIMIZATION
149 VPX_CFLAGS
+= -DNDEBUG
151 VPX_CONF
+= --disable-optimizations
154 # Always enable debug symbols, we strip in the final executables if needed
155 VPX_CONF
+= --enable-debug
158 # Starting NDK19, standalone toolchains are deprecated and gcc is not shipped.
159 # The presence of gcc can be used to detect if we are using an old standalone
160 # toolchain. Unfortunately, libvpx buildsystem only work with standalone
161 # toolchains, therefore pass the HOSTVARS directly to bypass any detection.
162 ifneq ($(shell $(VPX_CROSS
)gcc
-v
>/dev
/null
2>&1 || echo FAIL
),)
163 VPX_HOSTVARS
= $(HOSTVARS
)
168 rm -rf
$(PREFIX
)/include/vpx
169 cd
$< && LDFLAGS
="$(VPX_LDFLAGS)" CROSS
=$(VPX_CROSS
) $(VPX_HOSTVARS
) .
/configure
--target
=$(VPX_TARGET
) \
170 $(VPX_CONF
) --prefix=$(PREFIX
)
171 cd
$< && CONFIG_DEBUG
=1 $(MAKE
)
172 $(call pkg_static
,"vpx.pc")
173 cd
$< && CONFIG_DEBUG
=1 $(MAKE
) install