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