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