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