]> git.sesse.net Git - vlc/blob - contrib/src/postproc/rules.mak
Contribs: fix postproc build on mips.
[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 ifeq ($(ARCH),arm)
16 ifdef HAVE_ARMV7A
17 # XXX: assumes > ARMv7-A, and thus thumb2-able
18 FFMPEGCONF += --enable-thumb
19 endif
20 endif
21 endif
22
23 ifdef HAVE_CROSS_COMPILE
24 POSTPROCCONF += --enable-cross-compile
25 ifndef HAVE_IOS
26 POSTPROCCONF += --cross-prefix=$(HOST)-
27 endif
28 endif
29
30 # ARM stuff
31 ifeq ($(ARCH),arm)
32 POSTPROCCONF += --disable-runtime-cpudetect --arch=arm
33 ifdef HAVE_NEON
34 POSTPROCCONF += --cpu=cortex-a8 --enable-neon
35 POSTPROC_CFLAGS += -mfloat-abi=softfp -mfpu=neon
36 endif
37 endif
38
39 # MIPS stuff
40 ifeq ($(ARCH),mipsel)
41 POSTPROCCONF += --arch=mips
42 endif
43
44 # x86 stuff
45 ifeq ($(ARCH),i386)
46 POSTPROCCONF += --arch=x86
47 endif
48
49 # Darwin
50 ifdef HAVE_DARWIN_OS
51 POSTPROCCONF += --arch=$(ARCH) --target-os=darwin
52 endif
53 ifeq ($(ARCH),x86_64)
54 POSTPROCCONF += --cpu=core2
55 endif
56 ifdef HAVE_IOS
57 ifeq ($(ARCH),arm)
58 POSTPROCCONF += --as="$(AS)"
59 endif
60 endif
61
62 # Linux
63 ifdef HAVE_LINUX
64 POSTPROCCONF += --target-os=linux
65 # --enable-pic
66 endif
67
68 # Windows
69 ifdef HAVE_WIN32
70 POSTPROCCONF += --target-os=mingw32
71 ifdef HAVE_WIN64
72 POSTPROCCONF += --cpu=athlon64 --arch=x86_64
73 else # !WIN64
74 POSTPROCCONF+= --cpu=i686 --arch=x86
75 endif
76 else
77 POSTPROCCONF += --enable-pthreads
78 endif
79
80 ifdef HAVE_WINCE
81 POSTPROCCONF += --target-os=mingw32ce --arch=armv4l --cpu=armv4t
82 endif
83
84 POSTPROC_CFLAGS += --std=gnu99
85
86 # Build
87
88 PKGS += postproc
89 ifeq ($(call need_pkg,"libpostproc"),)
90 PKGS_FOUND += postproc
91 endif
92
93 $(TARBALLS)/postproc-git.tar.gz:
94         $(call download,$(POSTPROC_SNAPURL))
95
96 POSTPROC_VERSION := git
97
98 .sum-postproc: $(TARBALLS)/postproc-$(POSTPROC_VERSION).tar.gz
99         $(warning Not implemented.)
100         touch $@
101
102 postproc: postproc-$(POSTPROC_VERSION).tar.gz .sum-postproc
103         rm -Rf $@ $@-git
104         mkdir -p $@-git
105         $(ZCAT) "$<" | (cd $@-git && tar xv --strip-components=1)
106 ifdef HAVE_WIN32
107         sed -i "s/std=c99/std=gnu99/" $@-$(POSTPROC_VERSION)/configure
108 endif
109         $(MOVE)
110
111 .postproc: postproc
112         cd $< && $(HOSTVARS) ./configure \
113                 --extra-cflags="$(POSTPROC_CFLAGS) -DHAVE_STDINT_H"  \
114                 --extra-ldflags="$(LDFLAGS)" $(POSTPROCCONF) \
115                 --prefix="$(PREFIX)" --enable-static --disable-shared
116         cd $< && $(MAKE) install-libs install-headers
117         touch $@