Contribs: update AOM to a more recent hash
[vlc.git] / contrib / src / aom / rules.mak
blob76510fd62b0f941acadd65d770656eb3ee282339
1 # aom
2 AOM_HASH := e2aa4019709af0520b79397a28934237b15d2fda
3 AOM_VERSION := git-$(AOM_HASH)
4 AOM_GITURL := https://aomedia.googlesource.com/aom/+archive/$(AOM_HASH).tar.gz
6 PKGS += aom
7 ifeq ($(call need_pkg,"aom"),)
8 PKGS_FOUND += aom
9 endif
11 $(TARBALLS)/aom-$(AOM_VERSION).tar.gz:
12 $(call download,$(AOM_GITURL))
14 .sum-aom: aom-$(AOM_VERSION).tar.gz
15 $(warning $@ not implemented)
16 touch $@
18 aom: aom-$(AOM_VERSION).tar.gz .sum-aom
19 rm -Rf $@-$(AOM_VERSION) $@
20 mkdir -p $@-$(AOM_VERSION)
21 tar xvzf "$<" -C $@-$(AOM_VERSION)
22 ifdef HAVE_WINSTORE
23 $(APPLY) $(SRC)/aom/aom-pthreads-win32.patch
24 endif
25 $(MOVE)
27 DEPS_aom =
28 ifdef HAVE_WIN32
29 DEPS_aom += pthreads $(DEPS_pthreads)
30 endif
32 AOM_LDFLAGS := $(LDFLAGS)
34 AOM_CONF := \
35 -DCONFIG_RUNTIME_CPU_DETECT=1 \
36 -DENABLE_DOCS=OFF \
37 -DENABLE_EXAMPLES=OFF \
38 -DENABLE_TOOLS=OFF \
39 -DCONFIG_UNIT_TESTS=0 \
40 -DCONFIG_INSTALL_BINS=0 \
41 -DCONFIG_INSTALL_DOCS=0 \
42 -DCONFIG_DEPENDENCY_TRACKING=0
44 ifndef BUILD_ENCODERS
45 AOM_CONF += -DCONFIG_AV1_ENCODER=0
46 endif
48 ifndef HAVE_WIN32
49 AOM_CONF += -DCONFIG_PIC=1
50 endif
52 ifdef HAVE_WIN32
53 ifneq ($(filter arm aarch64, $(ARCH)),)
54 # These targets don't have runtime cpu detection.
55 AOM_CONF += -DCONFIG_RUNTIME_CPU_DETECT=0
56 endif
57 ifeq ($(ARCH),arm)
58 # armv7, not just plain arm
59 AOM_CONF += -DAOM_TARGET_CPU=armv7
60 AOM_CONF += -DAOM_ADS2GAS_REQUIRED=1 -DAOM_ADS2GAS=../build/make/ads2gas.pl -DAOM_ADS2GAS_OPTS="-thumb;-noelf" -DAOM_GAS_EXT=S
61 endif
62 endif
64 # libaom doesn't allow in-tree builds
65 .aom: aom toolchain.cmake
66 cd $< && mkdir -p aom_build
67 cd $</aom_build && LDFLAGS="$(AOM_LDFLAGS)" $(HOSTVARS) $(CMAKE) ../ $(AOM_CONF)
68 cd $< && $(MAKE) -C aom_build
69 cd $</aom_build && ../../../../contrib/src/pkg-static.sh aom.pc
70 cd $</aom_build && $(MAKE) install
71 touch $@