1AC_PREREQ([2.69])
2
3dnl initialize autoconf
4dnl when going to/from release please set the nano (fourth number) right !
5dnl releases only do Wall, git and prerelease does Werror too
6AC_INIT([GStreamer Bad Plug-ins],[1.16.2],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-bad])
7
8AG_GST_INIT
9
10dnl initialize automake
11AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
12
13dnl define PACKAGE_VERSION_* variables
14AS_VERSION
15
16dnl check if this is a release version
17AS_NANO(GST_GIT="no", GST_GIT="yes")
18
19dnl can autoconf find the source ?
20AC_CONFIG_SRCDIR([docs/plugins/gst-plugins-bad-plugins-docs.sgml])
21
22dnl define the output header for config
23AC_CONFIG_HEADERS([config.h])
24
25dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
26AM_MAINTAINER_MODE([enable])
27
28dnl sets host_* variables
29AC_CANONICAL_HOST
30
31dnl use pretty build output with automake >= 1.11
32m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
33  [AM_DEFAULT_VERBOSITY=1
34   AC_SUBST(AM_DEFAULT_VERBOSITY)])
35
36dnl PKG_CONFIG_SYSROOT_DIR is a valid environment variable
37m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
38
39dnl our libraries and install dirs use GST_API_VERSION in the filename
40dnl to allow side-by-side installation of different API versions
41GST_API_VERSION=1.0
42AC_SUBST(GST_API_VERSION)
43AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
44  [GStreamer API Version])
45
46AG_GST_LIBTOOL_PREPARE
47
48dnl CURRENT, REVISION, AGE
49dnl - library source changed -> increment REVISION
50dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
51dnl - interfaces added -> increment AGE
52dnl - interfaces removed -> AGE = 0
53dnl sets GST_LT_LDFLAGS
54AS_LIBTOOL(GST, 1602, 0, 1602)
55
56dnl *** required versions of GStreamer stuff ***
57GST_REQ=1.16.2
58GSTPB_REQ=1.16.2
59
60dnl *** autotools stuff ****
61
62dnl allow for different autotools
63AS_AUTOTOOLS_ALTERNATE
64
65dnl Add parameters for aclocal
66AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
67
68dnl set up gettext
69dnl the version check needs to stay here because autopoint greps for it
70AM_GNU_GETTEXT_VERSION([0.17])
71AM_GNU_GETTEXT([external])
72AG_GST_GETTEXT([gst-plugins-bad-$GST_API_VERSION])
73
74dnl *** check for arguments to configure ***
75
76AG_GST_ARG_DISABLE_FATAL_WARNINGS
77AG_GST_ARG_ENABLE_EXTRA_CHECKS
78
79AG_GST_ARG_DEBUG
80AG_GST_ARG_PROFILING
81AG_GST_ARG_VALGRIND
82AG_GST_ARG_GCOV
83
84AG_GST_ARG_EXAMPLES
85
86AG_GST_ARG_WITH_PKG_CONFIG_PATH
87AG_GST_ARG_WITH_PACKAGE_NAME
88AG_GST_ARG_WITH_PACKAGE_ORIGIN
89
90AG_GST_ARG_WITH_PLUGINS
91
92AG_GST_ARG_ENABLE_EXTERNAL
93
94AG_GST_ARG_ENABLE_EXPERIMENTAL
95
96AG_GST_PKG_CONFIG_PATH
97
98dnl *** checks for platform ***
99AG_GST_PLATFORM
100
101dnl * hardware/architecture *
102
103dnl common/m4/gst-arch.m4
104dnl check CPU type
105AG_GST_ARCH
106
107dnl Determine endianness
108AC_C_BIGENDIAN
109
110dnl *** software ***
111
112dnl check for large file support
113dnl affected plugins must include config.h
114AC_SYS_LARGEFILE
115
116dnl *** checks for programs ***
117
118dnl find a compiler
119AC_PROG_CC
120AC_PROG_CC_STDC
121
122dnl determine c++ compiler
123AC_PROG_CXX
124dnl determine if c++ is available on this system
125AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
126
127AC_PROG_OBJC
128
129dnl check if the compiler supports '-c' and '-o' options
130AM_PROG_CC_C_O
131
132dnl check if the compiler supports do while(0) macros
133AG_GST_CHECK_DOWHILE_MACROS
134
135AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
136AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
137
138dnl check for gobject-introspection
139GOBJECT_INTROSPECTION_CHECK([1.31.1])
140
141dnl check for documentation tools
142GTK_DOC_CHECK([1.12])
143AG_GST_PLUGIN_DOCS([1.12])
144
145dnl *** checks for libraries ***
146
147dnl check for libm, for sin() etc.
148LT_LIB_M
149AC_SUBST(LIBM)
150
151AC_FUNC_MMAP
152
153dnl check for pthreads
154AX_PTHREAD
155
156dnl *** checks for header files ***
157
158AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
159AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
160
161if test "x$HAVE_UNISTD_H" != "xyes"; then
162  GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
163fi
164
165AC_CHECK_HEADERS([sys/time.h])
166
167dnl used by ext/dts
168AX_CREATE_STDINT_H
169
170AC_CHECK_HEADERS([pthread.h], HAVE_PTHREAD_H=yes)
171AM_CONDITIONAL(HAVE_PTHREAD_H, test "x$HAVE_PTHREAD_H" = "xyes")
172
173dnl *** checks for types/defines ***
174
175dnl *** checks for structures ***
176
177dnl *** checks for compiler characteristics ***
178
179dnl *** checks for library functions ***
180AC_CHECK_FUNCS([gmtime_r pipe2])
181
182dnl *** checks for headers ***
183AC_CHECK_HEADERS([sys/utsname.h])
184
185dnl *** checks for dependency libraries ***
186
187dnl *** checks for socket and nsl libraries ***
188AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
189AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
190
191dnl GLib is required
192GLIB_REQ=2.40.0
193AG_GST_GLIB_CHECK([$GLIB_REQ])
194
195dnl Needed by plugins that use g_module_*() API
196PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
197
198dnl checks for gstreamer
199dnl uninstalled is selected preferentially -- see pkg-config(1)
200AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
201AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
202AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
203AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
204AG_GST_CHECK_GST_NET($GST_API_VERSION, [$GST_REQ], yes)
205AG_GST_PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-[$GST_API_VERSION], [$GSTPB_REQ], yes)
206AG_GST_PKG_CHECK_MODULES(GST_AUDIO, gstreamer-audio-[$GST_API_VERSION], [$GSTPB_REQ], yes)
207AG_GST_PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-[$GST_API_VERSION], [$GSTPB_REQ], yes)
208AG_GST_PKG_CHECK_MODULES(GST_GL, gstreamer-gl-[$GST_API_VERSION], [$GSTPB_REQ], no)
209AG_GST_PKG_CHECK_MODULES(GST_SDP, gstreamer-sdp-[$GST_API_VERSION], [$GSTPB_REQ], yes)
210
211if test "x$HAVE_GST_GL" = "xyes"; then
212
213  AC_MSG_CHECKING([GStreamer OpenGL window systems ...])
214  GST_GL_WINSYS=`$PKG_CONFIG --variable=gl_winsys gstreamer-gl-1.0`
215  AC_MSG_RESULT([$GST_GL_WINSYS])
216  GST_GL_HAVE_WINDOW_X11=""
217  GST_GL_HAVE_WINDOW_WAYLAND=""
218  GST_GL_HAVE_WINDOW_ANDROID=""
219  GST_GL_HAVE_WINDOW_COCOA=""
220  GST_GL_HAVE_WINDOW_EAGL=""
221  case "$GST_GL_WINSYS" in  *x11*) GST_GL_HAVE_WINDOW_X11="1" ;; esac
222  case "$GST_GL_WINSYS" in  *wayland*) GST_GL_HAVE_WINDOW_WAYLAND="1" ;; esac
223  case "$GST_GL_WINSYS" in  *android*) GST_GL_HAVE_WINDOW_ANDROID="1" ;; esac
224  case "$GST_GL_WINSYS" in  *cocoa*) GST_GL_HAVE_WINDOW_COCOA="1" ;; esac
225  case "$GST_GL_WINSYS" in  *eagl*) GST_GL_HAVE_WINDOW_EAGL="1" ;; esac
226
227  AC_MSG_CHECKING([GStreamer OpenGL platforms ...])
228  GST_GL_PLATFORMS=`$PKG_CONFIG --variable=gl_platforms gstreamer-gl-1.0`
229  AC_MSG_RESULT([$GST_GL_PLATFORMS])
230  GST_GL_HAVE_PLATFORM_GLX=""
231  GST_GL_HAVE_PLATFORM_EGL=""
232  GST_GL_HAVE_PLATFORM_CGL=""
233  GST_GL_HAVE_PLATFORM_EAGL=""
234  case "$GST_GL_PLATFORMS" in  *glx*) GST_GL_HAVE_PLATFORM_GLX="1" ;; esac
235  case "$GST_GL_PLATFORMS" in  *egl*) GST_GL_HAVE_PLATFORM_EGL="1" ;; esac
236  case "$GST_GL_PLATFORMS" in  *cgl*) GST_GL_HAVE_PLATFORM_CGL="1" ;; esac
237  case "$GST_GL_PLATFORMS" in  *eagl*) GST_GL_HAVE_PLATFORM_EAGL="1" ;; esac
238
239  AC_MSG_CHECKING([GStreamer OpenGL apis ...])
240  GST_GL_APIS=`$PKG_CONFIG --variable=gl_apis gstreamer-gl-1.0`
241  AC_MSG_RESULT([$GST_GL_APIS])
242  GST_GL_HAVE_API_GLES2=""
243  GST_GL_HAVE_API_GL=""
244  case "$GST_GL_APIS" in  *gles2*) GST_GL_HAVE_API_GLES2="1" ;; esac
245  case "$GST_GL_APIS" in "gl"|"gl "*|*" gl"|*" gl "*) GST_GL_HAVE_API_GL="1" ;; esac
246fi
247AM_CONDITIONAL(USE_OPENGL, test "x$GST_GL_HAVE_API_GL" = "x1")
248
249AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
250
251AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
252
253dnl check for uninstalled plugin directories for unit tests
254AG_GST_CHECK_UNINSTALLED_SETUP([
255  AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [$GSTPB_REQ])
256  AG_GST_CHECK_GST_PLUGINS_UGLY($GST_API_VERSION, [$GSTPB_REQ])
257  AG_GST_CHECK_GST_PLUGINS_LIBAV($GST_API_VERSION, [$GSTPB_REQ])
258])
259
260dnl Check for documentation xrefs
261GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
262GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
263GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
264AC_SUBST(GLIB_PREFIX)
265AC_SUBST(GST_PREFIX)
266AC_SUBST(GSTPB_PREFIX)
267
268dnl GTK is optional and used in examples
269HAVE_GTK=NO
270GTK2_REQ=2.14.0
271GTK3_REQ=2.91.3
272if test "x$BUILD_EXAMPLES" = "xyes"; then
273  AC_MSG_CHECKING([which gtk+ version to compile examples against (optional)])
274  AC_ARG_WITH([gtk],
275    AS_HELP_STRING([--with-gtk=3.0|2.0],[which gtk+ version to compile against (default: 2.0)]),
276    [case "$with_gtk" in
277        2.0) GTK_REQ=$GTK2_REQ ;;
278        3.0) GTK_REQ=$GTK3_REQ ;;
279        *) AC_MSG_ERROR([invalid gtk+ version specified]);;
280    esac],
281    [with_gtk=2.0
282     GTK_REQ=$GTK2_REQ])
283  AC_MSG_RESULT([$with_gtk (>= $GTK_REQ)])
284  PKG_CHECK_MODULES(GTK, gtk+-x11-$with_gtk >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
285  AC_SUBST(GTK_LIBS)
286  AC_SUBST(GTK_CFLAGS)
287fi
288AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
289
290dnl Check for -Bsymbolic-functions linker flag used to avoid
291dnl intra-library PLT jumps, if available.
292AC_ARG_ENABLE(Bsymbolic,
293              [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
294              [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
295               AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
296               LDFLAGS=-Wl,-Bsymbolic-functions
297               LIBS=
298               AC_TRY_LINK([], [return 0],
299                           AC_MSG_RESULT(yes)
300                           enable_Bsymbolic=yes,
301                           AC_MSG_RESULT(no)
302                           enable_Bsymbolic=no)
303               LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
304
305dnl *** set variables based on configure arguments ***
306
307dnl GTK is optional and used in examples
308HAVE_GTK3=NO
309HAVE_GTK3_WAYLAND=""
310if test "x$BUILD_EXAMPLES" = "xyes"; then
311  PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.4, HAVE_GTK3=yes, HAVE_GTK3=no)
312  if test "x$HAVE_GTK3" = "xyes"; then
313    HAVE_GTK=yes
314    GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
315    AC_SUBST(GTK_VERSION)
316    GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
317    AC_SUBST(GTK_BASE_DIR)
318    GTK3_TARGETS=`$PKG_CONFIG --variable=targets gtk+-3.0`
319    case "$GTK3_TARGETS" in  *wayland*) HAVE_GTK3_WAYLAND="1" ;; esac
320  fi
321fi
322AC_SUBST(GTK3_LIBS)
323AC_SUBST(GTK3_CFLAGS)
324AC_SUBST(HAVE_GTK3)
325AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
326AM_CONDITIONAL(HAVE_GTK3_WAYLAND, test "x$HAVE_GTK3_WAYLAND" = "x1")
327
328dnl x11 is optional for librfb
329HAVE_X11=NO
330PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no)
331AC_SUBST(X11_LIBS)
332AC_SUBST(X11_CFLAGS)
333AC_SUBST(HAVE_X11)
334AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "xyes")
335if test "x$HAVE_X11" = "xyes"; then
336  AC_DEFINE(HAVE_X11, 1, [Define if you have X11 library])
337fi
338
339dnl exif (used on jifmux tests) ****
340PKG_CHECK_MODULES(EXIF, libexif >= 0.6.16, HAVE_EXIF="yes", HAVE_EXIF="no")
341AC_SUBST(EXIF_LIBS)
342AC_SUBST(EXIF_CFLAGS)
343AM_CONDITIONAL(USE_EXIF, test "x$HAVE_EXIF" = "xyes")
344
345AG_GST_CHECK_FEATURE(IQA, [iqa], iqa , [
346  PKG_CHECK_MODULES(DSSIM, dssim, [
347    HAVE_DSSIM="yes"
348    HAVE_IQA="yes"
349  ], [
350    HAVE_DSSIM="no"
351    HAVE_IQA="no"
352  ])
353
354  if test "x$HAVE_DSSIM" = "xyes"; then
355    AC_DEFINE(HAVE_DSSIM, 1, [Define if you have dssim library])
356  fi
357  AC_SUBST(DSSIM_LIBS)
358  AC_SUBST(DSSIM_CFLAGS)
359])
360AM_CONDITIONAL(HAVE_DSSIM, test "x$HAVE_DSSIM" = "xyes")
361
362dnl Orc
363ORC_CHECK([0.4.17])
364
365dnl set license and copyright notice
366GST_LICENSE="LGPL"
367AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
368AC_SUBST(GST_LICENSE)
369
370dnl define LIBDIR so we can inform people where we live
371AS_AC_EXPAND(LIBDIR, $libdir)
372AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
373
374dnl set location of plugin directory
375AG_GST_SET_PLUGINDIR
376
377dnl set release date/time
378AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
379  ["${srcdir}/gst-plugins-bad.doap"],
380  [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
381
382dnl If only building static libraries, define GST_STATIC_COMPILATION. This is
383dnl needed only on Windows, but it doesn't hurt to have it everywhere.
384if test x$enable_static = xyes -a x$enable_shared = xno; then
385  GST_STATIC_CFLAGS="-DGST_STATIC_COMPILATION"
386fi
387
388AC_ARG_WITH([player-tests],
389  AS_HELP_STRING([--with-player-tests],[Enable GstPlayer tests that need network access (default: no)]))
390if test x$with_player_tests = xyes; then
391  AC_PATH_PROG([WGET], [wget], no)
392  if test x$WGET = xno; then
393    AC_MSG_WARN([wget required for GstPlayer tests but not found - disabling])
394    with_player_tests=no
395  fi
396fi
397AM_CONDITIONAL(WITH_GST_PLAYER_TESTS, test "x$with_player_tests" = "xyes")
398
399# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
400dnl make sure it doesn't complain about unused variables if debugging is disabled
401NO_WARNINGS=""
402AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
403
404dnl define an ERROR_CFLAGS Makefile variable
405dnl -Waggregate-return - libexif returns aggregates
406dnl -Wundef - Windows headers check _MSC_VER unconditionally
407AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
408    -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
409    -Wwrite-strings -Wformat-security -Wold-style-definition
410    -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
411    -Wnested-externs $NO_WARNINGS])
412
413dnl define an ERROR_CXXFLAGS Makefile variable
414AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
415    -Wmissing-declarations -Wredundant-decls
416    -Wwrite-strings -Wformat-nonliteral -Wformat-security
417    -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar $NO_WARNINGS])
418
419dnl define an ERROR_OBJCFLAGS Makefile variable
420AG_GST_SET_ERROR_OBJCFLAGS($FATAL_WARNINGS, [
421    -Wmissing-declarations -Wredundant-decls
422    -Wwrite-strings -Wformat-nonliteral -Wformat-security
423    -Winit-self -Wmissing-include-dirs -Wno-multichar $NO_WARNINGS])
424
425dnl define correct level for debugging messages
426AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
427
428dnl used in examples
429AG_GST_DEFAULT_ELEMENTS
430
431dnl *** plug-ins to include ***
432
433dnl these are all the gst plug-ins, compilable without additional libs
434AG_GST_CHECK_PLUGIN(accurip)
435AG_GST_CHECK_PLUGIN(adpcmdec)
436AG_GST_CHECK_PLUGIN(adpcmenc)
437AG_GST_CHECK_PLUGIN(aiff)
438AG_GST_CHECK_PLUGIN(videoframe_audiolevel)
439AG_GST_CHECK_PLUGIN(asfmux)
440AG_GST_CHECK_PLUGIN(audiobuffersplit)
441AG_GST_CHECK_PLUGIN(audiofxbad)
442AG_GST_CHECK_PLUGIN(audiolatency)
443AG_GST_CHECK_PLUGIN(audiomixmatrix)
444AG_GST_CHECK_PLUGIN(audiovisualizers)
445AG_GST_CHECK_PLUGIN(autoconvert)
446AG_GST_CHECK_PLUGIN(bayer)
447AG_GST_CHECK_PLUGIN(camerabin2)
448AG_GST_CHECK_PLUGIN(coloreffects)
449AG_GST_CHECK_PLUGIN(debugutils)
450AG_GST_CHECK_PLUGIN(dvbsuboverlay)
451AG_GST_CHECK_PLUGIN(dvdspu)
452AG_GST_CHECK_PLUGIN(faceoverlay)
453AG_GST_CHECK_PLUGIN(festival)
454AG_GST_CHECK_PLUGIN(fieldanalysis)
455AG_GST_CHECK_PLUGIN(freeverb)
456AG_GST_CHECK_PLUGIN(frei0r)
457AG_GST_CHECK_PLUGIN(gaudieffects)
458AG_GST_CHECK_PLUGIN(geometrictransform)
459AG_GST_CHECK_PLUGIN(gdp)
460AG_GST_CHECK_PLUGIN(id3tag)
461AG_GST_CHECK_PLUGIN(inter)
462AG_GST_CHECK_PLUGIN(interlace)
463AG_GST_CHECK_PLUGIN(ivfparse)
464AG_GST_CHECK_PLUGIN(ivtc)
465AG_GST_CHECK_PLUGIN(jp2kdecimator)
466AG_GST_CHECK_PLUGIN(jpegformat)
467AG_GST_CHECK_PLUGIN(librfb)
468AG_GST_CHECK_PLUGIN(midi)
469AG_GST_CHECK_PLUGIN(mpegdemux)
470AG_GST_CHECK_PLUGIN(mpegtsdemux)
471AG_GST_CHECK_PLUGIN(mpegtsmux)
472AG_GST_CHECK_PLUGIN(mpegpsmux)
473AG_GST_CHECK_PLUGIN(mxf)
474AG_GST_CHECK_PLUGIN(netsim)
475AG_GST_CHECK_PLUGIN(onvif)
476AG_GST_CHECK_PLUGIN(pcapparse)
477AG_GST_CHECK_PLUGIN(pnm)
478AG_GST_CHECK_PLUGIN(proxy)
479AG_GST_CHECK_PLUGIN(rawparse)
480AG_GST_CHECK_PLUGIN(removesilence)
481AG_GST_CHECK_PLUGIN(sdp)
482AG_GST_CHECK_PLUGIN(segmentclip)
483AG_GST_CHECK_PLUGIN(siren)
484AG_GST_CHECK_PLUGIN(smooth)
485AG_GST_CHECK_PLUGIN(speed)
486AG_GST_CHECK_PLUGIN(subenc)
487AG_GST_CHECK_PLUGIN(timecode)
488AG_GST_CHECK_PLUGIN(videofilters)
489AG_GST_CHECK_PLUGIN(videoparsers)
490AG_GST_CHECK_PLUGIN(videosignal)
491AG_GST_CHECK_PLUGIN(vmnc)
492AG_GST_CHECK_PLUGIN(y4m)
493AG_GST_CHECK_PLUGIN(yadif)
494
495dnl *** plug-ins to exclude ***
496
497AC_CHECK_HEADER(AVFoundation/AVFoundation.h, HAVE_AVFOUNDATION="yes", HAVE_AVFOUNDATION="no", [-])
498AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])
499AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h, HAVE_VIDEOTOOLBOX="yes", HAVE_VIDEOTOOLBOX="no", [-])
500
501if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
502  old_LIBS=$LIBS
503  LIBS="$LIBS -framework VideoToolbox"
504  AC_CHECK_FUNC(VTCompressionSessionPrepareToEncodeFrames, [
505    AC_DEFINE(HAVE_VIDEOTOOLBOX_10_9_6, 1, [Define if building with VideoToolbox >= 10.9.6])
506  ], [
507  ])
508  LIBS=$old_LIBS
509fi
510
511AM_CONDITIONAL(HAVE_AVFOUNDATION, test "x$HAVE_AVFOUNDATION" = "xyes")
512if test "x$HAVE_AVFOUNDATION" = "xyes"; then
513  AC_DEFINE(HAVE_AVFOUNDATION, 1, [Define if building with AVFoundation])
514fi
515
516AM_CONDITIONAL(HAVE_IOS, test "x$HAVE_IOS" = "xyes")
517if test "x$HAVE_IOS" = "xyes"; then
518  AC_DEFINE(HAVE_IOS, 1, [Define if building for Apple iOS])
519fi
520
521AM_CONDITIONAL(HAVE_VIDEOTOOLBOX, test "x$HAVE_VIDEOTOOLBOX" = "xyes")
522if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
523  AC_DEFINE(HAVE_VIDEOTOOLBOX, 1, [Define if building with VideoToolbox])
524fi
525
526dnl disable gst plugins we might not be able to build on this
527dnl platform: (ugly but minimally invasive)
528dnl FIXME: maybe move to sys, or make work with winsock2
529AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
530AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
531
532if test "x$HAVE_WINSOCK2_H" = "xyes"; then
533  WINSOCK2_LIBS="-lws2_32"
534  AC_SUBST(WINSOCK2_LIBS)
535fi
536
537dnl Vulkan
538PKG_CHECK_MODULES(XCB, xcb >= 1.10, GST_VULKAN_HAVE_WINDOW_XCB=1, GST_VULKAN_HAVE_WINDOW_XCB=0)
539AM_CONDITIONAL(USE_XCB, test "x$GST_VULKAN_HAVE_WINDOW_XCB" = "x1")
540
541PKG_CHECK_MODULES(VULKAN_WAYLAND, wayland-client >= 1.4, GST_VULKAN_HAVE_WINDOW_WAYLAND=1, GST_VULKAN_HAVE_WINDOW_WAYLAND=0)
542AM_CONDITIONAL(USE_WAYLAND, test "x$GST_VULKAN_HAVE_WINDOW_WAYLAND" = "x1")
543VULKAN_CONFIG_DEFINES="
544#define GST_VULKAN_HAVE_WINDOW_XCB $GST_VULKAN_HAVE_WINDOW_XCB
545#define GST_VULKAN_HAVE_WINDOW_WAYLAND $GST_VULKAN_HAVE_WINDOW_WAYLAND"
546
547AC_CONFIG_COMMANDS([ext/vulkan/vkconfig.h], [
548	outfile=vkconfig.h-tmp
549	cat > $outfile <<\_______EOF
550/* vkconfig.h
551 *
552 * This is a generated file.  Please modify `configure.ac'
553 */
554
555#ifndef __GST_VULKAN_CONFIG_H__
556#define __GST_VULKAN_CONFIG_H__
557
558#include <gst/gst.h>
559
560G_BEGIN_DECLS
561
562_______EOF
563
564	cat >>$outfile <<_______EOF
565$vulkan_config_defines
566_______EOF
567
568	cat >>$outfile <<_______EOF
569
570G_END_DECLS
571
572#endif  /* __GST_VULKAN_CONFIG_H__ */
573_______EOF
574
575
576	if cmp -s $outfile ext/vulkan/vkconfig.h; then
577          AC_MSG_NOTICE([ext/vulkan/vkconfig.h is unchanged])
578	  rm -f $outfile
579	else
580	  mv $outfile ext/vulkan/vkconfig.h
581	fi
582],[
583vulkan_config_defines='$VULKAN_CONFIG_DEFINES'
584])
585
586dnl *** sys plug-ins ***
587
588dnl DirectSound
589translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
590AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], directsoundsrc, [
591  HAVE_DIRECTSOUND="no"
592  save_CFLAGS="$CFLAGS"
593  save_LDFLAGS="$LDFLAGS"
594  save_LIBS="$LIBS"
595  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
596  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
597  LIBS="$LIBS -lwinmm -ldsound -ldxerr9 -luser32"
598  AC_MSG_CHECKING(for DirectSound LDFLAGS)
599  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
600#include <windows.h>
601#include <dxerr9.h>
602#include <dsound.h>
603#include <mmsystem.h>
604]], [[
605  DXGetErrorString9 (0);
606  DirectSoundCreate(NULL, NULL, NULL);
607]])],
608    [HAVE_DIRECTSOUND="yes"],
609    [HAVE_DIRECTSOUND="no"])
610  AC_MSG_RESULT($HAVE_DIRECTSOUND)
611  CFLAGS=$save_CFLAGS
612  LDFLAGS=$save_LDFLAGS
613  LIBS=$save_LIBS
614
615  if test "x$HAVE_DIRECTSOUND" = "xyes";  then
616    dnl this is much more than we want
617    DIRECTSOUND_LIBS="-lwinmm -ldsound -ldxerr9 -luser32"
618    AC_SUBST(DIRECTX_CFLAGS)
619    AC_SUBST(DIRECTX_LDFLAGS)
620    AC_SUBST(DIRECTSOUND_LIBS)
621  fi
622  AC_SUBST(HAVE_DIRECTSOUND)
623])
624
625dnl WASAPI
626translit(dnm, m, l) AM_CONDITIONAL(USE_WASAPI, true)
627AG_GST_CHECK_FEATURE(WASAPI, [WASAPI plug-in], wasapi, [
628  HAVE_WASAPI="no"
629  save_CFLAGS="$CFLAGS"
630  save_LDFLAGS="$LDFLAGS"
631  save_LIBS="$LIBS"
632  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
633  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
634  LIBS="$LIBS -lole32 -lwinmm -lksuser"
635  AC_MSG_CHECKING(for WASAPI LDFLAGS)
636  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
637#include <windows.h>
638#include <stdio.h>
639#include <mmsystem.h>
640#include <mmdeviceapi.h>
641]], [[
642int main ()
643{
644    HRESULT hr = S_OK;
645
646    hr = CoInitialize(NULL);
647    if (FAILED(hr)) {
648        printf("CoInitialize failed: hr = 0x%08x", hr);
649        return __LINE__;
650    }
651
652	int result = 0;
653    // result = do_everything(argc, argv);
654
655    CoUninitialize();
656    return result;
657}
658]])],
659    [HAVE_WASAPI="yes"],
660    [HAVE_WASAPI="no"])
661  AC_MSG_RESULT($HAVE_WASAPI)
662  CFLAGS=$save_CFLAGS
663  LDFLAGS=$save_LDFLAGS
664  LIBS=$save_LIBS
665
666  if test "x$HAVE_WASAPI" = "xyes";  then
667    WASAPI_LIBS="-lole32 -lwinmm -lksuser"
668    AC_SUBST(WASAPI_LIBS)
669  fi
670  AC_SUBST(HAVE_WASAPI)
671])
672
673dnl Direct3D
674translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECT3D, true)
675AG_GST_CHECK_FEATURE(DIRECT3D, [Direct3D plug-in], direct3dsink, [
676  HAVE_DIRECT3D="no"
677  save_CFLAGS="$CFLAGS"
678  save_LDFLAGS="$LDFLAGS"
679  save_LIBS="$LIBS"
680  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
681  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
682  LIBS="$LIBS -ld3d9 -lgdi32"
683  AC_MSG_CHECKING(for Direct3D LDFLAGS)
684  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
685#include <windows.h>
686#include <d3d9.h>
687]], [[
688  Direct3DCreate9(D3D_SDK_VERSION);
689]])],
690    [HAVE_DIRECT3D="yes"],
691    [HAVE_DIRECT3D="no"])
692  AC_MSG_RESULT($HAVE_DIRECT3D)
693  CFLAGS=$save_CFLAGS
694  LDFLAGS=$save_LDFLAGS
695  LIBS=$save_LIBS
696
697  if test "x$HAVE_DIRECT3D" = "xyes";  then
698    DIRECT3D_LIBS="-ld3d9 -lgdi32"
699    AC_SUBST(DIRECT3D_LIBS)
700  fi
701  AC_SUBST(HAVE_DIRECT3D)
702])
703
704dnl winscreencap
705translit(dnm, m, l) AM_CONDITIONAL(USE_WINSCREENCAP, true)
706AG_GST_CHECK_FEATURE(WINSCREENCAP, [winscreencap plug-in], winscreencap, [
707  HAVE_WINSCREENCAP="no"
708  save_CFLAGS="$CFLAGS"
709  save_LDFLAGS="$LDFLAGS"
710  save_LIBS="$LIBS"
711  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
712  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
713  LIBS="$LIBS -ld3d9 -lgdi32"
714  AC_MSG_CHECKING(for Direct3D LDFLAGS)
715  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
716#include <windows.h>
717#include <d3d9.h>
718]], [[
719  Direct3DCreate9(D3D_SDK_VERSION);
720]])],
721    [HAVE_WINSCREENCAP="yes"],
722    [HAVE_WINSCREENCAP="no"])
723  AC_MSG_RESULT($HAVE_WINSCREENCAP)
724  CFLAGS=$save_CFLAGS
725  LDFLAGS=$save_LDFLAGS
726  LIBS=$save_LIBS
727
728  if test "x$HAVE_WINSCREENCAP" = "xyes";  then
729    WINSCREENCAP_LIBS="-ld3d9 -lgdi32"
730    AC_SUBST(WINSCREENCAP_LIBS)
731  fi
732  AC_SUBST(HAVE_WINSCREENCAP)
733])
734
735dnl winks
736translit(dnm, m, l) AM_CONDITIONAL(USE_WINKS, true)
737AG_GST_CHECK_FEATURE(WINKS, [Winks plug-in], winks, [
738  HAVE_WINKS="no"
739  save_CFLAGS="$CFLAGS"
740  save_LDFLAGS="$LDFLAGS"
741  save_LIBS="$LIBS"
742  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
743  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
744  LIBS="$LIBS -lole32 -luuid -lstrmiids"
745  AC_MSG_CHECKING(for Winks LDFLAGS)
746  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
747#include <windows.h>
748#include <strmif.h>
749#include <uuids.h>
750]], [[
751int main () {
752  IGraphBuilder *pGraph = NULL;
753  HRESULT hr = CoInitialize(NULL);
754  hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
755                        &IID_IGraphBuilder, (void **)&pGraph);
756
757  return 0;
758}
759]])],
760    [HAVE_WINKS="yes"],
761    [HAVE_WINKS="no"])
762  AC_MSG_RESULT($HAVE_WINKS)
763  CFLAGS=$save_CFLAGS
764  LDFLAGS=$save_LDFLAGS
765  LIBS=$save_LIBS
766
767  if test "x$HAVE_WINKS" = "xyes";  then
768    dnl this is much more than we want
769    WINKS_LIBS="-ldxguid -lole32 -luuid -lstrmiids -lksuser -lsetupapi"
770    AC_SUBST(DIRECTX_CFLAGS)
771    AC_SUBST(DIRECTX_LDFLAGS)
772    AC_SUBST(WINKS_LIBS)
773  fi
774  AC_SUBST(HAVE_WINKS)
775])
776
777dnl *** Android Media ***
778translit(dnm, m, l) AM_CONDITIONAL(USE_ANDROID_MEDIA, true)
779HAVE_ANDROID_MEDIA="no"
780AG_GST_CHECK_FEATURE(ANDROID_MEDIA, [Android Media], androidmedia, [
781  case "$host" in
782    *android*)
783      AC_CHECK_HEADER(jni.h, HAVE_ANDROID_MEDIA="yes", HAVE_ANDROID_MEDIA="no")
784      ;;
785    *)
786      HAVE_ANDROID_MEDIA="no"
787      ;;
788  esac
789])
790
791dnl *** AppleMedia (OS X and iOS) ***
792translit(dnm, m, l) AM_CONDITIONAL(USE_APPLE_MEDIA, true)
793HAVE_APPLE_MEDIA="no"
794dnl SystemConfiguration.h is common to OS X and iOS, so we check for that
795AG_GST_CHECK_FEATURE(APPLE_MEDIA, [Apple video], applemedia, [
796  AC_CHECK_HEADER(SystemConfiguration/SystemConfiguration.h, HAVE_APPLE_MEDIA="yes", HAVE_APPLE_MEDIA="no")
797  dnl OSX 10.7 and earlier lack VideoToolbox/VideoToolbox.h
798  if test "x$HAVE_IOS" = "xno"; then
799    AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h,, HAVE_APPLE_MEDIA="no")
800  fi
801])
802
803dnl in case header SystemConfiguration/SystemConfiguration.h is found on other platforms
804case "$host" in
805  *-*darwin*)
806    ;;
807  *)
808    HAVE_APPLE_MEDIA="no"
809    ;;
810esac
811
812dnl *** bluez ***
813translit(dnm, m, l) AM_CONDITIONAL(USE_BLUEZ, true)
814AG_GST_CHECK_FEATURE(BLUEZ, [Bluez], bluez, [
815  PKG_CHECK_MODULES([BLUEZ5], [bluez >= 5.0], [
816    PKG_CHECK_MODULES([GIO_UNIX], gio-unix-2.0 > 2.24, [
817      AC_CHECK_PROG([GDBUS_CODEGEN],[gdbus-codegen],[gdbus-codegen])
818      HAVE_BLUEZ=yes
819      AC_DEFINE(HAVE_BLUEZ5,[1],[Bluez5 detected])
820    ], [
821      HAVE_BLUEZ=no
822    ])
823  ], [
824    HAVE_BLUEZ=no
825  ])
826])
827
828dnl *** OS/X AVCVideoServices ***
829translit(dnm, m, l) AM_CONDITIONAL(USE_AVC, true)
830HAVE_AVC="no"
831AG_GST_CHECK_FEATURE(AVC, [AVC Video Services], avcsrc, [
832  AC_LANG_PUSH([C++])
833  save_CPPFLAGS="$CPPFLAGS"
834  CPPFLAGS="$CPPFLAGS -framework AVCVideoServices -framework CoreFoundation"
835  save_LIBS="$LIBS"
836  LIBS="$LIBS -framework AVCVideoServices -framework CoreFoundation"
837  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[HAVE_AVC=yes],[HAVE_AVC=no])
838  LIBS=$save_LIBS
839  CPPFLAGS=$save_CPPFLAGS
840  AC_LANG_POP([C++])
841])
842dnl in case header AVCVideoServices/AVCVideoServices.h is found on other platforms
843case "$host" in
844  *-*darwin*)
845    ;;
846  *)
847    HAVE_AVC="no"
848    ;;
849esac
850
851dnl check for shm_open (for shm plugin)
852translit(dnm, m, l) AM_CONDITIONAL(USE_SHM, true)
853AG_GST_CHECK_FEATURE(SHM, [POSIX shared memory source and sink], shm, [
854    if test "x$HAVE_SYS_SOCKET_H" = "xyes"; then
855        case $host in
856        *-darwin* | *-macos10*)
857            AC_DEFINE(HAVE_OSX,[1],[Apple Mac OS X operating system detected])
858            HAVE_SHM=yes
859            ;;
860        *-*-OpenBSD*)
861            HAVE_SHM=yes
862            ;;
863        *)
864            AC_CHECK_LIB([rt], [shm_open],
865                AC_CHECK_DECL([MSG_NOSIGNAL], HAVE_SHM=yes, HAVE_SHM=no, [
866                #include <sys/socket.h>
867  	            ]),
868                HAVE_SHM=no)
869            AC_SUBST(SHM_LIBS, "-lrt")
870            ;;
871        esac
872    else
873        HAVE_SHM=no
874    fi
875])
876
877dnl check for unix sockets (ipcpipeline plugin)
878translit(dnm, m, l) AM_CONDITIONAL(USE_IPCPIPELINE, true)
879AG_GST_CHECK_FEATURE(IPCPIPELINE, [Unix sockets], ipcpipeline, [
880    if test "x$HAVE_SYS_SOCKET_H" = "xyes"; then
881        AC_CHECK_FUNC(pipe, [
882          AC_CHECK_FUNC(socketpair, [HAVE_IPCPIPELINE=yes], [HAVE_IPCPIPELINE=no])
883          ], [
884          HAVE_IPCPIPELINE=no
885        ])
886    else
887        HAVE_IPCPIPELINE=no
888    fi
889])
890
891dnl check for OpenSL ES
892translit(dnm, m, l) AM_CONDITIONAL(USE_OPENSLES, true)
893AG_GST_CHECK_FEATURE(OPENSLES, [OpenSL ES], opensl, [
894  AC_CHECK_HEADER(SLES/OpenSLES.h, HAVE_OPENSLES="yes", HAVE_OPENSLES="no")
895])
896
897dnl *** UVC H264 ***
898translit(dnm, m, l) AM_CONDITIONAL(USE_UVCH264, true)
899AG_GST_CHECK_FEATURE(UVCH264, [UVC H264], uvch264, [
900  AC_CHECK_HEADER(linux/uvcvideo.h, HAVE_UVCVIDEO_H=yes, HAVE_UVCVIDEO_H=no)
901  PKG_CHECK_MODULES(G_UDEV, gudev-1.0 , [
902          AC_DEFINE([HAVE_GUDEV], 1, [Define if gudev is installed])
903          HAVE_GUDEV="yes" ],
904          [HAVE_GUDEV="no"])
905  PKG_CHECK_MODULES(LIBUSB, libusb-1.0 , [
906          AC_DEFINE([HAVE_LIBUSB], 1, [Define if libusb 1.x is installed])
907          HAVE_LIBUSB="yes" ],
908          [HAVE_LIBUSB="no"])
909  if test "x$HAVE_UVCVIDEO_H" = "xyes" && \
910     test "x$HAVE_GUDEV" = "xyes" && \
911     test "x$HAVE_LIBUSB" = "xyes"; then
912    HAVE_UVCH264=yes
913  else
914    HAVE_UVCH264=no
915  fi
916])
917AC_SUBST(LIBUDEV_CFLAGS)
918AC_SUBST(LIBUDEV_LIBS)
919AC_SUBST(LIBUSB_CFLAGS)
920AC_SUBST(LIBUSB_LIBS)
921
922dnl *** CUDA ***
923translit(dnm, m, l) AM_CONDITIONAL(USE_CUDA, true)
924AG_GST_CHECK_FEATURE(CUDA, [NVIDIA CUDA API],, [
925  AC_ARG_WITH([cuda-prefix],
926          AS_HELP_STRING([--with-cuda-prefix],
927          [Use the provided prefix for detecting the cuda installation]),
928          [AS_IF([test "x$with_cuda_prefix" != "x"],
929                 [CUDA_PREFIX="$with_cuda_prefix"])],
930          [CUDA_PREFIX=""])
931
932  HAVE_CUDA="yes"
933  if test "x$CUDA_PREFIX" != "x"; then
934    dnl only override if not already set
935    if test "x$CUDA_CFLAGS" = "x" -a "x$CUDA_LIBS" = "x"; then
936      dnl this is an educated guess, user can always override these
937      CUDA_CFLAGS="-I$CUDA_PREFIX/include"
938      CUDA_LIBS="-L$CUDA_PREFIX/lib -L$CUDA_PREFIX/lib64 -L$CUDA_PREFIX/lib/stubs -L$CUDA_PREFIX/lib64/stubs -lcuda -lcudart"
939    fi
940  else
941    PKG_CHECK_MODULES([CUDA], [cuda-10.1 cudart-10.1],, [
942      PKG_CHECK_MODULES([CUDA], [cuda-10.0 cudart-10.0],, [
943        PKG_CHECK_MODULES([CUDA], [cuda-9.2 cudart-9.2],, [
944          PKG_CHECK_MODULES([CUDA], [cuda-9.1 cudart-9.1],, [
945            PKG_CHECK_MODULES([CUDA], [cuda-9.0 cudart-9.0],, [
946              PKG_CHECK_MODULES([CUDA], [cuda-8.0 cudart-8.0],, [
947                PKG_CHECK_MODULES([CUDA], [cuda-7.5 cudart-7.5],, [
948                  PKG_CHECK_MODULES([CUDA], [cuda-7.0 cudart-7.0],, [
949                    PKG_CHECK_MODULES([CUDA], [cuda-6.5 cudart-6.5],, [
950                      AC_MSG_WARN([Could not find cuda headers/libraries])])])])])])])])])])
951  fi
952
953  HAVE_CUDA_H=no
954  HAVE_CUDART_H=no
955  save_CPPFLAGS="$CPPFLAGS"
956  CPPFLAGS="$CUDA_CFLAGS $save_CPPFLAGS "
957  AC_CHECK_HEADER([cuda.h], [HAVE_CUDA_H=yes],
958      AC_MSG_WARN([Could not find cuda.h]))
959  AC_CHECK_HEADER([cuda_runtime_api.h], [HAVE_CUDART_H=yes],
960      AC_MSG_WARN([Could not find cuda_runtime_api.h]))
961  CPPFLAGS=$save_CPPFLAGS
962
963  dnl libcuda and libcudart libraries
964  save_LIBS="$LIBS"
965  LIBS="$CUDA_LIBS $save_LIBS"
966  HAVE_CUDART_LIB="no"
967  AC_CHECK_LIB(cudart,cudaGetErrorString,[HAVE_CUDART_LIB="yes"], [
968      AC_MSG_WARN([Could not find cudart library])])
969  HAVE_CUDA_LIB="no"
970  AC_CHECK_LIB(cuda,cuInit,[HAVE_CUDA_LIB="yes"], [
971      AC_MSG_WARN([Could not find cuda library])])
972  LIBS="$save_LIBS"
973])
974
975dnl *** NVDEC ***
976translit(dnm, m, l) AM_CONDITIONAL(USE_NVDEC, true)
977AG_GST_CHECK_FEATURE(NVDEC, [nvdec], nvdec, [
978  save_CPPFLAGS="$CPPFLAGS"
979  CPPFLAGS="$CUDA_CFLAGS $save_CPPFLAGS"
980  CPPFLAGS=$save_CPPFLAGS
981
982  HAVE_NVCUVID=no
983  save_LIBS="$LIBS"
984  LIBS="$CUDA_LIBS $save_LIBS"
985  AC_CHECK_LIB(nvcuvid, cuvidCtxLock, [HAVE_NVCUVID=yes],
986      AC_MSG_WARN([Could not find library nvcuvid]))
987  LIBS="$save_LIBS"
988
989  if test "x$HAVE_NVCUVID" = "xyes"; then
990    HAVE_NVDEC=yes
991  else
992    HAVE_NVDEC=no
993  fi
994])
995
996dnl *** NVENC ***
997translit(dnm, m, l) AM_CONDITIONAL(USE_NVENC, true)
998AG_GST_CHECK_FEATURE(NVENC, [NVIDIA Encode API], nvenc, [
999  dnl libnvnidia-encode library
1000  HAVE_NVENCODE_LIB=no
1001  AC_ARG_VAR(NVENCODE_LIBS, [linker flags for nvidia-encode])
1002  saved_LIBS="$LIBS"
1003  LIBS="$NVENCODE_LIBS $saved_LIBS"
1004  AC_CHECK_LIB(nvidia-encode, NvEncodeAPICreateInstance, [HAVE_NVENCODE_LIB="yes"],
1005      AC_MSG_WARN([Could not find library nvidia-encode]))
1006  NVENCODE_LIBS="$NVENCODE_LIBS -lnvidia-encode"
1007  AC_SUBST(NVENCODE_LIBS)
1008  LIBS="$saved_LIBS"
1009
1010  USE_NVENC_GST_GL=no
1011  if test "x$HAVE_CUDA_H" = "xyes" \
1012      -a "x$HAVE_CUDART_H" = "xyes" \
1013      -a "x$HAVE_CUDA_LIB" = "xyes" \
1014      -a "x$HAVE_CUDART_LIB" = "xyes" \
1015      -a "x$HAVE_NVENCODE_LIB" = "xyes"; then
1016    HAVE_NVENC="yes"
1017    if test "x$GST_GL_HAVE_API_GL" = "x1"; then
1018      dnl cuda-gl interop header
1019      save_CPPFLAGS="$CPPFLAGS"
1020      CPPFLAGS="$save_CPPFLAGS $CUDA_CFLAGS"
1021      AC_CHECK_HEADER([cuda_gl_interop.h], [
1022        USE_NVENC_GST_GL="yes"
1023        AC_DEFINE(HAVE_NVENC_GST_GL, [1] , [NVENC GStreamer OpenGL support available])
1024        ])
1025      CPPFLAGS="$save_CPPFLAGS"
1026    fi
1027  else
1028    HAVE_NVENC="no"
1029  fi
1030])
1031AM_CONDITIONAL(USE_NVENC_GST_GL, test "x$USE_NVENC_GST_GL" = "xyes")
1032
1033dnl check for tinyalsa
1034translit(dnm, m, l) AM_CONDITIONAL(USE_TINYALSA, true)
1035AG_GST_CHECK_FEATURE(TINYALSA, [tinyalsa], tinyalsa, [
1036  AC_CHECK_HEADER(tinyalsa/asoundlib.h, HAVE_TINYALSA="yes", HAVE_TINYALSA="no")
1037])
1038
1039dnl check for intel mediasdk
1040translit(dnm, m, l) AM_CONDITIONAL(USE_MSDK, true)
1041AG_GST_CHECK_FEATURE(MSDK, [Intel MediaSDK], msdk, [
1042  AG_GST_PKG_CHECK_MODULES(GST_ALLOCATORS, gstreamer-allocators-1.0)
1043  PKG_CHECK_MODULES(G_UDEV, gudev-1.0 , [
1044          AC_DEFINE([HAVE_GUDEV], 1, [Define if gudev is installed])
1045          HAVE_GUDEV="yes" ],
1046          [HAVE_GUDEV="no"])
1047  PKG_CHECK_MODULES(LIBMFX, libmfx,
1048  [
1049    AC_DEFINE(HAVE_LIBMFX, 1, [Define if mfx_dispatcher is available])
1050    HAVE_MSDK="yes"
1051    dnl external msdk dispatchers sometimes install headers into prefix/mfx/
1052    save_CPPFLAGS="$CPPFLAGS"
1053    CPPFLAGS="$LIBMFX_CFLAGS $save_CPPFLAGS"
1054    AC_CHECK_HEADER(mfx/mfxdefs.h, [HAVE_MFX_MFXDEFS_H=1], [HAVE_MFX_MFXDEFS_H=0])
1055    if test $HAVE_MFX_MFXDEFS_H -eq 1; then
1056      MFX_INCDIR="`$PKG_CONFIG --variable=includedir libmfx`"
1057      MSDK_CFLAGS="-I$MFX_INCDIR/mfx"
1058      AC_SUBST(MSDK_CFLAGS)
1059    fi
1060    CPPFLAGS="$save_CPPFLAGS"
1061  ], [
1062    AC_ARG_WITH([msdk-prefix],
1063            AS_HELP_STRING([--with-msdk-prefix],
1064            [Use the provided prefix for detecting the Intel MediaSDK]),
1065            [AS_IF([test "x$with_msdk_prefix" != "x"],
1066                   [MSDK_PREFIX="$with_msdk_prefix"])],
1067            [AS_IF([test "x$MFX_HOME" != "x"],
1068                   [MSDK_PREFIX="$MFX_HOME"],
1069                   [MSDK_PREFIX="/opt/intel/media"])])
1070    MSDK_CFLAGS="-I$MSDK_PREFIX/include -I$MSDK_PREFIX/include/mfx"
1071    MSDK_LIBS="-L$MSDK_PREFIX/lib/lin_x64 -L$MSDK_PREFIX/lib/x64 -L$MSDK_PREFIX/lib64 -L$MSDK_PREFIX/lib -lmfx -ldl"
1072    AC_SUBST(MSDK_CFLAGS)
1073    AC_SUBST(MSDK_LIBS)
1074
1075    save_CPPFLAGS="$CPPFLAGS"
1076    CPPFLAGS="$MSDK_CFLAGS $save_CPPFLAGS"
1077    AC_CHECK_HEADER(mfxdefs.h, HAVE_MFXDEFS_H="yes", HAVE_MFXDEFS_H="no")
1078    CPPFLAGS="$save_CPPFLAGS"
1079
1080    save_LIBS="$LIBS"
1081    LIBS="$MSDK_LIBS $LIBS"
1082    AC_LANG_PUSH([C++])
1083    AC_CHECK_LIB(mfx,MFXInit,HAVE_MFX_LIB="yes",HAVE_MFX_LIB="no")
1084    AC_LANG_POP([C++])
1085    LIBS="$save_LIBS"
1086
1087    if test "x$HAVE_MFXDEFS_H" = "xyes" \
1088        -a "x$HAVE_MFX_LIB" = "xyes"; then
1089      HAVE_MSDK="yes"
1090    else
1091      HAVE_MSDK="no"
1092    fi
1093  ])
1094
1095  PKG_CHECK_MODULES(LIBVA_DRM, libva-drm, HAVE_LIBVA_DRM="yes", HAVE_LIBVA_DRM="no")
1096
1097  if test "x$HAVE_GUDEV" = "xyes" \
1098     -a  "x$HAVE_MSDK" = "xyes" \
1099     -a "x$HAVE_LIBVA_DRM" = "xyes"; then
1100    HAVE_MSDK="yes"
1101  else
1102    HAVE_MSDK="no"
1103  fi
1104], [], [
1105  dnl check the availability of vp9 apis
1106  USE_MSDK_VP9_DEC=0
1107  save_CPPFLAGS="$CPPFLAGS"
1108  CPPFLAGS="$LIBMFX_CFLAGS $MSDK_CFLAGS $save_CPPFLAGS"
1109  AC_CHECK_HEADER(mfxvp9.h, [HAVE_MFXVP9_H=1], [HAVE_MFXVP9_H=0],
1110  [
1111    #include <mfxplugin.h>
1112  ])
1113
1114  if test $HAVE_MFXVP9_H -eq 1; then
1115      USE_MSDK_VP9_DEC=1
1116      AC_DEFINE(USE_MSDK_VP9_DEC, 1, [Define if MediaSDK VP9 decoder api is available])
1117  fi
1118], [USE_MSDK_VP9_DEC=0])
1119AM_CONDITIONAL(USE_MSDK_LIBVA,
1120    test "x$HAVE_MSDK" = "xyes" -a "x$HAVE_LIBVA_DRM" = "xyes")
1121AM_CONDITIONAL([USE_MSDK_VP9_DEC],
1122    [test $USE_MSDK_VP9_DEC -eq 1])
1123
1124dnl *** ext plug-ins ***
1125dnl keep this list sorted alphabetically !
1126
1127if test "x$BUILD_EXTERNAL" = "xyes"; then
1128
1129dnl *** assrender ***
1130translit(dnm, m, l) AM_CONDITIONAL(USE_ASSRENDER, true)
1131AG_GST_CHECK_FEATURE(ASSRENDER, [ASS/SSA renderer], assrender, [
1132  PKG_CHECK_MODULES(ASSRENDER, libass >= 0.10.2, [
1133    HAVE_ASSRENDER="yes" ], [
1134    HAVE_ASSRENDER="no"
1135  ])
1136])
1137AC_SUBST(ASSRENDER_CFLAGS)
1138AC_SUBST(ASSRENDER_LIBS)
1139
1140dnl *** AOM ***
1141translit(dnm, m, l) AM_CONDITIONAL(USE_AOM, true)
1142AG_GST_CHECK_FEATURE(AOM, [AV1 encoder/decoder], aom, [
1143  AG_GST_PKG_CHECK_MODULES(AOM, aom)
1144])
1145
1146dnl *** vo-amrwbenc ***
1147translit(dnm, m, l) AM_CONDITIONAL(USE_VOAMRWBENC, true)
1148AG_GST_CHECK_FEATURE(VOAMRWBENC, [vo-amrwbenc library], vo-amrwbenc, [
1149  AG_GST_PKG_CHECK_MODULES(VOAMRWBENC, vo-amrwbenc >= 0.1.0)
1150])
1151
1152dnl *** vo-aacenc ***
1153translit(dnm, m, l) AM_CONDITIONAL(USE_VOAACENC, true)
1154AG_GST_CHECK_FEATURE(VOAACENC, [vo-aacenc library], vo-aacenc, [
1155  AG_GST_PKG_CHECK_MODULES(VOAACENC, vo-aacenc >= 0.1.0)
1156])
1157
1158dnl *** bs2b ***
1159translit(dnm, m, l) AM_CONDITIONAL(USE_BS2B, true)
1160AG_GST_CHECK_FEATURE(BS2B, [bs2b], bs2b, [
1161  PKG_CHECK_MODULES(BS2B, libbs2b >= 3.1.0, HAVE_BS2B="yes", [
1162    HAVE_BS2B="no"
1163  ])
1164  AC_SUBST(BS2B_CFLAGS)
1165  AC_SUBST(BS2B_LIBS)
1166])
1167
1168dnl *** BZ2 ***
1169translit(dnm, m, l) AM_CONDITIONAL(USE_BZ2, true)
1170AG_GST_CHECK_FEATURE(BZ2, [bz2 library], bz2, [
1171  save_LIBS=$LIBS
1172  LIBS="$LIBS -lbz2"
1173  AC_MSG_CHECKING([for BZ2_bzlibVersion in -lbz2])
1174  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <bzlib.h>]], [[const char *version = BZ2_bzlibVersion ();]])],[HAVE_BZ2=yes],[HAVE_BZ2=no])
1175  AC_MSG_RESULT($HAVE_BZ2)
1176  LIBS=$save_LIBS
1177  if test "x$HAVE_BZ2" = "xyes"; then
1178    BZ2_LIBS="-lbz2"
1179  fi
1180  AC_SUBST(BZ2_LIBS)
1181
1182])
1183
1184#dnl *** cairo ***
1185#translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true)
1186#AG_GST_CHECK_FEATURE(CAIRO, [cairo plug-in], cairo, [
1187#  PKG_CHECK_MODULES(CAIRO, cairo >= 1.0 glitz-glx, HAVE_CAIRO=yes, [
1188#    HAVE_CAIRO=no
1189#  ])
1190#  AC_SUBST(CAIRO_CFLAGS)
1191#  AC_SUBST(CAIRO_LIBS)
1192#])
1193
1194dnl *** chromaprint ***
1195translit(dnm, m, l) AM_CONDITIONAL(USE_CHROMAPRINT, true)
1196AG_GST_CHECK_FEATURE(CHROMAPRINT, [chromaprint], chromaprint, [
1197  PKG_CHECK_MODULES(CHROMAPRINT, libchromaprint, HAVE_CHROMAPRINT="yes", [
1198    HAVE_CHROMAPRINT="no"
1199  ])
1200  AC_SUBST(CHROMAPRINT_CFLAGS)
1201  AC_SUBST(CHROMAPRINT_LIBS)
1202])
1203
1204dnl *** Curl ***
1205translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true)
1206AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
1207  PKG_CHECK_MODULES(CURL, libcurl >= 7.35.0, [
1208    HAVE_CURL="yes"
1209    AC_CHECK_HEADERS([unistd.h sys/socket.h sys/types.h netinet/in.h netinet/tcp.h fcntl.h], [ ], [
1210      AC_CHECK_HEADERS([unistd.h sys/types.h winsock2.h ws2tcpip.h fcntl.h], [ ], [HAVE_CURL="no"])
1211    ])
1212    AC_CHECK_HEADERS([netinet/ip.h], [], [HAVE_CURL="no"],
1213    [[#ifdef HAVE_SYS_TYPES_H
1214     # include <sys/types.h>
1215     #endif
1216     #ifdef HAVE_NETINET_IN_H
1217     # include <netinet/in.h>
1218     #endif
1219    ]])
1220    AC_MSG_CHECKING([for socket support needed by curlsink])
1221    AC_MSG_RESULT($HAVE_CURL)
1222  ], [
1223    HAVE_CURL="no"
1224  ])
1225  AC_SUBST(CURL_CFLAGS)
1226  AC_SUBST(CURL_LIBS)
1227  PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
1228    HAVE_SSH2="yes"
1229    AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
1230  ], [
1231    HAVE_SSH2="no"
1232  ])
1233  AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes")
1234  AC_SUBST(SSH2_CFLAGS)
1235  AC_SUBST(SSH2_LIBS)
1236],,,[AM_CONDITIONAL(USE_SSH2, false)])
1237
1238dnl **** DASH ****
1239translit(dnm, m, l) AM_CONDITIONAL(USE_DASH, true)
1240AG_GST_CHECK_FEATURE(DASH, [DASH plug-in], dash, [
1241  PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.8, [HAVE_LIBXML2="yes"
1242    HAVE_DASH="yes"], [HAVE_LIBXML2="no"
1243    HAVE_DASH="no"])
1244  AC_SUBST(LIBXML2_CFLAGS)
1245  AC_SUBST(LIBXML2_LIBS)
1246])
1247
1248dnl *** dc1394  ***
1249translit(dnm, m, l) AM_CONDITIONAL(USE_DC1394, true)
1250AG_GST_CHECK_FEATURE(DC1394, [libdc1394], dc1394, [
1251   PKG_CHECK_MODULES(LIBDC1394, libdc1394-2 >= 2.0.0, [
1252   	if test -z "`$PKG_CONFIG --modversion libdc1394-2 | grep 2.0.0-rc`"; then
1253		HAVE_DC1394="yes"
1254	else
1255		HAVE_DC1394="no"
1256	fi
1257   ], [
1258        HAVE_DC1394="no"
1259	AC_MSG_RESULT(no)
1260   ])
1261   AC_SUBST(LIBDC1394_CFLAGS)
1262   AC_SUBST(LIBDC1394_LIBS)
1263])
1264
1265dnl *** decklink  ***
1266translit(dnm, m, l) AM_CONDITIONAL(USE_DECKLINK, true)
1267AG_GST_CHECK_FEATURE(DECKLINK, [decklink], decklink, [
1268   HAVE_DECKLINK=no
1269   case "$host" in
1270     *android*)
1271       HAVE_DECKLINK=no
1272       ;;
1273     *-*linux*)
1274       if test "x$HAVE_PTHREAD_H" = "xyes"; then
1275         AC_CHECK_LIB(dl, dlopen,
1276           [
1277            HAVE_DECKLINK=yes
1278            DECKLINK_CXXFLAGS=
1279            DECKLINK_LIBS="-lpthread -ldl"
1280           ])
1281       fi
1282       ;;
1283     *-*darwin*)
1284       if test "x$HAVE_PTHREAD_H" = "xyes"; then
1285         AC_CHECK_LIB(dl, dlopen,
1286           [
1287            HAVE_DECKLINK=yes
1288            DECKLINK_CXXFLAGS=
1289            DECKLINK_LIBS="-lpthread -ldl"
1290            HAVE_DECKLINK_OSX=yes
1291           ])
1292       fi
1293       ;;
1294     *-mingw*)
1295       HAVE_DECKLINK=yes
1296       DECKLINK_CXXFLAGS=
1297       DECKLINK_LIBS="-lole32 -loleaut32"
1298       HAVE_DECKLINK_WIN=yes
1299       ;;
1300     *)
1301       HAVE_DECKLINK=no
1302       ;;
1303   esac
1304
1305   AC_SUBST(DECKLINK_CXXFLAGS)
1306   AC_SUBST(DECKLINK_LIBS)
1307])
1308AM_CONDITIONAL(DECKLINK_OSX, test "x$HAVE_DECKLINK_OSX" = xyes)
1309AM_CONDITIONAL(DECKLINK_WIN, test "x$HAVE_DECKLINK_WIN" = xyes)
1310
1311dnl **** DirectFB ****
1312translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTFB, true)
1313AG_GST_CHECK_FEATURE(DIRECTFB, [directfb], dfbvideosink , [
1314  PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.24, HAVE_DIRECTFB="yes", [
1315    HAVE_DIRECTFB="no"
1316  ])
1317])
1318
1319dnl **** Wayland ****
1320translit(dnm, m, l) AM_CONDITIONAL(USE_WAYLAND, true)
1321AC_PATH_PROG([wayland_scanner], [wayland-scanner])
1322AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland , [
1323  PKG_CHECK_MODULES(WAYLAND, wayland-client >= 1.11.0 libdrm >= 2.4.55 wayland-protocols >= 1.15, [
1324    if test "x$wayland_scanner" != "x"; then
1325      HAVE_WAYLAND="yes"
1326      AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
1327    else
1328      AC_MSG_RESULT([wayland-scanner is required to build the wayland plugin])
1329      HAVE_WAYLAND="no"
1330    fi
1331    ],
1332    [ HAVE_WAYLAND="no"
1333  ])
1334])
1335
1336dnl **** WebP ****
1337translit(dnm, m, l) AM_CONDITIONAL(USE_WEBP, true)
1338AG_GST_CHECK_FEATURE(WEBP, [WebP], webp , [
1339  PKG_CHECK_MODULES(WEBP, libwebp >= 0.2.1, [
1340    HAVE_WEBP="yes" ], [ HAVE_WEBP="no"
1341  ])
1342  AC_SUBST(WEBP_CFLAGS)
1343  AC_SUBST(WEBP_LIBS)
1344])
1345
1346dnl *** DTS ***
1347translit(dnm, m, l) AM_CONDITIONAL(USE_DTS, true)
1348AG_GST_CHECK_FEATURE(DTS, [dts library], dtsdec, [
1349  HAVE_DTS="yes"
1350  AG_GST_CHECK_LIBHEADER(DTS, dca, dca_init, $LIBM, dca.h,
1351    DTS_LIBS="-ldca $LIBM", HAVE_DTS="no")
1352  if test $HAVE_DTS = "no"; then
1353    AG_GST_CHECK_LIBHEADER(DTS, dts_pic, dts_init, $LIBM, dts.h,
1354      [ DTS_LIBS="-ldts_pic $LIBM"
1355        AC_DEFINE(DTS_OLD, 1, [Define if an old libdts is used])
1356      ])
1357  fi
1358  AC_SUBST(DTS_LIBS)
1359])
1360
1361dnl *** resindvd ***
1362translit(dnm, m, l) AM_CONDITIONAL(USE_RESINDVD, true)
1363AG_GST_CHECK_FEATURE(RESINDVD, [resindvd plugin], resindvd, [
1364  PKG_CHECK_MODULES(DVDNAV, dvdnav >= 4.1.2 dvdread >= 4.1.2, HAVE_RESINDVD="yes", [
1365    HAVE_RESINDVD="no"
1366  ])
1367])
1368
1369dnl **** Free AAC Encoder (FAAC) ****
1370translit(dnm, m, l) AM_CONDITIONAL(USE_FAAC, true)
1371AG_GST_CHECK_FEATURE(FAAC, [AAC encoder plug-in], faac, [
1372  AG_GST_CHECK_LIBHEADER(FAAC, faac, faacEncOpen, $LIBM, faac.h,
1373    FAAC_LIBS="-lfaac $LIBM")
1374  AC_SUBST(FAAC_LIBS)
1375])
1376
1377dnl **** Free AAC Decoder (FAAD2) ****
1378translit(dnm, m, l) AM_CONDITIONAL(USE_FAAD, true)
1379AG_GST_CHECK_FEATURE(FAAD, [FAAD2 AAC decoder plug-in], faad, [
1380  AG_GST_CHECK_LIBHEADER(FAAD, faad, NeAACDecOpen, $LIBM, neaacdec.h, [
1381    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <faad.h>]], [[
1382      #if !defined(FAAD2_VERSION) || !defined(FAAD_FMT_DOUBLE)
1383      #error Not faad2
1384      #elif !defined(LATM)
1385      #error Not faad2 >= 2.7
1386      #endif
1387    ]])],[
1388      HAVE_FAAD="yes"
1389      FAAD_LIBS="-lfaad"
1390    ], [
1391      AC_MSG_WARN([Found libfaad, but version not recent enough. Need faad2 >= 2.7])
1392      HAVE_FAAD="no"
1393    ])
1394  ], [
1395      HAVE_FAAD="no"
1396  ])
1397  AC_SUBST(FAAD_LIBS)
1398])
1399
1400dnl *** fbdev ***
1401translit(dnm, m, l) AM_CONDITIONAL(USE_FBDEV, true)
1402AG_GST_CHECK_FEATURE(FBDEV, [linux framebuffer], fbdevsink, [
1403  if test "x$HAVE_FBDEV" != "xyes"; then
1404    AC_CHECK_HEADER([linux/fb.h], HAVE_FBDEV=yes, HAVE_FBDEV=no)
1405  fi
1406])
1407
1408dnl *** fdkaac ***
1409translit(dnm, m, l) AM_CONDITIONAL(USE_FDK_AAC, true)
1410AG_GST_CHECK_FEATURE(FDK_AAC, [fdkaac plugin], fdkaac, [
1411  PKG_CHECK_MODULES(FDK_AAC, fdk-aac, HAVE_FDK_AAC="yes", HAVE_FDK_AAC="no")
1412
1413  PKG_CHECK_EXISTS(fdk-aac >= 2.0.0, [
1414    AC_DEFINE(HAVE_FDK_AAC_2_0_0, 1, [Define if we have fdk-aac >= 2.0.0])
1415  ])
1416
1417  PKG_CHECK_EXISTS(fdk-aac >= 0.1.4, [
1418    AC_DEFINE(HAVE_FDK_AAC_0_1_4, 1, [Define if we have fdk-aac >= 0.1.4])
1419  ])
1420])
1421
1422dnl *** flite ***
1423translit(dnm, m, l) AM_CONDITIONAL(USE_FLITE, true)
1424AG_GST_CHECK_FEATURE(FLITE, [Flite plugin], flite, [
1425  AG_GST_CHECK_LIBHEADER(FLITE, flite, flite_init, $LIBM, flite/flite.h,
1426    FLITE_LIBS="-lflite -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex $LIBM")
1427
1428  AC_SUBST(FLITE_CFLAGS)
1429  AC_SUBST(FLITE_LIBS)
1430])
1431
1432dnl *** gsm ***
1433translit(dnm, m, l) AM_CONDITIONAL(USE_GSM, true)
1434AG_GST_CHECK_FEATURE(GSM, [GSM library], gsmenc gsmdec, [
1435  AG_GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm.h, GSM_LIBS="-lgsm")
1436  if test $HAVE_GSM != "yes"; then
1437    AG_GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm/gsm.h, GSM_LIBS="-lgsm")
1438    if test $HAVE_GSM = "yes"; then
1439      AC_DEFINE(GSM_HEADER_IN_SUBDIR, 1, [Define if GSM header in gsm/ subdir])
1440    fi
1441  fi
1442  AC_SUBST(GSM_LIBS)
1443])
1444
1445dnl *** fluidSynth ***
1446translit(dnm, m, l) AM_CONDITIONAL(USE_FLUIDSYNTH, true)
1447AG_GST_CHECK_FEATURE(FLUIDSYNTH, [fluidsynth], fluidsynth, [
1448  PKG_CHECK_MODULES(FLUIDSYNTH, fluidsynth >= 1.0, HAVE_FLUIDSYNTH="yes", [
1449    HAVE_FLUIDSYNTH="no"
1450  ])
1451])
1452
1453dnl *** kate ***
1454translit(dnm, m, l) AM_CONDITIONAL(USE_KATE, true)
1455AG_GST_CHECK_FEATURE(KATE, [Kate], kate, [
1456  PKG_CHECK_MODULES(KATE, kate >= 0.1.7, HAVE_KATE="yes", [
1457    HAVE_KATE="no"
1458  ])
1459  AC_SUBST(KATE_CFLAGS)
1460  AC_SUBST(KATE_LIBS)
1461  PKG_CHECK_MODULES(TIGER, tiger >= 0.3.2,
1462    [
1463      HAVE_TIGER="yes"
1464      AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available])
1465    ],
1466    [
1467      HAVE_TIGER="no"
1468    ]
1469  )
1470  AM_CONDITIONAL(USE_TIGER, test "x$HAVE_TIGER" = "xyes")
1471  AC_SUBST(TIGER_CFLAGS)
1472  AC_SUBST(TIGER_LIBS)
1473],,,[AM_CONDITIONAL(USE_TIGER, false)])
1474
1475dnl *** kms ***
1476translit(dnm, m, l) AM_CONDITIONAL(USE_KMS, true)
1477AG_GST_CHECK_FEATURE(KMS, [drm/kms libraries], kms, [
1478  AG_GST_PKG_CHECK_MODULES(GST_ALLOCATORS, gstreamer-allocators-1.0)
1479  PKG_CHECK_MODULES([KMS_DRM], [libdrm >= 2.4.55], HAVE_KMS=yes, HAVE_KMS=no)
1480])
1481
1482dnl *** ladspa ***
1483translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
1484AG_GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
1485  AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
1486
1487  PKG_CHECK_MODULES(LRDF, lrdf, HAVE_LRDF=yes, HAVE_LRDF=no)
1488  if test $HAVE_LRDF = "yes"; then
1489    AC_DEFINE(HAVE_LRDF, 1, [Define if we have liblrdf])
1490  fi
1491  AC_SUBST(LRDF_LIBS)
1492  AC_SUBST(LRDF_CFLAGS)
1493])
1494
1495dnl *** LCM2  ***
1496#translit(dnm, m, l) AM_CONDITIONAL(USE_LCMS2, true)
1497AG_GST_CHECK_FEATURE(LCMS2, [LCMS colormanagement plugin], lcms2, [
1498  PKG_CHECK_MODULES(LCMS2, lcms2 >= 2.7, HAVE_LCMS2="yes", [
1499    HAVE_LCMS2="no"
1500  ])
1501   AC_SUBST(LCMS2_LIBS)
1502])
1503
1504dnl *** LV2 ***
1505translit(dnm, m, l) AM_CONDITIONAL(USE_LV2, true)
1506AG_GST_CHECK_FEATURE(LV2, [lv2], lv2, [
1507  PKG_CHECK_MODULES(LILV, lilv-0 >= 0.22, [
1508    HAVE_LV2="yes",
1509    HAVE_LILV_0_22="yes"
1510    AC_DEFINE(HAVE_LILV_0_22, 1, [Define if we have liblilv >= 0.22])
1511  ],[
1512    PKG_CHECK_MODULES(LILV, lilv-0 >= 0.16, HAVE_LV2="yes", HAVE_LV2="no")
1513  ])
1514  AC_SUBST(LILV_CFLAGS)
1515  AC_SUBST(LILV_LIBS)
1516])
1517
1518dnl *** libde265 ***
1519translit(dnm, m, l) AM_CONDITIONAL(USE_LIBDE265, true)
1520AG_GST_CHECK_FEATURE(LIBDE265, [libde265 HEVC/H.265 decoder], libde265, [
1521  PKG_CHECK_MODULES(LIBDE265, libde265 >= 0.9, HAVE_LIBDE265="yes", HAVE_LIBDE265="no")
1522  AC_SUBST(LIBDE265_CFLAGS)
1523  AC_SUBST(LIBDE265_LIBS)
1524])
1525
1526dnl *** libmms ***
1527translit(dnm, m, l) AM_CONDITIONAL(USE_LIBMMS, true)
1528AG_GST_CHECK_FEATURE(LIBMMS, [mms protocol library], libmms, [
1529  dnl check with pkg-config first
1530  PKG_CHECK_MODULES(LIBMMS, libmms >= 0.4, HAVE_LIBMMS="yes", [
1531    HAVE_LIBMMS="no"
1532  ])
1533])
1534AC_SUBST(LIBMMS_LIBS)
1535
1536dnl *** libsrt ***
1537translit(dnm, m, l) AM_CONDITIONAL(USE_SRT, true)
1538AG_GST_CHECK_FEATURE(SRT, [srt library], srt, [
1539  PKG_CHECK_MODULES(SRT, srt, HAVE_SRT="yes", HAVE_SRT=no)
1540  AC_SUBST(SRT_LIBS)
1541  AC_SUBST(SRT_CFLAGS)
1542])
1543
1544dnl *** libsrtp ***
1545translit(dnm, m, l) AM_CONDITIONAL(USE_SRTP, true)
1546AG_GST_CHECK_FEATURE(SRTP, [srtp library], srtp, [
1547  HAVE_SRTP="no"
1548  AG_GST_PKG_CHECK_MODULES(SRTP, libsrtp2 >= 2.1.0)
1549  if test x"$HAVE_SRTP" = x"yes"; then
1550    AC_DEFINE([HAVE_SRTP2], 1, [Define if libsrtp2 is used])
1551  else
1552    PKG_CHECK_MODULES(SRTP, libsrtp, HAVE_SRTP="yes",
1553      AG_GST_CHECK_LIBHEADER(SRTP, srtp, crypto_policy_set_aes_gcm_128_16_auth, , srtp/srtp.h, SRTP_LIBS="-lsrtp")
1554    )
1555  fi
1556  AC_SUBST(SRTP_LIBS)
1557  AC_SUBST(SRTP_CFLAGS)
1558])
1559
1560dnl *** dtls ***
1561translit(dnm, m, l) AM_CONDITIONAL(USE_DTLS, true)
1562AG_GST_CHECK_FEATURE(DTLS, [DTLS plugin], dtls, [
1563  PKG_CHECK_MODULES(DTLS, [ openssl >= 1.0.1  libcrypto ], [
1564    HAVE_DTLS="yes"
1565    AC_SUBST(DTLS_CFLAGS)
1566    AC_SUBST(DTLS_LIBS)
1567  ], [
1568    HAVE_DTLS="no"
1569  ])
1570])
1571
1572dnl *** ttml ***
1573translit(dnm, m, l) AM_CONDITIONAL(USE_TTML, true)
1574AG_GST_CHECK_FEATURE(TTML, [TTML plugin], ttml, [
1575  PKG_CHECK_MODULES(TTML, [ libxml-2.0 >= 2.9.2 pango cairo pangocairo ], [
1576    HAVE_TTML="yes"
1577  ], [
1578    HAVE_TTML="no"
1579  ])
1580])
1581
1582dnl *** modplug ***
1583translit(dnm, m, l) AM_CONDITIONAL(USE_MODPLUG, true)
1584AG_GST_CHECK_FEATURE(MODPLUG, modplug, modplug, [
1585  if test "x$HAVE_CXX" != "xyes"; then
1586    AC_MSG_WARN([Not compiling modplug plugin as it requires a C++ compiler])
1587    HAVE_MODPLUG="no"
1588  else
1589    PKG_CHECK_MODULES(MODPLUG, libmodplug, HAVE_MODPLUG="yes", HAVE_MODPLUG="no")
1590  fi
1591  AC_SUBST(MODPLUG_CFLAGS)
1592  AC_SUBST(MODPLUG_LIBS)
1593])
1594
1595dnl *** mjpegtools version info ***
1596dnl some may prefer older version (given quirks above)
1597dnl hm, no version info seems available within mjpegtools headers
1598dnl and API really moves along
1599echo
1600PKG_CHECK_EXISTS(mjpegtools >= 1.6.1.93 mjpegtools < 1.8.0, [
1601  mjpegtools_api=10601
1602], [
1603  PKG_CHECK_EXISTS(mjpegtools >= 1.8.0 mjpegtools < 1.9.0, [
1604    mjpegtools_api=10800
1605  ], [
1606    PKG_CHECK_EXISTS(mjpegtools >= 2.0.0, [
1607      mjpegtools_api=20000
1608    ], [
1609      PKG_CHECK_MODULES(MJPEG, mjpegtools >= 1.9.0 mjpegtools < 2.0.0, [
1610        dnl logging API changed in release candidates
1611        OLD_CFLAGS="$CFLAGS"
1612        OLD_LIBS="$LIBS"
1613        CFLAGS="$MJPEG_CFLAGS"
1614        LIBS="$LIBS $MJPEG_LIBS -lmjpegutils $LIBM $PTHREAD_LIBS"
1615        AC_CHECK_FUNC(mjpeg_loglev_t, [
1616          mjpegtools_api=10903
1617          ], [
1618          mjpegtools_api=10900
1619          ])
1620        CFLAGS="$OLD_CFLAGS"
1621        LIBS="$OLD_LIBS"
1622      ], [
1623        mjpegtools_api=0
1624      ])
1625    ])
1626  ])
1627])
1628AC_DEFINE_UNQUOTED(GST_MJPEGTOOLS_API, $mjpegtools_api,
1629  [mjpegtools API evolution])
1630
1631dnl *** mpeg2enc ***
1632translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2ENC, true)
1633AG_GST_CHECK_FEATURE(MPEG2ENC, [mpeg2enc], mpeg2enc, [
1634  HAVE_MPEG2ENC="no"
1635  dnl we require a c++ compiler for this one
1636  if [ test x$HAVE_CXX = xyes ]; then
1637    dnl libmpeg2enc was first included in mjpegtools-1.6.2-rc3 (1.6.1.92)
1638    dnl since many distros include mjpegtools specifically without mplex
1639    dnl and mpeg2enc, we check for mpeg2enc on its own, too.
1640    PKG_CHECK_MODULES(MPEG2ENC, mjpegtools >= 1.6.1.93, [
1641      dnl HACK because mpeg2enc 1.8.0 header files have a spurious 'include config.h'
1642      touch config.h
1643      dnl switch over to c++ to test things
1644      AC_LANG([C++])
1645      OLD_CPPFLAGS="$CPPFLAGS"
1646      dnl HACK as above
1647      CPPFLAGS_GOOD="$CPPFLAGS $MPEG2ENC_CFLAGS"
1648      CPPFLAGS="$CPPFLAGS_GOOD -I."
1649      dnl check headers
1650      mpeg2enc_headers_ok=no
1651      AC_CHECK_HEADER([mpeg2encoder.hh], [
1652        MPEG2ENC_LIBS="$MPEG2ENC_LIBS -lmpeg2encpp $LIBM $PTHREAD_LIBS"
1653        OLD_LIBS="$LIBS"
1654        LIBS="$LIBS $MPEG2ENC_LIBS"
1655        AC_MSG_CHECKING([for valid mpeg2enc objects])
1656        AC_RUN_IFELSE([AC_LANG_SOURCE([[
1657          #include <mpeg2encoder.hh>
1658          #include <mpeg2encoptions.hh>
1659
1660          int
1661          main (int   argc,
1662                char *argv[])
1663          {
1664            MPEG2EncOptions *options = new MPEG2EncOptions ();
1665            MPEG2Encoder *encoder = new MPEG2Encoder (*options);
1666            return 0;
1667          }
1668        ]])],[
1669          AC_MSG_RESULT(yes)
1670          dnl so far so good, let's check more things:
1671          dnl mjpegtools-1.8.0 does not install the required
1672          dnl mpeg2syntaxcodes.h header by default, and a new release
1673          dnl is not in sight, so check for this oversight in case
1674          dnl distros or folks have fixed this themselves
1675          if test "$mjpegtools_api" -ge "10800"; then
1676            AC_CHECK_HEADER([mpeg2syntaxcodes.h], [
1677                mpeg2enc_headers_ok=yes
1678              ], [
1679                mpeg2enc_headers_ok=no
1680              ])
1681          else
1682            mpeg2enc_headers_ok=yes
1683          fi
1684          if test "x$mpeg2enc_headers_ok" = "xyes"; then
1685            HAVE_MPEG2ENC="yes"
1686          fi
1687          CPPFLAGS="$CPPFLAGS_GOOD"
1688          AC_SUBST(MPEG2ENC_CFLAGS)
1689          AC_SUBST(MPEG2ENC_LIBS)
1690        ],[
1691          AC_MSG_RESULT(no)
1692        ],[])
1693        LIBS="$OLD_LIBS"
1694      ])
1695
1696      CPPFLAGS="$OLD_CPPFLAGS"
1697      AC_LANG([C])
1698    ], [
1699      HAVE_MPEG2ENC="no"
1700    ])
1701  fi
1702])
1703
1704dnl *** mplex ***
1705translit(dnm, m, l) AM_CONDITIONAL(USE_MPLEX, true)
1706AG_GST_CHECK_FEATURE(MPLEX, [mplex], mplex, [
1707  HAVE_MPLEX="no"
1708  dnl we require a c++ compiler for this one
1709  if [ test x$HAVE_CXX = xyes ]; then
1710    dnl libmplex was first included in mjpegtools-1.6.2-rc4 (1.6.1.93)
1711    dnl since many distros include mjpegtools specifically without mplex
1712    dnl and mpeg2enc, we check for mplex on its own, too.
1713    dnl libmplex < 1.9rc? has fuzzy ABI, valgrind and other problems
1714    PKG_CHECK_MODULES(MPLEX, mjpegtools >= 1.9.0, [
1715      dnl HACK because mplex 2.0.0 header files have a spurious 'include config.h'
1716      touch config.h
1717      dnl switch over to c++ to test things
1718      AC_LANG([C++])
1719      OLD_CPPFLAGS="$CPPFLAGS"
1720      dnl HACK as above
1721      CPPFLAGS_GOOD="$CPPFLAGS $MPLEX_CFLAGS"
1722      CPPFLAGS="$CPPFLAGS_GOOD -I."
1723      AC_CHECK_HEADER(interact.hpp, [
1724        MPLEX_LIBS="$MPLEX_LIBS -lmplex2 $LIBM"
1725        OLD_LIBS="$LIBS"
1726        LIBS="$LIBS $MPLEX_LIBS"
1727        OLD_LDFLAGS="$LDFLAGS"
1728        LDFLAGS="$LDFLAGS $MPLEX_LDFLAGS"
1729        dnl older libmplex uses off_t SegmentSize (), which leads to fuzzy ABI;
1730        dnl don't want this here
1731        AC_MSG_CHECKING([for valid mplex objects])
1732        AC_RUN_IFELSE([AC_LANG_SOURCE([[
1733
1734#include <interact.hpp>
1735#include <outputstrm.hpp>
1736#include <multiplexor.hpp>
1737int
1738main (int   argc,
1739      char *argv[])
1740{
1741  class TestOutputStream : public OutputStream {
1742  public:
1743    TestOutputStream () : OutputStream () { }
1744    void Write (uint8_t *a, unsigned int b) { }
1745    void NextSegment () { }
1746    uint64_t SegmentSize () { return 0; }
1747    void Close () { }
1748    int Open () { return 0; }
1749};
1750  MultiplexJob *job = new MultiplexJob ();
1751  vector<IBitStream *> inputs;
1752  job->SetupInputStreams (inputs);
1753  TestOutputStream *out = new TestOutputStream ();
1754  Multiplexor *mux = new Multiplexor(*job, *out, NULL);
1755  return 0;
1756}
1757        ]])],[
1758          HAVE_MPLEX="yes"
1759          CPPFLAGS="$CPPFLAGS_GOOD"
1760          AC_SUBST(MPLEX_CFLAGS)
1761          AC_SUBST(MPLEX_LIBS)
1762          AC_SUBST(MPLEX_LDFLAGS)
1763          AC_MSG_RESULT(yes)
1764        ],[AC_MSG_RESULT(no)],[])
1765        LIBS="$OLD_LIBS"
1766        LDFLAGS="$OLD_LDFLAGS"
1767      ])
1768      CPPFLAGS="$OLD_CPPFLAGS"
1769      AC_LANG([C])
1770    ], HAVE_MPLEX="no")
1771  fi
1772])
1773
1774dnl *** musepack ***
1775translit(dnm, m, l) AM_CONDITIONAL(USE_MUSEPACK, true)
1776AG_GST_CHECK_FEATURE(MUSEPACK, [musepackdec], musepack, [
1777  AC_CHECK_HEADER([mpc/mpcdec.h], [
1778    HAVE_MUSEPACK="yes"
1779    MUSEPACK_LIBS="-lmpcdec"
1780    AC_SUBST(MUSEPACK_LIBS)
1781    ], [HAVE_MUSEPACK="no"])
1782])
1783
1784dnl *** neon ***
1785translit(dnm, m, l) AM_CONDITIONAL(USE_NEON, true)
1786AG_GST_CHECK_FEATURE(NEON, [neon http client plugins], neonhttpsrc, [
1787  PKG_CHECK_MODULES(NEON, neon >= 0.27.0  neon <= 0.30.99, HAVE_NEON="yes", [
1788    HAVE_NEON="no"
1789  ])
1790  AC_SUBST(NEON_CFLAGS)
1791  AC_SUBST(NEON_LIBS)
1792])
1793
1794dnl *** ofa ***
1795translit(dnm, m, l) AM_CONDITIONAL(USE_OFA, true)
1796AG_GST_CHECK_FEATURE(OFA, [ofa plugins], ofa, [
1797  PKG_CHECK_MODULES(OFA, libofa >= 0.9.3, HAVE_OFA="yes", [
1798    HAVE_OFA="no"
1799  ])
1800  AC_SUBST(OFA_CFLAGS)
1801  AC_SUBST(OFA_LIBS)
1802])
1803
1804dnl *** OpenAL ***
1805translit(dnm, m, l) AM_CONDITIONAL(USE_OPENAL, true)
1806AG_GST_CHECK_FEATURE(OPENAL, [OpenAL plugin], openal, [
1807  PKG_CHECK_MODULES(OPENAL, openal >= 1.14, HAVE_OPENAL="yes", [
1808    HAVE_OPENAL="no"
1809  ])
1810  AC_SUBST(OPENAL_CFLAGS)
1811  AC_SUBST(OPENAL_LIBS)
1812])
1813
1814dnl *** opencv ***
1815translit(dnm, m, l) AM_CONDITIONAL(USE_OPENCV, true)
1816AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [
1817  dnl we specify a max. version too because we set CV_NO_BACKWARD_COMPATIBILITY
1818  dnl and don't want the build to break when a new opencv version comes out.
1819  dnl Need to adjust this upwards once we know that our code compiles fine with
1820  dnl a new version and the no-backward-compatibility define. (There doesn't
1821  dnl seem to be a switch to suppress the warnings the cvcompat.h header
1822  dnl causes.)
1823  PKG_CHECK_MODULES([OPENCV], [opencv >= 3.0.0 opencv < 3.5.0] , [
1824    AC_PROG_CXX
1825    AC_LANG([C++])
1826    OLD_CPPFLAGS=$CPPFLAGS
1827    CPPFLAGS=$OPENCV_CFLAGS
1828    something_not_found=no
1829    AC_CHECK_HEADERS([opencv2/bgsegm.hpp \
1830                      opencv2/calib3d.hpp \
1831                      opencv2/core.hpp \
1832                      opencv2/imgproc.hpp \
1833                      opencv2/objdetect.hpp \
1834                      opencv2/opencv.hpp \
1835                      opencv2/video.hpp \
1836                      opencv2/bgsegm.hpp], [], [something_not_found=yes])
1837
1838    CPPFLAGS=$OLD_CPPFLAGS
1839    AC_LANG([C])
1840
1841    if test $something_not_found = "yes"; then
1842      AC_MSG_RESULT([not all opencv2 headers were found])
1843      HAVE_OPENCV="no"
1844    else
1845      HAVE_OPENCV="yes"
1846    fi
1847  ], [
1848    PKG_CHECK_MODULES([OPENCV], [opencv4 >= 4.0.0 opencv4 < 4.2.0] , [
1849    AC_PROG_CXX
1850    AC_LANG([C++])
1851    OLD_CPPFLAGS=$CPPFLAGS
1852    CPPFLAGS=$OPENCV_CFLAGS
1853    something_not_found=no
1854    AC_CHECK_HEADERS([opencv2/bgsegm.hpp \
1855                      opencv2/calib3d.hpp \
1856                      opencv2/core.hpp \
1857                      opencv2/imgproc.hpp \
1858                      opencv2/objdetect.hpp \
1859                      opencv2/opencv.hpp \
1860                      opencv2/video.hpp \
1861                      opencv2/bgsegm.hpp], [], [something_not_found=yes])
1862
1863    CPPFLAGS=$OLD_CPPFLAGS
1864    AC_LANG([C])
1865
1866    if test $something_not_found = "yes"; then
1867      AC_MSG_RESULT([not all opencv2 headers were found])
1868      HAVE_OPENCV="no"
1869    else
1870      HAVE_OPENCV="yes"
1871    fi
1872  ], [
1873    HAVE_OPENCV="no"
1874  ])
1875  ])
1876  OPENCV_PREFIX="`$PKG_CONFIG --variable=prefix opencv`"
1877  AC_DEFINE_UNQUOTED(OPENCV_PREFIX, "$OPENCV_PREFIX", [opencv install prefix])
1878  AC_SUBST(OPENCV_PREFIX)
1879  OPENCV_PREFIX="`$PKG_CONFIG --variable=prefix opencv`"
1880  AC_DEFINE_UNQUOTED(OPENCV_PREFIX, "$OPENCV_PREFIX", [opencv install prefix])
1881  AC_SUBST(OPENCV_PREFIX)
1882  AC_SUBST(OPENCV_CFLAGS)
1883  AC_SUBST(OPENCV_LIBS)
1884  dnl the OpenCV prefix is used at runtime for some object properties, and also
1885  dnl used here to detect which directory is the correct one. For the second
1886  dnl case, make sure the right sysroot is used, ensuring correct behavior
1887  dnl during cross compilation.
1888  if test -d "$PKG_CONFIG_SYSROOT_DIR/$OPENCV_PREFIX/share/opencv/"; then
1889    AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["opencv"], [OpenCV path name])
1890  else
1891    AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["OpenCV"], [OpenCV path name])
1892  fi
1893])
1894
1895dnl *** OpenEXR ***
1896translit(dnm, m, l) AM_CONDITIONAL(USE_OPENEXR, true)
1897AG_GST_CHECK_FEATURE(OPENEXR, [openexr library], openexr, [
1898  AG_GST_PKG_CHECK_MODULES(OPENEXR, OpenEXR)
1899  if test "x$HAVE_OPENEXR" = "xyes"; then
1900    AG_GST_PKG_CHECK_MODULES(OPENEXR240, OpenEXR >= 2.4.0)
1901    if test "x$HAVE_OPENEXR240" = "xyes"; then
1902      OPENEXR_STDCFLAGS=
1903    else
1904      OPENEXR_STDCFLAGS="-std=c++98"
1905    fi
1906    AC_SUBST([OPENEXR_STDCFLAGS])
1907  fi
1908])
1909
1910dnl *** openh264 ***
1911translit(dnm, m, l) AM_CONDITIONAL(USE_OPENH264, true)
1912AG_GST_CHECK_FEATURE(OPENH264, [openh264 library], openh264, [
1913  AG_GST_PKG_CHECK_MODULES(OPENH264, openh264 >= 1.3.0)
1914])
1915
1916dnl *** OpenJPEG ***
1917translit(dnm, m, l) AM_CONDITIONAL(USE_OPENJPEG, true)
1918AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [
1919  HAVE_OPENJPEG="no"
1920  AG_GST_PKG_CHECK_MODULES(OPENJPEG, libopenjp2 >= 2.1)
1921  if test x"$HAVE_OPENJPEG" != x"yes"; then
1922    # Fallback to v1.5
1923    OPENJPEG_LIBS=""
1924    PKG_CHECK_MODULES(OPENJPEG, libopenjpeg1,
1925      HAVE_OPENJPEG="yes",
1926      AG_GST_CHECK_LIBHEADER(OPENJPEG, openjpeg, opj_version, , openjpeg.h, OPENJPEG_LIBS="-lopenjpeg")
1927    )
1928    if test x"$HAVE_OPENJPEG" = x"yes"; then
1929      AC_DEFINE([HAVE_OPENJPEG_1], 1, [Define if OpenJPEG 1 is used])
1930    fi
1931  fi
1932  AC_SUBST(OPENJPEG_CFLAGS)
1933  AC_SUBST(OPENJPEG_LIBS)
1934])
1935
1936dnl *** OpenMPT ***
1937translit(dnm, m, l) AM_CONDITIONAL(USE_OPENMPT, true)
1938AG_GST_CHECK_FEATURE(OPENMPT, openmpt, openmpt, [
1939  PKG_CHECK_MODULES(OPENMPT, libopenmpt, HAVE_OPENMPT="yes", HAVE_OPENMPT="no")
1940  AC_SUBST(OPENMPT_CFLAGS)
1941  AC_SUBST(OPENMPT_LIBS)
1942])
1943
1944dnl *** OpenNI2 ***
1945translit(dnm, m, l) AM_CONDITIONAL(USE_OPENNI2, true)
1946AG_GST_CHECK_FEATURE(OPENNI2, [openni2 library], openni2, [
1947  PKG_CHECK_MODULES(OPENNI2, libopenni2 >= 0.26, HAVE_OPENNI2="yes", [ HAVE_OPENNI2="no" ] )
1948  AC_SUBST(OPENNI2_CFLAGS)
1949  AC_SUBST(OPENNI2_LIBS)
1950])
1951
1952dnl *** Opus ***
1953translit(dnm, m, l) AM_CONDITIONAL(USE_OPUS, true)
1954AG_GST_CHECK_FEATURE(OPUS, [opus], opus, [
1955  PKG_CHECK_MODULES(OPUS, opus >= 0.9.4, [
1956          AC_DEFINE([HAVE_OPUS], 1, [Define if Opus >= 0.9.4 is installed])
1957          HAVE_OPUS="yes"
1958  ], [
1959          HAVE_OPUS="no"
1960  ])
1961  AC_SUBST(OPUS_CFLAGS)
1962  AC_SUBST(OPUS_LIBS)
1963])
1964
1965dnl *** pango ***
1966translit(dnm, m, l) AM_CONDITIONAL(USE_PANGO, true)
1967AG_GST_CHECK_FEATURE(PANGO, [Pango font rendering], pango, [
1968  AG_GST_PKG_CHECK_MODULES(PANGO, pango >= 1.22.0  pangocairo >= 1.22.0)
1969])
1970
1971dnl *** rsvg ***
1972translit(dnm, m, l) AM_CONDITIONAL(USE_RSVG, true)
1973AG_GST_CHECK_FEATURE(RSVG, [rsvg decoder], rsvg, [
1974  AG_GST_PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= 2.36.2)
1975])
1976
1977dnl *** gl ***
1978HAVE_GL="no"
1979translit(dnm, m, l) AM_CONDITIONAL(USE_GL, true)
1980AG_GST_CHECK_FEATURE(GL, [gl elements], gl, [
1981  if test "x$HAVE_GST_GL" = "xyes"; then
1982    HAVE_GL="yes"
1983  fi
1984])
1985AM_CONDITIONAL(USE_GL, test "x$HAVE_GL" = "xyes")
1986AM_CONDITIONAL(USE_OPENGL, test "x$GST_GL_HAVE_API_GL" = "x1")
1987
1988dnl *** Vulkan ***
1989translit(dnm, m, l) AM_CONDITIONAL(USE_VULKAN, true)
1990AG_GST_CHECK_FEATURE(VULKAN, [Vulkan elements], vulkan, [
1991  AC_CHECK_HEADER(vulkan/vulkan.h, [
1992    AC_CHECK_LIB(vulkan, vkCreateDevice, [
1993      VULKAN_LIBS="-lvulkan"
1994      AC_SUBST(VULKAN_LIBS)
1995      if test "x$GST_VULKAN_HAVE_WINDOW_XCB" = "x1"; then
1996        HAVE_VULKAN="yes"
1997      fi
1998      if test "x$GST_VULKAN_HAVE_WINDOW_WAYLAND" = "x1"; then
1999        HAVE_VULKAN="yes"
2000      fi
2001    ], [])
2002  ], [])
2003])
2004
2005dnl *** teletextdec ***
2006translit(dnm, m, l) AM_CONDITIONAL(USE_TELETEXTDEC, true)
2007AG_GST_CHECK_FEATURE(TELETEXTDEC, [Teletext decoder], teletextdec, [
2008  AG_GST_PKG_CHECK_MODULES(TELETEXTDEC, zvbi-0.2)
2009 ])
2010
2011dnl *** wildmidi ***
2012translit(dnm, m, l) AM_CONDITIONAL(USE_WILDMIDI, true)
2013AG_GST_CHECK_FEATURE(WILDMIDI, [wildmidi midi soft synth plugin], wildmidi, [
2014  AG_GST_CHECK_LIBHEADER(WILDMIDI, WildMidi,
2015                         WildMidi_Init, ,
2016                         wildmidi_lib.h,
2017                         WILDMIDI_LIBS="-lWildMidi")
2018  WILDMIDI_CFLAGS=
2019  WILDMIDI_LIBS=
2020  if test "x$HAVE_WILDMIDI" = "xyes"; then
2021    AC_MSG_CHECKING([for wildmidi >= 4.0])
2022    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wildmidi_lib.h>]], [[
2023        #if LIBWILDMIDI_VER_MAJOR == 0 && LIBWILDMIDI_VER_MINOR < 4
2024        #error "wildmidi too old"
2025        #endif
2026    ]])], [ AC_MSG_RESULT(yes)
2027      HAVE_WILDMIDI="yes"
2028      WILDMIDI_CFLAGS=
2029      WILDMIDI_LIBS=-lWildMidi
2030    ], [ AC_MSG_RESULT(no)
2031      HAVE_WILDMIDI="no"
2032    ])
2033  else
2034    AC_MSG_WARN([WildMidi library or development headers not found])
2035  fi
2036  AC_SUBST(WILDMIDI_CFLAGS)
2037  AC_SUBST(WILDMIDI_LIBS)
2038])
2039
2040dnl **** Smooth Streaming ****
2041translit(dnm, m, l) AM_CONDITIONAL(USE_SMOOTHSTREAMING, true)
2042AG_GST_CHECK_FEATURE(SMOOTHSTREAMING, [Smooth Streaming plug-in], smoothstreaming, [
2043  PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.4,
2044    [HAVE_LIBXML2="yes"
2045     HAVE_SMOOTHSTREAMING="yes"],
2046    [HAVE_LIBXML2="no"
2047     HAVE_SMOOTHSTREAMING="no"])
2048  AC_SUBST(LIBXML2_CFLAGS)
2049  AC_SUBST(LIBXML2_LIBS)
2050])
2051
2052dnl *** sndfile ***
2053translit(dnm, m, l) AM_CONDITIONAL(USE_SNDFILE, true)
2054AG_GST_CHECK_FEATURE(SNDFILE, [sndfile plug-in], sfdec sfenc, [
2055  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.16, HAVE_SNDFILE="yes", HAVE_SNDFILE="no")
2056  AC_SUBST(SNDFILE_CFLAGS)
2057  AC_SUBST(SNDFILE_LIBS)
2058])
2059
2060dnl *** soundtouch ***
2061translit(dnm, m, l) AM_CONDITIONAL(USE_SOUNDTOUCH, true)
2062AG_GST_CHECK_FEATURE(SOUNDTOUCH, [soundtouch plug-in], soundtouch, [
2063  dnl We only need -lBPM on soundtouch < 1.4
2064  dnl We check for libSoundTouch since Debian used it before upstream
2065  dnl added a pkgconfig file.
2066  HAVE_SOUNDTOUCH_1_4=yes
2067  PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch,
2068    [HAVE_SOUNDTOUCH=yes],
2069    [PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch-1.4,
2070      [HAVE_SOUNDTOUCH=yes],
2071      [PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch-1.0,
2072        [HAVE_SOUNDTOUCH=yes
2073          HAVE_SOUNDTOUCH_1_4=no
2074          SOUNDTOUCH_LIBS="$SOUNDTOUCH_LIBS -lBPM"],
2075        [PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch >= 1.4,
2076          [HAVE_SOUNDTOUCH=yes],
2077          [PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch,
2078            [HAVE_SOUNDTOUCH=yes
2079              HAVE_SOUNDTOUCH_1_4=no
2080              SOUNDTOUCH_LIBS="$SOUNDTOUCH_LIBS -lBPM"],
2081            HAVE_SOUNDTOUCH=no)])])])])
2082  AC_SUBST(SOUNDTOUCH_CFLAGS)
2083  AC_SUBST(SOUNDTOUCH_LIBS)
2084  if test "x$HAVE_CXX" != "xyes"; then
2085    USE_SOUNDTOUCH=false
2086    AC_MSG_NOTICE([Not building soundtouch plugin: no C++ compiler found])
2087  fi
2088  if test "x$HAVE_SOUNDTOUCH" = "xyes" -a "x$HAVE_SOUNDTOUCH_1_4" = "xyes"; then
2089     AC_DEFINE([HAVE_SOUNDTOUCH_1_4], [1],
2090         [Defined if the available libSoundTouch is >= 1.4])
2091  fi
2092])
2093
2094dnl *** gme ***
2095translit(dnm, m, l) AM_CONDITIONAL(USE_GME, true)
2096AG_GST_CHECK_FEATURE(GME, [gme decoder], gme, [
2097  AC_CHECK_HEADER(gme/gme.h, [
2098    AC_CHECK_LIB(gme, gme_new_emu, [
2099      GME_LIBS="-lgme"
2100      AC_SUBST(GME_LIBS)
2101      HAVE_GME=yes
2102    ], [
2103      HAVE_GME=no
2104    ])
2105  ], [
2106    HAVE_GME=no
2107  ])
2108
2109  if test "x$HAVE_GME" = "xyes"; then
2110    AC_CHECK_LIB(gme, gme_enable_accuracy, [
2111      AC_DEFINE(HAVE_LIBGME_ACCURACY, 1, [Define if gme 0.5.6 or newer is available])
2112      ])
2113  fi
2114])
2115
2116dnl *** dvb ***
2117translit(dnm, m, l) AM_CONDITIONAL(USE_DVB, true)
2118AG_GST_CHECK_FEATURE(DVB, [DVB Source], dvb, [
2119  AC_MSG_CHECKING([Checking for up to date dvb installation])
2120  AC_CHECK_HEADER(linux/dvb/version.h, [
2121    AC_MSG_CHECKING([for up-to-date dvb API])
2122    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/dvb/version.h>]], [[
2123        #if DVB_API_VERSION < 5 || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR <= 4)
2124        #error "Incompatible dvb API"
2125        #endif
2126    ]])], [ AC_MSG_RESULT(yes)
2127      HAVE_DVB="yes"
2128    ], [ AC_MSG_RESULT(no)
2129      HAVE_DVB="no"
2130    ])
2131  ], [HAVE_DVB="no"])
2132])
2133
2134dnl *** vdpau ***
2135translit(dnm, m, l) AM_CONDITIONAL(USE_VDPAU, true)
2136AG_GST_CHECK_FEATURE(VDPAU, [VDPAU], vdpau, [
2137  VDPAU_CFLAGS=
2138  VDPAU_LIBS=-lvdpau
2139  HAVE_VDPAU=no
2140
2141  PKG_CHECK_MODULES(VDPAU, vdpau, [HAVE_VDPAU="yes"],
2142  [
2143    if test "$HAVE_VDPAU" = "no"; then
2144      saved_CPPFLAGS="$CPPFLAGS"
2145      AC_CHECK_HEADER([vdpau/vdpau.h], [HAVE_VDPAU_H=yes])
2146
2147      if test -z "$HAVE_VDPAU_H"; then
2148        dnl Didn't find VDPAU header straight away.
2149        dnl Try /usr/include/nvidia. Need to clear caching vars first
2150        AC_MSG_NOTICE([VDPAU header not in standard path. Checking /usr/include/nvidia])
2151        unset ac_cv_header_vdpau_vdpau_h
2152        unset ac_cv_header_vdpau_vdpau_x11_h
2153        VDPAU_CFLAGS="-I/usr/include/nvidia"
2154        VDPAU_LIBS="-L/usr/lib/nvidia -lvdpau"
2155        CPPFLAGS="$VDPAU_CFLAGS $saved_CPPFLAGS"
2156        AC_CHECK_HEADER([vdpau/vdpau.h], [HAVE_VDPAU_H=yes])
2157      fi
2158
2159      AC_CHECK_HEADER([vdpau/vdpau_x11.h], [HAVE_VDPAU_X11_H=yes])
2160
2161      if test "x$HAVE_VDPAU_H" = "xyes" -a "x$HAVE_VDPAU_X11_H" = "xyes"; then
2162        dnl Found the headers - look for the lib
2163        AC_MSG_NOTICE([VDPAU headers found. Checking libraries])
2164        saved_LIBS="$LIBS"
2165        LIBS="$VDPAU_LIBS $saved_LIBS"
2166        AC_CHECK_LIB(vdpau,vdp_device_create_x11,[HAVE_VDPAU="yes"])
2167        LIBS="$saved_LIBS"
2168      fi
2169    fi
2170  ])
2171
2172  if test "$HAVE_VDPAU" = "yes"; then
2173    AC_MSG_NOTICE([Found up to date VDPAU installation])
2174    AC_SUBST(VDPAU_CFLAGS)
2175    AC_SUBST(VDPAU_LIBS)
2176  fi
2177])
2178
2179dnl *** sbc ***
2180translit(dnm, m, l) AM_CONDITIONAL(USE_SBC, true)
2181AG_GST_CHECK_FEATURE(SBC, [SBC bluetooth audio codec], sbc, [
2182  AG_GST_PKG_CHECK_MODULES(SBC, [sbc >= 1.0])
2183])
2184
2185dnl *** zbar ***
2186translit(dnm, m, l) AM_CONDITIONAL(USE_ZBAR, true)
2187AG_GST_CHECK_FEATURE(ZBAR, [ZBar barcode detector], zbar, [
2188  AG_GST_PKG_CHECK_MODULES(ZBAR, zbar >= 0.9)
2189])
2190
2191dnl *** rtmp ***
2192translit(dnm, m, l) AM_CONDITIONAL(USE_RTMP, true)
2193AG_GST_CHECK_FEATURE(RTMP, [rtmp library], rtmp, [
2194  AG_GST_PKG_CHECK_MODULES(RTMP, librtmp)
2195])
2196
2197dnl *** spandsp ***
2198translit(dnm, m, l) AM_CONDITIONAL(USE_SPANDSP, true)
2199AG_GST_CHECK_FEATURE(SPANDSP, [Spandsp], spandsp, [
2200  PKG_CHECK_MODULES(SPANDSP, spandsp >= 0.0.6, [
2201    HAVE_SPANDSP="yes" ], [
2202    HAVE_SPANDSP="no"
2203  ])
2204])
2205AC_SUBST(SPANDSP_CFLAGS)
2206AC_SUBST(SPANDSP_LIBS)
2207
2208dnl *** hls-crypto ***
2209AC_ARG_WITH([hls-crypto],
2210  AS_HELP_STRING([--with-hls-crypto=auto|nettle|libgcrypt|openssl], [
2211    which cryptographic library version to compile against for hls (default: auto)
2212  ]), [
2213    AS_CASE([$with_hls_crypto],
2214      [nettle],[],
2215      [libgcrypt],[],
2216      [openssl],[],
2217      [with_hls_crypto=auto]
2218    )
2219  ]
2220)
2221
2222dnl *** hls ***
2223translit(dnm, m, l) AM_CONDITIONAL(USE_HLS, true)
2224AG_GST_CHECK_FEATURE(HLS, [http live streaming plugin], hls, [
2225  AS_CASE([$with_hls_crypto],
2226    [nettle], [
2227      PKG_CHECK_MODULES(NETTLE, nettle, [
2228        AC_DEFINE(HAVE_NETTLE, 1, [Define if nettle is available])
2229        HAVE_HLS="yes"
2230      ],[AC_MSG_ERROR([Could not find nettle library])])
2231    ],
2232    [libgcrypt], [
2233      AM_PATH_LIBGCRYPT([1.2.0], [
2234        AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if libgcrypt is available])
2235        HAVE_HLS="yes"
2236      ],[AC_MSG_ERROR([Could not find libgcrypt library])])
2237    ],
2238    [openssl], [
2239      PKG_CHECK_MODULES(OPENSSL, openssl, [
2240        AC_DEFINE(HAVE_OPENSSL, 1, [Define if openssl is available])
2241        HAVE_HLS="yes"
2242      ],[AC_MSG_ERROR([Could not find openssl library])])
2243    ],
2244    [
2245      dnl Try to find a valid crypto library
2246      HAVE_HLS="yes"
2247      PKG_CHECK_MODULES(NETTLE, nettle, [
2248        AC_DEFINE(HAVE_NETTLE, 1, [Define if nettle is available])
2249      ],[
2250        AM_PATH_LIBGCRYPT([1.2.0], [
2251          AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if libgcrypt is available])
2252        ],[
2253          PKG_CHECK_MODULES(OPENSSL, openssl, [
2254            AC_DEFINE(HAVE_OPENSSL, 1, [Define if openssl is available])
2255          ])
2256        ])
2257      ])
2258    ]
2259  )
2260])
2261
2262dnl *** x265 (H.265/HEVC encoder) ***
2263translit(dnm, m, l) AM_CONDITIONAL(USE_X265, true)
2264AG_GST_CHECK_FEATURE(X265, [x265 plug-in], x265, [
2265  AG_GST_PKG_CHECK_MODULES(X265, x265)
2266])
2267
2268dnl *** WebRTC Audio Processing ***
2269dnl Note: We test for a specific version as there is no API stability
2270translit(dnm, m, l) AM_CONDITIONAL(USE_WEBRTCDSP, true)
2271AG_GST_CHECK_FEATURE(WEBRTCDSP, [WebRTC Audio Processing], webrtcdsp, [
2272
2273  AG_GST_PKG_CHECK_MODULES(WEBRTCDSP, webrtc-audio-processing >= 0.2 webrtc-audio-processing < 0.4)
2274
2275  # On Android, C++ headers comes with the STL implementation
2276  AS_CASE(["${host}"],
2277    [*android*],
2278      [
2279        PKG_CHECK_MODULES(GNUSTL, gnustl, [
2280          WEBRTCDSP_CFLAGS="$WEBRTCDSP_CFLAGS $GNUSTL_CFLAGS"
2281          WEBRTCDSP_LIBS="$WEBRTCDSP_LIBS $GNUSTL_LIBS"])
2282      ])
2283  AC_SUBST([WEBRTCDSP_CFLAGS])
2284  AC_SUBST([WEBRTCDSP_LIBS])
2285
2286  AC_LANG_PUSH([C++])
2287  old_CPPFLAGS=$CPPFLAGS
2288  CPPFLAGS="-std=c++11 $CPPFLAGS $GNUSTL_CFLAGS"
2289  AC_CHECK_HEADER([vector],[],[HAVE_WEBRTCDSP=no])
2290  CPPFLAGS=$old_CPPFLAGS
2291  AC_LANG_POP([C++])
2292])
2293
2294dnl *** WebRTC ***
2295translit(dnm, m, l) AM_CONDITIONAL(USE_WEBRTC, true)
2296AG_GST_CHECK_FEATURE(WEBRTC, [WebRTC], webrtc, [
2297  PKG_CHECK_MODULES(NICE, nice >= 0.1.14, [
2298    HAVE_WEBRTC="yes" ], [
2299    HAVE_WEBRTC="no"
2300  ])
2301])
2302
2303dnl *** WPE ***
2304translit(dnm, m, l) AM_CONDITIONAL(USE_WPE, true)
2305AG_GST_CHECK_FEATURE(WPE, [WPE plug-in], wpe, [
2306PKG_CHECK_MODULES(WPE, [ wpe-webkit-1.0 >= 2.24 wpebackend-fdo-1.0 egl xkbcommon ], [
2307    HAVE_WPE="yes" ], [
2308    HAVE_WPE="no"
2309  ])
2310])
2311
2312dnl *** usrsctp ***
2313translit(dnm, m, l) AM_CONDITIONAL(USE_SCTP, true)
2314AG_GST_CHECK_FEATURE(SCTP, [sctp plug-in], sctp, [
2315  AC_CHECK_HEADER(usrsctp.h, [
2316    AC_CHECK_LIB(usrsctp, usrsctp_init, [
2317      USRSCTP_LIBS="-lusrsctp"
2318      AC_SUBST(USRSCTP_LIBS)
2319      HAVE_SCTP=yes
2320    ], [
2321      HAVE_SCTP=no
2322    ])
2323  ], [
2324    HAVE_SCTP=no
2325  ])
2326])
2327
2328else
2329
2330dnl not building plugins with external dependencies,
2331dnl but we still need to set the conditionals
2332
2333AM_CONDITIONAL(USE_ASSRENDER, false)
2334AM_CONDITIONAL(USE_AOM, false)
2335AM_CONDITIONAL(USE_VOAMRWBENC, false)
2336AM_CONDITIONAL(USE_VOAACENC, false)
2337AM_CONDITIONAL(USE_BS2B, false)
2338AM_CONDITIONAL(USE_BZ2, false)
2339AM_CONDITIONAL(USE_CHROMAPRINT, false)
2340AM_CONDITIONAL(USE_CURL, false)
2341AM_CONDITIONAL(USE_SSH2, false)
2342AM_CONDITIONAL(USE_DASH, false)
2343AM_CONDITIONAL(USE_DC1394, false)
2344AM_CONDITIONAL(USE_DECKLINK, false)
2345AM_CONDITIONAL(DECKLINK_OSX, false)
2346AM_CONDITIONAL(DECKLINK_WIN, false)
2347AM_CONDITIONAL(USE_DIRECTFB, false)
2348AM_CONDITIONAL(USE_WAYLAND, false)
2349AM_CONDITIONAL(USE_DTS, false)
2350AM_CONDITIONAL(USE_EXIF, false)
2351AM_CONDITIONAL(USE_RESINDVD, false)
2352AM_CONDITIONAL(USE_FAAC, false)
2353AM_CONDITIONAL(USE_FAAD, false)
2354AM_CONDITIONAL(USE_FBDEV, false)
2355AM_CONDITIONAL(USE_FDK_AAC, false)
2356AM_CONDITIONAL(USE_FLITE, false)
2357AM_CONDITIONAL(USE_FLUIDSYNTH, false)
2358AM_CONDITIONAL(USE_GL, false)
2359AM_CONDITIONAL(USE_GSM, false)
2360AM_CONDITIONAL(USE_HLS, false)
2361AM_CONDITIONAL(USE_IQA, false)
2362AM_CONDITIONAL(USE_KATE, false)
2363AM_CONDITIONAL(USE_KMS, false)
2364AM_CONDITIONAL(USE_TIGER, false)
2365AM_CONDITIONAL(USE_LADSPA, false)
2366AM_CONDITIONAL(USE_LCMS2, false)
2367AM_CONDITIONAL(USE_LV2, false)
2368AM_CONDITIONAL(USE_LIBDE265, false)
2369AM_CONDITIONAL(USE_LIBMMS, false)
2370AM_CONDITIONAL(USE_MODPLUG, false)
2371AM_CONDITIONAL(USE_MPEG2ENC, false)
2372AM_CONDITIONAL(USE_MPLEX, false)
2373AM_CONDITIONAL(USE_MUSEPACK, false)
2374AM_CONDITIONAL(USE_NEON, false)
2375AM_CONDITIONAL(USE_OFA, false)
2376AM_CONDITIONAL(USE_OPENAL, false)
2377AM_CONDITIONAL(USE_OPENCV, false)
2378AM_CONDITIONAL(USE_OPENEXR, false)
2379AM_CONDITIONAL(USE_OPENGL, false)
2380AM_CONDITIONAL(USE_OPENJPEG, false)
2381AM_CONDITIONAL(USE_OPENMPT, false)
2382AM_CONDITIONAL(USE_OPENNI2, false)
2383AM_CONDITIONAL(USE_OPUS, false)
2384AM_CONDITIONAL(USE_PANGO, false)
2385AM_CONDITIONAL(USE_WILDMIDI, false)
2386AM_CONDITIONAL(USE_SMOOTHSTREAMING, false)
2387AM_CONDITIONAL(USE_SNDFILE, false)
2388AM_CONDITIONAL(USE_SOUNDTOUCH, false)
2389AM_CONDITIONAL(USE_SPANDSP, false)
2390AM_CONDITIONAL(USE_SRTP, false)
2391AM_CONDITIONAL(USE_SRT, false)
2392AM_CONDITIONAL(USE_GME, false)
2393AM_CONDITIONAL(USE_DVB, false)
2394AM_CONDITIONAL(USE_VDPAU, false)
2395AM_CONDITIONAL(USE_SBC, false)
2396AM_CONDITIONAL(USE_ZBAR, false)
2397AM_CONDITIONAL(USE_RSVG, false)
2398AM_CONDITIONAL(USE_RTMP, false)
2399AM_CONDITIONAL(USE_TELETEXTDEC, false)
2400AM_CONDITIONAL(USE_UVCH264, false)
2401AM_CONDITIONAL(USE_WEBP, false)
2402AM_CONDITIONAL(USE_WEBRTC, false)
2403AM_CONDITIONAL(USE_WEBRTCDSP, false)
2404AM_CONDITIONAL(USE_OPENH264, false)
2405AM_CONDITIONAL(USE_X265, false)
2406AM_CONDITIONAL(USE_DTLS, false)
2407AM_CONDITIONAL(USE_VULKAN, false)
2408AM_CONDITIONAL(USE_TTML, false)
2409AM_CONDITIONAL(USE_SCTP, false)
2410
2411fi dnl of EXT plugins
2412
2413dnl *** finalize CFLAGS, LDFLAGS, LIBS
2414
2415dnl Overview:
2416dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
2417dnl GST_*:              flags shared by built objects to link against GStreamer
2418dnl GST_ALL_LDFLAGS:    linker flags shared by all
2419dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
2420dnl GST_LT_LDFLAGS:     library versioning of our libraries
2421dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
2422
2423dnl GST_OPTION_CFLAGS
2424if test "x$USE_DEBUG" = xyes; then
2425   PROFILE_CFLAGS="-g"
2426fi
2427AC_SUBST(PROFILE_CFLAGS)
2428
2429if test "x$PACKAGE_VERSION_NANO" = "x1"; then
2430  dnl Define _only_ during CVS (not pre-releases or releases)
2431  DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
2432else
2433  DEPRECATED_CFLAGS=""
2434fi
2435AC_SUBST(DEPRECATED_CFLAGS)
2436
2437VISIBILITY_CFLAGS=""
2438AS_COMPILER_FLAG([-fvisibility=hidden], [
2439  VISIBILITY_CFLAGS="-fvisibility=hidden"
2440  AC_DEFINE(GST_API_EXPORT, [extern __attribute__ ((visibility ("default")))], [public symbol export define])
2441], [
2442  VISIBILITY_CFLAGS=""
2443  AC_DEFINE(GST_API_EXPORT, [extern], [public symbol export define])
2444])
2445AC_SUBST(VISIBILITY_CFLAGS)
2446
2447VISIBILITY_CXXFLAGS=""
2448if test "x$HAVE_CXX" = "xyes"; then
2449  AS_CXX_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CXXFLAGS="-fvisibility=hidden"])
2450fi
2451AC_SUBST(VISIBILITY_CXXFLAGS)
2452
2453dnl disable strict aliasing
2454AS_COMPILER_FLAG([-fno-strict-aliasing], [EXTRA_CFLAGS="-fno-strict-aliasing"])
2455AC_SUBST(EXTRA_CFLAGS)
2456
2457dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
2458dnl at make time with e.g. make ERROR_CFLAGS=""
2459GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
2460GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
2461GST_OPTION_OBJCFLAGS="\$(WARNING_OBJCFLAGS) \$(ERROR_OBJCFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
2462AC_SUBST(GST_OPTION_CFLAGS)
2463AC_SUBST(GST_OPTION_CXXFLAGS)
2464AC_SUBST(GST_OPTION_OBJCFLAGS)
2465
2466dnl FIXME: do we want to rename to GST_ALL_* ?
2467dnl prefer internal headers to already installed ones
2468dnl also add builddir include for enumtypes and marshal
2469dnl add GST_OPTION_CFLAGS, but overridable
2470GST_CFLAGS="$GST_CFLAGS $GST_STATIC_CFLAGS -DGST_USE_UNSTABLE_API"
2471GST_CXXFLAGS="$GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(VISIBILITY_CXXFLAGS)"
2472GST_OBJCFLAGS="$GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_OBJCFLAGS) \$(VISIBILITY_CFLAGS)"
2473GST_CFLAGS="$GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS) \$(VISIBILITY_CFLAGS)"
2474AC_SUBST(GST_CFLAGS)
2475AC_SUBST(GST_CXXFLAGS)
2476AC_SUBST(GST_OBJCFLAGS)
2477AC_SUBST(GST_LIBS)
2478GST_PLUGINS_BAD_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
2479GST_PLUGINS_BAD_OBJCFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
2480GST_PLUGINS_BAD_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
2481AC_SUBST(GST_PLUGINS_BAD_CFLAGS)
2482AC_SUBST(GST_PLUGINS_BAD_CXXFLAGS)
2483AC_SUBST(GST_PLUGINS_BAD_OBJCFLAGS)
2484
2485dnl LDFLAGS really should only contain flags, not libs - they get added before
2486dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
2487GST_ALL_LDFLAGS="-no-undefined"
2488if test "x${enable_Bsymbolic}" = "xyes"; then
2489  GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
2490fi
2491AC_SUBST(GST_ALL_LDFLAGS)
2492
2493dnl GST_LIB_LDFLAGS
2494dnl linker flags shared by all libraries
2495dnl LDFLAGS modifier defining exported symbols from built libraries
2496dnl (export _gst_foo but not __gst_foo)
2497GST_LIB_LDFLAGS=""
2498AC_SUBST(GST_LIB_LDFLAGS)
2499
2500dnl this really should only contain flags, not libs - they get added before
2501dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
2502GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
2503AC_SUBST(GST_PLUGIN_LDFLAGS)
2504
2505dnl *** output files ***
2506
2507$MKDIR_P tests/check/orc
2508
2509dnl po/Makefile.in
2510
2511AC_CONFIG_FILES(
2512Makefile
2513common/Makefile
2514common/m4/Makefile
2515gst/Makefile
2516gst/accurip/Makefile
2517gst/adpcmdec/Makefile
2518gst/adpcmenc/Makefile
2519gst/aiff/Makefile
2520gst/videoframe_audiolevel/Makefile
2521gst/asfmux/Makefile
2522gst/audiobuffersplit/Makefile
2523gst/audiofxbad/Makefile
2524gst/audiolatency/Makefile
2525gst/audiomixmatrix/Makefile
2526gst/audiovisualizers/Makefile
2527gst/autoconvert/Makefile
2528gst/bayer/Makefile
2529gst/camerabin2/Makefile
2530gst/coloreffects/Makefile
2531gst/debugutils/Makefile
2532gst/dvbsuboverlay/Makefile
2533gst/dvdspu/Makefile
2534gst/faceoverlay/Makefile
2535gst/festival/Makefile
2536gst/fieldanalysis/Makefile
2537gst/freeverb/Makefile
2538gst/frei0r/Makefile
2539gst/gaudieffects/Makefile
2540gst/geometrictransform/Makefile
2541gst/gdp/Makefile
2542gst/id3tag/Makefile
2543gst/inter/Makefile
2544gst/interlace/Makefile
2545gst/ivfparse/Makefile
2546gst/ivtc/Makefile
2547gst/jp2kdecimator/Makefile
2548gst/jpegformat/Makefile
2549gst/librfb/Makefile
2550gst/midi/Makefile
2551gst/mpegdemux/Makefile
2552gst/mpegtsdemux/Makefile
2553gst/mpegtsmux/Makefile
2554gst/mpegtsmux/tsmux/Makefile
2555gst/mpegpsmux/Makefile
2556gst/mxf/Makefile
2557gst/netsim/Makefile
2558gst/onvif/Makefile
2559gst/pcapparse/Makefile
2560gst/pnm/Makefile
2561gst/proxy/Makefile
2562gst/rawparse/Makefile
2563gst/removesilence/Makefile
2564gst/sdp/Makefile
2565gst/segmentclip/Makefile
2566gst/siren/Makefile
2567gst/smooth/Makefile
2568gst/speed/Makefile
2569gst/subenc/Makefile
2570gst/timecode/Makefile
2571gst/videofilters/Makefile
2572gst/videoparsers/Makefile
2573gst/videosignal/Makefile
2574gst/vmnc/Makefile
2575gst/y4m/Makefile
2576gst/yadif/Makefile
2577gst-libs/Makefile
2578gst-libs/gst/Makefile
2579gst-libs/gst/adaptivedemux/Makefile
2580gst-libs/gst/basecamerabinsrc/Makefile
2581gst-libs/gst/insertbin/Makefile
2582gst-libs/gst/interfaces/Makefile
2583gst-libs/gst/isoff/Makefile
2584gst-libs/gst/codecparsers/Makefile
2585gst-libs/gst/mpegts/Makefile
2586gst-libs/gst/sctp/Makefile
2587gst-libs/gst/uridownloader/Makefile
2588gst-libs/gst/wayland/Makefile
2589gst-libs/gst/webrtc/Makefile
2590gst-libs/gst/player/Makefile
2591gst-libs/gst/audio/Makefile
2592gst-libs/gst/opencv/Makefile
2593sys/Makefile
2594sys/dshowdecwrapper/Makefile
2595sys/androidmedia/Makefile
2596sys/applemedia/Makefile
2597sys/bluez/Makefile
2598sys/d3dvideosink/Makefile
2599sys/decklink/Makefile
2600sys/directsound/Makefile
2601sys/dshowsrcwrapper/Makefile
2602sys/dshowvideosink/Makefile
2603sys/dvb/Makefile
2604sys/fbdev/Makefile
2605sys/ipcpipeline/Makefile
2606sys/kms/Makefile
2607sys/msdk/Makefile
2608sys/nvdec/Makefile
2609sys/nvenc/Makefile
2610sys/opensles/Makefile
2611sys/shm/Makefile
2612sys/tinyalsa/Makefile
2613sys/uvch264/Makefile
2614sys/vdpau/Makefile
2615sys/wasapi/Makefile
2616sys/winks/Makefile
2617sys/winscreencap/Makefile
2618tests/Makefile
2619tests/check/Makefile
2620tests/files/Makefile
2621tests/examples/Makefile
2622tests/examples/avsamplesink/Makefile
2623tests/examples/camerabin2/Makefile
2624tests/examples/codecparsers/Makefile
2625tests/examples/directfb/Makefile
2626tests/examples/audiomixmatrix/Makefile
2627tests/examples/ipcpipeline/Makefile
2628tests/examples/mpegts/Makefile
2629tests/examples/mxf/Makefile
2630tests/examples/opencv/Makefile
2631tests/examples/uvch264/Makefile
2632tests/examples/waylandsink/Makefile
2633tests/examples/webrtc/Makefile
2634tests/icles/Makefile
2635ext/voamrwbenc/Makefile
2636ext/voaacenc/Makefile
2637ext/assrender/Makefile
2638ext/aom/Makefile
2639ext/bs2b/Makefile
2640ext/bz2/Makefile
2641ext/chromaprint/Makefile
2642ext/closedcaption/Makefile
2643ext/colormanagement/Makefile
2644ext/curl/Makefile
2645ext/dash/Makefile
2646ext/dc1394/Makefile
2647ext/directfb/Makefile
2648ext/wayland/Makefile
2649ext/dts/Makefile
2650ext/faac/Makefile
2651ext/faad/Makefile
2652ext/fdkaac/Makefile
2653ext/flite/Makefile
2654ext/fluidsynth/Makefile
2655ext/gsm/Makefile
2656ext/hls/Makefile
2657ext/iqa/Makefile
2658ext/kate/Makefile
2659ext/ladspa/Makefile
2660ext/lv2/Makefile
2661ext/libde265/Makefile
2662ext/libmms/Makefile
2663ext/Makefile
2664ext/modplug/Makefile
2665ext/mpeg2enc/Makefile
2666ext/mplex/Makefile
2667ext/musepack/Makefile
2668ext/neon/Makefile
2669ext/ofa/Makefile
2670ext/openal/Makefile
2671ext/opencv/Makefile
2672ext/openexr/Makefile
2673ext/openh264/Makefile
2674ext/openjpeg/Makefile
2675ext/openmpt/Makefile
2676ext/openni2/Makefile
2677ext/opus/Makefile
2678ext/rsvg/Makefile
2679ext/resindvd/Makefile
2680ext/rtmp/Makefile
2681ext/sbc/Makefile
2682ext/sctp/Makefile
2683ext/smoothstreaming/Makefile
2684ext/sndfile/Makefile
2685ext/soundtouch/Makefile
2686ext/spandsp/Makefile
2687ext/srt/Makefile
2688ext/srtp/Makefile
2689ext/teletextdec/Makefile
2690ext/gme/Makefile
2691ext/wildmidi/Makefile
2692ext/vulkan/Makefile
2693ext/vulkan/xcb/Makefile
2694ext/vulkan/wayland/Makefile
2695ext/webp/Makefile
2696ext/x265/Makefile
2697ext/zbar/Makefile
2698ext/dtls/Makefile
2699ext/webrtc/Makefile
2700ext/webrtcdsp/Makefile
2701ext/wpe/Makefile
2702ext/ttml/Makefile
2703po/Makefile.in
2704docs/Makefile
2705docs/plugins/Makefile
2706docs/libs/Makefile
2707docs/version.entities
2708pkgconfig/Makefile
2709pkgconfig/gstreamer-plugins-bad.pc
2710pkgconfig/gstreamer-plugins-bad-uninstalled.pc
2711pkgconfig/gstreamer-codecparsers.pc
2712pkgconfig/gstreamer-codecparsers-uninstalled.pc
2713pkgconfig/gstreamer-insertbin.pc
2714pkgconfig/gstreamer-insertbin-uninstalled.pc
2715pkgconfig/gstreamer-mpegts.pc
2716pkgconfig/gstreamer-mpegts-uninstalled.pc
2717pkgconfig/gstreamer-player.pc
2718pkgconfig/gstreamer-player-uninstalled.pc
2719pkgconfig/gstreamer-sctp.pc
2720pkgconfig/gstreamer-sctp-uninstalled.pc
2721pkgconfig/gstreamer-wayland.pc
2722pkgconfig/gstreamer-wayland-uninstalled.pc
2723pkgconfig/gstreamer-webrtc.pc
2724pkgconfig/gstreamer-webrtc-uninstalled.pc
2725pkgconfig/gstreamer-bad-audio.pc
2726pkgconfig/gstreamer-bad-audio-uninstalled.pc
2727tools/Makefile
2728m4/Makefile
2729)
2730
2731AC_OUTPUT
2732
2733AG_GST_OUTPUT_PLUGINS
2734ORC_OUTPUT
2735