Skip to content
Snippets Groups Projects
Commit ab7bb974 authored by Ralph Giles's avatar Ralph Giles
Browse files

Build downloaded dependencies and link against them.

parent 2b39811f
No related branches found
No related tags found
No related merge requests found
# Cross-compiling opus file under mingw
TOOL_PREFIX ?= i686-w64-mingw32-
TOOL_PREFIX ?= i686-w64-mingw32
# To build opusfile under mingw, you need to first build:
DEPS = ogg opus ssl
......@@ -14,20 +14,26 @@ opus_URL := http://downloads.xiph.org/releases/opus/opus-1.1-beta.tar.gz
opus_SHA := ec1784287f385aef994b64734aaecae04860e61aa50fc6eef6643fa7e40dd193
ssl_URL := http://www.openssl.org/source/openssl-1.0.1e.tar.gz
ssl_SHA := f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3h
ssl_SHA := f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3
libopusfile-0.dll: ../unix/Makefile $(DEPS)
CC=$(TOOL_PREFIX)gcc \
RANLIB=$(TOOL_PREFIX)ranlib \
CC=$(TOOL_PREFIX)-gcc \
RANLIB=$(TOOL_PREFIX)-ranlib \
PKG_CONFIG_PATH=${PWD}/lib/pkgconfig \
$(MAKE) -f $<
opusfile: $(DEPS)
../configure --host=$(TOOL_PREFIX) --prefix=${PWD} \
PKG_CONFIG_PATH=${PWD}/lib/pkgconfig
$(MAKE)
clean:
$(RM) -r objs
# Generate rules to download and verify each dependency.
define WGET_template =
$(1): $$(notdir $$($(1)_URL))
$(1)_DIR := $$(basename $$(basename $$(notdir $$($(1)_URL))))
$(1)_DIR: $$(notdir $$($(1)_URL))
@if test "$$($(1)_SHA)" = "$$$$(sha256sum $$< | cut -f 1 -d ' ')"; \
then \
echo "+ $$@ checksum verified."; \
......@@ -38,9 +44,28 @@ define WGET_template =
tar xf $$<
$$(notdir $$($(1)_URL)):
wget $$($(1)_URL)
$(1): $(1)_BUILD
endef
$(foreach dep,$(DEPS),$(eval $(call WGET_template,$(dep))))
ogg_BUILD: $(ogg_DIR)
cd $< && ./configure --host=$(TOOL_PREFIX) --prefix=${PWD}
$(MAKE) -C $< check
$(MAKE) -C $< install
opus_BUILD: $(opus_DIR)
cd $< && ./configure --host=$(TOOL_PREFIX) --prefix=${PWD}
$(MAKE) -C $< check
$(MAKE) -C $< install
ssl_BUILD: $(ssl_DIR)
cd $< && ./Configure shared mingw64 no-asm \
--prefix=${PWD} \
--cross-compile-prefix=$(TOOL_PREFIX)-
$(MAKE) -C $< depend
$(MAKE) -C $<
$(MAKE) -C $< install
# CROSS_COMPILE="i686-w64-mingw32-" ./Configure mingw no-asm no-shared --prefix=$PWD/mingw && make depend && make -j8 && make install
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment