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