]> git.sesse.net Git - vlc/blob - contrib/src/postproc/rules.mak
contrib/ios: simplify arch handling
[vlc] / contrib / src / postproc / rules.mak
1 # POSTPROC
2
3 POSTPROC_SNAPURL := http://git.videolan.org/?p=libpostproc.git;a=snapshot;h=HEAD;sf=tgz
4
5 POSTPROCCONF = \
6         --cc="$(CC)" \
7         --disable-debug \
8         --enable-gpl \
9         --enable-postproc
10
11 DEPS_postproc = ffmpeg
12
13 ifdef ENABLE_SMALL
14 POSTPROCCONF += --enable-small
15 endif
16 ifdef HAVE_ARMV7A
17 POSTPROCCONF += --enable-thumb
18 endif
19
20 ifdef HAVE_CROSS_COMPILE
21 POSTPROCCONF += --enable-cross-compile
22 ifndef HAVE_IOS
23 POSTPROCCONF += --cross-prefix=$(HOST)-
24 endif
25 endif
26
27 # ARM stuff
28 ifeq ($(ARCH),arm)
29 POSTPROCCONF += --disable-runtime-cpudetect --arch=arm
30 ifdef HAVE_ARMV7A
31 POSTPROCCONF += --cpu=cortex-a8
32 endif
33 ifdef HAVE_NEON
34 POSTPROCCONF += --enable-neon
35 endif
36 endif
37
38 # MIPS stuff
39 ifeq ($(ARCH),mipsel)
40 POSTPROCCONF += --arch=mips
41 endif
42
43 # x86 stuff
44 ifeq ($(ARCH),i386)
45 POSTPROCCONF += --arch=x86
46 endif
47
48 # Darwin
49 ifdef HAVE_DARWIN_OS
50 POSTPROCCONF += --arch=$(ARCH) --target-os=darwin
51 endif
52 ifeq ($(ARCH),x86_64)
53 POSTPROCCONF += --cpu=core2
54 endif
55 ifdef HAVE_IOS
56 ifeq ($(ARCH),arm)
57 POSTPROCCONF += --as="$(AS)"
58 endif
59 endif
60
61 # Linux
62 ifdef HAVE_LINUX
63 POSTPROCCONF += --target-os=linux --enable-pic
64 endif
65
66 # Windows
67 ifdef HAVE_WIN32
68 POSTPROCCONF += --target-os=mingw32
69 ifdef HAVE_WIN64
70 POSTPROCCONF += --cpu=athlon64 --arch=x86_64
71 else # !WIN64
72 POSTPROCCONF+= --cpu=i686 --arch=x86
73 endif
74 else
75 POSTPROCCONF += --enable-pthreads
76 endif
77
78 ifdef HAVE_WINCE
79 POSTPROCCONF += --target-os=mingw32ce --arch=armv4l --cpu=armv4t
80 endif
81
82 # Build
83
84 ifdef GPL
85 PKGS += postproc
86 endif
87 ifeq ($(call need_pkg,"libpostproc"),)
88 PKGS_FOUND += postproc
89 endif
90
91 $(TARBALLS)/postproc-git.tar.gz:
92         $(call download,$(POSTPROC_SNAPURL))
93
94 POSTPROC_VERSION := git
95
96 .sum-postproc: $(TARBALLS)/postproc-$(POSTPROC_VERSION).tar.gz
97         $(warning Not implemented.)
98         touch $@
99
100 postproc: postproc-$(POSTPROC_VERSION).tar.gz .sum-postproc
101         rm -Rf $@ $@-git
102         mkdir -p $@-git
103         $(ZCAT) "$<" | (cd $@-git && tar xv --strip-components=1)
104         $(MOVE)
105
106 .postproc: postproc
107         cd $< && $(HOSTVARS) ./configure \
108                 --extra-cflags="$(EXTRA_CFLAGS)"  \
109                 --extra-ldflags="$(LDFLAGS)" $(POSTPROCCONF) \
110                 --prefix="$(PREFIX)" --enable-static --disable-shared
111         cd $< && $(MAKE) install-libs install-headers
112         touch $@