qt: playlist: use item title if available
[vlc.git] / contrib / src / vpx / rules.mak
blob3e7da64a597f462523f16bec48a22e7534894cba
1 # libvpx
3 VPX_VERSION := 1.10.0
4 VPX_URL := http://github.com/webmproject/libvpx/archive/v${VPX_VERSION}.tar.gz
6 PKGS += vpx
7 ifeq ($(call need_pkg,"vpx >= 1.5.0"),)
8 PKGS_FOUND += vpx
9 endif
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
17 $(UNPACK)
18 $(APPLY) $(SRC)/vpx/libvpx-ios.patch
19 ifdef HAVE_ANDROID
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)
23 endif
24 ifdef HAVE_MACOSX
25 ifeq ($(ARCH),aarch64)
26 $(APPLY) $(SRC)/vpx/libvpx-darwin-aarch64.patch
27 endif
28 endif
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
32 $(MOVE)
34 DEPS_vpx =
36 ifdef HAVE_WIN32
37 DEPS_vpx += pthreads $(DEPS_pthreads)
38 endif
40 ifdef HAVE_CROSS_COMPILE
41 VPX_CROSS := $(HOST)-
42 else
43 VPX_CROSS :=
44 endif
46 VPX_LDFLAGS := $(LDFLAGS)
48 ifeq ($(ARCH),arm)
49 VPX_ARCH := armv7
50 else ifeq ($(ARCH),i386)
51 VPX_ARCH := x86
52 else ifeq ($(ARCH),mips)
53 VPX_ARCH := mips32
54 else ifeq ($(ARCH),ppc)
55 VPX_ARCH := ppc32
56 else ifeq ($(ARCH),ppc64)
57 VPX_ARCH := ppc64
58 else ifeq ($(ARCH),sparc)
59 VPX_ARCH := sparc
60 else ifeq ($(ARCH),x86_64)
61 VPX_ARCH := x86_64
62 else ifeq ($(ARCH),aarch64)
63 VPX_ARCH := arm64
64 endif
66 ifdef HAVE_ANDROID
67 VPX_OS := android
68 else ifdef HAVE_LINUX
69 VPX_OS := linux
70 else ifdef HAVE_DARWIN_OS
71 VPX_CROSS :=
72 ifeq ($(ARCH),$(filter $(ARCH), arm aarch64))
73 VPX_OS := darwin
74 else
75 VPX_OS := darwin11
76 endif
77 else ifdef HAVE_SOLARIS
78 VPX_OS := solaris
79 else ifdef HAVE_WIN64 # must be before WIN32
80 VPX_OS := win64
81 else ifdef HAVE_WIN32
82 VPX_OS := win32
83 else ifdef HAVE_BSD
84 VPX_OS := linux
85 endif
87 VPX_TARGET := generic-gnu
88 ifdef VPX_ARCH
89 ifdef VPX_OS
90 VPX_TARGET := $(VPX_ARCH)-$(VPX_OS)-gcc
91 endif
92 endif
94 VPX_CONF := \
95 --disable-docs \
96 --disable-examples \
97 --disable-unit-tests \
98 --disable-install-bins \
99 --disable-install-docs \
100 --disable-dependency-tracking \
101 --enable-vp9-highbitdepth \
102 --disable-tools
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
107 ifndef HAVE_WIN32
108 ifndef HAVE_DARWIN_OS
109 VPX_CONF += --enable-runtime-cpu-detect
110 endif
111 endif
112 endif
114 ifndef BUILD_ENCODERS
115 VPX_CONF += --disable-vp8-encoder --disable-vp9-encoder
116 endif
118 ifndef HAVE_WIN32
119 VPX_CONF += --enable-pic
120 else
121 VPX_CONF += --extra-cflags="-mstackrealign"
122 endif
123 ifdef HAVE_MACOSX
124 VPX_CONF += --extra-cflags="$(CFLAGS) $(EXTRA_CFLAGS)"
125 endif
126 ifdef HAVE_IOS
127 VPX_CONF += --enable-vp8-decoder --disable-tools
128 VPX_CONF += --extra-cflags="$(CFLAGS) $(EXTRA_CFLAGS)"
129 ifdef HAVE_TVOS
130 VPX_LDFLAGS := -L$(IOS_SDK)/usr/lib -isysroot $(IOS_SDK) -mtvos-version-min=9.0
131 else
132 VPX_LDFLAGS := -L$(IOS_SDK)/usr/lib -isysroot $(IOS_SDK) -miphoneos-version-min=8.4
133 endif
134 ifeq ($(ARCH),aarch64)
135 VPX_LDFLAGS += -arch arm64
136 else
137 ifndef HAVE_IOS
138 VPX_LDFLAGS += -arch $(ARCH)
139 endif
140 endif
141 endif
143 ifneq ($(filter i386 x86_64,$(ARCH)),)
144 # broken text relocations or invalid register for .seh_savexmm with gcc8
145 VPX_CONF += --disable-mmx
146 endif
148 ifdef WITH_OPTIMIZATION
149 VPX_CFLAGS += -DNDEBUG
150 else
151 VPX_CONF += --disable-optimizations
152 endif
154 # Always enable debug symbols, we strip in the final executables if needed
155 VPX_CONF += --enable-debug
157 ifdef HAVE_ANDROID
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)
164 endif
165 endif
167 .vpx: libvpx
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
174 touch $@