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