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