midi: add an ALSA MIDI sequencer source
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ([2.69])
2
3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, git and prerelease does Werror too
6 AC_INIT([GStreamer Bad Plug-ins],[1.7.0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-bad])
7
8 AG_GST_INIT
9
10 dnl initialize automake
11 AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
12
13 dnl define PACKAGE_VERSION_* variables
14 AS_VERSION
15
16 dnl check if this is a release version
17 AS_NANO(GST_GIT="no", GST_GIT="yes")
18
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([docs/plugins/gst-plugins-bad-plugins-docs.sgml])
21
22 dnl define the output header for config
23 AC_CONFIG_HEADERS([config.h])
24
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
26 AM_MAINTAINER_MODE([enable])
27
28 dnl sets host_* variables
29 AC_CANONICAL_HOST
30
31 dnl use pretty build output with automake >= 1.11
32 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
33   [AM_DEFAULT_VERBOSITY=1
34    AC_SUBST(AM_DEFAULT_VERBOSITY)])
35
36 dnl PKG_CONFIG_SYSROOT_DIR is a valid environment variable
37 m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
38
39 dnl our libraries and install dirs use GST_API_VERSION in the filename
40 dnl to allow side-by-side installation of different API versions
41 GST_API_VERSION=1.0
42 AC_SUBST(GST_API_VERSION)
43 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
44   [GStreamer API Version])
45
46 AG_GST_LIBTOOL_PREPARE
47
48 dnl CURRENT, REVISION, AGE
49 dnl - library source changed -> increment REVISION
50 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
51 dnl - interfaces added -> increment AGE
52 dnl - interfaces removed -> AGE = 0
53 dnl sets GST_LT_LDFLAGS
54 AS_LIBTOOL(GST, 700, 0, 700)
55
56 dnl *** required versions of GStreamer stuff ***
57 GST_REQ=1.7.0.1
58 GSTPB_REQ=1.7.0.1
59
60 dnl *** autotools stuff ****
61
62 dnl allow for different autotools
63 AS_AUTOTOOLS_ALTERNATE
64
65 dnl Add parameters for aclocal
66 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
67
68 dnl set up gettext
69 dnl the version check needs to stay here because autopoint greps for it
70 AM_GNU_GETTEXT_VERSION([0.17])
71 AM_GNU_GETTEXT([external])
72 AG_GST_GETTEXT([gst-plugins-bad-$GST_API_VERSION])
73
74 dnl *** check for arguments to configure ***
75
76 AG_GST_ARG_DISABLE_FATAL_WARNINGS
77
78 AG_GST_ARG_DEBUG
79 AG_GST_ARG_PROFILING
80 AG_GST_ARG_VALGRIND
81 AG_GST_ARG_GCOV
82
83 AG_GST_ARG_EXAMPLES
84
85 AG_GST_ARG_WITH_PKG_CONFIG_PATH
86 AG_GST_ARG_WITH_PACKAGE_NAME
87 AG_GST_ARG_WITH_PACKAGE_ORIGIN
88
89 AG_GST_ARG_WITH_PLUGINS
90
91 AG_GST_ARG_ENABLE_EXTERNAL
92
93 AG_GST_ARG_ENABLE_EXPERIMENTAL
94
95 AG_GST_PKG_CONFIG_PATH
96
97 dnl *** checks for platform ***
98 AG_GST_PLATFORM
99
100 dnl * hardware/architecture *
101
102 dnl common/m4/gst-arch.m4
103 dnl check CPU type
104 AG_GST_ARCH
105
106 dnl Determine endianness
107 AC_C_BIGENDIAN
108
109 dnl *** checks for programs ***
110
111 dnl find a compiler
112 AC_PROG_CC
113 AC_PROG_CC_STDC
114
115 dnl determine c++ compiler
116 AC_PROG_CXX
117 dnl determine if c++ is available on this system
118 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
119
120 AC_PROG_OBJC
121
122 dnl check if the compiler supports '-c' and '-o' options
123 AM_PROG_CC_C_O
124
125 dnl check if the compiler supports do while(0) macros
126 AG_GST_CHECK_DOWHILE_MACROS
127
128 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
129 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
130
131 dnl check for gobject-introspection
132 GOBJECT_INTROSPECTION_CHECK([1.31.1])
133
134 dnl check for documentation tools
135 GTK_DOC_CHECK([1.12])
136 AG_GST_PLUGIN_DOCS([1.12])
137
138 dnl *** checks for libraries ***
139
140 dnl check for libm, for sin() etc.
141 LT_LIB_M
142 AC_SUBST(LIBM)
143
144 AC_FUNC_MMAP
145
146 dnl check for pthreads
147 AX_PTHREAD
148
149 dnl *** checks for header files ***
150
151 AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
152 AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
153
154 if test "x$HAVE_UNISTD_H" != "xyes"; then
155   GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
156 fi
157
158 AC_CHECK_HEADERS([sys/time.h])
159
160 dnl used by ext/dts
161 AX_CREATE_STDINT_H
162
163 AC_CHECK_HEADERS([pthread.h], HAVE_PTHREAD_H=yes)
164 AM_CONDITIONAL(HAVE_PTHREAD_H, test "x$HAVE_PTHREAD_H" = "xyes")
165
166 if test "x$HAVE_PTHREAD_H" != "xyes"; then
167   GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/dccp//`
168 fi
169
170 dnl *** checks for types/defines ***
171
172 dnl Check for FIONREAD ioctl declaration
173 dnl used in gst/dccp
174 GST_CHECK_FIONREAD
175
176 dnl *** checks for structures ***
177
178 dnl *** checks for compiler characteristics ***
179
180 dnl *** checks for library functions ***
181 AC_CHECK_FUNCS([gmtime_r])
182
183 dnl *** checks for headers ***
184 AC_CHECK_HEADERS([sys/utsname.h])
185
186 dnl *** checks for dependency libraries ***
187
188 dnl *** checks for socket and nsl libraries ***
189 AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
190 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
191
192 dnl GLib is required
193 GLIB_REQ=2.32.0
194 AG_GST_GLIB_CHECK([$GLIB_REQ])
195
196 dnl checks for gstreamer
197 dnl uninstalled is selected preferentially -- see pkg-config(1)
198 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
199 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
200 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
201 AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
202 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
203
204 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
205
206 dnl check for uninstalled plugin directories for unit tests
207 AG_GST_CHECK_UNINSTALLED_SETUP([
208   AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [0.11.0])
209   AG_GST_CHECK_GST_PLUGINS_UGLY($GST_API_VERSION, [0.11.0])
210   AG_GST_CHECK_GST_PLUGINS_LIBAV($GST_API_VERSION, [0.11.0])
211 ])
212
213 dnl Check for documentation xrefs
214 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
215 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
216 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
217 AC_SUBST(GLIB_PREFIX)
218 AC_SUBST(GST_PREFIX)
219 AC_SUBST(GSTPB_PREFIX)
220
221 dnl GTK is optional and used in examples
222 HAVE_GTK=NO
223 GTK2_REQ=2.14.0
224 GTK3_REQ=2.91.3
225 if test "x$BUILD_EXAMPLES" = "xyes"; then
226   AC_MSG_CHECKING([which gtk+ version to compile examples against (optional)])
227   AC_ARG_WITH([gtk],
228     AS_HELP_STRING([--with-gtk=3.0|2.0],[which gtk+ version to compile against (default: 2.0)]),
229     [case "$with_gtk" in
230         2.0) GTK_REQ=$GTK2_REQ ;;
231         3.0) GTK_REQ=$GTK3_REQ ;;
232         *) AC_MSG_ERROR([invalid gtk+ version specified]);;
233     esac],
234     [with_gtk=2.0
235      GTK_REQ=$GTK2_REQ])
236   AC_MSG_RESULT([$with_gtk (>= $GTK_REQ)])
237   PKG_CHECK_MODULES(GTK, gtk+-x11-$with_gtk >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
238   AC_SUBST(GTK_LIBS)
239   AC_SUBST(GTK_CFLAGS)
240 fi
241 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
242
243
244 dnl GTK is optional and used in examples
245 HAVE_GTK3=NO
246 if test "x$BUILD_EXAMPLES" = "xyes"; then
247   PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.4, HAVE_GTK3=yes, HAVE_GTK3=no)
248   if test "x$HAVE_GTK3" = "xyes"; then
249     HAVE_GTK=yes
250     GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
251     AC_SUBST(GTK_VERSION)
252     GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
253     AC_SUBST(GTK_BASE_DIR)
254   fi
255 fi
256 AC_SUBST(GTK3_LIBS)
257 AC_SUBST(GTK3_CFLAGS)
258 AC_SUBST(HAVE_GTK3)
259 AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
260
261 dnl clutter is optional and used in examples
262 HAVE_CLUTTER=no
263 HAVE_CLUTTER_X11=no
264 HAVE_CLUTTER_GLX=no
265 if test "x$BUILD_EXAMPLES" = "xyes"; then
266   PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= 1.8, HAVE_CLUTTER=yes, HAVE_CLUTTER=no)
267   AC_SUBST(CLUTTER_LIBS)
268   AC_SUBST(CLUTTER_CFLAGS)
269   AC_SUBST(HAVE_CLUTTER)
270
271   PKG_CHECK_MODULES(CLUTTER_GLX, clutter-glx-1.0 >= 1.8, HAVE_CLUTTER_GLX=yes, HAVE_CLUTTER_GLX=no)
272   AC_SUBST(CLUTTER_GLX_LIBS)
273   AC_SUBST(CLUTTER_GLX_CFLAGS)
274   AC_SUBST(HAVE_CLUTTER_GLX)
275
276   PKG_CHECK_MODULES(CLUTTER_X11, clutter-x11-1.0 >= 1.8, HAVE_CLUTTER_X11=yes, HAVE_CLUTTER_X11=no)
277   AC_SUBST(CLUTTER_X11_LIBS)
278   AC_SUBST(CLUTTER_X11_CFLAGS)
279   AC_SUBST(HAVE_CLUTTER_X11)
280 fi
281 AM_CONDITIONAL(HAVE_CLUTTER, test "x$HAVE_CLUTTER" = "xyes")
282 AM_CONDITIONAL(HAVE_CLUTTER_GLX, test "x$HAVE_CLUTTER_GLX" = "xyes")
283 AM_CONDITIONAL(HAVE_CLUTTER_X11, test "x$HAVE_CLUTTER_X11" = "xyes")
284
285 dnl used in the gl/clutteractor example
286 if test "x$BUILD_EXAMPLES" = "xyes"; then
287   PKG_CHECK_MODULES(XCOMPOSITE, xcomposite, HAVE_XCOMPOSITE=yes, HAVE_XCOMPOSITE=no)
288   AC_SUBST(XCOMPOSITE_CFLAGS)
289   AC_SUBST(XCOMPOSITE_LIBS)
290 fi
291 AM_CONDITIONAL(HAVE_XCOMPOSITE, test "x$HAVE_XCOMPOSITE" = "xyes")
292
293 dnl graphene-1.0 is optional and used in gltransformation
294 HAVE_GRAPHENE=NO
295 PKG_CHECK_MODULES(GRAPHENE, graphene-1.0 >= 1.0.0, HAVE_GRAPHENE=yes, HAVE_GRAPHENE=no)
296 if test "x$HAVE_GRAPHENE" = "xyes"; then
297   AC_DEFINE(HAVE_GRAPHENE, [1] , [Use graphene])
298 fi
299 AC_SUBST(HAVE_GRAPHENE)
300 AC_SUBST(GRAPHENE_LIBS)
301 AC_SUBST(GRAPHENE_CFLAGS)
302 AM_CONDITIONAL(HAVE_GRAPHENE, test "x$HAVE_GRAPHENE" = "xyes")
303
304
305 dnl sdl is optional and used in examples
306 HAVE_SDL=NO
307 if test "x$BUILD_EXAMPLES" = "xyes"; then
308   PKG_CHECK_MODULES(SDL, sdl >= 1.2.0, HAVE_SDL=yes, HAVE_SDL=no)
309   AC_SUBST(SDL_LIBS)
310   AC_SUBST(SDL_CFLAGS)
311   AC_SUBST(SDL_CLUTTER)
312 fi
313 AM_CONDITIONAL(HAVE_SDL, test "x$HAVE_SDL" = "xyes")
314
315
316 dnl Needed for GtkBuilder to autoconnect signals
317 PKG_CHECK_MODULES(GMODULE_EXPORT, gmodule-export-2.0, HAVE_GMODULE_EXPORT=yes, HAVE_GMODULE_EXPORT=no)
318
319 dnl Needed by plugins that use g_module_*() API
320 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
321
322 dnl x11 is optional for librfb
323 HAVE_X11=NO
324 PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no)
325 AC_SUBST(X11_LIBS)
326 AC_SUBST(X11_CFLAGS)
327 AC_SUBST(HAVE_X11)
328 AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "xyes")
329 if test "x$HAVE_X11" = "xyes"; then
330   AC_DEFINE(HAVE_X11, 1, [Define if you have X11 library])
331 fi
332
333 dnl exif (used on jifmux tests) ****
334 PKG_CHECK_MODULES(EXIF, libexif >= 0.6.16, HAVE_EXIF="yes", HAVE_EXIF="no")
335 AC_SUBST(EXIF_LIBS)
336 AC_SUBST(EXIF_CFLAGS)
337 AM_CONDITIONAL(USE_EXIF, test "x$HAVE_EXIF" = "xyes")
338
339 dnl Orc
340 ORC_CHECK([0.4.17])
341
342 dnl set license and copyright notice
343 GST_LICENSE="LGPL"
344 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
345 AC_SUBST(GST_LICENSE)
346
347 dnl define LIBDIR so we can inform people where we live
348 AS_AC_EXPAND(LIBDIR, $libdir)
349 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
350
351 dnl set location of plugin directory
352 AG_GST_SET_PLUGINDIR
353
354 dnl set release date/time
355 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
356   ["${srcdir}/gst-plugins-bad.doap"],
357   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
358
359 dnl build static plugins or not
360 AC_MSG_CHECKING([whether to build static plugins or not])
361 AC_ARG_ENABLE(
362   static-plugins,
363   AC_HELP_STRING(
364     [--enable-static-plugins],
365     [build static plugins @<:@default=no@:>@]),
366   [AS_CASE(
367     [$enableval], [no], [], [yes], [],
368     [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])],
369   [enable_static_plugins=no])
370 AC_MSG_RESULT([$enable_static_plugins])
371 if test "x$enable_static_plugins" = xyes; then
372   AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1,
373     [Define if static plugins should be built])
374   GST_PLUGIN_LIBTOOLFLAGS=""
375 else
376   GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static"
377 fi
378 AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
379 AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
380
381 # set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
382 dnl make sure it doesn't complain about unused variables if debugging is disabled
383 NO_WARNINGS=""
384 AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
385
386 dnl define an ERROR_CFLAGS Makefile variable
387 dnl -Waggregate-return - libexif returns aggregates
388 dnl -Wundef - Windows headers check _MSC_VER unconditionally
389 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
390     -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
391     -Wwrite-strings -Wformat-security -Wold-style-definition
392     -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
393     -Wnested-externs $NO_WARNINGS])
394
395 dnl define an ERROR_CXXFLAGS Makefile variable
396 AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
397     -Wmissing-declarations -Wredundant-decls
398     -Wwrite-strings -Wformat-nonliteral -Wformat-security
399     -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar $NO_WARNINGS])
400
401 dnl define an ERROR_OBJCFLAGS Makefile variable
402 AG_GST_SET_ERROR_OBJCFLAGS($FATAL_WARNINGS, [
403     -Wmissing-declarations -Wredundant-decls
404     -Wwrite-strings -Wformat-nonliteral -Wformat-security
405     -Winit-self -Wmissing-include-dirs -Wno-multichar $NO_WARNINGS])
406
407 dnl define correct level for debugging messages
408 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
409
410 dnl used in examples
411 AG_GST_DEFAULT_ELEMENTS
412
413 dnl *** plug-ins to include ***
414 dnl Non ported plugins (non-dependant, then dependant)
415 dnl Make sure you have a space before and after all plugins
416 GST_PLUGINS_NONPORTED=" cdxaparse \
417  dccp faceoverlay \
418  hdvparse \
419  mve nuvdemux \
420  patchdetect \
421  sdi tta \
422  videomeasure \
423  linsys \
424  apexsink dc1394 \
425  gsettings \
426  musepack nas sdl timidity \
427  acm wininet \
428  xvid lv2 teletextdec sndio libvisual"
429 AC_SUBST(GST_PLUGINS_NONPORTED)
430
431 dnl these are all the gst plug-ins, compilable without additional libs
432 AG_GST_CHECK_PLUGIN(accurip)
433 AG_GST_CHECK_PLUGIN(adpcmdec)
434 AG_GST_CHECK_PLUGIN(adpcmenc)
435 AG_GST_CHECK_PLUGIN(aiff)
436 AG_GST_CHECK_PLUGIN(asfmux)
437 AG_GST_CHECK_PLUGIN(audiofxbad)
438 AG_GST_CHECK_PLUGIN(audiomixer)
439 AG_GST_CHECK_PLUGIN(compositor)
440 AG_GST_CHECK_PLUGIN(audiovisualizers)
441 AG_GST_CHECK_PLUGIN(autoconvert)
442 AG_GST_CHECK_PLUGIN(bayer)
443 AG_GST_CHECK_PLUGIN(camerabin2)
444 AG_GST_CHECK_PLUGIN(cdxaparse)
445 AG_GST_CHECK_PLUGIN(coloreffects)
446 AG_GST_CHECK_PLUGIN(dataurisrc)
447 AG_GST_CHECK_PLUGIN(dccp)
448 AG_GST_CHECK_PLUGIN(debugutils)
449 AG_GST_CHECK_PLUGIN(dvbsuboverlay)
450 AG_GST_CHECK_PLUGIN(dvdspu)
451 AG_GST_CHECK_PLUGIN(faceoverlay)
452 AG_GST_CHECK_PLUGIN(festival)
453 AG_GST_CHECK_PLUGIN(fieldanalysis)
454 AG_GST_CHECK_PLUGIN(freeverb)
455 AG_GST_CHECK_PLUGIN(frei0r)
456 AG_GST_CHECK_PLUGIN(gaudieffects)
457 AG_GST_CHECK_PLUGIN(geometrictransform)
458 AG_GST_CHECK_PLUGIN(gdp)
459 AG_GST_CHECK_PLUGIN(hdvparse)
460 AG_GST_CHECK_PLUGIN(id3tag)
461 AG_GST_CHECK_PLUGIN(inter)
462 AG_GST_CHECK_PLUGIN(interlace)
463 AG_GST_CHECK_PLUGIN(ivfparse)
464 AG_GST_CHECK_PLUGIN(ivtc)
465 AG_GST_CHECK_PLUGIN(jp2kdecimator)
466 AG_GST_CHECK_PLUGIN(jpegformat)
467 AG_GST_CHECK_PLUGIN(librfb)
468 AG_GST_CHECK_PLUGIN(liveadder)
469 AG_GST_CHECK_PLUGIN(midi)
470 AG_GST_CHECK_PLUGIN(mpegdemux)
471 AG_GST_CHECK_PLUGIN(mpegtsdemux)
472 AG_GST_CHECK_PLUGIN(mpegtsmux)
473 AG_GST_CHECK_PLUGIN(mpegpsmux)
474 AG_GST_CHECK_PLUGIN(mve)
475 AG_GST_CHECK_PLUGIN(mxf)
476 AG_GST_CHECK_PLUGIN(nuvdemux)
477 AG_GST_CHECK_PLUGIN(onvif)
478 AG_GST_CHECK_PLUGIN(patchdetect)
479 AG_GST_CHECK_PLUGIN(pcapparse)
480 AG_GST_CHECK_PLUGIN(pnm)
481 AG_GST_CHECK_PLUGIN(rawparse)
482 AG_GST_CHECK_PLUGIN(removesilence)
483 AG_GST_CHECK_PLUGIN(rtp)
484 AG_GST_CHECK_PLUGIN(sdi)
485 AG_GST_CHECK_PLUGIN(sdp)
486 AG_GST_CHECK_PLUGIN(segmentclip)
487 AG_GST_CHECK_PLUGIN(siren)
488 AG_GST_CHECK_PLUGIN(smooth)
489 AG_GST_CHECK_PLUGIN(speed)
490 AG_GST_CHECK_PLUGIN(subenc)
491 AG_GST_CHECK_PLUGIN(stereo)
492 AG_GST_CHECK_PLUGIN(tta)
493 AG_GST_CHECK_PLUGIN(videofilters)
494 AG_GST_CHECK_PLUGIN(videomeasure)
495 AG_GST_CHECK_PLUGIN(videoparsers)
496 AG_GST_CHECK_PLUGIN(videosignal)
497 AG_GST_CHECK_PLUGIN(vmnc)
498 AG_GST_CHECK_PLUGIN(y4m)
499 AG_GST_CHECK_PLUGIN(yadif)
500
501 dnl *** plug-ins to exclude ***
502
503 AC_CHECK_HEADER(AVFoundation/AVFoundation.h, HAVE_AVFOUNDATION="yes", HAVE_AVFOUNDATION="no", [-])
504 AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])
505 AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h, HAVE_VIDEOTOOLBOX="yes", HAVE_VIDEOTOOLBOX="no", [-])
506
507 if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
508   old_LIBS=$LIBS
509   LIBS="$LIBS -framework VideoToolbox"
510   AC_CHECK_FUNC(VTCompressionSessionPrepareToEncodeFrames, [
511     AC_DEFINE(HAVE_VIDEOTOOLBOX_10_9_6, 1, [Define if building with VideoToolbox >= 10.9.6])
512   ], [
513   ])
514   LIBS=$old_LIBS
515 fi
516
517 AM_CONDITIONAL(HAVE_AVFOUNDATION, test "x$HAVE_AVFOUNDATION" = "xyes")
518 if test "x$HAVE_AVFOUNDATION" = "xyes"; then
519   AC_DEFINE(HAVE_AVFOUNDATION, 1, [Define if building with AVFoundation])
520 fi
521
522 AM_CONDITIONAL(HAVE_IOS, test "x$HAVE_IOS" = "xyes")
523 if test "x$HAVE_IOS" = "xyes"; then
524   AC_DEFINE(HAVE_IOS, 1, [Define if building for Apple iOS])
525 fi
526
527 AM_CONDITIONAL(HAVE_VIDEOTOOLBOX, test "x$HAVE_VIDEOTOOLBOX" = "xyes")
528 if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
529   AC_DEFINE(HAVE_VIDEOTOOLBOX, 1, [Define if building with VideoToolbox])
530 fi
531
532 dnl disable gst plugins we might not be able to build on this
533 dnl platform: (ugly but minimally invasive)
534 dnl FIXME: maybe move to sys, or make work with winsock2
535 AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
536 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
537
538 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
539   WINSOCK2_LIBS="-lws2_32"
540   AC_SUBST(WINSOCK2_LIBS)
541 fi
542
543 if test "x$HAVE_PTHREAD_H" = "xyes"; then
544   DCCP_LIBS="$DCCP_LIBS $PTHREAD_LIBS"
545   AC_SUBST(DCCP_LIBS)
546 else
547   AG_GST_DISABLE_PLUGIN(dccp)
548 fi
549
550 dnl *** opengl ***
551 AC_ARG_ENABLE([opengl],
552      [  --enable-opengl         Enable Desktop OpenGL support @<:@default=auto@:>@],
553      [case "${enableval}" in
554        yes)  NEED_GL=yes ;;
555        no)   NEED_GL=no ;;
556        auto) NEED_GL=auto ;;
557        *) AC_MSG_ERROR([bad value ${enableval} for --enable-opengl]) ;;
558      esac],[NEED_GL=auto])
559
560 AC_ARG_WITH([opengl-module-name],
561   AS_HELP_STRING([--with-opengl-module-name],[library module name for OpenGL (default: libGL)]))
562 if test x$with_opengl_module_name != x; then
563   AC_DEFINE_UNQUOTED(GST_GL_LIBGL_MODULE_NAME, "$with_opengl_module_name", [OpenGL module name])
564 fi
565
566 AC_ARG_ENABLE([gles2],
567      [  --enable-gles2          Enable OpenGL|ES 2.0 support @<:@default=auto@:>@],
568      [case "${enableval}" in
569        yes)  NEED_GLES2=yes ;;
570        no)   NEED_GLES2=no ;;
571        auto) NEED_GLES2=auto ;;
572        *) AC_MSG_ERROR([bad value ${enableval} for --enable-gles2]) ;;
573      esac],[NEED_GLES2=auto])
574
575 AC_ARG_WITH([gles2-module-name],
576   AS_HELP_STRING([--with-gles2-module-name],[library module name for GLES2 (default: libGLESv2)]))
577 if test x$with_gles2_module_name != x; then
578   AC_DEFINE_UNQUOTED(GST_GL_LIBGLESV2_MODULE_NAME, "$with_gles2_module_name", [GLES2 module name])
579 fi
580
581 AC_ARG_ENABLE([egl],
582      [  --enable-egl            Enable EGL support @<:@default=auto@:>@],
583      [case "${enableval}" in
584        yes)  NEED_EGL=yes ;;
585        no)   NEED_EGL=no ;;
586        auto) NEED_EGL=auto ;;
587        *) AC_MSG_ERROR([bad value ${enableval} for --enable-egl]) ;;
588      esac],[NEED_EGL=auto])
589
590 AC_ARG_WITH([egl-module-name],
591   AS_HELP_STRING([--with-egl-module-name],[library module name for EGL (default: libEGL)]))
592 if test x$with_egl_module_name != x; then
593   AC_DEFINE_UNQUOTED(GST_GL_LIBEGL_MODULE_NAME, "$with_egl_module_name", [EGL module name])
594 fi
595
596 AC_ARG_ENABLE([wgl],
597      [  --enable-wgl            Enable WGL support @<:@default=auto@:>@],
598      [case "${enableval}" in
599        yes)  NEED_WGL=yes ;;
600        no)   NEED_WGL=no ;;
601        auto) NEED_WGL=auto ;;
602        *) AC_MSG_ERROR([bad value ${enableval} for --enable-wgl]) ;;
603      esac],[NEED_WGL=auto])
604
605 AC_ARG_ENABLE([glx],
606      [  --enable-glx            Enable GLX support @<:@default=auto@:>@],
607      [case "${enableval}" in
608        yes)  NEED_GLX=yes ;;
609        no)   NEED_GLX=no ;;
610        auto) NEED_GLX=auto ;;
611        *) AC_MSG_ERROR([bad value ${enableval} for --enable-glx]) ;;
612      esac],[NEED_GLX=auto])
613
614 AC_ARG_ENABLE([cocoa],
615      [  --enable-cocoa          Enable Cocoa support @<:@default=auto@:>@],
616      [case "${enableval}" in
617        yes)  NEED_COCOA=yes ;;
618        no)   NEED_COCOA=no ;;
619        auto) NEED_COCOA=auto ;;
620        *) AC_MSG_ERROR([bad value ${enableval} for --enable-cocoa]) ;;
621      esac],[NEED_COCOA=auto])
622
623 AC_ARG_ENABLE([x11],
624      [  --enable-x11            Enable x11 support @<:@default=auto@:>@],
625      [case "${enableval}" in
626        yes)  NEED_X11=yes ;;
627        no)   NEED_X11=no ;;
628        auto) NEED_X11=auto ;;
629        *) AC_MSG_ERROR([bad value ${enableval} for --enable-x11]) ;;
630      esac],[NEED_X11=auto])
631
632 AC_ARG_ENABLE([wayland],
633      [  --enable-wayland        Enable Wayland support (requires EGL) @<:@default=auto@:>@],
634      [case "${enableval}" in
635        yes)  NEED_WAYLAND_EGL=yes ;;
636        no)   NEED_WAYLAND_EGL=no ;;
637        auto) NEED_WAYLAND_EGL=auto ;;
638        *) AC_MSG_ERROR([bad value ${enableval} for --enable-wayland]) ;;
639      esac],[NEED_WAYLAND_EGL=auto])
640
641 AC_ARG_ENABLE([dispmanx],
642      [  --enable-dispmanx        Enable Dispmanx support (requires EGL) @<:@default=auto@:>@],
643      [case "${enableval}" in
644        yes)  NEED_DISPMANX=yes ;;
645        no)   NEED_DISPMANX=no ;;
646        auto) NEED_DISPMANX=auto ;;
647        *) AC_MSG_ERROR([bad value ${enableval} for --enable-dispmanx]) ;;
648      esac],[NEED_DISPMANX=auto])
649
650 AG_GST_PKG_CHECK_MODULES(X, x11)
651 save_CPPFLAGS="$CPPFLAGS"
652 save_LIBS="$LIBS"
653
654 HAVE_GL=no
655 HAVE_GLES2=no
656 HAVE_WAYLAND_EGL=no
657
658 HAVE_EGL_RPI=no
659
660 case $host in
661   *-mingw32* )
662     LIBS="$LIBS -lgdi32"
663     AG_GST_CHECK_LIBHEADER(GL, opengl32, glTexImage2D,, GL/gl.h)
664     AC_CHECK_HEADER(GL/wglext.h, HAVE_WGLEXT="yes", HAVE_WGLEXT="no", [#include <GL/gl.h>])
665     if test "x$HAVE_WGLEXT" = "xyes"; then
666       HAVE_WGL=yes
667       HAVE_GL=yes
668     fi
669   ;;
670   *)
671     if test "x$NEED_GL" != "xno"; then
672       AG_GST_CHECK_LIBHEADER(GL, GL, glTexImage2D,, GL/gl.h)
673     fi
674     if test "x$NEED_GLES2" != "xno"; then
675       AG_GST_CHECK_LIBHEADER(GLES2, GLESv2, glTexImage2D,, GLES2/gl2.h)
676     fi
677     if test "x$NEED_EGL" != "xno"; then
678       AG_GST_CHECK_LIBHEADER(EGL, EGL, eglGetError,, EGL/egl.h)
679     fi
680
681     old_LIBS=$LIBS
682     old_CFLAGS=$CFLAGS
683
684     dnl FIXME: Mali EGL depends on GLESv1 or GLESv2
685     AC_CHECK_HEADER([EGL/fbdev_window.h],
686       [
687         LIBS="$LIBS -lUMP"
688         AC_CHECK_LIB([Mali], [mali_image_create],
689           [
690             LIBS="$LIBS -lMali"
691             AC_CHECK_LIB([GLESv2], [glEnable],
692               [
693                 AC_CHECK_HEADER([GLES2/gl2.h],
694                   [
695                     AC_CHECK_LIB([EGL], [eglGetProcAddress],
696                       [
697                         AC_CHECK_HEADER([EGL/egl.h],
698                           [
699                             HAVE_EGL=yes
700                             HAVE_GLES2=yes
701                             EGL_LIBS="-lMali -lUMP"
702                             EGL_CFLAGS=""
703                             AC_DEFINE(USE_EGL_MALI_FB, [1], [Use Mali FB EGL platform])
704                           ])
705                       ])
706                   ])
707               ])
708           ])
709       ])
710
711     dnl FIXME: EGL of RPi depends on GLESv1 or GLESv2
712     dnl FIXME: GLESv2 of RPi depends on EGL... WTF!
713     LIBS="$LIBS -lvcos -lvchiq_arm"
714     AC_CHECK_LIB([bcm_host], [bcm_host_init],
715       [
716         LIBS="$LIBS -lbcm_host"
717         AC_CHECK_HEADER(bcm_host.h,
718           [
719             LIBS="$LIBS -lGLESv2"
720             AC_CHECK_LIB([EGL], [eglGetProcAddress],
721               [
722                 LIBS="$LIBS -lEGL"
723                 AC_CHECK_HEADER([EGL/egl.h],
724                   [
725                     AC_CHECK_LIB([GLESv2], [glEnable],
726                       [
727                         AC_CHECK_HEADER([GLES2/gl2.h],
728                           [
729                             HAVE_EGL=yes
730                             HAVE_GLES2=yes
731                             HAVE_EGL_RPI=yes
732                             EGL_LIBS="-lbcm_host -lvcos -lvchiq_arm"
733                             EGL_CFLAGS=""
734                             AC_DEFINE(USE_EGL_RPI, [1], [Use RPi platform])
735                           ])
736                       ])
737                   ])
738               ])
739           ])
740       ])
741
742     LIBS=$old_LIBS
743     CFLAGS=$old_CFLAGS
744
745     PKG_CHECK_MODULES(WAYLAND_EGL, wayland-client >= 1.0 wayland-cursor >= 1.0 wayland-egl >= 9.0, HAVE_WAYLAND_EGL=yes, HAVE_WAYLAND_EGL=no)
746   ;;
747 esac
748
749 CPPFLAGS="$save_CPPFLAGS"
750 LIBS="$save_LIBS"
751
752 USE_OPENGL=no
753 USE_GLES2=no
754 USE_GLX=no
755 USE_COCOA=no
756 USE_WGL=no
757 USE_X11=no
758 USE_EAGL=no
759 GL_LIBS=
760 GL_CFLAGS=
761 GL_OBJCFLAGS=
762
763 dnl Check for what the user asked for and what we could find
764 if test "x$HAVE_EGL" = "xno"; then
765   if test "x$NEED_EGL" = "xyes"; then
766     AC_MSG_ERROR([Could not find the required EGL libraries])
767   fi
768 fi
769
770 if test "x$HAVE_GL" = "xno"; then
771   if test "x$NEED_GL" = "xyes"; then
772     AC_MSG_ERROR([Could not find the required OpenGL libraries])
773   fi
774 fi
775
776 if test "x$HAVE_GLES2" = "xno"; then
777   if test "x$NEED_GLES2" = "xyes"; then
778     AC_MSG_ERROR([Could not find the required OpenGL|ES 2.0 libraries])
779   fi
780 fi
781
782 dnl X, GLX and OpenGL
783 if test "x$HAVE_X" = "xno"; then
784   if test "x$NEED_GLX" = "xyes"; then
785     AC_MSG_ERROR([Building the GLX backend without X11 is unsupported])
786   fi
787   if test "x$NEED_X11" = "xyes"; then
788     AC_MSG_ERROR([Could not find X11 development libraries])
789   fi
790 else
791   if test "x$NEED_GL" != "xno"; then
792     if test "x$HAVE_GL" = "xno"; then
793       if test "x$NEED_GLX" = "xyes"; then
794         AC_MSG_ERROR([Building the GLX backend without the OpenGL backend is unsupported])
795       fi
796     else dnl HAVE_GL=yes
797       USE_OPENGL=yes
798       if test "x$NEED_GLX" != "xno"; then
799         USE_GLX=yes
800       fi
801     fi
802   fi
803 fi
804
805 dnl check if we can include both GL and GLES2 at the same time
806 if test "x$HAVE_GL" = "xyes" -a "x$HAVE_GLES2" = "xyes"; then
807   GL_INCLUDES="
808 #ifndef GL_GLEXT_PROTOTYPES
809 #define GL_GLEXT_PROTOTYPES 1
810 #endif
811 # ifdef HAVE_IOS
812 #  include <OpenGLES/ES2/gl.h>
813 #  include <OpenGLES/ES2/glext.h>
814 # else
815 #  include <GLES2/gl2.h>
816 #  include <GLES2/gl2ext.h>
817 # endif
818 # ifdef __APPLE__
819 #  include <OpenGL/OpenGL.h>
820 #  include <OpenGL/gl.h>
821 #  if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
822 #   define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
823 #   include <OpenGL/gl3.h>
824 #  endif
825 # else
826 #  include <GL/gl.h>
827 #  if __WIN32__ || _WIN32
828 #   include <GL/glext.h>
829 #  endif
830 # endif
831 "
832   AC_MSG_CHECKING([whether it is possible to include both GL and GLES2 headers])
833   save_CPPFLAGS="$CPPFLAGS"
834   CPPFLAGS="$CPPFLAGS $ERROR_CFLAGS"
835   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$GL_INCLUDES]], [[
836     #if !defined(GL_FALSE)
837     #error Failed to include GL headers
838     #endif
839     ]])],[ AC_MSG_RESULT(yes)
840     ],[AC_MSG_RESULT(no)
841     if test "x$NEED_GLES2" = "xyes"; then
842       if test "x$NEED_GL" = "xyes"; then
843         AC_MSG_ERROR([Cannot seem to include both GL and GLES2 headers. Try disabling one API])
844       fi
845       AC_MSG_WARN([Disabling Desktop GL support])
846       HAVE_GL=no
847       USE_OPENGL=no
848     else
849       AC_MSG_WARN([Disabling GL|ES 2.0 support])
850       HAVE_GLES2=no
851     fi
852   ])
853   CPPFLAGS="$save_CPPFLAGS"
854 fi
855
856 #dnl Check for OpenGL
857 echo host is $host
858 case $host in
859   *-android*)
860     if test "x$NEED_WGL" = "xyes"; then
861       AC_MSG_ERROR([WGL is not available on Android])
862     fi
863     if test "x$NEED_GLX" = "xyes"; then
864       AC_MSG_ERROR([GLX is not available on Android])
865     fi
866     if test "x$NEED_GL" = "xyes"; then
867       AC_MSG_ERROR([GL is not available on Android])
868     fi
869     if test "x$NEED_X11" = "xyes"; then
870       AC_MSG_ERROR([X11 is not available on Android])
871     fi
872     if test "x$NEED_COCOA" = "xyes"; then
873       AC_MSG_ERROR([Cocoa is not available on Android])
874     fi
875
876     dnl OpenGL|ES 2.0
877     if test "x$HAVE_GLES2" = "xyes"; then
878       if test "x$NEED_GLES2" != "xno"; then
879         GL_LIBS="$GL_LIBS -lGLESv2"
880         USE_GLES2=yes
881       fi
882     fi
883
884     dnl EGL
885     if test "x$HAVE_EGL" = "xyes"; then
886       if test "x$NEED_EGL" != "xno"; then
887         GL_LIBS="$GL_LIBS -lEGL"
888         USE_EGL=yes
889       fi
890     fi
891
892     if test "x$USE_EGL" != "xyes"; then
893       AC_MSG_ERROR([Need EGL on Android])
894     fi
895
896     if test "x$USE_GLES2" != "xyes"; then
897       AC_MSG_ERROR([Need OpenGL|ES 2.0 on Android])
898     fi
899
900     HAVE_WINDOW_ANDROID=yes
901     ;;
902   *-linux* | *-cygwin* | *-solaris* | *-netbsd* | *-freebsd* | *-openbsd* | *-kfreebsd* | *-dragonflybsd* | *-gnu* )
903     if test "x$NEED_WGL" = "xyes"; then
904       AC_MSG_ERROR([WGL is not available on unix])
905     fi
906
907     if test "x$HAVE_X" = "xno"; then
908       if test "x$HAVE_WAYLAND_EGL" = "xno"; then
909         AC_MSG_WARN([X or Wayland is required for OpenGL support])
910       fi
911     fi
912
913     dnl check Desktop OpenGL
914     if test "x$HAVE_GL" = "xyes"; then
915       if test "x$NEED_GL" != "xno"; then
916         GL_LIBS="$GL_LIBS -lGL"
917       fi
918     fi
919
920     dnl OpenGL|ES 2.0
921     if test "x$HAVE_GLES2" = "xyes"; then
922       if test "x$NEED_GLES2" != "xno"; then
923         GL_LIBS="$GL_LIBS -lGLESv2"
924         USE_GLES2=yes
925       fi
926     fi
927
928     if test "x$HAVE_X" = "xyes" -a "x$HAVE_EGL_RPI" = "xno"; then
929       if test "x$NEED_X11" != "xno"; then
930         GL_LIBS="$GL_LIBS $X_LIBS"
931         GL_CFLAGS="$GL_CFLAGS $X_CFLAGS"
932         HAVE_WINDOW_X11=yes
933       fi
934     fi
935
936     if test "x$HAVE_WAYLAND_EGL" = "xyes"; then
937       if test "x$NEED_EGL" = "xno" -o "x$HAVE_EGL" = "xno"; then
938         AC_MSG_WARN([EGL is required by the Wayland backend for OpenGL support])
939       else
940         if test "x$NEED_WAYLAND_EGL" != "xno"; then
941           HAVE_WINDOW_WAYLAND=yes
942           GL_LIBS="$GL_LIBS $WAYLAND_EGL_LIBS"
943           GL_CFLAGS="$GL_CFLAGS $WAYLAND_EGL_CFLAGS"
944         fi
945       fi
946     fi
947
948     if test "x$HAVE_EGL_RPI" = "xyes"; then
949       if test "x$NEED_DISPMANX" != "xno"; then
950         HAVE_WINDOW_DISPMANX=yes
951         USE_EGL=yes
952       fi
953     fi
954
955     dnl EGL
956     if test "x$HAVE_EGL" = "xno"; then
957       if test "x$HAVE_GL" = "xno"; then
958         AC_MSG_WARN([Building requires either EGL or GLX for OpenGL support])
959       fi
960     else
961       if test "x$NEED_EGL" != "xno"; then
962         if test "x$HAVE_WINDOW_WAYLAND" = "xyes" -o "x$HAVE_WINDOW_X11" = "xyes" -o "x$HAVE_WINDOW_DISPMANX" = "xyes"; then
963           GL_LIBS="$GL_LIBS -lEGL $EGL_LIBS"
964           GL_CFLAGS="$GL_CFLAGS $EGL_CFLAGS"
965           USE_EGL=yes
966         fi
967       fi
968     fi
969     ;;
970   *-darwin*)
971     if test "x$HAVE_IOS" = "xyes"; then
972       if test "x$NEED_WGL" = "xyes"; then
973         AC_MSG_ERROR([WGL is not available on iOS])
974       fi
975       if test "x$NEED_GLX" = "xyes"; then
976         AC_MSG_ERROR([GLX is not available on iOS])
977       fi
978       if test "x$NEED_GL" = "xyes"; then
979         AC_MSG_ERROR([GL is not available on iOS])
980       fi
981       if test "x$NEED_X11" = "xyes"; then
982         AC_MSG_ERROR([X11 is not available on iOS])
983       fi
984       if test "x$NEED_COCOA" = "xyes"; then
985         AC_MSG_ERROR([Cocoa is not available on iOS])
986       fi
987       if test "x$NEED_EGL" = "xyes"; then
988         AC_MSG_ERROR([EGL is not available on iOS])
989       fi
990
991       GL_LIBS="$LIBS -framework OpenGLES -framework QuartzCore -framework UIKit -framework CoreGraphics -framework CoreFoundation -framework Foundation"
992       GL_CFLAGS="$GL_CFLAGS"
993       USE_GLES2=yes
994       USE_EAGL=yes
995       HAVE_WINDOW_EAGL=yes
996
997       ac_cv_type_GLsizeiptr=yes
998       ac_cv_type_GLintptr=yes
999       ac_cv_type_GLchar=yes
1000     else
1001       dnl Only osx supports cocoa.
1002       if test "x$NEED_WGL" = "xyes"; then
1003         AC_MSG_ERROR([WGL is not available on Mac OS X])
1004       fi
1005
1006       if test "x$NEED_COCOA" != "xno"; then
1007         GL_LIBS="$LIBS -framework OpenGL -framework Cocoa -framework QuartzCore -framework CoreFoundation"
1008         GL_CFLAGS="$GL_CFLAGS"
1009         USE_COCOA=yes
1010         HAVE_WINDOW_COCOA=yes
1011         USE_OPENGL=yes
1012       fi
1013
1014       if test "x$USE_GLX" = "xyes"; then
1015         if test "x$HAVE_X" = "xyes"; then
1016           if test "x$NEED_X11" != "xno"; then
1017             GL_LIBS="$GL_LIBS $X_LIBS"
1018             GL_CFLAGS="$GL_CFLAGS $X_CFLAGS"
1019             HAVE_WINDOW_X11=yes
1020           fi
1021         fi
1022
1023         if test "x$HAVE_GL" = "xyes"; then
1024           if test "x$NEED_GL" != "xno"; then
1025             GL_LIBS="$GL_LIBS -lGL"
1026           fi
1027           USE_OPENGL=yes
1028         fi
1029       fi
1030
1031       if test "x$HAVE_EGL" = "xyes"; then
1032         if test "x$NEED_EGL" != "xno"; then
1033           if test "x$HAVE_WINDOW_X11" = "xyes"; then
1034             GL_LIBS="$GL_LIBS -lEGL $EGL_LIBS"
1035             GL_CFLAGS="$GL_CFLAGS $EGL_CFLAGS"
1036             USE_EGL=yes
1037           fi
1038         fi
1039       fi
1040
1041       dnl OpenGL|ES 2.0
1042       if test "x$HAVE_GLES2" = "xyes"; then
1043         if test "x$NEED_GLES2" != "xno"; then
1044           GL_LIBS="$GL_LIBS -lGLESv2"
1045           USE_GLES2=yes
1046         fi
1047       fi
1048     fi
1049     ;;
1050   *-mingw32*)
1051     if test "x$NEED_GLX" = "xyes"; then
1052       AC_MSG_ERROR([GLX is not available on Windows])
1053     fi
1054     if test "x$NEED_GLES2" = "xyes"; then
1055       AC_MSG_ERROR([OpenGL|ES 2.0 is not supported on your platform yet])
1056     fi
1057
1058     if test "x$HAVE_GL" = "xyes"; then
1059       if test "x$NEED_GL" != "xno"; then
1060         if test "x$HAVE_WGL" = "xyes"; then
1061           if test "$NEED_WGL" != "xno"; then
1062             GL_LIBS="$GL_LIBS -lgdi32 -lopengl32"
1063             HAVE_WINDOW_WIN32=yes
1064             USE_OPENGL=yes
1065             USE_WGL=yes
1066           fi
1067         fi
1068       fi
1069     fi
1070     ;;
1071   *)
1072     AC_MSG_WARN([Don't know how to check for OpenGL on your platform.])
1073     ;;
1074 esac
1075
1076 GL_PLATFORMS=
1077 GL_WINDOWS=
1078 GL_APIS=
1079 GL_CONFIG_DEFINES=
1080
1081 dnl APIs
1082
1083 GST_GL_HAVE_OPENGL=0
1084 GST_GL_HAVE_GLES2=0
1085 GST_GL_HAVE_GLES3=0
1086
1087 if test "x$USE_OPENGL" = "xyes"; then
1088   GL_APIS="gl $GL_APIS"
1089   GST_GL_HAVE_OPENGL=1
1090 fi
1091 if test "x$USE_GLES2" = "xyes"; then
1092   GL_APIS="gles2 $GL_APIS"
1093   GST_GL_HAVE_GLES2=1
1094 fi
1095
1096 GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES
1097 #define GST_GL_HAVE_OPENGL $GST_GL_HAVE_OPENGL
1098 #define GST_GL_HAVE_GLES2 $GST_GL_HAVE_GLES2
1099 #define GST_GL_HAVE_GLES3 $GST_GL_HAVE_GLES3
1100 "
1101
1102 dnl WINDOW's
1103
1104 GST_GL_HAVE_WINDOW_X11=0
1105 GST_GL_HAVE_WINDOW_COCOA=0
1106 GST_GL_HAVE_WINDOW_WIN32=0
1107 GST_GL_HAVE_WINDOW_WAYLAND=0
1108 GST_GL_HAVE_WINDOW_ANDROID=0
1109 GST_GL_HAVE_WINDOW_DISPMANX=0
1110 GST_GL_HAVE_WINDOW_EAGL=0
1111
1112 if test "x$HAVE_WINDOW_X11" = "xyes"; then
1113   GL_WINDOWS="x11 $GL_WINDOWS"
1114   GST_GL_HAVE_WINDOW_X11=1
1115 fi
1116 if test "x$HAVE_WINDOW_COCOA" = "xyes"; then
1117   GL_WINDOWS="cocoa $GL_WINDOWS"
1118   GST_GL_HAVE_WINDOW_COCOA=1
1119 fi
1120 if test "x$HAVE_WINDOW_WIN32" = "xyes"; then
1121   GL_WINDOWS="win32 $GL_WINDOWS"
1122   GST_GL_HAVE_WINDOW_WIN32=1
1123 fi
1124 if test "x$HAVE_WINDOW_WAYLAND" = "xyes"; then
1125   GL_WINDOWS="wayland $GL_WINDOWS"
1126   GST_GL_HAVE_WINDOW_WAYLAND=1
1127 fi
1128 if test "x$HAVE_WINDOW_ANDROID" = "xyes"; then
1129   GL_WINDOWS="android $GL_WINDOWS"
1130   GST_GL_HAVE_WINDOW_ANDROID=1
1131 fi
1132 if test "x$HAVE_WINDOW_DISPMANX" = "xyes"; then
1133   GL_WINDOWS="dispmanx $GL_WINDOWS"
1134   GST_GL_HAVE_WINDOW_DISPMANX=1
1135 fi
1136 if test "x$HAVE_WINDOW_EAGL" = "xyes"; then
1137   GL_WINDOWS="eagl $GL_WINDOWS"
1138   GST_GL_HAVE_WINDOW_EAGL=1
1139 fi
1140
1141 GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES
1142 #define GST_GL_HAVE_WINDOW_X11 $GST_GL_HAVE_WINDOW_X11
1143 #define GST_GL_HAVE_WINDOW_COCOA $GST_GL_HAVE_WINDOW_COCOA
1144 #define GST_GL_HAVE_WINDOW_WIN32 $GST_GL_HAVE_WINDOW_WIN32
1145 #define GST_GL_HAVE_WINDOW_WAYLAND $GST_GL_HAVE_WINDOW_WAYLAND
1146 #define GST_GL_HAVE_WINDOW_ANDROID $GST_GL_HAVE_WINDOW_ANDROID
1147 #define GST_GL_HAVE_WINDOW_DISPMANX $GST_GL_HAVE_WINDOW_DISPMANX
1148 #define GST_GL_HAVE_WINDOW_EAGL $GST_GL_HAVE_WINDOW_EAGL
1149 "
1150
1151 dnl PLATFORM's
1152
1153 GST_GL_HAVE_PLATFORM_EGL=0
1154 GST_GL_HAVE_PLATFORM_GLX=0
1155 GST_GL_HAVE_PLATFORM_WGL=0
1156 GST_GL_HAVE_PLATFORM_CGL=0
1157 GST_GL_HAVE_PLATFORM_EAGL=0
1158
1159 if test "x$USE_EGL" = "xyes"; then
1160   GL_PLATFORMS="egl $GL_PLATFORMS"
1161   GST_GL_HAVE_PLATFORM_EGL=1
1162 fi
1163 if test "x$USE_GLX" = "xyes"; then
1164   GL_PLATFORMS="glx $GL_PLATFORMS"
1165   GST_GL_HAVE_PLATFORM_GLX=1
1166 fi
1167 if test "x$USE_WGL" = "xyes"; then
1168   GL_PLATFORMS="wgl $GL_PLATFORMS"
1169   GST_GL_HAVE_PLATFORM_WGL=1
1170 fi
1171 if test "x$USE_COCOA" = "xyes"; then
1172   GL_PLATFORMS="cgl $GL_PLATFORMS"
1173   GST_GL_HAVE_PLATFORM_CGL=1
1174 fi
1175 if test "x$USE_EAGL" = "xyes"; then
1176   GL_PLATFORMS="eagl $GL_PLATFORMS"
1177   GST_GL_HAVE_PLATFORM_EAGL=1
1178 fi
1179
1180 GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES
1181 #define GST_GL_HAVE_PLATFORM_EGL $GST_GL_HAVE_PLATFORM_EGL
1182 #define GST_GL_HAVE_PLATFORM_GLX $GST_GL_HAVE_PLATFORM_GLX
1183 #define GST_GL_HAVE_PLATFORM_WGL $GST_GL_HAVE_PLATFORM_WGL
1184 #define GST_GL_HAVE_PLATFORM_CGL $GST_GL_HAVE_PLATFORM_CGL
1185 #define GST_GL_HAVE_PLATFORM_EAGL $GST_GL_HAVE_PLATFORM_EAGL
1186 "
1187
1188 dnl Check for no platforms/window systems
1189 if test "x$GL_APIS" = "x"; then
1190   AC_MSG_WARN([Either OpenGL or OpenGL|ES is required for OpenGL support])
1191 fi
1192 if test "x$GL_PLATFORMS" = "x"; then
1193   AC_MSG_WARN([Could not find any OpenGL platforms to use such as CGL, WGL or GLX])
1194 fi
1195 if test "x$GL_WINDOWS" = "x"; then
1196   AC_MSG_WARN([Could not find any window systems to use such as Cocoa, Win32API or X11])
1197 fi
1198
1199 if test "x$GL_APIS" = "x" -o "x$GL_PLATFORMS" = "x" -o "x$GL_WINDOWS" = "x"; then
1200   GL_LIBS=
1201   GL_CFLAGS=
1202   GL_OBJCFLAGS=
1203   USE_OPENGL=no
1204   USE_GLES2=no
1205   USE_GLX=no
1206   USE_EGL=no
1207   USE_WGL=no
1208   USE_COCOA=no
1209   USE_EGL_MALI=no
1210   USE_EGL_RPI=no
1211   USE_EAGL=no
1212
1213   HAVE_WINDOW_X11=no
1214   HAVE_WINDOW_WIN32=no
1215   HAVE_WINDOW_DISPMANX=no
1216   HAVE_WINDOW_WAYLAND=no
1217   HAVE_WINDOW_ANDROID=no
1218   HAVE_WINDOW_COCOA=no
1219   HAVE_WINDOW_EAGL=no
1220 fi
1221
1222 AC_SUBST(GL_LIBS)
1223 AC_SUBST(GL_CFLAGS)
1224 AC_SUBST(GL_OBJCFLAGS)
1225 AC_SUBST(USE_OPENGL)
1226 AC_SUBST(USE_GLES2)
1227
1228 AM_CONDITIONAL(HAVE_WINDOW_X11, test "x$HAVE_WINDOW_X11" = "xyes")
1229 AM_CONDITIONAL(HAVE_WINDOW_COCOA, test "x$HAVE_WINDOW_COCOA" = "xyes")
1230 AM_CONDITIONAL(HAVE_WINDOW_WIN32, test "x$HAVE_WINDOW_WIN32" = "xyes")
1231 AM_CONDITIONAL(HAVE_WINDOW_DISPMANX, test "x$HAVE_WINDOW_DISPMANX" = "xyes")
1232 AM_CONDITIONAL(HAVE_WINDOW_WAYLAND, test "x$HAVE_WINDOW_WAYLAND" = "xyes")
1233 AM_CONDITIONAL(HAVE_WINDOW_ANDROID, test "x$HAVE_WINDOW_ANDROID" = "xyes")
1234 AM_CONDITIONAL(HAVE_WINDOW_EAGL, test "x$HAVE_WINDOW_EAGL" = "xyes")
1235
1236 AM_CONDITIONAL(USE_OPENGL, test "x$USE_OPENGL" = "xyes")
1237 AM_CONDITIONAL(USE_GLES2, test "x$USE_GLES2" = "xyes")
1238 AM_CONDITIONAL(USE_GLX, test "x$USE_GLX" = "xyes")
1239 AM_CONDITIONAL(USE_EGL, test "x$USE_EGL" = "xyes")
1240 AM_CONDITIONAL(USE_WGL, test "x$USE_WGL" = "xyes")
1241 AM_CONDITIONAL(USE_COCOA, test "x$USE_COCOA" = "xyes")
1242 AM_CONDITIONAL(USE_EGL_MALI, test "x$USE_EGL_MALI" = "xyes")
1243 AM_CONDITIONAL(USE_EGL_RPI, test "x$USE_EGL_RPI" = "xyes")
1244 AM_CONDITIONAL(USE_EAGL, test "x$USE_EAGL" = "xyes")
1245
1246 AM_CONDITIONAL(HAVE_GST_GL, test "x$USE_OPENGL" = "xyes" -o "x$USE_GLES2" = "xyes")
1247
1248 dnl Check for some types that are not always present
1249 GL_INCLUDES=""
1250 if test "x$USE_GLES2" = "xyes"; then
1251   GL_INCLUDES="$GL_INCLUDES
1252 #ifndef GL_GLEXT_PROTOTYPES
1253 #define GL_GLEXT_PROTOTYPES 1
1254 #endif
1255 # ifdef HAVE_IOS
1256 #  include <OpenGLES/ES2/gl.h>
1257 #  include <OpenGLES/ES2/glext.h>
1258 # else
1259 #  include <GLES2/gl2.h>
1260 #  include <GLES2/gl2ext.h>
1261 # endif
1262 "
1263 fi
1264
1265 if test "x$USE_OPENGL" = "xyes"; then
1266   GL_INCLUDES="$GL_INCLUDES
1267 # ifdef __APPLE__
1268 #  include <OpenGL/OpenGL.h>
1269 #  include <OpenGL/gl.h>
1270 # else
1271 #  include <GL/gl.h>
1272 #  if __WIN32__ || _WIN32
1273 #   include <GL/glext.h>
1274 #  endif
1275 # endif
1276 "
1277 fi
1278
1279 GST_GL_HAVE_GLEGLIMAGEOES=0
1280 GST_GL_HAVE_GLCHAR=0
1281 GST_GL_HAVE_GLSIZEIPTR=0
1282 GST_GL_HAVE_GLINTPTR=0
1283 GST_GL_HAVE_GLSYNC=0
1284 GST_GL_HAVE_GLUINT64=0
1285
1286 old_CFLAGS=$CFLAGS
1287 CFLAGS="$GL_CFLAGS $CFLAGS"
1288
1289 AC_CHECK_TYPES(GLeglImageOES, [], [], [[$GL_INCLUDES]])
1290 if test "x$ac_cv_type_GLeglImageOES" = "xyes"; then
1291   GST_GL_HAVE_GLEGLIMAGEOES=1
1292 fi
1293
1294 AC_CHECK_TYPES(GLchar, [], [], [[$GL_INCLUDES]])
1295 if test "x$ac_cv_type_GLchar" = "xyes"; then
1296   GST_GL_HAVE_GLCHAR=1
1297 fi
1298
1299 AC_CHECK_TYPES(GLsizeiptr, [], [], [[$GL_INCLUDES]])
1300 if test "x$ac_cv_type_GLsizeiptr" = "xyes"; then
1301   GST_GL_HAVE_GLSIZEIPTR=1
1302 fi
1303
1304 AC_CHECK_TYPES(GLintptr, [], [], [[$GL_INCLUDES]])
1305 if test "x$ac_cv_type_GLintptr" = "xyes"; then
1306   GST_GL_HAVE_GLINTPTR=1
1307 fi
1308
1309 AC_CHECK_TYPES(GLsync, [], [], [[$GL_INCLUDES]])
1310 if test "x$ac_cv_type_GLsync" = "xyes"; then
1311   GST_GL_HAVE_GLSYNC=1
1312 fi
1313
1314 AC_CHECK_TYPES(GLuint64, [], [], [[$GL_INCLUDES]])
1315 if test "x$ac_cv_type_GLuint64" = "xyes"; then
1316   GST_GL_HAVE_GLUINT64=1
1317 fi
1318
1319 CFLAGS=$old_CFLAGS
1320
1321 GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES
1322 #define GST_GL_HAVE_GLEGLIMAGEOES $GST_GL_HAVE_GLEGLIMAGEOES
1323 #define GST_GL_HAVE_GLCHAR $GST_GL_HAVE_GLCHAR
1324 #define GST_GL_HAVE_GLSIZEIPTR $GST_GL_HAVE_GLSIZEIPTR
1325 #define GST_GL_HAVE_GLINTPTR $GST_GL_HAVE_GLINTPTR
1326 #define GST_GL_HAVE_GLSYNC $GST_GL_HAVE_GLSYNC
1327 #define GST_GL_HAVE_GLUINT64 $GST_GL_HAVE_GLUINT64
1328 "
1329
1330 AC_CONFIG_COMMANDS([gst-libs/gst/gl/gstglconfig.h], [
1331         outfile=gstglconfig.h-tmp
1332         cat > $outfile <<\_______EOF
1333 /* gstglconfig.h
1334  *
1335  * This is a generated file.  Please modify `configure.ac'
1336  */
1337
1338 #ifndef __GST_GL_CONFIG_H__
1339 #define __GST_GL_CONFIG_H__
1340
1341 #include <gst/gst.h>
1342
1343 G_BEGIN_DECLS
1344
1345 _______EOF
1346
1347         cat >>$outfile <<_______EOF
1348 $gl_config_defines
1349 _______EOF
1350
1351         cat >>$outfile <<_______EOF
1352
1353 G_END_DECLS
1354
1355 #endif  /* __GST_GL_CONFIG_H__ */
1356 _______EOF
1357
1358
1359         if cmp -s $outfile gst-libs/gst/gl/gstglconfig.h; then
1360           AC_MSG_NOTICE([gst-libs/gst/gl/gstglconfig.h is unchanged])
1361           rm -f $outfile
1362         else
1363           mv $outfile gst-libs/gst/gl/gstglconfig.h
1364         fi
1365 ],[
1366 gl_config_defines='$GL_CONFIG_DEFINES'
1367 ])
1368
1369 dnl libpng is optional
1370 PKG_CHECK_MODULES(LIBPNG, libpng >= 1.0, HAVE_PNG=yes, HAVE_PNG=no)
1371 if test "x$HAVE_PNG" = "xyes"; then
1372   AC_DEFINE(HAVE_PNG, [1] , [Use libpng])
1373 fi
1374 AC_SUBST(HAVE_PNG)
1375 AC_SUBST(LIBPNG_LIBS)
1376 AC_SUBST(LIBPNG_CFLAGS)
1377 AM_CONDITIONAL(HAVE_PNG, test "x$HAVE_PNG" = "xyes")
1378
1379 dnl libjpeg is optional
1380 AC_ARG_WITH(jpeg-mmx, [  --with-jpeg-mmx, path to MMX'ified JPEG library])
1381 OLD_LIBS="$LIBS"
1382 if test x$with_jpeg_mmx != x; then
1383   LIBS="$LIBS -L$with_jpeg_mmx"
1384 fi
1385 AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
1386 JPEG_LIBS="$LIBS -ljpeg-mmx"
1387 LIBS="$OLD_LIBS"
1388 if test x$HAVE_JPEG != xyes; then
1389   JPEG_LIBS="-ljpeg"
1390   AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
1391 fi
1392
1393 if test x$HAVE_JPEG = xyes; then
1394   AC_DEFINE(HAVE_JPEG, [1], [Use libjpeg])
1395 else
1396   AC_DEFINE(HAVE_JPEG, [0], [Use libjpeg])
1397   JPEG_LIBS=
1398 fi
1399 AC_SUBST(JPEG_LIBS)
1400 AC_SUBST(HAVE_JPEG)
1401 AM_CONDITIONAL(HAVE_JPEG, test "x$HAVE_JPEG" = "xyes")
1402
1403
1404 dnl *** sys plug-ins ***
1405
1406 dnl *** alsa ***
1407 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
1408 AG_GST_CHECK_FEATURE(ALSA, [ALSA], alsa, [
1409   PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
1410     HAVE_ALSA="yes"
1411     AC_SUBST(ALSA_CFLAGS)
1412     AC_SUBST(ALSA_LIBS)
1413   ], [
1414     AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
1415   ])
1416 ])
1417
1418 dnl DirectSound
1419 translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
1420 AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], directsoundsrc, [
1421   HAVE_DIRECTSOUND="no"
1422   save_CFLAGS="$CFLAGS"
1423   save_LDFLAGS="$LDFLAGS"
1424   save_LIBS="$LIBS"
1425   CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
1426   LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
1427   LIBS="$LIBS -lwinmm -ldsound -ldxerr9 -luser32"
1428   AC_MSG_CHECKING(for DirectSound LDFLAGS)
1429   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1430 #include <windows.h>
1431 #include <dxerr9.h>
1432 #include <dsound.h>
1433 #include <mmsystem.h>
1434 ]], [[
1435   DXGetErrorString9 (0);
1436   DirectSoundCreate(NULL, NULL, NULL);
1437 ]])],
1438     [HAVE_DIRECTSOUND="yes"],
1439     [HAVE_DIRECTSOUND="no"])
1440   AC_MSG_RESULT($HAVE_DIRECTSOUND)
1441   CFLAGS=$save_CFLAGS
1442   LDFLAGS=$save_LDFLAGS
1443   LIBS=$save_LIBS
1444
1445   if test "x$HAVE_DIRECTSOUND" = "xyes";  then
1446     dnl this is much more than we want
1447     DIRECTSOUND_LIBS="-lwinmm -ldsound -ldxerr9 -luser32"
1448     AC_SUBST(DIRECTX_CFLAGS)
1449     AC_SUBST(DIRECTX_LDFLAGS)
1450     AC_SUBST(DIRECTSOUND_LIBS)
1451   fi
1452   AC_SUBST(HAVE_DIRECTSOUND)
1453 ])
1454
1455 dnl WASAPI
1456 translit(dnm, m, l) AM_CONDITIONAL(USE_WASAPI, true)
1457 AG_GST_CHECK_FEATURE(WASAPI, [WASAPI plug-in], wasapi, [
1458   HAVE_WASAPI="no"
1459   save_CFLAGS="$CFLAGS"
1460   save_LDFLAGS="$LDFLAGS"
1461   save_LIBS="$LIBS"
1462   CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
1463   LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
1464   LIBS="$LIBS -lole32 -lwinmm -lksuser"
1465   AC_MSG_CHECKING(for WASAPI LDFLAGS)
1466   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1467 #include <windows.h>
1468 #include <stdio.h>
1469 #include <mmsystem.h>
1470 #include <mmdeviceapi.h>
1471 ]], [[
1472 int main ()
1473 {
1474     HRESULT hr = S_OK;
1475
1476     hr = CoInitialize(NULL);
1477     if (FAILED(hr)) {
1478         printf("CoInitialize failed: hr = 0x%08x", hr);
1479         return __LINE__;
1480     }
1481
1482         int result = 0;
1483     // result = do_everything(argc, argv);
1484
1485     CoUninitialize();
1486     return result;
1487 }
1488 ]])],
1489     [HAVE_WASAPI="yes"],
1490     [HAVE_WASAPI="no"])
1491   AC_MSG_RESULT($HAVE_WASAPI)
1492   CFLAGS=$save_CFLAGS
1493   LDFLAGS=$save_LDFLAGS
1494   LIBS=$save_LIBS
1495
1496   if test "x$HAVE_WASAPI" = "xyes";  then
1497     WASAPI_LIBS="-lole32 -lwinmm -lksuser"
1498     AC_SUBST(WASAPI_LIBS)
1499   fi
1500   AC_SUBST(HAVE_WASAPI)
1501 ])
1502
1503 dnl Direct3D
1504 translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECT3D, true)
1505 AG_GST_CHECK_FEATURE(DIRECT3D, [Direct3D plug-in], direct3dsink, [
1506   HAVE_DIRECT3D="no"
1507   save_CFLAGS="$CFLAGS"
1508   save_LDFLAGS="$LDFLAGS"
1509   save_LIBS="$LIBS"
1510   CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
1511   LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
1512   LIBS="$LIBS -ld3d9 -lgdi32"
1513   AC_MSG_CHECKING(for Direct3D LDFLAGS)
1514   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1515 #include <windows.h>
1516 #include <d3d9.h>
1517 ]], [[
1518   Direct3DCreate9(D3D_SDK_VERSION);
1519 ]])],
1520     [HAVE_DIRECT3D="yes"],
1521     [HAVE_DIRECT3D="no"])
1522   AC_MSG_RESULT($HAVE_DIRECT3D)
1523   CFLAGS=$save_CFLAGS
1524   LDFLAGS=$save_LDFLAGS
1525   LIBS=$save_LIBS
1526
1527   if test "x$HAVE_DIRECT3D" = "xyes";  then
1528     DIRECT3D_LIBS="-ld3d9 -lgdi32"
1529     AC_SUBST(DIRECT3D_LIBS)
1530   fi
1531   AC_SUBST(HAVE_DIRECT3D)
1532 ])
1533
1534 dnl winscreencap
1535 translit(dnm, m, l) AM_CONDITIONAL(USE_WINSCREENCAP, true)
1536 AG_GST_CHECK_FEATURE(WINSCREENCAP, [winscreencap plug-in], winscreencap, [
1537   HAVE_WINSCREENCAP="no"
1538   save_CFLAGS="$CFLAGS"
1539   save_LDFLAGS="$LDFLAGS"
1540   save_LIBS="$LIBS"
1541   CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
1542   LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
1543   LIBS="$LIBS -ld3d9 -lgdi32"
1544   AC_MSG_CHECKING(for Direct3D LDFLAGS)
1545   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1546 #include <windows.h>
1547 #include <d3d9.h>
1548 ]], [[
1549   Direct3DCreate9(D3D_SDK_VERSION);
1550 ]])],
1551     [HAVE_WINSCREENCAP="yes"],
1552     [HAVE_WINSCREENCAP="no"])
1553   AC_MSG_RESULT($HAVE_WINSCREENCAP)
1554   CFLAGS=$save_CFLAGS
1555   LDFLAGS=$save_LDFLAGS
1556   LIBS=$save_LIBS
1557
1558   if test "x$HAVE_WINSCREENCAP" = "xyes";  then
1559     WINSCREENCAP_LIBS="-ld3d9 -lgdi32"
1560     AC_SUBST(WINSCREENCAP_LIBS)
1561   fi
1562   AC_SUBST(HAVE_WINSCREENCAP)
1563 ])
1564
1565 dnl winks
1566 translit(dnm, m, l) AM_CONDITIONAL(USE_WINKS, true)
1567 AG_GST_CHECK_FEATURE(WINKS, [Winks plug-in], winks, [
1568   HAVE_WINKS="no"
1569   save_CFLAGS="$CFLAGS"
1570   save_LDFLAGS="$LDFLAGS"
1571   save_LIBS="$LIBS"
1572   CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
1573   LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
1574   LIBS="$LIBS -lole32 -luuid -lstrmiids"
1575   AC_MSG_CHECKING(for Winks LDFLAGS)
1576   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1577 #include <windows.h>
1578 #include <strmif.h>
1579 #include <uuids.h>
1580 ]], [[
1581 int main () {
1582   IGraphBuilder *pGraph = NULL;
1583   HRESULT hr = CoInitialize(NULL);
1584   hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
1585                         &IID_IGraphBuilder, (void **)&pGraph);
1586
1587   return 0;
1588 }
1589 ]])],
1590     [HAVE_WINKS="yes"],
1591     [HAVE_WINKS="no"])
1592   AC_MSG_RESULT($HAVE_WINKS)
1593   CFLAGS=$save_CFLAGS
1594   LDFLAGS=$save_LDFLAGS
1595   LIBS=$save_LIBS
1596
1597   if test "x$HAVE_WINKS" = "xyes";  then
1598     dnl this is much more than we want
1599     WINKS_LIBS="-ldxguid -lole32 -luuid -lstrmiids -lksuser -lsetupapi"
1600     AC_SUBST(DIRECTX_CFLAGS)
1601     AC_SUBST(DIRECTX_LDFLAGS)
1602     AC_SUBST(WINKS_LIBS)
1603   fi
1604   AC_SUBST(HAVE_WINKS)
1605 ])
1606
1607 dnl *** Android Media ***
1608 translit(dnm, m, l) AM_CONDITIONAL(USE_ANDROID_MEDIA, true)
1609 HAVE_ANDROID_MEDIA="no"
1610 AG_GST_CHECK_FEATURE(ANDROID_MEDIA, [Android Media], androidmedia, [
1611   case "$host" in
1612     *android*)
1613       AC_CHECK_HEADER(jni.h, HAVE_ANDROID_MEDIA="yes", HAVE_ANDROID_MEDIA="no")
1614       ;;
1615     *)
1616       HAVE_ANDROID_MEDIA="no"
1617       ;;
1618   esac
1619 ])
1620
1621 dnl *** AppleMedia (OS X and iOS) ***
1622 translit(dnm, m, l) AM_CONDITIONAL(USE_APPLE_MEDIA, true)
1623 HAVE_APPLE_MEDIA="no"
1624 dnl SystemConfiguration.h is common to OS X and iOS, so we check for that
1625 AG_GST_CHECK_FEATURE(APPLE_MEDIA, [Apple video], applemedia, [
1626   AC_CHECK_HEADER(SystemConfiguration/SystemConfiguration.h, HAVE_APPLE_MEDIA="yes", HAVE_APPLE_MEDIA="no")
1627   dnl OSX 10.7 and earlier lack VideoToolbox/VideoToolbox.h
1628   if test "x$HAVE_IOS" = "xno"; then
1629     AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h,, HAVE_APPLE_MEDIA="no")
1630   fi
1631 ])
1632
1633 dnl in case header SystemConfiguration/SystemConfiguration.h is found on other platforms
1634 case "$host" in
1635   *-*darwin*)
1636     ;;
1637   *)
1638     HAVE_APPLE_MEDIA="no"
1639     ;;
1640 esac
1641
1642 dnl *** bluez ***
1643 translit(dnm, m, l) AM_CONDITIONAL(USE_BLUEZ, true)
1644 AG_GST_CHECK_FEATURE(BLUEZ, [Bluez], bluez, [
1645   PKG_CHECK_MODULES([BLUEZ5], [bluez >= 5.0], [
1646     PKG_CHECK_MODULES([GIO_UNIX], gio-unix-2.0 > 2.24, [
1647       AC_CHECK_PROG([GDBUS_CODEGEN],[gdbus-codegen],[gdbus-codegen])
1648       HAVE_BLUEZ=yes
1649       AC_DEFINE(HAVE_BLUEZ5,[1],[Bluez5 detected])
1650     ], [
1651       HAVE_BLUEZ=no
1652     ])
1653   ], [
1654     HAVE_BLUEZ=no
1655   ])
1656 ])
1657
1658 dnl *** OS/X AVCVideoServices ***
1659 translit(dnm, m, l) AM_CONDITIONAL(USE_AVC, true)
1660 HAVE_AVC="no"
1661 AG_GST_CHECK_FEATURE(AVC, [AVC Video Services], avcsrc, [
1662   AC_LANG_PUSH([C++])
1663   save_CPPFLAGS="$CPPFLAGS"
1664   CPPFLAGS="$CPPFLAGS -framework AVCVideoServices -framework CoreFoundation"
1665   save_LIBS="$LIBS"
1666   LIBS="$LIBS -framework AVCVideoServices -framework CoreFoundation"
1667   AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[HAVE_AVC=yes],[HAVE_AVC=no])
1668   LIBS=$save_LIBS
1669   CPPFLAGS=$save_CPPFLAGS
1670   AC_LANG_POP([C++])
1671 ])
1672 dnl in case header AVCVideoServices/AVCVideoServices.h is found on other platforms
1673 case "$host" in
1674   *-*darwin*)
1675     ;;
1676   *)
1677     HAVE_AVC="no"
1678     ;;
1679 esac
1680
1681 dnl check for shm_open (for shm plugin)
1682 translit(dnm, m, l) AM_CONDITIONAL(USE_SHM, true)
1683 AG_GST_CHECK_FEATURE(SHM, [POSIX shared memory source and sink], shm, [
1684     if test "x$HAVE_SYS_SOCKET_H" = "xyes"; then
1685         case $host in
1686         *-darwin* | *-macos10*)
1687             AC_DEFINE(HAVE_OSX,[1],[Apple Mac OS X operating system detected])
1688             HAVE_SHM=yes
1689             ;;
1690         *)
1691             AC_CHECK_LIB([rt], [shm_open],
1692                 AC_CHECK_DECL([MSG_NOSIGNAL], HAVE_SHM=yes, HAVE_SHM=no, [
1693                 #include <sys/socket.h>
1694                     ]),
1695                 HAVE_SHM=no)
1696             AC_SUBST(SHM_LIBS, "-lrt")
1697             ;;
1698         esac
1699     else
1700         HAVE_SHM=no
1701     fi
1702 ])
1703
1704 dnl check for Video CD
1705 translit(dnm, m, l) AM_CONDITIONAL(USE_VCD, true)
1706 AG_GST_CHECK_FEATURE(VCD, [Video CD], vcdsrc, [
1707   AC_CHECK_HEADER(linux/cdrom.h, HAVE_VCD="yes", HAVE_VCD="no")
1708 ])
1709
1710 dnl check for OpenSL ES
1711 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENSLES, true)
1712 AG_GST_CHECK_FEATURE(OPENSLES, [OpenSL ES], opensl, [
1713   AC_CHECK_HEADER(SLES/OpenSLES.h, HAVE_OPENSLES="yes", HAVE_OPENSLES="no")
1714 ])
1715
1716 dnl *** UVC H264 ***
1717 translit(dnm, m, l) AM_CONDITIONAL(USE_UVCH264, true)
1718 AG_GST_CHECK_FEATURE(UVCH264, [UVC H264], uvch264, [
1719   AC_CHECK_HEADER(linux/uvcvideo.h, HAVE_UVCVIDEO_H=yes, HAVE_UVCVIDEO_H=no)
1720   PKG_CHECK_MODULES(G_UDEV, gudev-1.0 , [
1721           AC_DEFINE([HAVE_GUDEV], 1, [Define if gudev is installed])
1722           HAVE_GUDEV="yes" ],
1723           [HAVE_GUDEV="no"])
1724   PKG_CHECK_MODULES(LIBUSB, libusb-1.0 , [
1725           AC_DEFINE([HAVE_LIBUSB], 1, [Define if libusb 1.x is installed])
1726           HAVE_LIBUSB="yes" ],
1727           [HAVE_LIBUSB="no"])
1728   if test "x$HAVE_UVCVIDEO_H" = "xyes" && \
1729      test "x$HAVE_GUDEV" = "xyes" && \
1730      test "x$HAVE_LIBUSB" = "xyes"; then
1731     HAVE_UVCH264=yes
1732   else
1733     HAVE_UVCH264=no
1734   fi
1735 ])
1736 AC_SUBST(LIBUDEV_CFLAGS)
1737 AC_SUBST(LIBUDEV_LIBS)
1738 AC_SUBST(LIBUSB_CFLAGS)
1739 AC_SUBST(LIBUSB_LIBS)
1740
1741
1742 dnl *** ext plug-ins ***
1743 dnl keep this list sorted alphabetically !
1744
1745 if test "x$BUILD_EXTERNAL" = "xyes"; then
1746
1747 dnl *** assrender ***
1748 translit(dnm, m, l) AM_CONDITIONAL(USE_ASSRENDER, true)
1749 AG_GST_CHECK_FEATURE(ASSRENDER, [ASS/SSA renderer], assrender, [
1750   PKG_CHECK_MODULES(ASSRENDER, libass >= 0.9.4, [
1751     HAVE_ASSRENDER="yes" ], [
1752     HAVE_ASSRENDER="no"
1753   ])
1754 ])
1755 AC_SUBST(ASSRENDER_CFLAGS)
1756 AC_SUBST(ASSRENDER_LIBS)
1757
1758 dnl *** vo-amrwbenc ***
1759 translit(dnm, m, l) AM_CONDITIONAL(USE_VOAMRWBENC, true)
1760 AG_GST_CHECK_FEATURE(VOAMRWBENC, [vo-amrwbenc library], vo-amrwbenc, [
1761   AG_GST_PKG_CHECK_MODULES(VOAMRWBENC, vo-amrwbenc >= 0.1.0)
1762 ])
1763
1764 dnl *** vo-aacenc ***
1765 translit(dnm, m, l) AM_CONDITIONAL(USE_VOAACENC, true)
1766 AG_GST_CHECK_FEATURE(VOAACENC, [vo-aacenc library], vo-aacenc, [
1767   AG_GST_PKG_CHECK_MODULES(VOAACENC, vo-aacenc >= 0.1.0)
1768 ])
1769
1770 dnl *** apexsink ***
1771 translit(dnm, m, l) AM_CONDITIONAL(USE_APEXSINK, true)
1772 AG_GST_CHECK_FEATURE(APEXSINK, [AirPort Express Wireless sink], apexsink, [
1773   PKG_CHECK_MODULES(APEXSINK, [ openssl >= 0.9.5  libcrypto ], [
1774     HAVE_APEXSINK="yes"
1775     saved_LIBS="$LIBS"
1776     LIBS=""
1777     AC_SEARCH_LIBS(socket, [socket], [ ], [ APEXSINK="no" ])
1778     AC_SEARCH_LIBS(gethostbyname, [nsl], [ ], [ APEXSINK="no" ])
1779     APEXSINK_LIBS="$APEXSINK_LIBS $LIBS"
1780     LIBS="$saved_LIBS"
1781     AC_SUBST(APEXSINK_CFLAGS)
1782     AC_SUBST(APEXSINK_LIBS)
1783   ], [
1784     APEXSINK="no"
1785   ])
1786 ])
1787
1788 dnl *** bs2b ***
1789 translit(dnm, m, l) AM_CONDITIONAL(USE_BS2B, true)
1790 AG_GST_CHECK_FEATURE(BS2B, [bs2b], bs2b, [
1791   PKG_CHECK_MODULES(BS2B, libbs2b >= 3.1.0, HAVE_BS2B="yes", [
1792     HAVE_BS2B="no"
1793   ])
1794   AC_SUBST(BS2B_CFLAGS)
1795   AC_SUBST(BS2B_LIBS)
1796 ])
1797
1798 dnl *** BZ2 ***
1799 translit(dnm, m, l) AM_CONDITIONAL(USE_BZ2, true)
1800 AG_GST_CHECK_FEATURE(BZ2, [bz2 library], bz2, [
1801   save_LIBS=$LIBS
1802   LIBS="$LIBS -lbz2"
1803   AC_MSG_CHECKING([for BZ2_bzlibVersion in -lbz2])
1804   AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <bzlib.h>]], [[const char *version = BZ2_bzlibVersion ();]])],[HAVE_BZ2=yes],[HAVE_BZ2=no])
1805   AC_MSG_RESULT($HAVE_BZ2)
1806   LIBS=$save_LIBS
1807   if test "x$HAVE_BZ2" = "xyes"; then
1808     BZ2_LIBS="-lbz2"
1809   fi
1810   AC_SUBST(BZ2_LIBS)
1811
1812 ])
1813
1814 #dnl *** cairo ***
1815 #translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true)
1816 #AG_GST_CHECK_FEATURE(CAIRO, [cairo plug-in], cairo, [
1817 #  PKG_CHECK_MODULES(CAIRO, cairo >= 1.0 glitz-glx, HAVE_CAIRO=yes, [
1818 #    HAVE_CAIRO=no
1819 #  ])
1820 #  AC_SUBST(CAIRO_CFLAGS)
1821 #  AC_SUBST(CAIRO_LIBS)
1822 #])
1823
1824 dnl *** chromaprint ***
1825 translit(dnm, m, l) AM_CONDITIONAL(USE_CHROMAPRINT, true)
1826 AG_GST_CHECK_FEATURE(CHROMAPRINT, [chromaprint], chromaprint, [
1827   PKG_CHECK_MODULES(CHROMAPRINT, libchromaprint, HAVE_CHROMAPRINT="yes", [
1828     HAVE_CHROMAPRINT="no"
1829   ])
1830   AC_SUBST(CHROMAPRINT_CFLAGS)
1831   AC_SUBST(CHROMAPRINT_LIBS)
1832 ])
1833
1834 dnl *** Curl ***
1835 translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true)
1836 AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
1837   PKG_CHECK_MODULES(CURL, libcurl >= 7.35.0, [
1838     HAVE_CURL="yes"
1839     AC_CHECK_HEADERS([unistd.h sys/socket.h sys/types.h netinet/in.h netinet/tcp.h fcntl.h], [ ], [
1840       AC_CHECK_HEADERS([unistd.h sys/types.h winsock2.h ws2tcpip.h fcntl.h], [ ], [HAVE_CURL="no"])
1841     ])
1842     AC_CHECK_HEADERS([netinet/ip.h], [], [HAVE_CURL="no"],
1843     [[#ifdef HAVE_SYS_TYPES_H
1844      # include <sys/types.h>
1845      #endif
1846      #ifdef HAVE_NETINET_IN_H
1847      # include <netinet/in.h>
1848      #endif
1849     ]])
1850     AC_MSG_CHECKING([for socket support needed by curlsink])
1851     AC_MSG_RESULT($HAVE_CURL)
1852   ], [
1853     HAVE_CURL="no"
1854   ])
1855   AC_SUBST(CURL_CFLAGS)
1856   AC_SUBST(CURL_LIBS)
1857   PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
1858     HAVE_SSH2="yes"
1859     AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
1860   ], [
1861     HAVE_SSH2="no"
1862   ])
1863   AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes")
1864   AC_SUBST(SSH2_CFLAGS)
1865   AC_SUBST(SSH2_LIBS)
1866 ],,,[AM_CONDITIONAL(USE_SSH2, false)])
1867
1868 dnl **** DASH ****
1869 translit(dnm, m, l) AM_CONDITIONAL(USE_DASH, true)
1870 AG_GST_CHECK_FEATURE(DASH, [DASH plug-in], dash, [
1871   PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.8, [HAVE_LIBXML2="yes"
1872     HAVE_DASH="yes"], [HAVE_LIBXML2="no"
1873     HAVE_DASH="no"])
1874   AC_SUBST(LIBXML2_CFLAGS)
1875   AC_SUBST(LIBXML2_LIBS)
1876 ])
1877
1878 dnl *** dc1394  ***
1879 translit(dnm, m, l) AM_CONDITIONAL(USE_DC1394, true)
1880 AG_GST_CHECK_FEATURE(DC1394, [libdc1394], dc1394, [
1881    PKG_CHECK_MODULES(LIBDC1394, libdc1394-2 >= 2.0.0, [
1882         if test -z "`$PKG_CONFIG --modversion libdc1394-2 | grep 2.0.0-rc`"; then
1883                 HAVE_DC1394="yes"
1884         else
1885                 HAVE_DC1394="no"
1886         fi
1887    ], [
1888         HAVE_DC1394="no"
1889         AC_MSG_RESULT(no)
1890    ])
1891    AC_SUBST(LIBDC1394_CFLAGS)
1892    AC_SUBST(LIBDC1394_LIBS)
1893 ])
1894
1895 dnl *** decklink  ***
1896 translit(dnm, m, l) AM_CONDITIONAL(USE_DECKLINK, true)
1897 AG_GST_CHECK_FEATURE(DECKLINK, [decklink], decklink, [
1898    HAVE_DECKLINK=no
1899    case "$host" in
1900      *android*)
1901        HAVE_DECKLINK=no
1902        ;;
1903      *-*linux*)
1904        if test "x$HAVE_PTHREAD_H" = "xyes"; then
1905          AC_CHECK_LIB(dl, dlopen,
1906            [
1907             HAVE_DECKLINK=yes
1908             DECKLINK_CXXFLAGS=
1909             DECKLINK_LIBS="-lpthread -ldl"
1910            ])
1911        fi
1912        ;;
1913      *-*darwin*)
1914        if test "x$HAVE_PTHREAD_H" = "xyes"; then
1915          AC_CHECK_LIB(dl, dlopen,
1916            [
1917             HAVE_DECKLINK=yes
1918             DECKLINK_CXXFLAGS=
1919             DECKLINK_LIBS="-lpthread -ldl"
1920             HAVE_DECKLINK_OSX=yes
1921            ])
1922        fi
1923        ;;
1924      *)
1925        HAVE_DECKLINK=no
1926        ;;
1927    esac
1928
1929    AC_SUBST(DECKLINK_CXXFLAGS)
1930    AC_SUBST(DECKLINK_LIBS)
1931 ])
1932 AM_CONDITIONAL(DECKLINK_OSX, test "x$HAVE_DECKLINK_OSX" = xyes)
1933
1934 dnl **** DirectFB ****
1935 translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTFB, true)
1936 AG_GST_CHECK_FEATURE(DIRECTFB, [directfb], dfbvideosink , [
1937   PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.24, HAVE_DIRECTFB="yes", [
1938     HAVE_DIRECTFB="no"
1939   ])
1940 ])
1941
1942 dnl **** Wayland ****
1943 translit(dnm, m, l) AM_CONDITIONAL(USE_WAYLAND, true)
1944 AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland , [
1945   PKG_CHECK_MODULES(WAYLAND, wayland-client >= 1.4.0 wayland-scanner, [
1946     HAVE_WAYLAND="yes" ], [ HAVE_WAYLAND="no"
1947   ])
1948 ])
1949
1950 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
1951
1952 dnl **** WebP ****
1953 translit(dnm, m, l) AM_CONDITIONAL(USE_WEBP, true)
1954 AG_GST_CHECK_FEATURE(WEBP, [WebP], webp , [
1955   PKG_CHECK_MODULES(WEBP, libwebp >= 0.2.1, [
1956     HAVE_WEBP="yes" ], [ HAVE_WEBP="no"
1957   ])
1958   AC_SUBST(WEBP_CFLAGS)
1959   AC_SUBST(WEBP_LIBS)
1960 ])
1961
1962 dnl *** Daala ***
1963 translit(dnm, m, l) AM_CONDITIONAL(USE_DAALA, true)
1964 AG_GST_CHECK_FEATURE(DAALA, [daala], daala, [
1965   if test "x$BUILD_EXPERIMENTAL" = "xyes"; then
1966     PKG_CHECK_MODULES(DAALA, daalaenc daaladec, [
1967             HAVE_DAALA="yes"
1968     ], [
1969             HAVE_DAALA="no"
1970     ])
1971     AC_SUBST(DAALA_CFLAGS)
1972     AC_SUBST(DAALA_LIBS)
1973   fi
1974 ])
1975
1976 dnl *** DTS ***
1977 translit(dnm, m, l) AM_CONDITIONAL(USE_DTS, true)
1978 AG_GST_CHECK_FEATURE(DTS, [dts library], dtsdec, [
1979   HAVE_DTS="yes"
1980   AG_GST_CHECK_LIBHEADER(DTS, dca, dca_init, $LIBM, dca.h,
1981     DTS_LIBS="-ldca $LIBM", HAVE_DTS="no")
1982   if test $HAVE_DTS = "no"; then
1983     AG_GST_CHECK_LIBHEADER(DTS, dts_pic, dts_init, $LIBM, dts.h,
1984       [ DTS_LIBS="-ldts_pic $LIBM"
1985         AC_DEFINE(DTS_OLD, 1, [Define if an old libdts is used])
1986       ])
1987   fi
1988   AC_SUBST(DTS_LIBS)
1989 ])
1990
1991 dnl *** resindvd ***
1992 translit(dnm, m, l) AM_CONDITIONAL(USE_RESINDVD, true)
1993 AG_GST_CHECK_FEATURE(RESINDVD, [resindvd plugin], resindvd, [
1994   PKG_CHECK_MODULES(DVDNAV, dvdnav >= 4.1.2 dvdread >= 4.1.2, HAVE_RESINDVD="yes", [
1995     HAVE_RESINDVD="no"
1996   ])
1997 ])
1998
1999 dnl **** Free AAC Encoder (FAAC) ****
2000 translit(dnm, m, l) AM_CONDITIONAL(USE_FAAC, true)
2001 AG_GST_CHECK_FEATURE(FAAC, [AAC encoder plug-in], faac, [
2002   AG_GST_CHECK_LIBHEADER(FAAC, faac, faacEncOpen, $LIBM, faac.h,
2003     FAAC_LIBS="-lfaac $LIBM")
2004   AC_SUBST(FAAC_LIBS)
2005 ])
2006
2007 dnl **** Free AAC Decoder (FAAD) ****
2008 translit(dnm, m, l) AM_CONDITIONAL(USE_FAAD, true)
2009 AG_GST_CHECK_FEATURE(FAAD, [AAC decoder plug-in], faad, [
2010   HAVE_FAAD="yes"
2011   faad_hdr=""
2012   AG_GST_CHECK_LIBHEADER(FAAD, faad, faacDecOpen, $LIBM, faad.h,
2013     FAAD_LIBS="-lfaad $LIBM", HAVE_FAAD="no")
2014   if test $HAVE_FAAD = "no"; then
2015     AG_GST_CHECK_LIBHEADER(FAAD, faad, NeAACDecOpen, $LIBM, neaacdec.h,
2016       [ FAAD_LIBS="-lfaad $LIBM"
2017         AC_DEFINE(FAAD_IS_NEAAC, 1, [Define if AAC is using new api prefix])
2018         faad_hdr="neaacdec.h"
2019       ], [
2020         HAVE_FAAD="no"
2021       ],)
2022   else
2023     faad_hdr="faad.h"
2024   fi
2025   if test $HAVE_FAAD = "yes"; then
2026     AC_MSG_CHECKING([Checking for FAAD >= 2.0])
2027     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <faad.h>]], [[
2028         #if !defined(FAAD2_VERSION) || !defined(FAAD_FMT_DOUBLE)
2029         #error Not faad2
2030         #else
2031         /* Release candidate of 2.0 is not good enough for us. This field
2032          * was added only in 2.0 final and does not exist in 2.0-RC3 */
2033         faacDecConfiguration conf; conf.dontUpSampleImplicitSBR = 1;
2034         #endif
2035     ]])],[
2036       HAVE_FAAD="yes"
2037
2038       AC_MSG_CHECKING([Checking FAAD2 version in $faad_hdr])
2039       for minor in 10 9 8 7 6 5 0; do
2040         if test x$faad2_minor_version = "x"; then
2041           AC_EGREP_CPP([\"2\.$minor\"$], [
2042               #include <$faad_hdr>
2043               FAAD2_VERSION
2044             ], [
2045               faad2_minor_version=$minor
2046             ])
2047         fi
2048       done
2049       if test x$faad2_minor_version = "x"; then
2050         AC_MSG_RESULT([no idea])
2051       else
2052         AC_MSG_RESULT([2.$faad2_minor_version])
2053         AC_DEFINE_UNQUOTED([FAAD2_MINOR_VERSION], [$faad2_minor_version], [The x in 2.x])
2054       fi
2055     ],[
2056       HAVE_FAAD="no"
2057     ])
2058   fi
2059   AC_SUBST(FAAD_LIBS)
2060   AC_SUBST(FAAD_IS_NEAAC)
2061 ])
2062
2063 dnl *** fbdev ***
2064 translit(dnm, m, l) AM_CONDITIONAL(USE_FBDEV, true)
2065 AG_GST_CHECK_FEATURE(FBDEV, [linux framebuffer], fbdevsink, [
2066   if test "x$HAVE_FBDEV" != "xyes"; then
2067     AC_CHECK_HEADER([linux/fb.h], HAVE_FBDEV=yes, HAVE_FBDEV=no)
2068   fi
2069 ])
2070
2071 dnl *** flite ***
2072 translit(dnm, m, l) AM_CONDITIONAL(USE_FLITE, true)
2073 AG_GST_CHECK_FEATURE(FLITE, [Flite plugin], flite, [
2074   AG_GST_CHECK_LIBHEADER(FLITE, flite, flite_init, $LIBM, flite/flite.h,
2075     FLITE_LIBS="-lflite -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex $LIBM")
2076
2077   AC_SUBST(FLITE_CFLAGS)
2078   AC_SUBST(FLITE_LIBS)
2079 ])
2080
2081 dnl *** gsm ***
2082 translit(dnm, m, l) AM_CONDITIONAL(USE_GSM, true)
2083 AG_GST_CHECK_FEATURE(GSM, [GSM library], gsmenc gsmdec, [
2084   AG_GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm.h, GSM_LIBS="-lgsm")
2085   if test $HAVE_GSM != "yes"; then
2086     AG_GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm/gsm.h, GSM_LIBS="-lgsm")
2087     if test $HAVE_GSM = "yes"; then
2088       AC_DEFINE(GSM_HEADER_IN_SUBDIR, 1, [Define if GSM header in gsm/ subdir])
2089     fi
2090   fi
2091   AC_SUBST(GSM_LIBS)
2092 ])
2093
2094 dnl *** fluidSynth ***
2095 translit(dnm, m, l) AM_CONDITIONAL(USE_FLUIDSYNTH, true)
2096 AG_GST_CHECK_FEATURE(FLUIDSYNTH, [fluidsynth], fluidsynth, [
2097   PKG_CHECK_MODULES(FLUIDSYNTH, fluidsynth >= 1.0, HAVE_FLUIDSYNTH="yes", [
2098     HAVE_FLUIDSYNTH="no"
2099   ])
2100 ])
2101
2102 dnl *** kate ***
2103 translit(dnm, m, l) AM_CONDITIONAL(USE_KATE, true)
2104 AG_GST_CHECK_FEATURE(KATE, [Kate], kate, [
2105   PKG_CHECK_MODULES(KATE, kate >= 0.1.7, HAVE_KATE="yes", [
2106     HAVE_KATE="no"
2107   ])
2108   AC_SUBST(KATE_CFLAGS)
2109   AC_SUBST(KATE_LIBS)
2110   PKG_CHECK_MODULES(TIGER, tiger >= 0.3.2,
2111     [
2112       HAVE_TIGER="yes"
2113       AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available])
2114     ],
2115     [
2116       HAVE_TIGER="no"
2117     ]
2118   )
2119   AM_CONDITIONAL(USE_TIGER, test "x$HAVE_TIGER" = "xyes")
2120   AC_SUBST(TIGER_CFLAGS)
2121   AC_SUBST(TIGER_LIBS)
2122 ],,,[AM_CONDITIONAL(USE_TIGER, false)])
2123
2124 dnl *** ladspa ***
2125 translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
2126 AG_GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
2127   AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
2128
2129   PKG_CHECK_MODULES(LRDF, lrdf, HAVE_LRDF=yes, HAVE_LRDF=no)
2130   if test $HAVE_LRDF = "yes"; then
2131     AC_DEFINE(HAVE_LRDF, 1, [Define if we have liblrdf])
2132   fi
2133   AC_SUBST(LRDF_LIBS)
2134   AC_SUBST(LRDF_CFLAGS)
2135 ])
2136
2137 dnl *** LV2 ***
2138 translit(dnm, m, l) AM_CONDITIONAL(USE_LV2, true)
2139 AG_GST_CHECK_FEATURE(LV2, [lv2], lv2, [
2140   PKG_CHECK_MODULES(SLV2, slv2 >= 0.6.6, HAVE_LV2="yes", HAVE_LV2="no")
2141   AC_SUBST(SLV2_CFLAGS)
2142   AC_SUBST(SLV2_LIBS)
2143 ])
2144
2145 dnl *** libde265 ***
2146 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBDE265, true)
2147 AG_GST_CHECK_FEATURE(LIBDE265, [libde265 HEVC/H.265 decoder], libde265, [
2148   PKG_CHECK_MODULES(LIBDE265, libde265 >= 0.9, HAVE_LIBDE265="yes", HAVE_LIBDE265="no")
2149   AC_SUBST(LIBDE265_CFLAGS)
2150   AC_SUBST(LIBDE265_LIBS)
2151 ])
2152
2153 dnl *** libmms ***
2154 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBMMS, true)
2155 AG_GST_CHECK_FEATURE(LIBMMS, [mms protocol library], libmms, [
2156   dnl check with pkg-config first
2157   PKG_CHECK_MODULES(LIBMMS, libmms >= 0.4, HAVE_LIBMMS="yes", [
2158     HAVE_LIBMMS="no"
2159   ])
2160 ])
2161 AC_SUBST(LIBMMS_LIBS)
2162
2163
2164 dnl *** libsrtp ***
2165 translit(dnm, m, l) AM_CONDITIONAL(USE_SRTP, true)
2166 AG_GST_CHECK_FEATURE(SRTP, [srtp library], srtp, [
2167   PKG_CHECK_MODULES(SRTP, libsrtp, HAVE_SRTP="yes",
2168     AG_GST_CHECK_LIBHEADER(SRTP, srtp, srtp_init, , srtp/srtp.h, SRTP_LIBS="-lsrtp")
2169   )
2170   AC_SUBST(SRTP_LIBS)
2171   AC_SUBST(SRTP_CFLAGS)
2172 ])
2173
2174 dnl *** dtls ***
2175 translit(dnm, m, l) AM_CONDITIONAL(USE_DTLS, true)
2176 AG_GST_CHECK_FEATURE(DTLS, [DTLS plugin], dtls, [
2177   PKG_CHECK_MODULES(DTLS, [ openssl >= 0.9.5  libcrypto ], [
2178     HAVE_DTLS="yes"
2179     AC_SUBST(DTLS_CFLAGS)
2180     AC_SUBST(DTLS_LIBS)
2181   ], [
2182     HAVE_DTLS="no"
2183   ])
2184 ])
2185
2186 dnl *** linsys ***
2187 translit(dnm, m, l) AM_CONDITIONAL(USE_LINSYS, true)
2188 AG_GST_CHECK_FEATURE(LINSYS, [Linear Systems SDI plugin], linsys, [
2189   case "$host" in
2190     *-*linux*)
2191       HAVE_LINSYS=yes
2192       ;;
2193     *)
2194       HAVE_LINSYS=no
2195       ;;
2196   esac
2197 ])
2198
2199 dnl *** modplug ***
2200 translit(dnm, m, l) AM_CONDITIONAL(USE_MODPLUG, true)
2201 AG_GST_CHECK_FEATURE(MODPLUG, modplug, modplug, [
2202   if test "x$HAVE_CXX" != "xyes"; then
2203     AC_MSG_WARN([Not compiling modplug plugin as it requires a C++ compiler])
2204     HAVE_MODPLUG="no"
2205   else
2206     PKG_CHECK_MODULES(MODPLUG, libmodplug, HAVE_MODPLUG="yes", HAVE_MODPLUG="no")
2207   fi
2208   AC_SUBST(MODPLUG_CFLAGS)
2209   AC_SUBST(MODPLUG_LIBS)
2210 ])
2211
2212 dnl *** mimic ***
2213 translit(dnm, m, l) AM_CONDITIONAL(USE_MIMIC, true)
2214 AG_GST_CHECK_FEATURE(MIMIC, [libmimic library], mimic, [
2215   MIMIC_REQUIRED=1.0
2216   PKG_CHECK_MODULES(MIMIC, libmimic >= $MIMIC_REQUIRED,
2217       HAVE_MIMIC=yes, HAVE_MIMIC=no)
2218   AC_SUBST(MIMIC_CFLAGS)
2219   AC_SUBST(MIMIC_LIBS)
2220 ])
2221
2222 dnl *** mjpegtools version info ***
2223 dnl some may prefer older version (given quirks above)
2224 dnl hm, no version info seems available within mjpegtools headers
2225 dnl and API really moves along
2226 echo
2227 PKG_CHECK_EXISTS(mjpegtools >= 1.6.1.93 mjpegtools < 1.8.0, [
2228   mjpegtools_api=10601
2229 ], [
2230   PKG_CHECK_EXISTS(mjpegtools >= 1.8.0 mjpegtools < 1.9.0, [
2231     mjpegtools_api=10800
2232   ], [
2233     PKG_CHECK_EXISTS(mjpegtools >= 2.0.0, [
2234       mjpegtools_api=20000
2235     ], [
2236       PKG_CHECK_MODULES(MJPEG, mjpegtools >= 1.9.0 mjpegtools < 2.0.0, [
2237         dnl logging API changed in release candidates
2238         OLD_CFLAGS="$CFLAGS"
2239         OLD_LIBS="$LIBS"
2240         CFLAGS="$MJPEG_CFLAGS"
2241         LIBS="$LIBS $MJPEG_LIBS -lmjpegutils $LIBM $PTHREAD_LIBS"
2242         AC_CHECK_FUNC(mjpeg_loglev_t, [
2243           mjpegtools_api=10903
2244           ], [
2245           mjpegtools_api=10900
2246           ])
2247         CFLAGS="$OLD_CFLAGS"
2248         LIBS="$OLD_LIBS"
2249       ], [
2250         mjpegtools_api=0
2251       ])
2252     ])
2253   ])
2254 ])
2255 AC_DEFINE_UNQUOTED(GST_MJPEGTOOLS_API, $mjpegtools_api,
2256   [mjpegtools API evolution])
2257
2258 dnl *** mpeg2enc ***
2259 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2ENC, true)
2260 AG_GST_CHECK_FEATURE(MPEG2ENC, [mpeg2enc], mpeg2enc, [
2261   HAVE_MPEG2ENC="no"
2262   dnl we require a c++ compiler for this one
2263   if [ test x$HAVE_CXX = xyes ]; then
2264     dnl libmpeg2enc was first included in mjpegtools-1.6.2-rc3 (1.6.1.92)
2265     dnl since many distros include mjpegtools specifically without mplex
2266     dnl and mpeg2enc, we check for mpeg2enc on its own, too.
2267     PKG_CHECK_MODULES(MPEG2ENC, mjpegtools >= 1.6.1.93, [
2268       dnl HACK because mpeg2enc 1.8.0 header files have a spurious 'include config.h'
2269       touch config.h
2270       dnl switch over to c++ to test things
2271       AC_LANG([C++])
2272       OLD_CPPFLAGS="$CPPFLAGS"
2273       dnl HACK as above
2274       CPPFLAGS_GOOD="$CPPFLAGS $MPEG2ENC_CFLAGS"
2275       CPPFLAGS="$CPPFLAGS_GOOD -I."
2276       dnl check headers
2277       mpeg2enc_headers_ok=no
2278       AC_CHECK_HEADER([mpeg2encoder.hh], [
2279         MPEG2ENC_LIBS="$MPEG2ENC_LIBS -lmpeg2encpp $LIBM $PTHREAD_LIBS"
2280         OLD_LIBS="$LIBS"
2281         LIBS="$LIBS $MPEG2ENC_LIBS"
2282         AC_MSG_CHECKING([for valid mpeg2enc objects])
2283         AC_RUN_IFELSE([AC_LANG_SOURCE([[
2284           #include <mpeg2encoder.hh>
2285           #include <mpeg2encoptions.hh>
2286
2287           int
2288           main (int   argc,
2289                 char *argv[])
2290           {
2291             MPEG2EncOptions *options = new MPEG2EncOptions ();
2292             MPEG2Encoder *encoder = new MPEG2Encoder (*options);
2293             return 0;
2294           }
2295         ]])],[
2296           AC_MSG_RESULT(yes)
2297           dnl so far so good, let's check more things:
2298           dnl mjpegtools-1.8.0 does not install the required
2299           dnl mpeg2syntaxcodes.h header by default, and a new release
2300           dnl is not in sight, so check for this oversight in case
2301           dnl distros or folks have fixed this themselves
2302           if test "$mjpegtools_api" -ge "10800"; then
2303             AC_CHECK_HEADER([mpeg2syntaxcodes.h], [
2304                 mpeg2enc_headers_ok=yes
2305               ], [
2306                 mpeg2enc_headers_ok=no
2307               ])
2308           else
2309             mpeg2enc_headers_ok=yes
2310           fi
2311           if test "x$mpeg2enc_headers_ok" = "xyes"; then
2312             HAVE_MPEG2ENC="yes"
2313           fi
2314           CPPFLAGS="$CPPFLAGS_GOOD"
2315           AC_SUBST(MPEG2ENC_CFLAGS)
2316           AC_SUBST(MPEG2ENC_LIBS)
2317         ],[
2318           AC_MSG_RESULT(no)
2319         ],[])
2320         LIBS="$OLD_LIBS"
2321       ])
2322
2323       CPPFLAGS="$OLD_CPPFLAGS"
2324       AC_LANG([C])
2325     ], [
2326       HAVE_MPEG2ENC="no"
2327     ])
2328   fi
2329 ])
2330
2331 dnl *** mpg123 ***
2332 translit(dnm, m, l) AM_CONDITIONAL(USE_MPG123, true)
2333 AG_GST_CHECK_FEATURE(MPG123, [mpg123 audio decoder], mpg123, [
2334   PKG_CHECK_MODULES(MPG123, libmpg123 >= 1.13, HAVE_MPG123="yes", HAVE_MPG123="no")
2335   AC_SUBST(MPG123_CFLAGS)
2336   AC_SUBST(MPG123_LIBS)
2337 ])
2338
2339 dnl *** mplex ***
2340 translit(dnm, m, l) AM_CONDITIONAL(USE_MPLEX, true)
2341 AG_GST_CHECK_FEATURE(MPLEX, [mplex], mplex, [
2342   HAVE_MPLEX="no"
2343   dnl we require a c++ compiler for this one
2344   if [ test x$HAVE_CXX = xyes ]; then
2345     dnl libmplex was first included in mjpegtools-1.6.2-rc4 (1.6.1.93)
2346     dnl since many distros include mjpegtools specifically without mplex
2347     dnl and mpeg2enc, we check for mplex on its own, too.
2348     dnl libmplex < 1.9rc? has fuzzy ABI, valgrind and other problems
2349     PKG_CHECK_MODULES(MPLEX, mjpegtools >= 1.9.0, [
2350       dnl HACK because mplex 2.0.0 header files have a spurious 'include config.h'
2351       touch config.h
2352       dnl switch over to c++ to test things
2353       AC_LANG([C++])
2354       OLD_CPPFLAGS="$CPPFLAGS"
2355       dnl HACK as above
2356       CPPFLAGS_GOOD="$CPPFLAGS $MPLEX_CFLAGS"
2357       CPPFLAGS="$CPPFLAGS_GOOD -I."
2358       AC_CHECK_HEADER(interact.hpp, [
2359         MPLEX_LIBS="$MPLEX_LIBS -lmplex2 $LIBM"
2360         OLD_LIBS="$LIBS"
2361         LIBS="$LIBS $MPLEX_LIBS"
2362         OLD_LDFLAGS="$LDFLAGS"
2363         LDFLAGS="$LDFLAGS $MPLEX_LDFLAGS"
2364         dnl older libmplex uses off_t SegmentSize (), which leads to fuzzy ABI;
2365         dnl don't want this here
2366         AC_MSG_CHECKING([for valid mplex objects])
2367         AC_RUN_IFELSE([AC_LANG_SOURCE([[
2368
2369 #include <interact.hpp>
2370 #include <outputstrm.hpp>
2371 #include <multiplexor.hpp>
2372 int
2373 main (int   argc,
2374       char *argv[])
2375 {
2376   class TestOutputStream : public OutputStream {
2377   public:
2378     TestOutputStream () : OutputStream () { }
2379     void Write (uint8_t *a, unsigned int b) { }
2380     void NextSegment () { }
2381     uint64_t SegmentSize () { }
2382     void Close () { }
2383     int Open () { }
2384 };
2385   MultiplexJob *job = new MultiplexJob ();
2386   vector<IBitStream *> inputs;
2387   job->SetupInputStreams (inputs);
2388   TestOutputStream *out = new TestOutputStream ();
2389   Multiplexor *mux = new Multiplexor(*job, *out, NULL);
2390   return 0;
2391 }
2392         ]])],[
2393           HAVE_MPLEX="yes"
2394           CPPFLAGS="$CPPFLAGS_GOOD"
2395           AC_SUBST(MPLEX_CFLAGS)
2396           AC_SUBST(MPLEX_LIBS)
2397           AC_SUBST(MPLEX_LDFLAGS)
2398           AC_MSG_RESULT(yes)
2399         ],[AC_MSG_RESULT(no)],[])
2400         LIBS="$OLD_LIBS"
2401         LDFLAGS="$OLD_LDFLAGS"
2402       ])
2403       CPPFLAGS="$OLD_CPPFLAGS"
2404       AC_LANG([C])
2405     ], HAVE_MPLEX="no")
2406   fi
2407 ])
2408
2409 dnl *** musepack ***
2410 translit(dnm, m, l) AM_CONDITIONAL(USE_MUSEPACK, true)
2411 AG_GST_CHECK_FEATURE(MUSEPACK, [musepackdec], musepack, [
2412   AC_CHECK_HEADER([mpc/mpcdec.h], [
2413     HAVE_MUSEPACK="yes"
2414     MUSEPACK_LIBS="-lmpcdec"
2415     AC_SUBST(MUSEPACK_LIBS)
2416     ], [AC_CHECK_HEADER([mpcdec/mpcdec.h], [
2417       HAVE_MUSEPACK="yes"
2418       MUSEPACK_LIBS="-lmpcdec"
2419       AC_DEFINE(MPC_IS_OLD_API, 1, [Define if the old MusePack API is used])
2420       AC_SUBST(MUSEPACK_LIBS)
2421     ], [HAVE_MUSEPACK="no"])])
2422 ])
2423
2424 dnl *** nas ***
2425 translit(dnm, m, l) AM_CONDITIONAL(USE_NAS, true)
2426 AG_GST_CHECK_FEATURE(NAS, [nas plug-in], nassink, [
2427   HAVE_NAS="no"
2428   if test "x$HAVE_X" = "xyes"; then
2429     save_cppflags=$CFLAGS
2430     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2431     AG_GST_CHECK_LIBHEADER(NAS, audio, AuOpenServer, $X_LIBS, audio/audiolib.h,
2432       NAS_LIBS="$X_LIBS -laudio" NAS_CFLAGS="$X_CFLAGS")
2433     CPPFLAGS="$save_cppflags"
2434   fi
2435   AC_SUBST(NAS_CFLAGS)
2436   AC_SUBST(NAS_LIBS)
2437 ])
2438
2439 dnl *** neon ***
2440 translit(dnm, m, l) AM_CONDITIONAL(USE_NEON, true)
2441 AG_GST_CHECK_FEATURE(NEON, [neon http client plugins], neonhttpsrc, [
2442   PKG_CHECK_MODULES(NEON, neon >= 0.27.0  neon <= 0.30.99, HAVE_NEON="yes", [
2443     HAVE_NEON="no"
2444   ])
2445   AC_SUBST(NEON_CFLAGS)
2446   AC_SUBST(NEON_LIBS)
2447 ])
2448
2449 dnl *** ofa ***
2450 translit(dnm, m, l) AM_CONDITIONAL(USE_OFA, true)
2451 AG_GST_CHECK_FEATURE(OFA, [ofa plugins], ofa, [
2452   PKG_CHECK_MODULES(OFA, libofa >= 0.9.3, HAVE_OFA="yes", [
2453     HAVE_OFA="no"
2454   ])
2455   AC_SUBST(OFA_CFLAGS)
2456   AC_SUBST(OFA_LIBS)
2457 ])
2458
2459 dnl *** OpenAL ***
2460 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENAL, true)
2461 AG_GST_CHECK_FEATURE(OPENAL, [OpenAL plugin], openal, [
2462   PKG_CHECK_MODULES(OPENAL, openal >= 1.14, HAVE_OPENAL="yes", [
2463     HAVE_OPENAL="no"
2464   ])
2465   AC_SUBST(OPENAL_CFLAGS)
2466   AC_SUBST(OPENAL_LIBS)
2467 ])
2468
2469 dnl *** opencv ***
2470 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENCV, true)
2471 AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [
2472   dnl we specify a max. version too because we set CV_NO_BACKWARD_COMPATIBILITY
2473   dnl and don't want the build to break when a new opencv version comes out.
2474   dnl Need to adjust this upwards once we know that our code compiles fine with
2475   dnl a new version and the no-backward-compatibility define. (There doesn't
2476   dnl seem to be a switch to suppress the warnings the cvcompat.h header
2477   dnl causes.)
2478   PKG_CHECK_MODULES(OPENCV, opencv >= 2.3.0 opencv < 2.5.0 , [
2479     AC_PROG_CXX
2480     AC_LANG([C++])
2481     OLD_CPPFLAGS=$CPPFLAGS
2482     CPPFLAGS=$OPENCV_CFLAGS
2483     something_not_found=no
2484     AC_CHECK_HEADERS([opencv2/contrib/contrib.hpp \
2485                       opencv2/core/core_c.h \
2486                       opencv2/core/types_c.h \
2487                       opencv2/core/version.hpp \
2488                       opencv2/highgui/highgui_c.h \
2489                       opencv2/imgproc/imgproc.hpp \
2490                       opencv2/imgproc/imgproc_c.h \
2491                       opencv2/legacy/compat.hpp \
2492                       opencv2/legacy/legacy.hpp \
2493                       opencv2/objdetect/objdetect.hpp \
2494                       opencv2/video/background_segm.hpp], [], [something_not_found=yes])
2495     CPPFLAGS=$OLD_CPPFLAGS
2496     AC_LANG([C])
2497
2498     if test $something_not_found = "yes"; then
2499       AC_MSG_RESULT([not all opencv2 headers were found])
2500       HAVE_OPENCV="no"
2501     else
2502       HAVE_OPENCV="yes"
2503     fi
2504   ], [
2505     HAVE_OPENCV="no"
2506   ])
2507   OPENCV_PREFIX="`$PKG_CONFIG --variable=prefix opencv`"
2508   AC_DEFINE_UNQUOTED(OPENCV_PREFIX, "$OPENCV_PREFIX", [opencv install prefix])
2509   AC_SUBST(OPENCV_PREFIX)
2510   AC_SUBST(OPENCV_CFLAGS)
2511   AC_SUBST(OPENCV_LIBS)
2512   dnl the OpenCV prefix is used at runtime for some object properties, and also
2513   dnl used here to detect which directory is the correct one. For the second
2514   dnl case, make sure the right sysroot is used, ensuring correct behavior
2515   dnl during cross compilation.
2516   if test -d "$PKG_CONFIG_SYSROOT_DIR/$OPENCV_PREFIX/share/opencv/"; then
2517     AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["opencv"], [OpenCV path name])
2518   else
2519     AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["OpenCV"], [OpenCV path name])
2520   fi
2521 ])
2522
2523 dnl *** OpenEXR ***
2524 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENEXR, true)
2525 AG_GST_CHECK_FEATURE(OPENEXR, [openexr library], openexr, [
2526   AG_GST_PKG_CHECK_MODULES(OPENEXR, OpenEXR)
2527 ])
2528
2529 dnl *** openh264 ***
2530 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENH264, true)
2531 AG_GST_CHECK_FEATURE(OPENH264, [openh264 library], openh264, [
2532   AG_GST_PKG_CHECK_MODULES(OPENH264, openh264 >= 1.3.0)
2533 ])
2534
2535 dnl *** OpenJPEG ***
2536 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENJPEG, true)
2537 AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [
2538   HAVE_OPENJPEG="no"
2539
2540   save_LIBS="$LIBS"
2541   save_CFLAGS="$CFLAGS"
2542   OPENJPEG_LIBS="-lopenjp2"
2543   LIBS="$LIBS $OPENJPEG_LIBS"
2544   CFLAGS="$CFLAGS $OPENJPEG_CFLAGS"
2545   AC_LINK_IFELSE([
2546     AC_LANG_PROGRAM([#include <openjpeg-2.0/openjpeg.h>],
2547                     [return (int) *opj_version ();])
2548                  ], [HAVE_OPENJPEG=yes], [HAVE_OPENJPEG=no])
2549   LIBS="$save_LIBS"
2550   CFLAGS="$save_CFLAGS"
2551
2552   if test x"$HAVE_OPENJPEG" = x"no"; then
2553     OPENJPEG_LIBS=""
2554     PKG_CHECK_MODULES(OPENJPEG, libopenjpeg1,
2555       HAVE_OPENJPEG="yes",
2556       AG_GST_CHECK_LIBHEADER(OPENJPEG, openjpeg, opj_version, , openjpeg.h, OPENJPEG_LIBS="-lopenjpeg")
2557     )
2558     if test x"$HAVE_OPENJPEG" = x"yes"; then
2559       AC_DEFINE([HAVE_OPENJPEG_1], 1, [Define if OpenJPEG 1 is used])
2560     fi
2561   fi
2562   AC_SUBST(OPENJPEG_CFLAGS)
2563   AC_SUBST(OPENJPEG_LIBS)
2564 ])
2565
2566 dnl *** OpenNI2 ***
2567 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENNI2, true)
2568 AG_GST_CHECK_FEATURE(OPENNI2, [openni2 library], openni2, [
2569   PKG_CHECK_MODULES(OPENNI2, libopenni2 >= 0.26, HAVE_OPENNI2="yes", [ HAVE_OPENNI2="no" ] )
2570   AC_SUBST(OPENNI2_CFLAGS)
2571   AC_SUBST(OPENNI2_LIBS)
2572 ])
2573
2574 dnl *** Opus ***
2575 translit(dnm, m, l) AM_CONDITIONAL(USE_OPUS, true)
2576 AG_GST_CHECK_FEATURE(OPUS, [opus], opus, [
2577   PKG_CHECK_MODULES(OPUS, opus >= 0.9.4, [
2578           AC_DEFINE([HAVE_OPUS], 1, [Define if Opus >= 0.9.4 is installed])
2579           HAVE_OPUS="yes"
2580   ], [
2581           HAVE_OPUS="no"
2582   ])
2583   AC_SUBST(OPUS_CFLAGS)
2584   AC_SUBST(OPUS_LIBS)
2585 ])
2586
2587 dnl *** pvr ***
2588 translit(dnm, m, l) AM_CONDITIONAL(USE_PVR, true)
2589 AG_GST_CHECK_FEATURE(PVR, [pvrvideosink], pvr, [
2590   PKG_CHECK_MODULES([PVR], [libtimemmgr], HAVE_PVR=yes, HAVE_PVR=no)
2591   AC_SUBST(PVR_CFLAGS)
2592   AC_SUBST(PVR_LIBS)
2593 ])
2594
2595  AC_ARG_WITH([pvr-external-headers],
2596               AS_HELP_STRING([--with-pvr-external-headers],[Use system installed PVR2D headers]),
2597               [AS_IF([test "x$with_pvr_external_headers" = "xno"],
2598                      [PVR_CFLAGS="$PVR_CFLAGS -I\$(srcdir)/pvr_includes"])],
2599               [PVR_CFLAGS="$PVR_CFLAGS -I\$(srcdir)/pvr_includes"])
2600
2601 dnl *** rsvg ***
2602 translit(dnm, m, l) AM_CONDITIONAL(USE_RSVG, true)
2603 AG_GST_CHECK_FEATURE(RSVG, [rsvg decoder], rsvg, [
2604   PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= 2.36 cairo, [
2605     HAVE_RSVG="yes"
2606     PKG_CHECK_MODULES(RSVG_2_36_2, librsvg-2.0 >= 2.36.2, HAVE_RSVG_2_36_2="yes", HAVE_RSVG_2_36_2="no")
2607     if test "x$HAVE_RSVG_2_36_2" = "xyes"; then
2608       AC_DEFINE(HAVE_RSVG_2_36_2, [1], [Have RSVG 2.36.2 or newer])
2609     fi
2610   ], [
2611     HAVE_RSVG="no"
2612   ])
2613   AC_SUBST(RSVG_CFLAGS)
2614   AC_SUBST(RSVG_LIBS)
2615 ])
2616
2617 dnl *** gl ***
2618 translit(dnm, m, l) AM_CONDITIONAL(USE_GL, true)
2619 AG_GST_CHECK_FEATURE(GL, [gl elements], gl, [
2620   HAVE_GL="no"
2621
2622   if test x"$USE_OPENGL" = x"yes" -o x"$USE_GLES2" = x"yes"; then
2623     HAVE_GL="yes"
2624   fi
2625 ])
2626
2627 dnl *** gtk+ ***
2628 HAVE_GTK3_GL="no"
2629 translit(dnm, m, l) AM_CONDITIONAL(USE_GTK3, true)
2630 AG_GST_CHECK_FEATURE(GTK3, [Gtk+ elements], gtk, [
2631   PKG_CHECK_MODULES(GTK3, gtk+-3.0, [
2632     AC_DEFINE([HAVE_GTK3], 1, [Define if Gtk+ 3.0 is installed])
2633     HAVE_GTK3="yes"
2634   ], [
2635     HAVE_GTK3="no"
2636   ])
2637   PKG_CHECK_MODULES(GTK3_GL, gtk+-3.0 >= 3.15.0, [
2638     GDK_WINDOWING="no"
2639     if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
2640       PKG_CHECK_MODULES(GTK3_X11, gtk+-x11-3.0, [
2641         GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_X11_CFLAGS"
2642         GTK3_LIBS="$GTK3_LIBS $GTK3_X11_LIBS"
2643         GDK_WINDOWING="yes"
2644       ], [AC_MSG_NOTICE([Could not find Gtk X11 integration])])
2645     fi
2646     if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
2647       PKG_CHECK_MODULES(GTK3_WAYLAND, gtk+-wayland-3.0, [
2648         GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_WAYLAND_CFLAGS"
2649         GTK3_LIBS="$GTK3_LIBS $GTK3_WAYLAND_LIBS"
2650         GDK_WINDOWING="yes"
2651       ], [AC_MSG_NOTICE([Could not find Gtk Wayland integration])])
2652     fi
2653     if test "x$GDK_WINDOWING" = "xyes"; then
2654       AC_DEFINE([HAVE_GTK3_GL], 1, [Define if Gtk+ 3.0 GL is installed])
2655       HAVE_GTK3_GL="yes"
2656     fi
2657   ], [
2658       HAVE_GTK3_GL="no"
2659   ])
2660 ])
2661 AM_CONDITIONAL(USE_GTK3_GL, test "x$HAVE_GTK3_GL" = "xyes")
2662
2663 dnl *** Qt ***
2664 translit(dnm, m, l) AM_CONDITIONAL(USE_QT, true)
2665 AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
2666   PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Quick >= 5.4.0, [
2667       QT_PATH=`$PKG_CONFIG --variable=exec_prefix Qt5Core`
2668       QT_HOST_PATH=`$PKG_CONFIG --variable=host_bins Qt5Core`
2669       AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
2670       AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
2671       AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
2672       if test "x$MOC" = "x" || test "x$UIC" = "x" || test "x$RCC" = "x"; then
2673         AC_MSG_WARN([One of the required qt build programs was not found])
2674         HAVE_QT="no"
2675       else
2676         HAVE_QT="yes"
2677         HAVE_QT_WINDOWING="no"
2678         if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
2679           PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
2680             AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
2681             QT_CFLAGS="$QT_CFLAGS $QT_X11_CFLAGS"
2682             QT_LIBS="$QT_LIBS $QT_X11_LIBS"
2683             HAVE_QT_WINDOWING="yes"
2684           ], [AC_MSG_NOTICE([Could not find Qt X11 integration])])
2685         fi
2686         if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
2687           PKG_CHECK_MODULES(QT_WAYLAND, Qt5WaylandClient, [
2688             AC_DEFINE([HAVE_QT_WAYLAND], [],
2689                 [Define if Qt Wayland integration is installed])
2690             QT_CFLAGS="$QT_CFLAGS $QT_WAYLAND_CFLAGS"
2691             QT_LIBS="$QT_LIBS $QT_WAYLAND_LIBS"
2692             HAVE_QT_WINDOWING="yes"
2693           ], [AC_MSG_NOTICE([Could not find Qt Wayland integration])])
2694         fi
2695         if test "x$GST_GL_HAVE_WINDOW_ANDROID" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
2696           PKG_CHECK_MODULES(QT_ANDROID, Qt5AndroidExtras, [
2697             # c++ on android requires a standard library and there are multiple
2698             # choices.  cerbero provides a pkg-config file the describes a choice
2699             # so try to use that.  Outside cerbero one has to pass these flags
2700             # manually for the library one is using
2701             PKG_CHECK_MODULES(GNUSTL, gnustl, [
2702               QT_CFLAGS="$QT_CFLAGS $GNUSTL_CFLAGS"
2703               QT_LIBS="$QT_CFLAGS $GNUSTL_LIBS"
2704               ], [
2705               AC_MSG_NOTICE([Could not find Standard C++ library])])
2706
2707             AC_DEFINE([HAVE_QT_ANDROID], [],
2708                 [Define if Qt Android integration is installed])
2709             QT_CFLAGS="$QT_CFLAGS $QT_ANDROID_CFLAGS"
2710             QT_LIBS="$QT_LIBS $QT_ANDROID_LIBS"
2711             HAVE_QT_WINDOWING="yes"
2712           ], [AC_MSG_NOTICE([Could not find Qt Android integration])])
2713         fi
2714         if test "x$HAVE_QT_WINDOWING" = "xno"; then
2715           AC_MSG_WARN([Could not find any Qt Windowing integration])
2716           HAVE_QT="no"
2717         fi
2718         AC_SUBST([QT_CFLAGS])
2719         AC_SUBST([QT_LIBS])
2720       fi
2721   ], [
2722       HAVE_QT="no"
2723   ])
2724 ])
2725
2726 dnl *** libvisual ***
2727 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBVISUAL, true)
2728 AG_GST_CHECK_FEATURE(LIBVISUAL, [libvisual visualization library], libvisual, [
2729   AG_GST_PKG_CHECK_MODULES(LIBVISUAL, libvisual-0.4 >= 0.4.0)
2730   if test x$HAVE_LIBVISUAL = xyes; then
2731     LIBVIS_PLUGINSDIR="`$PKG_CONFIG --variable=pluginsbasedir libvisual-0.4`"
2732   fi
2733   AC_MSG_NOTICE([libvisual pluginsdir: $LIBVIS_PLUGINSDIR])
2734   if test x$LIBVIS_PLUGINSDIR != x; then
2735     AC_DEFINE_UNQUOTED(LIBVISUAL_PLUGINSBASEDIR,
2736         "$LIBVIS_PLUGINSDIR",
2737         [directory in which the detected libvisual's plugins are located])
2738   fi
2739 ])
2740
2741 dnl *** timidity ***
2742 translit(dnm, m, l) AM_CONDITIONAL(USE_TIMIDITY, true)
2743 AG_GST_CHECK_FEATURE(TIMIDITY, [timidity midi soft synth plugin], timidity, [
2744   PKG_CHECK_MODULES(TIMIDITY, libtimidity, [
2745     HAVE_TIMIDITY="yes",
2746         AC_MSG_CHECKING([for timidity.cfg])
2747         timidity_cfg=""
2748         if test -r /etc/timidity.cfg; then
2749           timidity_cfg=/etc/timidity.cfg
2750         elif test -r /etc/timidity/timidity.cfg; then
2751           timidity_cfg=/etc/timidity/timidity.cfg
2752         elif test -r /usr/share/timidity/timidity.cfg; then
2753           timidity_cfg=/usr/share/timidity/timidity.cfg
2754         elif test -r /usr/local/share/timidity/timidity.cfg; then
2755           timidity_cfg=/usr/local/share/timidity/timidity.cfg
2756         fi
2757         if test "x$timidity_cfg" != "x"; then
2758           AC_MSG_RESULT($timidity_cfg)
2759       AC_DEFINE_UNQUOTED(TIMIDITY_CFG, "$timidity_cfg", [Define location of timidity.cfg])
2760         else
2761           AC_MSG_RESULT([not found])
2762         fi
2763   ], [
2764     HAVE_TIMIDITY="no"
2765   ])
2766   AC_SUBST(TIMIDITY_CFLAGS)
2767   AC_SUBST(TIMIDITY_LIBS)
2768 ])
2769
2770 dnl *** teletextdec ***
2771 translit(dnm, m, l) AM_CONDITIONAL(USE_TELETEXTDEC, true)
2772 AG_GST_CHECK_FEATURE(TELETEXTDEC, [Teletext decoder], teletextdec, [
2773   AG_GST_PKG_CHECK_MODULES(TELETEXTDEC, zvbi-0.2)
2774  ])
2775
2776 dnl *** wildmidi ***
2777 translit(dnm, m, l) AM_CONDITIONAL(USE_WILDMIDI, true)
2778 AG_GST_CHECK_FEATURE(WILDMIDI, [wildmidi midi soft synth plugin], wildmidi, [
2779   AG_GST_CHECK_LIBHEADER(WILDMIDI, WildMidi,
2780                          WildMidi_Init, ,
2781                          wildmidi_lib.h,
2782                          WILDMIDI_LIBS="-lWildMidi")
2783   AC_CHECK_LIB(WildMidi, WildMidi_LoadSamples, AC_DEFINE(HAVE_WILDMIDI_0_2_2, [1], [Have WildMidi 0.2.2 or earlier library]))
2784
2785   if test "x$HAVE_WILDMIDI" = "xyes"; then
2786          WILDMIDI_CFLAGS=
2787          WILDMIDI_LIBS=-lWildMidi
2788          AC_MSG_NOTICE(compiling gstWildMidi)
2789   else
2790          WILDMIDI_CFLAGS=
2791          WILDMIDI_LIBS=
2792          AC_MSG_WARN(no WildMidi library found (libWildMidi))
2793   fi
2794   AC_SUBST(WILDMIDI_CFLAGS)
2795   AC_SUBST(WILDMIDI_LIBS)
2796 ])
2797
2798 dnl *** SDL ***
2799 translit(dnm, m, l) AM_CONDITIONAL(USE_SDL, true)
2800 AG_GST_CHECK_FEATURE(SDL, [SDL plug-in], sdlvideosink sdlaudiosink, [
2801     AM_PATH_SDL(, HAVE_SDL=yes, HAVE_SDL=no)
2802 ])
2803
2804 dnl **** Smooth Streaming ****
2805 translit(dnm, m, l) AM_CONDITIONAL(USE_SMOOTHSTREAMING, true)
2806 AG_GST_CHECK_FEATURE(SMOOTHSTREAMING, [Smooth Streaming plug-in], smoothstreaming, [
2807   PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.4,
2808     [HAVE_LIBXML2="yes"
2809      HAVE_SMOOTHSTREAMING="yes"],
2810     [HAVE_LIBXML2="no"
2811      HAVE_SMOOTHSTREAMING="no"])
2812   AC_SUBST(LIBXML2_CFLAGS)
2813   AC_SUBST(LIBXML2_LIBS)
2814 ])
2815
2816 dnl *** sndfile ***
2817 translit(dnm, m, l) AM_CONDITIONAL(USE_SNDFILE, true)
2818 AG_GST_CHECK_FEATURE(SNDFILE, [sndfile plug-in], sfdec sfenc, [
2819   PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.16, HAVE_SNDFILE="yes", HAVE_SNDFILE="no")
2820   AC_SUBST(SNDFILE_CFLAGS)
2821   AC_SUBST(SNDFILE_LIBS)
2822 ])
2823
2824 dnl *** soundtouch ***
2825 translit(dnm, m, l) AM_CONDITIONAL(USE_SOUNDTOUCH, true)
2826 AG_GST_CHECK_FEATURE(SOUNDTOUCH, [soundtouch plug-in], soundtouch, [
2827   dnl We only need -lBPM on soundtouch < 1.4
2828   dnl We check for libSoundTouch since Debian used it before upstream
2829   dnl added a pkgconfig file.
2830   HAVE_SOUNDTOUCH_1_4=yes
2831   PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch,
2832     [HAVE_SOUNDTOUCH=yes],
2833     [PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch-1.4,
2834       [HAVE_SOUNDTOUCH=yes],
2835       [PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch-1.0,
2836         [HAVE_SOUNDTOUCH=yes
2837           HAVE_SOUNDTOUCH_1_4=no
2838           SOUNDTOUCH_LIBS="$SOUNDTOUCH_LIBS -lBPM"],
2839         [PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch >= 1.4,
2840           [HAVE_SOUNDTOUCH=yes],
2841           [PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch,
2842             [HAVE_SOUNDTOUCH=yes
2843               HAVE_SOUNDTOUCH_1_4=no
2844               SOUNDTOUCH_LIBS="$SOUNDTOUCH_LIBS -lBPM"],
2845             HAVE_SOUNDTOUCH=no)])])])])
2846   AC_SUBST(SOUNDTOUCH_CFLAGS)
2847   AC_SUBST(SOUNDTOUCH_LIBS)
2848   if test "x$HAVE_CXX" != "xyes"; then
2849     USE_SOUNDTOUCH=false
2850     AC_MSG_NOTICE([Not building soundtouch plugin: no C++ compiler found])
2851   fi
2852   if test "x$HAVE_SOUNDTOUCH" = "xyes" -a "x$HAVE_SOUNDTOUCH_1_4" = "xyes"; then
2853      AC_DEFINE([HAVE_SOUNDTOUCH_1_4], [1],
2854          [Defined if the available libSoundTouch is >= 1.4])
2855   fi
2856 ])
2857
2858 dnl *** spc ***
2859 translit(dnm, m, l) AM_CONDITIONAL(USE_SPC, true)
2860 AG_GST_CHECK_FEATURE(SPC, [spc decoder], spc, [
2861   AC_CHECK_HEADER(openspc.h, [
2862     AC_CHECK_LIB(openspc, OSPC_Init, [
2863       SPC_LIBS="-lopenspc"
2864       AC_SUBST(SPC_LIBS)
2865       HAVE_SPC=yes
2866     ], [
2867       HAVE_SPC=no
2868     ])
2869   ], [
2870     HAVE_SPC=no
2871   ])
2872 ])
2873
2874 dnl *** gme ***
2875 translit(dnm, m, l) AM_CONDITIONAL(USE_GME, true)
2876 AG_GST_CHECK_FEATURE(GME, [gme decoder], gme, [
2877   AC_CHECK_HEADER(gme/gme.h, [
2878     AC_CHECK_LIB(gme, gme_new_emu, [
2879       GME_LIBS="-lgme"
2880       AC_SUBST(GME_LIBS)
2881       HAVE_GME=yes
2882     ], [
2883       HAVE_GME=no
2884     ])
2885   ], [
2886     HAVE_GME=no
2887   ])
2888
2889   if test "x$HAVE_GME" = "xyes"; then
2890     AC_CHECK_LIB(gme, gme_enable_accuracy, [
2891       AC_DEFINE(HAVE_LIBGME_ACCURACY, 1, [Define if gme 0.5.6 or newer is available])
2892       ])
2893   fi
2894 ])
2895
2896 dnl *** XVID ***
2897 translit(dnm, m, l) AM_CONDITIONAL(USE_XVID, true)
2898 AG_GST_CHECK_FEATURE(XVID, [xvid plugins], xvid, [
2899   HAVE_XVID=no
2900   AC_CHECK_HEADER(xvid.h, [
2901     OLD_LIBS="$LIBS"
2902     LIBS="$PTHREAD_LIBS $LIBM"
2903     AC_CHECK_LIB(xvidcore, xvid_encore, [
2904       AC_CHECK_LIB(xvidcore, xvid_decore, [
2905         AC_CHECK_LIB(xvidcore, xvid_global, [
2906           AC_MSG_CHECKING([for up-to-date XviD API version])
2907           AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xvid.h>]], [[
2908               #if XVID_API_MAJOR(XVID_API) != 4
2909               #error "Incompatible XviD API version"
2910               #endif
2911               #if XVID_API_MAJOR(XVID_API) == 4 && XVID_API_MINOR(XVID_API) < 3
2912               #error "Incompatible XviD API version"
2913               #endif
2914           ]])],[ AC_MSG_RESULT(yes)
2915             XVID_LIBS="-lxvidcore $LIBM"
2916             AC_SUBST(XVID_LIBS)
2917             HAVE_XVID=yes
2918           ],[AC_MSG_RESULT(no) ])
2919         ], )
2920       ], )
2921     ], )
2922     LIBS="$OLD_LIBS"
2923   ], )
2924 ])
2925
2926 dnl *** dvb ***
2927 translit(dnm, m, l) AM_CONDITIONAL(USE_DVB, true)
2928 AG_GST_CHECK_FEATURE(DVB, [DVB Source], dvb, [
2929   AC_MSG_CHECKING([Checking for up to date dvb installation])
2930   AC_CHECK_HEADER(linux/dvb/version.h, [
2931     AC_MSG_CHECKING([for up-to-date dvb API])
2932     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/dvb/version.h>]], [[
2933         #if DVB_API_VERSION < 5 || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR <= 4)
2934         #error "Incompatible dvb API"
2935         #endif
2936     ]])], [ AC_MSG_RESULT(yes)
2937       HAVE_DVB="yes"
2938     ], [ AC_MSG_RESULT(no)
2939       HAVE_DVB="no"
2940     ])
2941   ], [HAVE_DVB="no"])
2942 ])
2943
2944 dnl *** wininet ***
2945 translit(dnm, m, l) AM_CONDITIONAL(USE_WININET, true)
2946 AG_GST_CHECK_FEATURE(WININET, [Windows internet library], wininet, [
2947   AC_MSG_CHECKING([Checking for windows internet support])
2948   AC_CHECK_HEADERS([windows.h wininet.h],
2949       [HAVE_WININET="yes"], [HAVE_WININET="no"],
2950       [AC_INCLUDES_DEFAULT
2951 #include <windows.h>])
2952 ])
2953
2954 dnl *** acm ***
2955 translit(dnm, m, l) AM_CONDITIONAL(USE_ACM, true)
2956 AG_GST_CHECK_FEATURE(ACM, [Windows ACM library], acm, [
2957   AC_MSG_CHECKING([Checking for ACM support])
2958   AC_CHECK_HEADERS([windows.h msacm.h],
2959       [HAVE_ACM="yes"
2960        AC_SUBST(ACMENC_CFLAGS)
2961        AC_SUBST(ACMMP3DEC_CFLAGS)
2962       ], [HAVE_ACM="no"],
2963       [AC_INCLUDES_DEFAULT
2964 #include <windows.h>])
2965 ])
2966
2967 dnl *** vdpau ***
2968 translit(dnm, m, l) AM_CONDITIONAL(USE_VDPAU, true)
2969 AG_GST_CHECK_FEATURE(VDPAU, [VDPAU], vdpau, [
2970   VDPAU_CFLAGS=
2971   VDPAU_LIBS=-lvdpau
2972   HAVE_VDPAU=no
2973
2974   PKG_CHECK_MODULES(VDPAU, vdpau, [HAVE_VDPAU="yes"],
2975   [
2976     if test "$HAVE_VDPAU" = "no"; then
2977       saved_CPPFLAGS="$CPPFLAGS"
2978       AC_CHECK_HEADER([vdpau/vdpau.h], [HAVE_VDPAU_H=yes])
2979
2980       if test -z "$HAVE_VDPAU_H"; then
2981         dnl Didn't find VDPAU header straight away.
2982         dnl Try /usr/include/nvidia. Need to clear caching vars first
2983         AC_MSG_NOTICE([VDPAU header not in standard path. Checking /usr/include/nvidia])
2984         unset ac_cv_header_vdpau_vdpau_h
2985         unset ac_cv_header_vdpau_vdpau_x11_h
2986         VDPAU_CFLAGS="-I/usr/include/nvidia"
2987         VDPAU_LIBS="-L/usr/lib/nvidia -lvdpau"
2988         CPPFLAGS="$VDPAU_CFLAGS $saved_CPPFLAGS"
2989         AC_CHECK_HEADER([vdpau/vdpau.h], [HAVE_VDPAU_H=yes])
2990       fi
2991
2992       AC_CHECK_HEADER([vdpau/vdpau_x11.h], [HAVE_VDPAU_X11_H=yes])
2993
2994       if test "x$HAVE_VDPAU_H" = "xyes" -a "x$HAVE_VDPAU_X11_H" = "xyes"; then
2995         dnl Found the headers - look for the lib
2996         AC_MSG_NOTICE([VDPAU headers found. Checking libraries])
2997         saved_LIBS="$LIBS"
2998         LIBS="$VDPAU_LIBS $saved_LIBS"
2999         AC_CHECK_LIB(vdpau,vdp_device_create_x11,[HAVE_VDPAU="yes"])
3000         LIBS="$saved_LIBS"
3001       fi
3002     fi
3003   ])
3004
3005   if test "$HAVE_VDPAU" = "yes"; then
3006     AC_MSG_NOTICE([Found up to date VDPAU installation])
3007     AC_SUBST(VDPAU_CFLAGS)
3008     AC_SUBST(VDPAU_LIBS)
3009   fi
3010 ])
3011
3012 dnl *** sbc ***
3013 translit(dnm, m, l) AM_CONDITIONAL(USE_SBC, true)
3014 AG_GST_CHECK_FEATURE(SBC, [SBC bluetooth audio codec], sbc, [
3015   AG_GST_PKG_CHECK_MODULES(SBC, [sbc >= 1.0])
3016 ])
3017
3018 dnl *** schroedinger ***
3019 translit(dnm, m, l) AM_CONDITIONAL(USE_SCHRO, true)
3020 AG_GST_CHECK_FEATURE(SCHRO, [Schroedinger video codec], schro, [
3021   AG_GST_PKG_CHECK_MODULES(SCHRO, schroedinger-1.0 >= 1.0.10)
3022 ])
3023
3024 dnl *** zbar ***
3025 translit(dnm, m, l) AM_CONDITIONAL(USE_ZBAR, true)
3026 AG_GST_CHECK_FEATURE(ZBAR, [ZBar barcode detector], zbar, [
3027   AG_GST_PKG_CHECK_MODULES(ZBAR, zbar >= 0.9)
3028 ])
3029
3030 dnl *** rtmp ***
3031 translit(dnm, m, l) AM_CONDITIONAL(USE_RTMP, true)
3032 AG_GST_CHECK_FEATURE(RTMP, [rtmp library], rtmp, [
3033   AG_GST_PKG_CHECK_MODULES(RTMP, librtmp)
3034 ])
3035
3036 dnl *** spandsp ***
3037 translit(dnm, m, l) AM_CONDITIONAL(USE_SPANDSP, true)
3038 AG_GST_CHECK_FEATURE(SPANDSP, [Spandsp], spandsp, [
3039   PKG_CHECK_MODULES(SPANDSP, spandsp >= 0.0.6, [
3040     HAVE_SPANDSP="yes" ], [
3041     HAVE_SPANDSP="no"
3042   ])
3043 ])
3044 AC_SUBST(SPANDSP_CFLAGS)
3045 AC_SUBST(SPANDSP_LIBS)
3046
3047 dnl *** GSettings ***
3048 translit(dnm, m, l) AM_CONDITIONAL(USE_GSETTINGS, true)
3049 AG_GST_CHECK_FEATURE(GSETTINGS, [GSettings plugin], gsettings, [
3050   AG_GST_PKG_CHECK_MODULES(GSETTINGS, gio-2.0 >= 2.25.0)
3051   if test "x$HAVE_GSETTINGS" = "xyes"; then
3052     GLIB_GSETTINGS
3053   fi
3054 ])
3055
3056 dnl *** sndio ***
3057 translit(dnm, m, l) AM_CONDITIONAL(USE_SNDIO, true)
3058 AG_GST_CHECK_FEATURE(SNDIO, [sndio audio], sndio, [
3059   AC_CHECK_HEADER(sndio.h, HAVE_SNDIO="yes", HAVE_SNDIO="no")
3060   if test "x$HAVE_SNDIO" = "xyes"; then
3061     AC_CHECK_LIB(sndio, sio_open, HAVE_SNDIO="yes", HAVE_SNDIO="no")
3062     if test "x$HAVE_SNDIO" = "xyes"; then
3063       SNDIO_LIBS=-lsndio
3064       AC_SUBST(SNDIO_LIBS)
3065     fi
3066   fi
3067 ])
3068
3069 dnl *** hls ***
3070 translit(dnm, m, l) AM_CONDITIONAL(USE_HLS, true)
3071 AG_GST_CHECK_FEATURE(HLS, [http live streaming plugin], hls, [
3072   PKG_CHECK_MODULES(NETTLE, nettle,
3073   [
3074     AC_DEFINE(HAVE_NETTLE, 1, [Define if nettle is available])
3075     HAVE_HLS="yes"
3076   ], [
3077     AM_PATH_LIBGCRYPT([1.2.0],
3078     [
3079       AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if libgcrypt is available])
3080       HAVE_HLS="yes"
3081     ], [
3082       PKG_CHECK_MODULES(OPENSSL, openssl,
3083       [
3084         AC_DEFINE(HAVE_OPENSSL, 1, [Define if openssl is available])
3085         HAVE_HLS="yes"
3086       ], [
3087         HAVE_HLS="no"
3088       ])
3089     ])
3090   ])
3091 ])
3092
3093 dnl *** x265 (H.265/HEVC encoder) ***
3094 translit(dnm, m, l) AM_CONDITIONAL(USE_X265, true)
3095 AG_GST_CHECK_FEATURE(X265, [x265 plug-in], x265, [
3096   AG_GST_PKG_CHECK_MODULES(X265, x265)
3097 ])
3098
3099 else
3100
3101 dnl not building plugins with external dependencies,
3102 dnl but we still need to set the conditionals
3103
3104 AM_CONDITIONAL(USE_ASSRENDER, false)
3105 AM_CONDITIONAL(USE_VOAMRWBENC, false)
3106 AM_CONDITIONAL(USE_VOAACENC, false)
3107 AM_CONDITIONAL(USE_APEXSINK, false)
3108 AM_CONDITIONAL(USE_BS2B, false)
3109 AM_CONDITIONAL(USE_BZ2, false)
3110 AM_CONDITIONAL(USE_CHROMAPRINT, false)
3111 AM_CONDITIONAL(USE_CURL, false)
3112 AM_CONDITIONAL(USE_SSH2, false)
3113 AM_CONDITIONAL(USE_DASH, false)
3114 AM_CONDITIONAL(USE_DC1394, false)
3115 AM_CONDITIONAL(USE_DECKLINK, false)
3116 AM_CONDITIONAL(DECKLINK_OSX, false)
3117 AM_CONDITIONAL(USE_DIRECTFB, false)
3118 AM_CONDITIONAL(USE_WAYLAND, false)
3119 AM_CONDITIONAL(USE_DAALA, false)
3120 AM_CONDITIONAL(USE_DTS, false)
3121 AM_CONDITIONAL(USE_EXIF, false)
3122 AM_CONDITIONAL(USE_RESINDVD, false)
3123 AM_CONDITIONAL(USE_FAAC, false)
3124 AM_CONDITIONAL(USE_FAAD, false)
3125 AM_CONDITIONAL(USE_FBDEV, false)
3126 AM_CONDITIONAL(USE_FLITE, false)
3127 AM_CONDITIONAL(USE_FLUIDSYNTH, false)
3128 AM_CONDITIONAL(USE_GL, false)
3129 AM_CONDITIONAL(USE_GSM, false)
3130 AM_CONDITIONAL(USE_GTK3, false)
3131 AM_CONDITIONAL(USE_GTK3_GL, false)
3132 AM_CONDITIONAL(USE_HLS, false)
3133 AM_CONDITIONAL(USE_KATE, false)
3134 AM_CONDITIONAL(USE_TIGER, false)
3135 AM_CONDITIONAL(USE_LADSPA, false)
3136 AM_CONDITIONAL(USE_LV2, false)
3137 AM_CONDITIONAL(USE_LIBDE265, false)
3138 AM_CONDITIONAL(USE_LIBMMS, false)
3139 AM_CONDITIONAL(USE_LINSYS, false)
3140 AM_CONDITIONAL(USE_MODPLUG, false)
3141 AM_CONDITIONAL(USE_MIMIC, false)
3142 AM_CONDITIONAL(USE_MPEG2ENC, false)
3143 AM_CONDITIONAL(USE_MPG123, false)
3144 AM_CONDITIONAL(USE_MPLEX, false)
3145 AM_CONDITIONAL(USE_MUSEPACK, false)
3146 AM_CONDITIONAL(USE_NAS, false)
3147 AM_CONDITIONAL(USE_NEON, false)
3148 AM_CONDITIONAL(USE_OFA, false)
3149 AM_CONDITIONAL(USE_OPENAL, false)
3150 AM_CONDITIONAL(USE_OPENCV, false)
3151 AM_CONDITIONAL(USE_OPENEXR, false)
3152 AM_CONDITIONAL(USE_OPENJPEG, false)
3153 AM_CONDITIONAL(USE_OPENNI2, false)
3154 AM_CONDITIONAL(USE_OPUS, false)
3155 AM_CONDITIONAL(USE_PVR, false)
3156 AM_CONDITIONAL(USE_QT, false)
3157 AM_CONDITIONAL(USE_LIBVISUAL, false)
3158 AM_CONDITIONAL(USE_TIMIDITY, false)
3159 AM_CONDITIONAL(USE_WILDMIDI, false)
3160 AM_CONDITIONAL(USE_SDL, false)
3161 AM_CONDITIONAL(USE_SMOOTHSTREAMING, false)
3162 AM_CONDITIONAL(USE_SNDFILE, false)
3163 AM_CONDITIONAL(USE_SOUNDTOUCH, false)
3164 AM_CONDITIONAL(USE_SPANDSP, false)
3165 AM_CONDITIONAL(USE_SPC, false)
3166 AM_CONDITIONAL(USE_SRTP, false)
3167 AM_CONDITIONAL(USE_GME, false)
3168 AM_CONDITIONAL(USE_GSETTINGS, false)
3169 AM_CONDITIONAL(USE_XVID, false)
3170 AM_CONDITIONAL(USE_DVB, false)
3171 AM_CONDITIONAL(USE_WININET, false)
3172 AM_CONDITIONAL(USE_ACM, false)
3173 AM_CONDITIONAL(USE_VDPAU, false)
3174 AM_CONDITIONAL(USE_SBC, false)
3175 AM_CONDITIONAL(USE_SCHRO, false)
3176 AM_CONDITIONAL(USE_ZBAR, false)
3177 AM_CONDITIONAL(USE_RSVG, false)
3178 AM_CONDITIONAL(USE_RTMP, false)
3179 AM_CONDITIONAL(USE_TELETEXTDEC, false)
3180 AM_CONDITIONAL(USE_SNDIO, false)
3181 AM_CONDITIONAL(USE_UVCH264, false)
3182 AM_CONDITIONAL(USE_WEBP, false)
3183 AM_CONDITIONAL(USE_OPENH264, false)
3184 AM_CONDITIONAL(USE_X265, false)
3185 AM_CONDITIONAL(USE_DTLS, false)
3186
3187 fi dnl of EXT plugins
3188
3189 dnl *** finalize CFLAGS, LDFLAGS, LIBS
3190
3191 dnl Overview:
3192 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
3193 dnl GST_*:              flags shared by built objects to link against GStreamer
3194 dnl GST_ALL_LDFLAGS:    linker flags shared by all
3195 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
3196 dnl GST_LT_LDFLAGS:     library versioning of our libraries
3197 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
3198
3199 dnl GST_OPTION_CFLAGS
3200 if test "x$USE_DEBUG" = xyes; then
3201    PROFILE_CFLAGS="-g"
3202 fi
3203 AC_SUBST(PROFILE_CFLAGS)
3204
3205 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
3206   dnl Define _only_ during CVS (not pre-releases or releases)
3207   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
3208 else
3209   DEPRECATED_CFLAGS=""
3210 fi
3211 AC_SUBST(DEPRECATED_CFLAGS)
3212
3213 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
3214 dnl at make time with e.g. make ERROR_CFLAGS=""
3215 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
3216 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
3217 GST_OPTION_OBJCFLAGS="\$(WARNING_OBJCFLAGS) \$(ERROR_OBJCFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
3218 AC_SUBST(GST_OPTION_CFLAGS)
3219 AC_SUBST(GST_OPTION_CXXFLAGS)
3220 AC_SUBST(GST_OPTION_OBJCFLAGS)
3221
3222 dnl FIXME: do we want to rename to GST_ALL_* ?
3223 dnl prefer internal headers to already installed ones
3224 dnl also add builddir include for enumtypes and marshal
3225 dnl add GST_OPTION_CFLAGS, but overridable
3226 GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
3227 GST_CXXFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS)"
3228 GST_OBJCFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_OBJCFLAGS)"
3229 GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
3230 AC_SUBST(GST_CFLAGS)
3231 AC_SUBST(GST_CXXFLAGS)
3232 AC_SUBST(GST_OBJCFLAGS)
3233 AC_SUBST(GST_LIBS)
3234 GST_PLUGINS_BAD_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
3235 GST_PLUGINS_BAD_OBJCFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
3236 GST_PLUGINS_BAD_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
3237 AC_SUBST(GST_PLUGINS_BAD_CFLAGS)
3238 AC_SUBST(GST_PLUGINS_BAD_CXXFLAGS)
3239 AC_SUBST(GST_PLUGINS_BAD_OBJCFLAGS)
3240
3241 dnl LDFLAGS really should only contain flags, not libs - they get added before
3242 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
3243 GST_ALL_LDFLAGS="-no-undefined"
3244 AC_SUBST(GST_ALL_LDFLAGS)
3245
3246 dnl GST_LIB_LDFLAGS
3247 dnl linker flags shared by all libraries
3248 dnl LDFLAGS modifier defining exported symbols from built libraries
3249 dnl (export _gst_foo but not __gst_foo)
3250 GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*"
3251 AC_SUBST(GST_LIB_LDFLAGS)
3252
3253 dnl this really should only contain flags, not libs - they get added before
3254 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
3255 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
3256 AC_SUBST(GST_PLUGIN_LDFLAGS)
3257
3258 dnl *** output files ***
3259
3260 $MKDIR_P tests/check/orc
3261
3262 dnl po/Makefile.in
3263
3264 AC_CONFIG_FILES(
3265 Makefile
3266 common/Makefile
3267 common/m4/Makefile
3268 gst-plugins-bad.spec
3269 gst/Makefile
3270 gst/accurip/Makefile
3271 gst/adpcmdec/Makefile
3272 gst/adpcmenc/Makefile
3273 gst/aiff/Makefile
3274 gst/asfmux/Makefile
3275 gst/audiofxbad/Makefile
3276 gst/audiomixer/Makefile
3277 gst/audiovisualizers/Makefile
3278 gst/autoconvert/Makefile
3279 gst/bayer/Makefile
3280 gst/camerabin2/Makefile
3281 gst/cdxaparse/Makefile
3282 gst/coloreffects/Makefile
3283 gst/dataurisrc/Makefile
3284 gst/dccp/Makefile
3285 gst/debugutils/Makefile
3286 gst/dvbsuboverlay/Makefile
3287 gst/dvdspu/Makefile
3288 gst/faceoverlay/Makefile
3289 gst/festival/Makefile
3290 gst/fieldanalysis/Makefile
3291 gst/freeverb/Makefile
3292 gst/frei0r/Makefile
3293 gst/gaudieffects/Makefile
3294 gst/geometrictransform/Makefile
3295 gst/gdp/Makefile
3296 gst/hdvparse/Makefile
3297 gst/id3tag/Makefile
3298 gst/inter/Makefile
3299 gst/interlace/Makefile
3300 gst/ivfparse/Makefile
3301 gst/ivtc/Makefile
3302 gst/jp2kdecimator/Makefile
3303 gst/jpegformat/Makefile
3304 gst/librfb/Makefile
3305 gst/liveadder/Makefile
3306 gst/midi/Makefile
3307 gst/mpegdemux/Makefile
3308 gst/mpegtsdemux/Makefile
3309 gst/mpegtsmux/Makefile
3310 gst/mpegtsmux/tsmux/Makefile
3311 gst/mpegpsmux/Makefile
3312 gst/mve/Makefile
3313 gst/mxf/Makefile
3314 gst/nuvdemux/Makefile
3315 gst/onvif/Makefile
3316 gst/patchdetect/Makefile
3317 gst/pcapparse/Makefile
3318 gst/pnm/Makefile
3319 gst/rawparse/Makefile
3320 gst/removesilence/Makefile
3321 gst/rtp/Makefile
3322 gst/sdi/Makefile
3323 gst/sdp/Makefile
3324 gst/segmentclip/Makefile
3325 gst/siren/Makefile
3326 gst/smooth/Makefile
3327 gst/speed/Makefile
3328 gst/subenc/Makefile
3329 gst/stereo/Makefile
3330 gst/tta/Makefile
3331 gst/videofilters/Makefile
3332 gst/videomeasure/Makefile
3333 gst/videoparsers/Makefile
3334 gst/videosignal/Makefile
3335 gst/vmnc/Makefile
3336 gst/y4m/Makefile
3337 gst/yadif/Makefile
3338 gst/compositor/Makefile
3339 gst-libs/Makefile
3340 gst-libs/gst/Makefile
3341 gst-libs/gst/adaptivedemux/Makefile
3342 gst-libs/gst/basecamerabinsrc/Makefile
3343 gst-libs/gst/gl/Makefile
3344 gst-libs/gst/gl/android/Makefile
3345 gst-libs/gst/gl/cocoa/Makefile
3346 gst-libs/gst/gl/dispmanx/Makefile
3347 gst-libs/gst/gl/glprototypes/Makefile
3348 gst-libs/gst/gl/eagl/Makefile
3349 gst-libs/gst/gl/egl/Makefile
3350 gst-libs/gst/gl/wayland/Makefile
3351 gst-libs/gst/gl/win32/Makefile
3352 gst-libs/gst/gl/x11/Makefile
3353 gst-libs/gst/insertbin/Makefile
3354 gst-libs/gst/interfaces/Makefile
3355 gst-libs/gst/codecparsers/Makefile
3356 gst-libs/gst/mpegts/Makefile
3357 gst-libs/gst/uridownloader/Makefile
3358 gst-libs/gst/wayland/Makefile
3359 gst-libs/gst/base/Makefile
3360 gst-libs/gst/video/Makefile
3361 sys/Makefile
3362 sys/dshowdecwrapper/Makefile
3363 sys/acmenc/Makefile
3364 sys/acmmp3dec/Makefile
3365 sys/androidmedia/Makefile
3366 sys/applemedia/Makefile
3367 sys/applemedia-nonpublic/Makefile
3368 sys/avc/Makefile
3369 sys/bluez/Makefile
3370 sys/d3dvideosink/Makefile
3371 sys/decklink/Makefile
3372 sys/directsound/Makefile
3373 sys/dshowsrcwrapper/Makefile
3374 sys/dshowvideosink/Makefile
3375 sys/dvb/Makefile
3376 sys/fbdev/Makefile
3377 sys/linsys/Makefile
3378 sys/opensles/Makefile
3379 sys/shm/Makefile
3380 sys/uvch264/Makefile
3381 sys/vcd/Makefile
3382 sys/vdpau/Makefile
3383 sys/pvr2d/Makefile
3384 sys/wasapi/Makefile
3385 sys/wininet/Makefile
3386 sys/winks/Makefile
3387 sys/winscreencap/Makefile
3388 tests/Makefile
3389 tests/check/Makefile
3390 tests/files/Makefile
3391 tests/examples/Makefile
3392 tests/examples/avsamplesink/Makefile
3393 tests/examples/camerabin2/Makefile
3394 tests/examples/codecparsers/Makefile
3395 tests/examples/directfb/Makefile
3396 tests/examples/gl/Makefile
3397 tests/examples/gl/cocoa/Makefile
3398 tests/examples/gl/clutter/Makefile
3399 tests/examples/gl/generic/Makefile
3400 tests/examples/gl/generic/cube/Makefile
3401 tests/examples/gl/generic/cubeyuv/Makefile
3402 tests/examples/gl/generic/doublecube/Makefile
3403 tests/examples/gl/generic/recordgraphic/Makefile
3404 tests/examples/gl/gtk/Makefile
3405 tests/examples/gl/gtk/gtkvideooverlay/Makefile
3406 tests/examples/gl/gtk/3dvideo/Makefile
3407 tests/examples/gl/gtk/filternovideooverlay/Makefile
3408 tests/examples/gl/gtk/filtervideooverlay/Makefile
3409 tests/examples/gl/gtk/fxtest/Makefile
3410 tests/examples/gl/gtk/switchvideooverlay/Makefile
3411 tests/examples/gl/qt/Makefile
3412 tests/examples/gl/sdl/Makefile
3413 tests/examples/gtk/Makefile
3414 tests/examples/mpegts/Makefile
3415 tests/examples/mxf/Makefile
3416 tests/examples/opencv/Makefile
3417 tests/examples/uvch264/Makefile
3418 tests/icles/Makefile
3419 ext/voamrwbenc/Makefile
3420 ext/voaacenc/Makefile
3421 ext/assrender/Makefile
3422 ext/apexsink/Makefile
3423 ext/bs2b/Makefile
3424 ext/bz2/Makefile
3425 ext/chromaprint/Makefile
3426 ext/curl/Makefile
3427 ext/dash/Makefile
3428 ext/dc1394/Makefile
3429 ext/directfb/Makefile
3430 ext/wayland/Makefile
3431 ext/daala/Makefile
3432 ext/dts/Makefile
3433 ext/gl/Makefile
3434 ext/gtk/Makefile
3435 ext/faac/Makefile
3436 ext/faad/Makefile
3437 ext/flite/Makefile
3438 ext/fluidsynth/Makefile
3439 ext/gsm/Makefile
3440 ext/hls/Makefile
3441 ext/kate/Makefile
3442 ext/ladspa/Makefile
3443 ext/lv2/Makefile
3444 ext/libde265/Makefile
3445 ext/libmms/Makefile
3446 ext/libvisual/Makefile
3447 ext/Makefile
3448 ext/modplug/Makefile
3449 ext/mpeg2enc/Makefile
3450 ext/mpg123/Makefile
3451 ext/mimic/Makefile
3452 ext/mplex/Makefile
3453 ext/musepack/Makefile
3454 ext/nas/Makefile
3455 ext/neon/Makefile
3456 ext/ofa/Makefile
3457 ext/openal/Makefile
3458 ext/opencv/Makefile
3459 ext/openexr/Makefile
3460 ext/openh264/Makefile
3461 ext/openjpeg/Makefile
3462 ext/openni2/Makefile
3463 ext/opus/Makefile
3464 ext/qt/Makefile
3465 ext/rsvg/Makefile
3466 ext/resindvd/Makefile
3467 ext/rtmp/Makefile
3468 ext/sbc/Makefile
3469 ext/schroedinger/Makefile
3470 ext/sdl/Makefile
3471 ext/smoothstreaming/Makefile
3472 ext/sndfile/Makefile
3473 ext/soundtouch/Makefile
3474 ext/spandsp/Makefile
3475 ext/sndio/Makefile
3476 ext/srtp/Makefile
3477 ext/teletextdec/Makefile
3478 ext/gme/Makefile
3479 ext/gsettings/Makefile
3480 ext/gsettings/org.freedesktop.gstreamer.default-elements.gschema.xml
3481 ext/spc/Makefile
3482 ext/timidity/Makefile
3483 ext/webp/Makefile
3484 ext/x265/Makefile
3485 ext/xvid/Makefile
3486 ext/zbar/Makefile
3487 ext/dtls/Makefile
3488 po/Makefile.in
3489 docs/Makefile
3490 docs/plugins/Makefile
3491 docs/libs/Makefile
3492 docs/version.entities
3493 pkgconfig/Makefile
3494 pkgconfig/gstreamer-plugins-bad.pc
3495 pkgconfig/gstreamer-plugins-bad-uninstalled.pc
3496 pkgconfig/gstreamer-codecparsers.pc
3497 pkgconfig/gstreamer-codecparsers-uninstalled.pc
3498 pkgconfig/gstreamer-insertbin.pc
3499 pkgconfig/gstreamer-insertbin-uninstalled.pc
3500 pkgconfig/gstreamer-gl.pc
3501 pkgconfig/gstreamer-gl-uninstalled.pc
3502 pkgconfig/gstreamer-mpegts.pc
3503 pkgconfig/gstreamer-mpegts-uninstalled.pc
3504 pkgconfig/gstreamer-wayland.pc
3505 pkgconfig/gstreamer-wayland-uninstalled.pc
3506 pkgconfig/gstreamer-bad-base.pc
3507 pkgconfig/gstreamer-bad-base-uninstalled.pc
3508 pkgconfig/gstreamer-bad-video.pc
3509 pkgconfig/gstreamer-bad-video-uninstalled.pc
3510 tools/Makefile
3511 m4/Makefile
3512 )
3513
3514 dnl Create the config.h file for Visual Studio builds
3515 dnl Beware of spaces and /'s in some of the shell variable contents.
3516 sed \
3517     -e 's/.*config.h.in.*autoheader.*/\/* Autogenerated config.h created for win32 Visual Studio builds *\/\n\n\/* PREFIX -- specifically added for Windows for easier moving *\/\n#define PREFIX "C:\\\\gstreamer"/' \
3518     -e 's/.* GETTEXT_PACKAGE$/#define GETTEXT_PACKAGE "'$GETTEXT_PACKAGE'"/' \
3519     -e 's/.* GST_DATADIR$/#define GST_DATADIR PREFIX "\\\\share"/' \
3520     -e 's/.* GST_LEVEL_DEFAULT$/#define GST_LEVEL_DEFAULT GST_LEVEL_ERROR/' \
3521     -e 's/.* GST_LICENSE$/#define GST_LICENSE "'$GST_LICENSE'"/' \
3522     -e 's/.* GST_API_VERSION$/#define GST_API_VERSION "'$GST_API_VERSION'"/' \
3523     -e "s,.* GST_PACKAGE_NAME$,#define GST_PACKAGE_NAME \"${GST_PACKAGE_NAME}\"," \
3524     -e 's/.* GST_PACKAGE_ORIGIN$/#define GST_PACKAGE_ORIGIN "Unknown package origin"/' \
3525     -e "s,.* GST_PACKAGE_RELEASE_DATETIME$,#define GST_PACKAGE_RELEASE_DATETIME \"${GST_PACKAGE_RELEASE_DATETIME}\"," \
3526     -e 's/.* HAVE_CPU_I386$/#define HAVE_CPU_I386 1/' \
3527     -e 's/.* HAVE_STDLIB_H$/#define HAVE_STDLIB_H 1/' \
3528     -e 's/.* HAVE_STRING_H$/#define HAVE_STRING_H 1/' \
3529     -e 's/.* HAVE_SYS_STAT_H$/#define HAVE_SYS_STAT_H 1/' \
3530     -e 's/.* HAVE_SYS_TYPES_H$/#define HAVE_SYS_TYPES_H 1/' \
3531     -e 's/.* HAVE_WIN32$/#define HAVE_WIN32 1/' \
3532     -e 's/.* HOST_CPU$/#define HOST_CPU "i686"/' \
3533     -e 's/.* LIBDIR$/#ifdef _DEBUG\n#  define LIBDIR PREFIX "\\\\debug\\\\lib"\n#else\n#  define LIBDIR PREFIX "\\\\lib"\n#endif/' \
3534     -e 's/.* LOCALEDIR$/#define LOCALEDIR PREFIX "\\\\share\\\\locale"/' \
3535     -e "s/.* PACKAGE$/#define PACKAGE \"$PACKAGE\"/" \
3536     -e 's/.* PACKAGE_BUGREPORT$/#define PACKAGE_BUGREPORT "http:\/\/bugzilla.gnome.org\/enter_bug.cgi?product=GStreamer"/' \
3537     -e "s/.* PACKAGE_NAME$/#define PACKAGE_NAME \"$PACKAGE_NAME\"/" \
3538     -e "s/.* PACKAGE_STRING$/#define PACKAGE_STRING \"$PACKAGE_STRING\"/" \
3539     -e 's/.* PACKAGE_TARNAME$/#define PACKAGE_TARNAME "'$PACKAGE_TARNAME'"/' \
3540     -e 's/.* PACKAGE_VERSION$/#define PACKAGE_VERSION "'$PACKAGE_VERSION'"/' \
3541     -e 's/.* PLUGINDIR$/#ifdef _DEBUG\n#  define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-0.11"\n#else\n#  define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-0.11"\n#endif/' \
3542     -e 's/.* VERSION$/#define VERSION "'$VERSION'"/' \
3543     -e "s/.* DEFAULT_AUDIOSINK$/#define DEFAULT_AUDIOSINK \"directsoundsink\"/" \
3544     -e "s/.* DEFAULT_AUDIOSRC$/#define DEFAULT_AUDIOSRC \"audiotestsrc\"/" \
3545     -e "s/.* DEFAULT_VIDEOSRC$/#define DEFAULT_VIDEOSRC \"videotestsrc\"/" \
3546     -e "s/.* DEFAULT_VISUALIZER$/#define DEFAULT_VISUALIZER \"goom\"/" \
3547     -e 's/.* HAVE_WINDOWS_H$/#define HAVE_WINDOWS_H 1/' \
3548     -e 's/.* HAVE_WININET_H$/#define HAVE_WININET_H 1/' \
3549     -e 's/.* HAVE_WINSOCK2_H$/#define HAVE_WINSOCK2_H 1/' \
3550     -e 's/.* HAVE_WS2TCPIP_H$/#define HAVE_WS2TCPIP_H 1/' \
3551     config.h.in >win32/common/config.h-new
3552
3553 AC_OUTPUT
3554
3555 AG_GST_OUTPUT_PLUGINS
3556 ORC_OUTPUT
3557