]> git.sesse.net Git - vlc/blob - contrib/src/vpx/rules.mak
contrib: vpx: try to set correct target for OSX
[vlc] / contrib / src / vpx / rules.mak
1 # libvpx
2
3 VPX_VERSION := v0.9.7-p1
4 VPX_URL := http://webm.googlecode.com/files/libvpx-$(VPX_VERSION).tar.bz2
5
6 $(TARBALLS)/libvpx-$(VPX_VERSION).tar.bz2:
7         $(call download,$(VPX_URL))
8
9 .sum-vpx: libvpx-$(VPX_VERSION).tar.bz2
10
11 libvpx: libvpx-$(VPX_VERSION).tar.bz2 .sum-vpx
12         $(UNPACK)
13         $(APPLY) $(SRC)/vpx/libvpx-no-cross.patch
14         $(APPLY) $(SRC)/vpx/libvpx-no-abi.patch
15         $(APPLY) $(SRC)/vpx/libvpx-win64.patch
16         $(APPLY) $(SRC)/vpx/libvpx-darwin10.patch
17         $(MOVE)
18
19 DEPS_vpx =
20
21 ifdef HAVE_CROSS_COMPILE
22 VPX_CROSS := $(HOST)-
23 else
24 VPX_CROSS :=
25 endif
26
27 ifeq ($(ARCH),arm)
28 VPX_ARCH := armv7
29 else ifeq ($(ARCH),i386)
30 VPX_ARCH := x86
31 else ifeq ($(ARCH),mips)
32 VPX_ARCH := mips32
33 else ifeq ($(ARCH),ppc)
34 VPX_ARCH := ppc32
35 else ifeq ($(ARCH),ppc64)
36 VPX_ARCH := ppc64
37 else ifeq ($(ARCH),sparc)
38 VPX_ARCH := sparch
39 else ifeq ($(ARCH),x86_64)
40 VPX_ARCH := x86_64
41 endif
42
43 ifdef HAVE_LINUX
44 VPX_OS := linux
45 else ifdef HAVE_MACOSX
46 ifeq ($(ARCH),arm)
47 VPX_OS := darwin
48 else
49 ifeq ($(OSX_VERSION),10.5)
50 VPX_OS := darwin9
51 else
52 VPX_OS := darwin10
53 endif
54 endif
55 else ifdef HAVE_SOLARIS
56 VPX_OS := solaris
57 else ifdef HAVE_WIN64 # must be before WIN32
58 VPX_OS := win64
59 else ifdef HAVE_WIN32
60 VPX_OS := win32
61 endif
62
63 VPX_TARGET := generic-gnu
64 ifdef VPX_ARCH
65 ifdef VPX_OS
66 VPX_TARGET := $(VPX_ARCH)-$(VPX_OS)-gcc
67 endif
68 endif
69
70 VPX_CONF := \
71         --enable-runtime-cpu-detect \
72         --disable-install-bins \
73         --disable-install-srcs \
74         --disable-install-libs \
75         --disable-install-docs \
76         --disable-examples \
77         --disable-vp8-decoder
78 ifndef HAVE_WIN32
79 VPX_CONF += --enable-pic
80 endif
81
82 .vpx: libvpx
83         cd $< && CROSS=$(VPX_CROSS) ./configure --target=$(VPX_TARGET) \
84                 $(VPX_CONF)
85         cd $< && $(MAKE) install
86         rm -Rf -- "$(PREFIX)/include/vpx/"
87         mkdir -p -- "$(PREFIX)/include/vpx/"
88         # Of course! Why the hell would it be listed or in make install?
89         cp $</vpx/*.h $</vpx_ports/*.h "$(PREFIX)/include/vpx/"
90         rm -f -- "$(PREFIX)/include/vpx/config.h"
91         $(RANLIB) $</libvpx.a
92         # Of course! Why the hell would it be listed or in make install?
93         mkdir -p -- "$(PREFIX)/lib"
94         install -- $</libvpx.a "$(PREFIX)/lib/libvpx.a"
95         touch $@