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