forked from intel/libyami
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
425 lines (351 loc) · 12.5 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
# YAMI-API version
# YAMI-API version for api headers, only change it when the api interface is changed.
m4_define([yami_api_major_version], 0)
# update this for every release when micro version large than zero
m4_define([yami_api_minor_version], 2)
# change this for any api change
m4_define([yami_api_micro_version], 0)
m4_define([yami_api_version],
[yami_api_major_version.yami_api_minor_version.yami_api_micro_version])
# package version (lib name suffix), usually sync with git tag
m4_define([libyami_major_version], 0)
m4_define([libyami_minor_version], 4)
# even number of micro_version means a release after full validation cycle
m4_define([libyami_micro_version], 0)
m4_define([libyami_version],
[libyami_major_version.libyami_minor_version.libyami_micro_version])
# libva minimun version requirement
m4_define([va_min_api_version], [0.36])
AC_INIT([libyami],
[libyami_version],
[https://github.com/01org/libyami/issues/new],
[libyami],
[https://github.com/01org/libyami])
AC_CONFIG_SRCDIR([common/common_def.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
LIBYAMI_LT_VERSION="libyami_major_version:libyami_minor_version:libyami_micro_version"
LIBYAMI_LT_LDFLAGS="-version-number $LIBYAMI_LT_VERSION"
# "-release" option should be avoid, that create lib name like libyami-1.s0.xxx
AC_SUBST(LIBYAMI_LT_VERSION)
AC_SUBST(LIBYAMI_LT_LDFLAGS)
YAMI_API_MAJOR_VERSION=yami_api_major_version
YAMI_API_MINOR_VERSION=yami_api_minor_version
YAMI_API_MICRO_VERSION=yami_api_micro_version
YAMI_API_VERSION=yami_api_version
AC_SUBST(YAMI_API_MAJOR_VERSION)
AC_SUBST(YAMI_API_MINOR_VERSION)
AC_SUBST(YAMI_API_MICRO_VERSION)
AC_SUBST(YAMI_API_VERSION)
AM_CONDITIONAL(BUILD_STATIC,
[test "x$enable_static" = "xyes"])
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],
[build with extra debug @<:@default=no@:>@])],
[], [enable_debug="no"])
if test "$enable_debug" = "yes"; then
AC_DEFINE([__ENABLE_DEBUG__], [1],
[Defined to 1 if --enable-debug="yes"])
fi
GTEST_LIB_CHECK([1.7.0], [:], [:])
AM_CONDITIONAL([ENABLE_UNITTESTS],
[test "x$HAVE_GTEST" = "xyes"])
AC_ARG_ENABLE(dmabuf,
[AC_HELP_STRING([--enable-dmabuf],
[support dma_buf buffer sharing @<:@default=no@:>@])],
[], [enable_dmabuf="no"])
if test "$enable_dmabuf" = "yes"; then
AC_DEFINE([__ENABLE_DMABUF__], [1],
[Defined to 1 if --enable-dmabuf="yes"])
fi
AM_CONDITIONAL(ENABLE_DMABUF,
[test "x$enable_dmabuf" = "xyes"])
AC_ARG_ENABLE(v4l2,
[AC_HELP_STRING([--enable-v4l2],
[wrapper of v4l2 interface @<:@default=no@:>@])],
[], [enable_v4l2="no"])
if test "$enable_v4l2" = "yes"; then
AC_DEFINE([__ENABLE_V4L2__], [1],
[Defined to 1 if --enable-v4l2="yes"])
fi
AM_CONDITIONAL(ENABLE_V4L2,
[test "x$enable_v4l2" = "xyes"])
AC_ARG_ENABLE(capi,
[AC_HELP_STRING([--enable-capi],
[wrapper of c api interface @<:@default=no@:>@])],
[], [enable_capi="no"])
if test "$enable_capi" = "yes"; then
AC_DEFINE([__ENABLE_CAPI__], [1],
[Defined to 1 if --enable-capi="yes"])
fi
AM_CONDITIONAL(ENABLE_CAPI,
[test "x$enable_capi" = "xyes"])
AC_ARG_ENABLE(x11,
[AC_HELP_STRING([--enable-x11],
[enable x11 @<:@default=yes@:>@])],
[], [enable_x11="yes"])
if test "$enable_x11" = "yes"; then
AC_DEFINE([__ENABLE_X11__], [1],
[Defined to 1 if --enable-x11="yes"])
fi
AM_CONDITIONAL(ENABLE_X11,
[test "x$enable_x11" = "xyes"])
AC_ARG_ENABLE(baytrail,
[AC_HELP_STRING([--enable-baytrail],
[build with baytrail/chromeos support @<:@default=no@:>@])],
[], [enable_baytrail="no"])
if test "$enable_baytrail" = "yes"; then
AC_DEFINE([__PLATFORM_BYT__], [1],
[Defined to 1 if --enable-baytrail="yes"])
fi
AC_ARG_ENABLE(v4l2-ops,
[AC_HELP_STRING([--enable-v4l2-ops],
[support v4l2codec_device_ops.h interface in v4l2 wrapper @<:@default=no@:>@])],
[], [enable_v4l2_ops="no"])
if test "$enable_v4l2_ops" = "yes"; then
AC_DEFINE([__ENABLE_V4L2_OPS__], [1],
[Defined to 1 if --enable-v4l2-ops="yes"])
fi
AM_CONDITIONAL(ENABLE_V4L2_OPS,
[test "x$enable_v4l2_ops" = "xyes"])
AC_ARG_ENABLE(md5,
[AC_HELP_STRING([--enable-md5], [enable generate md5 by per frame@<:@default=yes@:>@])],
[], [enable_md5="yes"])
dnl mpeg2 decoder
AC_ARG_ENABLE(mpeg2dec,
[AC_HELP_STRING([--enable-mpeg2dec],
[build with mpeg2 decoder support @<:@default=no@:>@])],
[], [enable_mpeg2dec="no"])
AM_CONDITIONAL(BUILD_MPEG2_DECODER,
[test "x$enable_mpeg2dec" = "xyes"])
dnl vp8 decoder
AC_ARG_ENABLE(vp8dec,
[AC_HELP_STRING([--enable-vp8dec],
[build with vp8 decoder support @<:@default=yes@:>@])],
[], [enable_vp8dec="yes"])
AM_CONDITIONAL(BUILD_VP8_DECODER,
[test "x$enable_vp8dec" = "xyes"])
dnl vp9 decoder
AC_ARG_ENABLE(vp9dec,
[AC_HELP_STRING([--enable-vp9dec],
[build with vp9 decoder support @<:@default=no@:>@])],
[], [enable_vp9dec="no"])
AM_CONDITIONAL(BUILD_VP9_DECODER,
[test "x$enable_vp9dec" = "xyes"])
dnl jpeg decoder
AC_ARG_ENABLE(jpegdec,
[AC_HELP_STRING([--enable-jpegdec],
[build with jpeg decoder support @<:@default=yes@:>@])],
[], [enable_jpegdec="yes"])
AM_CONDITIONAL(BUILD_JPEG_DECODER,
[test "x$enable_jpegdec" = "xyes"])
dnl h264 decoder
AC_ARG_ENABLE(h264dec,
[AC_HELP_STRING([--enable-h264dec],
[build with h264 decoder support @<:@default=yes@:>@])],
[], [enable_h264dec="yes"])
AM_CONDITIONAL(BUILD_H264_DECODER,
[test "x$enable_h264dec" = "xyes"])
dnl h265 decoder
AC_ARG_ENABLE(h265dec,
[AC_HELP_STRING([--enable-h265dec],
[build with h265 decoder support @<:@default=yes@:>@])],
[], [enable_h265dec="no"])
AM_CONDITIONAL(BUILD_H265_DECODER,
[test "x$enable_h265dec" = "xyes"])
dnl vc1 decoder
AC_ARG_ENABLE(vc1dec,
[AC_HELP_STRING([--enable-vc1dec],
[build with vc1 decoder support @<:@default=no@:>@])],
[], [enable_vc1dec="no"])
AM_CONDITIONAL(BUILD_VC1_DECODER,
[test "x$enable_vc1dec" = "xyes"])
dnl fake decoder
AC_ARG_ENABLE(fakedec,
[AC_HELP_STRING([--enable-fakedec],
[build with fake decoder support @<:@default=no@:>@])],
[], [enable_fakedec="no"])
if test "$enable_fakedec" = "yes"; then
AC_DEFINE([__BUILD_FAKE_DECODER__], [1],
[Defined to 1 if --enable-fakedec="yes"])
fi
AM_CONDITIONAL(BUILD_FAKE_DECODER,
[test "x$enable_fakedec" = "xyes"])
dnl h264 encoder
AC_ARG_ENABLE(h264enc,
[AC_HELP_STRING([--enable-h264enc],
[build with h264 encoder support @<:@default=yes@:>@])],
[], [enable_h264enc="yes"])
AM_CONDITIONAL(BUILD_H264_ENCODER,
[test "x$enable_h264enc" = "xyes"])
dnl jpeg encoder
AC_ARG_ENABLE(jpegenc,
[AC_HELP_STRING([--enable-jpegenc],
[build with jpeg encoder support @<:@default=no@:>@])],
[], [enable_jpegenc="no"])
AM_CONDITIONAL(BUILD_JPEG_ENCODER,
[test "x$enable_jpegenc" = "xyes"])
dnl vp8 encoder
AC_ARG_ENABLE(vp8enc,
[AC_HELP_STRING([--enable-vp8enc],
[build with vp8 encoder support @<:@default=no@:>@])],
[], [enable_vp8enc="no"])
AM_CONDITIONAL(BUILD_VP8_ENCODER,
[test "x$enable_vp8enc" = "xyes"])
dnl h265 encoder
AC_ARG_ENABLE(h265enc,
[AC_HELP_STRING([--enable-h265enc],
[build with h265 encoder support @<:@default=no@:>@])],
[], [enable_h265enc="no"])
AM_CONDITIONAL(BUILD_H265_ENCODER,
[test "x$enable_h265enc" = "xyes"])
dnl jpeg parser
AM_CONDITIONAL(BUILD_JPEG_PARSER,
[test "x$enable_jpegdec" = "xyes" -o "x$enable_jpegenc" = "xyes"])
dnl encoder getmv
AC_ARG_ENABLE(getmv,
[AC_HELP_STRING([--enable-getmv],
[build with get mv support @<:@default=no@:>@])],
[], [enable_getmv="no"])
if test "$enable_getmv" = "yes"; then
AC_DEFINE([__BUILD_GET_MV__], [1],
[Defined to 1 if --enable-getmv="yes"])
fi
AM_CONDITIONAL(BUILD_GET_MV,
[test "x$enable_getmv" = "xyes"])
dnl ocl blender
AC_ARG_ENABLE(oclblender,
[AC_HELP_STRING([--enable-oclblender],
[build with opencl based alpha blend support @<:@default=no@:>@])],
[], [enable_oclblender="no"])
AM_CONDITIONAL(BUILD_OCL_BLENDER,
[test "x$enable_oclblender" = "xyes"])
# dnl Doxygen
AC_ARG_ENABLE(docs,
[AC_HELP_STRING([--enable-docs],
[build Doxygen docs @<:@default=no@:>@])],
[], [enable_docs="no"])
if test "$enable_docs" = "yes"; then
AC_CHECK_TOOL([DOXYGEN], [doxygen], [no])
if test "$DOXYGEN" = "no"; then
enable_docs="no"
fi
fi
AM_CONDITIONAL(ENABLE_DOCS,
[test "$enable_docs" = "yes"])
AC_SUBST([AM_CFLAGS], ["-g -O2 -Wall -Wno-unused-function -Wno-cpp -Werror"])
AC_SUBST([AM_CXXFLAGS], ["-g -O2 -Wall -Wno-unused-function -Wno-cpp -Wno-missing-braces -Werror"])
# Checks for programs.
AC_DISABLE_STATIC
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
#LT_INIT
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
pkgconfigdir=${libdir}/pkgconfig
AC_SUBST(pkgconfigdir)
# Check for libva (vaapi version)
VA_API_VERSION=va_min_api_version
AS_IF([test x$enable_h265dec = xyes], [VA_API_VERSION="0.37"])
AS_IF([test x$enable_vp9dec = xyes], [VA_API_VERSION="0.37"])
AS_IF([test x$enable_jpegenc = xyes], [VA_API_VERSION="0.37"])
AS_IF([test x$enable_h265enc = xyes], [VA_API_VERSION="0.38"])
AS_IF([test x$enable_vp8enc = xyes], [VA_API_VERSION="0.38"])
LIBVA_PKG_REQ="libva >= $VA_API_VERSION"
PKG_CHECK_MODULES([LIBVA], [$LIBVA_PKG_REQ])
AC_SUBST(LIBVA_VERSION)
AC_SUBST(LIBVA_PKG_REQ)
LIBVA_DRM_PKG_REQ="libva-drm"
PKG_CHECK_MODULES([LIBVA_DRM], [$LIBVA_DRM_PKG_REQ])
AC_SUBST(LIBVA_DRM_PKG_REQ)
LIBVA_X11_PKG_REQ=""
X11_PKG_REQ=""
if test "$enable_x11" = "yes"; then
LIBVA_X11_PKG_REQ="libva-x11"
PKG_CHECK_MODULES([LIBVA_X11], [$LIBVA_X11_PKG_REQ],
[AC_DEFINE([HAVE_VA_X11], [1],
[Defined to 1 if VA/X11 API is enabled])])
X11_PKG_REQ="x11"
PKG_CHECK_MODULES([X11], [$X11_PKG_REQ])
fi
AC_SUBST(LIBVA_X11_PKG_REQ)
AC_SUBST(X11_PKG_REQ)
if test "$enable_v4l2" = "yes"; then
PKG_CHECK_MODULES([LIBV4L2], [libv4l2])
PKG_CHECK_MODULES([LIBEGL], [egl])
PKG_CHECK_MODULES([LIBGLES2], [glesv2])
fi
# drm_fourcc.h for dma_buf support
if test "$enable_dmabuf" = "yes"; then
PKG_CHECK_MODULES([LIBDRM], [libdrm])
fi
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset strcasecmp strdup])
AC_CONFIG_FILES([Makefile
codecparsers/Makefile
common/Makefile
vaapi/Makefile
decoder/Makefile
encoder/Makefile
vpp/Makefile
v4l2/Makefile
capi/Makefile
doc/Makefile
pkgconfig/Makefile])
AC_OUTPUT([
pkgconfig/libyami.pc
pkgconfig/libyami_v4l2.pc
common/YamiVersion.h
])
# Print a configuration summary
DECODERS=""
AS_IF([test x$enable_h265dec = xyes], [DECODERS="$DECODERS h265"])
AS_IF([test x$enable_vc1dec = xyes], [DECODERS="$DECODERS vc1"])
AS_IF([test x$enable_h264dec = xyes], [DECODERS="$DECODERS h264"])
AS_IF([test x$enable_jpegdec = xyes], [DECODERS="$DECODERS jpeg"])
AS_IF([test x$enable_mpeg2dec = xyes], [DECODERS="$DECODERS mpeg2"])
AS_IF([test x$enable_vp8dec = xyes], [DECODERS="$DECODERS vp8"])
AS_IF([test x$enable_vp9dec = xyes], [DECODERS="$DECODERS vp9"])
AS_IF([test x$enable_fakedec = xyes], [DECODERS="$DECODERS fake"])
ENCODERS=""
AS_IF([test x$enable_h265enc = xyes], [ENCODERS="$ENCODERS h265"])
AS_IF([test x$enable_h264enc = xyes], [ENCODERS="$ENCODERS h264"])
AS_IF([test x$enable_jpegenc = xyes], [ENCODERS="$ENCODERS jpeg"])
AS_IF([test x$enable_vp8enc = xyes], [ENCODERS="$ENCODERS vp8"])
VPPS=" scaler"
AS_IF([test x$enable_oclblender = xyes], [VPPS="$VPPS oclblender"])
AC_MSG_RESULT([
libyami - libyami_version (API: yami_api_version)
Build decoders ................... :$DECODERS
Build encoders ....................:$ENCODERS
Build vpps ........................:$VPPS
Build gtest unit tests ........... : $HAVE_GTEST
Build documentation .............. : $enable_docs
Enable debug ..................... : $enable_debug
Installation prefix .............. : $prefix
])