aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/depends/target/dav1d/Makefile35
1 files changed, 30 insertions, 5 deletions
diff --git a/tools/depends/target/dav1d/Makefile b/tools/depends/target/dav1d/Makefile
index 19808bba21..be5f2fa835 100644
--- a/tools/depends/target/dav1d/Makefile
+++ b/tools/depends/target/dav1d/Makefile
@@ -1,6 +1,29 @@
-include ../../Makefile.include
+-include ../../Makefile.include
include DAV1D-VERSION
-DEPS = ../../Makefile.include Makefile DAV1D-VERSION
+DEPS = Makefile DAV1D-VERSION
+
+ifeq ($(CROSS_COMPILING), yes)
+ DEPS += ../../Makefile.include
+ PYTHON = $(NATIVEPREFIX)/bin/python3
+ MESON = $(NATIVEPREFIX)/bin/meson
+ NINJA = $(NATIVEPREFIX)/bin/ninja
+else
+ ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+ PREFIX ?= $(ROOT_DIR)/dav1d-install
+ BASE_URL ?= http://mirrors.kodi.tv/build-deps/sources
+ AUTORECONF := autoreconf
+ RETRIEVE_TOOL := curl -Ls --retry 10 --retry-delay 3 -o $(ARCHIVE)
+ ARCHIVE_TOOL := tar --strip-components=1 -xf
+
+ ifeq ($(PLATFORM),)
+ PLATFORM = native
+ TARBALLS_LOCATION = $(ROOT_DIR)
+ DAV1D_INSTALL_PREFIX = --prefix $(PREFIX)
+ MESON = meson
+ NINJA = ninja
+ endif
+endif
+
MESON_BUILD_TYPE=release
@@ -9,7 +32,7 @@ ifeq ($(DEBUG_BUILD), yes)
endif
# configuration settings
-CONFIGURE = $(NATIVEPREFIX)/bin/python3 $(NATIVEPREFIX)/bin/meson \
+CONFIGURE = $(PYTHON) $(MESON) $(DAV1D_INSTALL_PREFIX) \
--buildtype=$(MESON_BUILD_TYPE) \
--default-library=static \
-Denable_asm=true \
@@ -32,6 +55,8 @@ LIBDYLIB=$(PLATFORM)/lib/lib$(LIBNAME).a
all: .installed-$(PLATFORM)
+download: $(TARBALLS_LOCATION)/$(ARCHIVE)
+
$(TARBALLS_LOCATION)/$(ARCHIVE):
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
@@ -42,10 +67,10 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
cd $(PLATFORM); $(CONFIGURE) . build
$(LIBDYLIB): $(PLATFORM)
- cd $(PLATFORM)/build; $(NATIVEPREFIX)/bin/ninja -v
+ cd $(PLATFORM)/build; $(NINJA) -v
.installed-$(PLATFORM): $(LIBDYLIB)
- cd $(PLATFORM)/build; $(NATIVEPREFIX)/bin/ninja -v install
+ cd $(PLATFORM)/build; $(NINJA) -v install
touch $@
clean: