Allow conditional builds without X11.
[hwdecode-demos:vj-hwdecode-demos.git] / src / Makefile.am
1 # Private APIs
2 PRIVATE_APIS = xvba
3
4 noinst_HEADERS =        \
5         buffer.h        \
6         common.h        \
7         crystalhd.h     \
8         debug.h         \
9         ffmpeg.h        \
10         glx.h           \
11         glx_compat.h    \
12         h264.h          \
13         image.h         \
14         mpeg2.h         \
15         mpeg4.h         \
16         put_bits.h      \
17         sysdeps.h       \
18         utils.h         \
19         utils_glx.h     \
20         utils_x11.h     \
21         vaapi.h         \
22         vaapi_compat.h  \
23         vc1.h           \
24         vdpau.h         \
25         vdpau_gate.h    \
26         vo_drm.h        \
27         x11.h           \
28         xvba.h          \
29         xvba_gate.h     \
30         $(NULL)
31
32 dist_pkgdata_DATA =     \
33         h264.mp4        \
34         mpeg2.m2v       \
35         mpeg4.mp4       \
36         vc1.raw         \
37         $(NULL)
38
39 bin_PROGRAMS =          \
40         $(crystalhd_PROGS) \
41         $(ffmpeg_PROGS) \
42         $(vaapi_PROGS)  \
43         $(vdpau_PROGS)  \
44         $(xvba_PROGS)   \
45         $(NULL)
46
47 x11_display_SOURCES     = x11.c utils_x11.c
48 glx_display_SOURCES     = glx.c utils_glx.c
49
50 display_SOURCES         =
51 display_CFLAGS          =
52 display_LIBS            =
53 if USE_DRM
54 display_SOURCES         += vo_drm.c
55 display_CFLAGS          += $(DRM_CFLAGS) $(UDEV_CFLAGS)
56 display_LIBS            += $(DRM_LIBS) $(UDEV_LIBS)
57 endif
58 if USE_X11
59 display_SOURCES         += $(x11_display_SOURCES)
60 display_CFLAGS          += $(X11_DEPS_CFLAGS)
61 display_LIBS            += $(X11_DEPS_LIBS)
62 endif
63 if USE_GLX
64 display_SOURCES         += $(glx_display_SOURCES)
65 display_CFLAGS          += $(GL_DEPS_CFLAGS) $(GLU_DEPS_CFLAGS)
66 display_LIBS            += $(GL_DEPS_LIBS) $(GLU_DEPS_LIBS)
67 endif
68
69 if USE_VAAPI
70 vaapi_PROGS     = vaapi_h264 vaapi_vc1 vaapi_mpeg2 vaapi_mpeg4
71 vaapi_source_c  = vaapi.c
72 vaapi_CFLAGS    = -DUSE_VAAPI
73 vaapi_LIBS      =
74 if USE_VAAPI_DRM
75 vaapi_CFLAGS    += $(VAAPI_DRM_DEPS_CFLAGS) -DUSE_VAAPI_DRM
76 vaapi_LIBS      += $(VAAPI_DRM_DEPS_LIBS)
77 endif
78 if USE_VAAPI_X11
79 vaapi_CFLAGS    += $(VAAPI_X11_DEPS_CFLAGS) -DUSE_VAAPI_X11
80 vaapi_LIBS      += $(VAAPI_X11_DEPS_LIBS)
81 endif
82 if USE_VAAPI_GLX
83 vaapi_CFLAGS    += $(VAAPI_GLX_DEPS_CFLAGS) -DUSE_VAAPI_GLX
84 vaapi_LIBS      += $(VAAPI_GLX_DEPS_LIBS)
85 endif
86 if USE_OLD_VAAPI
87 vaapi_CFLAGS    += $(OLD_VAAPI_CFLAGS) -DUSE_OLD_VAAPI -DUSE_VAAPI_X11
88 vaapi_LIBS      += $(OLD_VAAPI_LIBS)
89 endif
90 else
91 vaapi_PROGS     =
92 endif
93
94 if USE_VDPAU
95 vdpau_PROGS     = vdpau_h264 vdpau_vc1 vdpau_mpeg2
96 if USE_VDPAU_MPEG4
97 vdpau_PROGS     += vdpau_mpeg4
98 endif
99 vdpau_source_c  = vdpau.c vdpau_gate.c
100 vdpau_CFLAGS    = -DUSE_VDPAU $(VDPAU_DEPS_CFLAGS)
101 vdpau_LIBS      = $(VDPAU_DEPS_LIBS)
102 else
103 vdpau_PROGS     =
104 endif
105
106 if USE_XVBA
107 xvba_PROGS      = xvba_h264 xvba_vc1
108 xvba_source_c   = xvba.c xvba_gate.c
109 xvba_CFLAGS     = -DUSE_XVBA $(XVBA_DEPS_CFLAGS)
110 xvba_LIBS       = $(XVBA_DEPS_LIBS)
111 else
112 xvba_PROGS      =
113 endif
114
115 if USE_FFMPEG
116 ffmpeg_PROGS    = ffmpeg_h264 ffmpeg_vc1 ffmpeg_mpeg2 ffmpeg_mpeg4
117 ffmpeg_source_c = ffmpeg.c ffmpeg_video.c
118 ffmpeg_CFLAGS   = \
119         -DUSE_FFMPEG            \
120         $(LIBAVCODEC_CFLAGS)    \
121         $(LIBAVFORMAT_CFLAGS)   \
122         $(LIBSWSCALE_CFLAGS)    \
123         $(LIBAVUTIL_CFLAGS)     \
124         $(NULL)
125 ffmpeg_LIBS     = \
126         $(LIBAVCODEC_LIBS)      \
127         $(LIBAVFORMAT_LIBS)     \
128         $(LIBSWSCALE_LIBS)      \
129         $(LIBAVUTIL_LIBS)       \
130         $(NULL)
131 if USE_VAAPI
132 ffmpeg_source_c += $(vaapi_source_c)
133 ffmpeg_CFLAGS   += $(vaapi_CFLAGS)
134 ffmpeg_LIBS     += $(vaapi_LIBS)
135 endif
136 else
137 ffmpeg_PROGS    =
138 endif
139
140 if USE_CRYSTALHD
141 crystalhd_PROGS         = crystalhd_mpeg2 crystalhd_vc1 crystalhd_h264
142 crystalhd_source_c      = crystalhd.c crystalhd_video.c
143 crystalhd_CFLAGS        = -DUSE_CRYSTALHD $(CRYSTALHD_CFLAGS)
144 crystalhd_LIBS          = $(CRYSTALHD_LIBS)
145 else
146 crystalhd_PROGS         =
147 endif
148
149 common_SOURCES          = common.c debug.c utils.c image.c buffer.c $(display_SOURCES)
150 common_CFLAGS           = $(LIBSWSCALE_CFLAGS) $(CAIRO_CFLAGS) $(display_CFLAGS)
151 common_LIBS             = $(LIBSWSCALE_LIBS) $(CAIRO_LIBS) $(display_LIBS)
152
153 vaapi_common_SOURCES    = $(common_SOURCES) $(vaapi_source_c)
154 vaapi_common_CFLAGS     = $(common_CFLAGS) $(vaapi_CFLAGS)
155 vaapi_common_LIBS       = $(common_LIBS) $(vaapi_LIBS)
156 vaapi_h264_SOURCES      = $(vaapi_common_SOURCES) h264.c vaapi_h264.c
157 vaapi_h264_CFLAGS       = $(vaapi_common_CFLAGS)
158 vaapi_h264_LDADD        = $(vaapi_common_LIBS)
159 vaapi_vc1_SOURCES       = $(vaapi_common_SOURCES) vc1.c vaapi_vc1.c
160 vaapi_vc1_CFLAGS        = $(vaapi_common_CFLAGS)
161 vaapi_vc1_LDADD         = $(vaapi_common_LIBS)
162 vaapi_mpeg2_SOURCES     = $(vaapi_common_SOURCES) mpeg2.c vaapi_mpeg2.c
163 vaapi_mpeg2_CFLAGS      = $(vaapi_common_CFLAGS)
164 vaapi_mpeg2_LDADD       = $(vaapi_common_LIBS)
165 vaapi_mpeg4_SOURCES     = $(vaapi_common_SOURCES) mpeg4.c vaapi_mpeg4.c
166 vaapi_mpeg4_CFLAGS      = $(vaapi_common_CFLAGS)
167 vaapi_mpeg4_LDADD       = $(vaapi_common_LIBS)
168
169 vdpau_common_SOURCES    = $(common_SOURCES) $(vdpau_source_c)
170 vdpau_common_CFLAGS     = $(common_CFLAGS) $(vdpau_CFLAGS)
171 vdpau_common_LIBS       = $(common_LIBS) $(vdpau_LIBS)
172 vdpau_h264_SOURCES      = $(vdpau_common_SOURCES) h264.c vdpau_h264.c
173 vdpau_h264_CFLAGS       = $(vdpau_common_CFLAGS)
174 vdpau_h264_LDADD        = $(vdpau_common_LIBS)
175 vdpau_vc1_SOURCES       = $(vdpau_common_SOURCES) vc1.c vdpau_vc1.c
176 vdpau_vc1_CFLAGS        = $(vdpau_common_CFLAGS)
177 vdpau_vc1_LDADD         = $(vdpau_common_LIBS)
178 vdpau_mpeg2_SOURCES     = $(vdpau_common_SOURCES) mpeg2.c vdpau_mpeg2.c
179 vdpau_mpeg2_CFLAGS      = $(vdpau_common_CFLAGS)
180 vdpau_mpeg2_LDADD       = $(vdpau_common_LIBS)
181 vdpau_mpeg4_SOURCES     = $(vdpau_common_SOURCES) mpeg4.c vdpau_mpeg4.c
182 vdpau_mpeg4_CFLAGS      = $(vdpau_common_CFLAGS)
183 vdpau_mpeg4_LDADD       = $(vdpau_common_LIBS)
184
185 xvba_common_SOURCES     = $(common_SOURCES) $(xvba_source_c)
186 xvba_common_CFLAGS      = $(common_CFLAGS) $(xvba_CFLAGS)
187 xvba_common_LIBS        = $(common_LIBS) $(xvba_LIBS)
188 xvba_h264_SOURCES       = $(xvba_common_SOURCES) h264.c xvba_h264.c
189 xvba_h264_CFLAGS        = $(xvba_common_CFLAGS)
190 xvba_h264_LDADD         = $(xvba_common_LIBS)
191 xvba_vc1_SOURCES        = $(xvba_common_SOURCES) vc1.c xvba_vc1.c
192 xvba_vc1_CFLAGS         = $(xvba_common_CFLAGS)
193 xvba_vc1_LDADD          = $(xvba_common_LIBS)
194
195 ffmpeg_common_SOURCES   = $(common_SOURCES) $(ffmpeg_source_c)
196 ffmpeg_common_CFLAGS    = $(common_CFLAGS) $(ffmpeg_CFLAGS)
197 ffmpeg_common_LIBS      = $(common_LIBS) $(ffmpeg_LIBS)
198 ffmpeg_h264_SOURCES     = $(ffmpeg_common_SOURCES) h264.c
199 ffmpeg_h264_CFLAGS      = $(ffmpeg_common_CFLAGS) -DUSE_H264
200 ffmpeg_h264_LDADD       = $(ffmpeg_common_LIBS)
201 ffmpeg_vc1_SOURCES      = $(ffmpeg_common_SOURCES) vc1.c
202 ffmpeg_vc1_CFLAGS       = $(ffmpeg_common_CFLAGS) -DUSE_VC1
203 ffmpeg_vc1_LDADD        = $(ffmpeg_common_LIBS)
204 ffmpeg_mpeg2_SOURCES    = $(ffmpeg_common_SOURCES) mpeg2.c
205 ffmpeg_mpeg2_CFLAGS     = $(ffmpeg_common_CFLAGS) -DUSE_MPEG2
206 ffmpeg_mpeg2_LDADD      = $(ffmpeg_common_LIBS)
207 ffmpeg_mpeg4_SOURCES    = $(ffmpeg_common_SOURCES) mpeg4.c
208 ffmpeg_mpeg4_CFLAGS     = $(ffmpeg_common_CFLAGS) -DUSE_MPEG4
209 ffmpeg_mpeg4_LDADD      = $(ffmpeg_common_LIBS)
210
211 crystalhd_common_SOURCES = $(common_SOURCES) $(crystalhd_source_c)
212 crystalhd_common_CFLAGS = $(common_CFLAGS) $(crystalhd_CFLAGS)
213 crystalhd_common_LIBS   = $(common_LIBS) $(crystalhd_LIBS)
214 crystalhd_mpeg2_SOURCES = $(crystalhd_common_SOURCES) mpeg2.c
215 crystalhd_mpeg2_CFLAGS  = $(crystalhd_common_CFLAGS) -DUSE_MPEG2
216 crystalhd_mpeg2_LDADD   = $(crystalhd_common_LIBS)
217 crystalhd_vc1_SOURCES   = $(crystalhd_common_SOURCES) vc1.c
218 crystalhd_vc1_CFLAGS    = $(crystalhd_common_CFLAGS) -DUSE_VC1
219 crystalhd_vc1_LDADD     = $(crystalhd_common_LIBS)
220 crystalhd_h264_SOURCES  = $(crystalhd_common_SOURCES) h264.c
221 crystalhd_h264_CFLAGS   = $(crystalhd_common_CFLAGS) -DUSE_H264
222 crystalhd_h264_LDADD    = $(crystalhd_common_LIBS)
223
224 EXTRA_DIST = \
225         xvba.supp
226
227 # Extra clean files so that maintainer-clean removes *everything*
228 MAINTAINERCLEANFILES = Makefile.in config.h.in
229
230 # Filter out private files and add empty files instead to keep automake happy
231 dist-hook:
232         for p in $(PRIVATE_APIS); do                                    \
233             case ":$(FORCE_DIST):" in                                   \
234             (*":$$p:"*) ;; (*)                                          \
235             for f in $(distdir)/*$$p*.*; do echo > $$f; done;;  \
236             esac;                                                       \
237         done