rules.mak 1.91 KB
Newer Older
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
1 2
# libvpx

3
VPX_VERSION := v1.3.0
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
4 5 6 7 8 9 10 11 12 13
VPX_URL := http://webm.googlecode.com/files/libvpx-$(VPX_VERSION).tar.bz2

$(TARBALLS)/libvpx-$(VPX_VERSION).tar.bz2:
	$(call download,$(VPX_URL))

.sum-vpx: libvpx-$(VPX_VERSION).tar.bz2

libvpx: libvpx-$(VPX_VERSION).tar.bz2 .sum-vpx
	$(UNPACK)
	$(APPLY) $(SRC)/vpx/libvpx-no-cross.patch
14 15
	$(APPLY) $(SRC)/vpx/windows.patch
	$(APPLY) $(SRC)/vpx/libvpx-mac.patch
16 17 18 19 20
ifneq ($(which bash),/bin/bash)
	sed -i.orig \
		s,^\#!/bin/bash,\#!`which bash`,g \
		`grep -Rl ^\#!/bin/bash libvpx-$(VPX_VERSION)`
endif
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
21 22 23 24 25 26 27 28 29 30 31
	$(MOVE)

DEPS_vpx =

ifdef HAVE_CROSS_COMPILE
VPX_CROSS := $(HOST)-
else
VPX_CROSS :=
endif

ifeq ($(ARCH),arm)
32
VPX_ARCH := armv7
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
33 34 35 36 37 38 39 40 41
else ifeq ($(ARCH),i386)
VPX_ARCH := x86
else ifeq ($(ARCH),mips)
VPX_ARCH := mips32
else ifeq ($(ARCH),ppc)
VPX_ARCH := ppc32
else ifeq ($(ARCH),ppc64)
VPX_ARCH := ppc64
else ifeq ($(ARCH),sparc)
Konstantin Pavlov's avatar
Konstantin Pavlov committed
42
VPX_ARCH := sparc
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
43 44 45 46 47 48
else ifeq ($(ARCH),x86_64)
VPX_ARCH := x86_64
endif

ifdef HAVE_LINUX
VPX_OS := linux
49
else ifdef HAVE_DARWIN_OS
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
50 51 52
ifeq ($(ARCH),arm)
VPX_OS := darwin
else
53 54 55
ifeq ($(OSX_VERSION),10.5)
VPX_OS := darwin9
else
Rafaël Carré's avatar
Rafaël Carré committed
56
VPX_OS := darwin10
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
57
endif
58
endif
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
59 60 61 62 63 64
else ifdef HAVE_SOLARIS
VPX_OS := solaris
else ifdef HAVE_WIN64 # must be before WIN32
VPX_OS := win64
else ifdef HAVE_WIN32
VPX_OS := win32
Rafaël Carré's avatar
Rafaël Carré committed
65 66
else ifdef HAVE_BSD
VPX_OS := linux
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
67 68 69 70 71 72 73 74 75
endif

VPX_TARGET := generic-gnu
ifdef VPX_ARCH
ifdef VPX_OS
VPX_TARGET := $(VPX_ARCH)-$(VPX_OS)-gcc
endif
endif

76 77 78 79 80
VPX_CONF := \
	--enable-runtime-cpu-detect \
	--disable-install-bins \
	--disable-install-docs \
	--disable-examples \
81
	--disable-unit-tests \
82 83 84 85
	--disable-vp8-decoder
ifndef HAVE_WIN32
VPX_CONF += --enable-pic
endif
86 87 88 89 90 91
ifdef HAVE_MACOSX
VPX_CONF += --sdk-path=$(MACOSX_SDK)
endif
ifdef HAVE_IOS
VPX_CONF += --sdk-path=$(SDKROOT)
endif
92

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
93 94
.vpx: libvpx
	cd $< && CROSS=$(VPX_CROSS) ./configure --target=$(VPX_TARGET) \
95
		$(VPX_CONF) --prefix=$(PREFIX)
Rafaël Carré's avatar
Rafaël Carré committed
96 97
	cd $< && $(MAKE)
	cd $< && ../../../contrib/src/pkg-static.sh vpx.pc
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
98 99
	cd $< && $(MAKE) install
	touch $@