1AC_PREREQ([2.69])
2
3dnl please read gstreamer/docs/random/autotools before changing this file
4
5dnl initialize autoconf
6dnl releases only do -Wall, git and prerelease does -Werror too
7dnl use a three digit version number for releases, and four for git/pre
8AC_INIT([GStreamer Good Plug-ins],[1.14.4],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-good])
9
10AG_GST_INIT
11
12dnl initialize automake
13AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
14
15dnl define PACKAGE_VERSION_* variables
16AS_VERSION
17
18dnl check if this is a release version
19AS_NANO(GST_GIT="no", GST_GIT="yes")
20
21dnl can autoconf find the source ?
22AC_CONFIG_SRCDIR([gst/law/alaw.c])
23
24dnl define the output header for config
25AC_CONFIG_HEADERS([config.h])
26
27dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28AM_MAINTAINER_MODE([enable])
29
30dnl sets host_* variables
31AC_CANONICAL_HOST
32
33dnl PKG_CONFIG_SYSROOT_DIR is a valid environment variable
34m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
35
36dnl use pretty build output with automake >= 1.11
37m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
38  [AM_DEFAULT_VERBOSITY=1
39   AC_SUBST(AM_DEFAULT_VERBOSITY)])
40
41dnl our libraries and install dirs use GST_API_VERSION in the filename
42dnl to allow side-by-side installation of different API versions
43GST_API_VERSION=1.0
44AC_SUBST(GST_API_VERSION)
45AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
46  [GStreamer API Version])
47
48AG_GST_LIBTOOL_PREPARE
49AS_LIBTOOL(GST, 1404, 0, 1404)
50
51dnl *** required versions of GStreamer stuff ***
52GST_REQ=1.14.4
53GSTPB_REQ=1.14.4
54
55dnl *** autotools stuff ****
56
57dnl allow for different autotools
58AS_AUTOTOOLS_ALTERNATE
59
60dnl Add parameters for aclocal
61AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
62
63dnl set up gettext
64dnl the version check needs to stay here because autopoint greps for it
65AM_GNU_GETTEXT_VERSION([0.17])
66AM_GNU_GETTEXT([external])
67AG_GST_GETTEXT([gst-plugins-good-$GST_API_VERSION])
68
69dnl *** check for arguments to configure ***
70
71AG_GST_ARG_DISABLE_FATAL_WARNINGS
72AG_GST_ARG_ENABLE_EXTRA_CHECKS
73
74AG_GST_ARG_DEBUG
75AG_GST_ARG_PROFILING
76AG_GST_ARG_VALGRIND
77AG_GST_ARG_GCOV
78
79AG_GST_ARG_EXAMPLES
80
81AG_GST_ARG_WITH_PKG_CONFIG_PATH
82AG_GST_ARG_WITH_PACKAGE_NAME
83AG_GST_ARG_WITH_PACKAGE_ORIGIN
84
85AG_GST_ARG_WITH_PLUGINS
86
87AG_GST_ARG_ENABLE_EXTERNAL
88
89AG_GST_ARG_ENABLE_EXPERIMENTAL
90
91AG_GST_PKG_CONFIG_PATH
92
93dnl *** checks for platform ***
94
95dnl * hardware/architecture *
96
97dnl common/m4/gst-arch.m4
98dnl check CPU type
99AG_GST_ARCH
100
101dnl Determine endianness
102AC_C_BIGENDIAN
103
104dnl *** software ***
105
106dnl check for large file support
107dnl affected plugins must include config.h
108AC_SYS_LARGEFILE
109
110dnl *** checks for programs ***
111
112dnl find a compiler
113AC_PROG_CC
114AC_PROG_CC_STDC
115
116dnl determine c++ compiler
117AC_PROG_CXX
118dnl determine if c++ is available on this system
119AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
120
121dnl determine c++ preprocessor
122dnl FIXME: do we need this ?
123AC_PROG_CXXCPP
124
125AC_PROG_OBJC
126
127dnl check if the compiler supports '-c' and '-o' options
128AM_PROG_CC_C_O
129
130dnl find an assembler
131AM_PROG_AS
132
133dnl check if the compiler supports do while(0) macros
134AG_GST_CHECK_DOWHILE_MACROS
135
136AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
137AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
138
139dnl check for documentation tools
140GTK_DOC_CHECK([1.12])
141AG_GST_PLUGIN_DOCS([1.12])
142
143dnl *** checks for libraries ***
144
145dnl check for libm, for sin()
146LT_LIB_M
147AC_SUBST(LIBM)
148
149AC_CHECK_FUNCS(clock_gettime, [], [
150  AC_CHECK_LIB(rt, clock_gettime, [
151    AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
152    LIBRT="-lrt"
153    AC_SUBST([LIBRT])
154  ])
155])
156
157dnl check for pthreads
158AX_PTHREAD
159
160dnl *** checks for header files ***
161
162dnl check if we have ANSI C header files
163AC_HEADER_STDC
164
165dnl used by ext/wavpack
166AX_CREATE_STDINT_H
167
168dnl used in gst/udp
169AC_CHECK_HEADERS([sys/time.h])
170
171dnl used in gst/udp
172AC_CHECK_HEADERS([sys/socket.h])
173
174dnl *** checks for types/defines ***
175
176dnl Check for FIONREAD ioctl declaration.  This check is needed
177dnl for the UDP plugin to build on Solaris
178GST_CHECK_FIONREAD
179
180dnl *** checks for structures ***
181
182dnl *** checks for compiler characteristics ***
183
184dnl check if we have GCC inline-asm
185AS_GCC_INLINE_ASSEMBLY([HAVE_GCC_ASM=yes], [HAVE_GCC_ASM=no])
186if test x$HAVE_GCC_ASM = xyes ; then
187  AC_DEFINE(HAVE_GCC_ASM, 1,
188    [Define if compiler supports gcc inline assembly])
189fi
190AM_CONDITIONAL(HAVE_GCC_ASM, test "x$HAVE_GCC_ASM" = "xyes")
191
192dnl *** checks for library functions ***
193
194LIBS_SAVE=$LIBS
195LIBS="$LIBS $LIBM"
196AC_CHECK_FUNCS(rint sinh cosh asinh fpclass)
197LIBS=$LIBS_SAVE
198
199dnl Check whether isinf() is defined by math.h
200AC_CACHE_CHECK([for isinf], ac_cv_have_isinf,
201    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; int i=isinf(f)]])],[ac_cv_have_isinf="yes"],[ac_cv_have_isinf="no"]))
202if test "$ac_cv_have_isinf" = "yes"
203then
204    AC_DEFINE(HAVE_ISINF, 1, [Define to 1 if you have the `isinf' function.])
205fi
206
207dnl Check for mmap (needed by electricfence plugin)
208AC_FUNC_MMAP
209AC_CHECK_SIZEOF([off_t])
210AM_CONDITIONAL(GST_HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
211
212dnl Check for mmap (needed by electricfence plugin)
213
214AC_CHECK_TYPE([struct ip_mreqn], [
215              AC_DEFINE(HAVE_IP_MREQN,, [Define if we have struct ip_mreqn])],,
216              [#include <netinet/in.h>])
217
218dnl *** checks for dependency libraries ***
219
220
221dnl GLib
222GLIB_REQ=2.40.0
223AG_GST_GLIB_CHECK([$GLIB_REQ])
224
225dnl Orc
226ORC_CHECK([0.4.17])
227
228dnl checks for gstreamer
229dnl uninstalled is selected preferentially -- see pkg-config(1)
230AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
231AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
232AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
233AG_GST_CHECK_GST_NET($GST_API_VERSION, [$GST_REQ], yes)
234AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
235AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
236
237GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION`
238if test -z $GST_TOOLS_DIR; then
239  AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
240fi
241AC_SUBST(GST_TOOLS_DIR)
242
243AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
244AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
245
246AG_GST_PKG_CHECK_MODULES(GST_GL, gstreamer-gl-[$GST_API_VERSION], [$GST_REQ], no)
247
248dnl FIXME: if uninstalled setup we might not want to pick up an installed gst-gl?
249if test "x$HAVE_GST_GL" = "xyes"; then
250
251  AC_MSG_CHECKING([GStreamer OpenGL window systems ...])
252  GST_GL_WINSYS=`$PKG_CONFIG --variable=gl_winsys gstreamer-gl-1.0`
253  AC_MSG_RESULT([$GST_GL_WINSYS])
254  GST_GL_HAVE_WINDOW_X11=""
255  GST_GL_HAVE_WINDOW_WAYLAND=""
256  GST_GL_HAVE_WINDOW_ANDROID=""
257  GST_GL_HAVE_WINDOW_COCOA=""
258  GST_GL_HAVE_WINDOW_EAGL=""
259  case "$GST_GL_WINSYS" in  *x11*) GST_GL_HAVE_WINDOW_X11="1" ;; esac
260  case "$GST_GL_WINSYS" in  *wayland*) GST_GL_HAVE_WINDOW_WAYLAND="1" ;; esac
261  case "$GST_GL_WINSYS" in  *android*) GST_GL_HAVE_WINDOW_ANDROID="1" ;; esac
262  case "$GST_GL_WINSYS" in  *cocoa*) GST_GL_HAVE_WINDOW_COCOA="1" ;; esac
263  case "$GST_GL_WINSYS" in  *eagl*) GST_GL_HAVE_WINDOW_EAGL="1" ;; esac
264
265  AC_MSG_CHECKING([GStreamer OpenGL platforms ...])
266  GST_GL_PLATFORMS=`$PKG_CONFIG --variable=gl_platforms gstreamer-gl-1.0`
267  AC_MSG_RESULT([$GST_GL_PLATFORMS])
268  GST_GL_HAVE_PLATFORM_GLX=""
269  GST_GL_HAVE_PLATFORM_EGL=""
270  GST_GL_HAVE_PLATFORM_CGL=""
271  GST_GL_HAVE_PLATFORM_EAGL=""
272  case "$GST_GL_PLATFORMS" in  *glx*) GST_GL_HAVE_PLATFORM_GLX="1" ;; esac
273  case "$GST_GL_PLATFORMS" in  *egl*) GST_GL_HAVE_PLATFORM_EGL="1" ;; esac
274  case "$GST_GL_PLATFORMS" in  *cgl*) GST_GL_HAVE_PLATFORM_CGL="1" ;; esac
275  case "$GST_GL_PLATFORMS" in  *eagl*) GST_GL_HAVE_PLATFORM_EAGL="1" ;; esac
276
277  AC_MSG_CHECKING([GStreamer OpenGL apis ...])
278  GST_GL_APIS=`$PKG_CONFIG --variable=gl_apis gstreamer-gl-1.0`
279  AC_MSG_RESULT([$GST_GL_APIS])
280  GST_GL_HAVE_API_GLES2=""
281  GST_GL_HAVE_API_GL=""
282  case "$GST_GL_APIS" in  *gles2*) GST_GL_HAVE_API_GLES2="1" ;; esac
283  case "$GST_GL_APIS" in "gl"|"gl "*|*" gl"|*" gl "*) GST_GL_HAVE_API_GL="1" ;; esac
284fi
285
286AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
287
288dnl Check for documentation xrefs
289GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
290GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
291GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
292AC_SUBST(GLIB_PREFIX)
293AC_SUBST(GST_PREFIX)
294AC_SUBST(GSTPB_PREFIX)
295
296dnl GTK is optional and used in examples
297HAVE_GTK=no
298GTK_REQ=3.0.0
299if test "x$BUILD_EXAMPLES" = "xyes"; then
300  PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
301  dnl some examples need gtk+-x11
302  PKG_CHECK_MODULES(GTK_X11, gtk+-x11-3.0 >= $GTK_REQ, HAVE_GTK_X11=yes, HAVE_GTK_X11=no)
303  AC_SUBST(GTK_LIBS)
304  AC_SUBST(GTK_CFLAGS)
305fi
306AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
307AM_CONDITIONAL(HAVE_GTK_X11, test "x$HAVE_GTK_X11" = "xyes")
308
309dnl Check for -Bsymbolic-functions linker flag used to avoid
310dnl intra-library PLT jumps, if available.
311AC_ARG_ENABLE(Bsymbolic,
312              [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
313              [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
314               AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
315               LDFLAGS=-Wl,-Bsymbolic-functions
316               LIBS=
317               AC_TRY_LINK([], [return 0],
318                           AC_MSG_RESULT(yes)
319                           enable_Bsymbolic=yes,
320                           AC_MSG_RESULT(no)
321                           enable_Bsymbolic=no)
322               LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
323
324dnl *** set variables based on configure arguments ***
325
326dnl set license and copyright notice
327GST_LICENSE="LGPL"
328AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
329AC_SUBST(GST_LICENSE)
330
331dnl set location of plugin directory
332AG_GST_SET_PLUGINDIR
333
334dnl set release date/time
335AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
336  ["${srcdir}/gst-plugins-good.doap"],
337  [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
338
339# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
340dnl make sure it doesn't complain about unused variables if debugging is disabled
341NO_WARNINGS=""
342AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
343
344dnl define an ERROR_CFLAGS Makefile variable
345dnl -Wundef: too many broken headers
346AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
347      -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
348      -Wwrite-strings -Wold-style-definition -Waggregate-return
349      -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
350      -Wnested-externs $NO_WARNINGS])
351
352dnl define an ERROR_CXXFLAGS Makefile variable
353AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
354        -Wmissing-declarations -Wredundant-decls
355        -Wwrite-strings
356        -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
357        $NO_WARNINGS])
358
359dnl define an ERROR_OBJCFLAGS Makefile variable
360AG_GST_SET_ERROR_OBJCFLAGS($FATAL_WARNINGS, [
361      -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
362      -Wwrite-strings -Wold-style-definition
363      -Winit-self -Wmissing-include-dirs -Wno-multichar
364      -Wnested-externs $NO_WARNINGS])
365
366dnl define correct level for debugging messages
367AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
368
369dnl used in examples
370AG_GST_DEFAULT_ELEMENTS
371
372dnl *** plug-ins to include ***
373
374dnl these are all the gst plug-ins, compilable without additional libs
375dnl videofilter is at the top because others depend on it
376AG_GST_CHECK_PLUGIN(alpha)
377AG_GST_CHECK_PLUGIN(apetag)
378AG_GST_CHECK_PLUGIN(audiofx)
379AG_GST_CHECK_PLUGIN(audioparsers)
380AG_GST_CHECK_PLUGIN(auparse)
381AG_GST_CHECK_PLUGIN(autodetect)
382AG_GST_CHECK_PLUGIN(avi)
383AG_GST_CHECK_PLUGIN(cutter)
384AG_GST_CHECK_PLUGIN(debugutils)
385AG_GST_CHECK_PLUGIN(deinterlace)
386AG_GST_CHECK_PLUGIN(dtmf)
387AG_GST_CHECK_PLUGIN(effectv)
388AG_GST_CHECK_PLUGIN(equalizer)
389AG_GST_CHECK_PLUGIN(flv)
390AG_GST_CHECK_PLUGIN(flx)
391AG_GST_CHECK_PLUGIN(goom)
392AG_GST_CHECK_PLUGIN(goom2k1)
393AG_GST_CHECK_PLUGIN(icydemux)
394AG_GST_CHECK_PLUGIN(id3demux)
395AG_GST_CHECK_PLUGIN(imagefreeze)
396AG_GST_CHECK_PLUGIN(interleave)
397AG_GST_CHECK_PLUGIN(isomp4)
398AG_GST_CHECK_PLUGIN(law)
399AG_GST_CHECK_PLUGIN(level)
400AG_GST_CHECK_PLUGIN(matroska)
401AG_GST_CHECK_PLUGIN(monoscope)
402AG_GST_CHECK_PLUGIN(multifile)
403AG_GST_CHECK_PLUGIN(multipart)
404AG_GST_CHECK_PLUGIN(replaygain)
405AG_GST_CHECK_PLUGIN(rtp)
406AG_GST_CHECK_PLUGIN(rtpmanager)
407AG_GST_CHECK_PLUGIN(rtsp)
408AG_GST_CHECK_PLUGIN(shapewipe)
409AG_GST_CHECK_PLUGIN(smpte)
410AG_GST_CHECK_PLUGIN(spectrum)
411AG_GST_CHECK_PLUGIN(udp)
412AG_GST_CHECK_PLUGIN(videobox)
413AG_GST_CHECK_PLUGIN(videocrop)
414AG_GST_CHECK_PLUGIN(videofilter)
415AG_GST_CHECK_PLUGIN(videomixer)
416AG_GST_CHECK_PLUGIN(wavenc)
417AG_GST_CHECK_PLUGIN(wavparse)
418AG_GST_CHECK_PLUGIN(y4m)
419
420dnl disable experimental plug-ins
421if test "x$BUILD_EXPERIMENTAL" != "xyes"; then
422  AG_GST_DISABLE_PLUGIN(monoscope)
423fi
424
425dnl *** sys plug-ins ***
426
427echo
428AC_MSG_NOTICE([Checking libraries for plugins in sys/])
429echo
430
431dnl DirectSound
432translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
433AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound plug-in], directsoundsink, [
434  HAVE_DIRECTSOUND="no"
435  save_CFLAGS="$CFLAGS"
436  save_LDFLAGS="$LDFLAGS"
437  save_LIBS="$LIBS"
438  CFLAGS="$CFLAGS $DIRECTSOUND_CFLAGS"
439  LDFLAGS="$LDFLAGS $DIRECTSOUND_LDFLAGS"
440  LIBS="$LIBS -ldsound -ldxerr9 -luser32 -lole32"
441  AC_MSG_CHECKING(for DirectSound LDFLAGS)
442  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
443#include <windows.h>
444#include <dxerr9.h>
445#include <dsound.h>
446]], [[
447  DXGetErrorString9 (0);
448  DirectSoundCreate(NULL, NULL, NULL);
449  CLSIDFromString(NULL, NULL);
450]])
451],
452    [HAVE_DIRECTSOUND="yes"],
453    [HAVE_DIRECTSOUND="no"])
454  AC_MSG_RESULT($HAVE_DIRECTSOUND)
455  CFLAGS=$save_CFLAGS
456  LDFLAGS=$save_LDFLAGS
457  LIBS=$save_LIBS
458
459  if test "x$HAVE_DIRECTSOUND" = "xyes";  then
460    dnl this is much more than we want
461    DIRECTSOUND_LIBS="-ldsound -ldxerr9 -luser32 -lole32"
462    AC_SUBST(DIRECTSOUND_CFLAGS)
463    AC_SUBST(DIRECTSOUND_LDFLAGS)
464    AC_SUBST(DIRECTSOUND_LIBS)
465  fi
466  AC_SUBST(HAVE_DIRECTSOUND)
467])
468
469dnl *** Win32 WaveOut ***
470translit(dnm, m, l) AM_CONDITIONAL(USE_WAVEFORM, true)
471AG_GST_CHECK_FEATURE(WAVEFORM, [Win32 WaveForm], waveformsink, [
472  AC_CHECK_HEADER(mmsystem.h, HAVE_WAVEFORM="yes", HAVE_WAVEFORM="no", [#include <windows.h>])
473])
474
475dnl *** OSS audio *** (Linux, *BSD)
476translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
477AG_GST_CHECK_FEATURE(OSS, [OSS audio], ossaudio, [
478 HAVE_OSS="yes"
479dnl Linux and newer BSD versions :
480 AC_CHECK_HEADER(sys/soundcard.h, [
481   AC_DEFINE(HAVE_OSS_INCLUDE_IN_SYS,, [Define if OSS includes are in /sys/])
482   ] , [
483dnl Some old BSD versions and also newer OpenBSD versions :
484   AC_CHECK_HEADER(soundcard.h, [
485     AC_DEFINE(HAVE_OSS_INCLUDE_IN_ROOT,, [Define if OSS includes are in /])
486     ], [
487  dnl Some old BSD versions :
488     AC_CHECK_HEADER(machine/soundcard.h, [
489       AC_DEFINE(HAVE_OSS_INCLUDE_IN_MACHINE,,
490         [Define if OSS includes are in /machine/])
491       ], [
492       HAVE_OSS="no"
493     ])
494   ])
495 ])
496])
497
498dnl *** oss4 ***
499translit(dnm, m, l) AM_CONDITIONAL(USE_OSS4, true)
500AG_GST_CHECK_FEATURE(OSS4, [Open Sound System 4], oss4, [
501  AC_MSG_CHECKING([Checking if we can build the OSS4 elements])
502  AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/stat.h sys/types.h],
503      [test -z "$OSS4_MISSING_HEADER" && HAVE_OSS4="yes"],
504      [OSS4_MISSING_HEADER="yes";HAVE_OSS4="no"])
505])
506
507dnl *** OSX Audio ***
508translit(dnm, m, l) AM_CONDITIONAL(USE_OSX_AUDIO, true)
509HAVE_IOS="no"
510AG_GST_CHECK_FEATURE(OSX_AUDIO, [OSX audio], osxaudio, [
511  AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
512    [HAVE_OSX_AUDIO="yes"],
513    [AC_CHECK_HEADER(CoreAudio/CoreAudioTypes.h,
514    [
515      HAVE_OSX_AUDIO="yes"
516      HAVE_IOS="yes"
517    ], [
518      HAVE_OSX_AUDIO="no"
519      HAVE_IOS="no"
520    ])]
521  )
522])
523if test "x$HAVE_IOS" = "xyes"; then
524  AC_DEFINE(HAVE_IOS, 1, [building for iOS platofrm])
525fi
526AM_CONDITIONAL(HAVE_IOS, test "x$HAVE_IOS" = "xyes")
527
528dnl *** OS X video ***
529translit(dnm, m, l) AM_CONDITIONAL(USE_OSX_VIDEO, true)
530HAVE_OSX_VIDEO="no"
531AG_GST_CHECK_FEATURE(OSX_VIDEO, [OSX video], osxvideosink, [
532  AC_CHECK_HEADER(OpenGL/gl.h, HAVE_OSX_VIDEO="yes", HAVE_OSX_VIDEO="no")
533
534  dnl in case header OpenGL/gl.h is found on other platforms (or older, unsupported OS X)
535  dnl also require Snow Leopard or newer
536
537  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
538        #include <AvailabilityMacros.h>
539        #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
540        #error Too old OSX version
541        #endif
542      ]], [[return 0;]])],[HAVE_OSX_VIDEO="yes"],[HAVE_OSX_VIDEO="no"])
543])
544
545dnl *** Video 4 Linux 2 ***
546dnl renamed to GST_V4L2 because of some conflict with kernel headers
547translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L2, true)
548HAVE_GST_V4L2=no
549AG_GST_CHECK_FEATURE(GST_V4L2, [Video 4 Linux 2], video4linux2, [
550  AC_MSG_CHECKING([Checking for video4linux2 header ...])
551  AC_CHECK_HEADER(linux/videodev2.h, [ HAVE_GST_V4L2=yes ],
552  [
553    AC_CHECK_HEADER(sys/videodev2.h, [ HAVE_GST_V4L2=yes ],
554    [
555      AC_CHECK_HEADER(sys/videoio.h, [ HAVE_GST_V4L2=yes ])
556    ])
557  ])
558  if test "x$HAVE_VIDEODEV" = "xno"; then
559     AC_MSG_WARN([video4linux2 was not found])
560  fi
561])
562
563# Optional gudev for device probing
564AC_ARG_WITH([gudev],
565  AS_HELP_STRING([--with-gudev],[device detection with gudev]),
566  [],
567  [with_gudev=check])
568if test x$HAVE_GST_V4L2 = xyes; then
569  if test x$with_gudev != xno; then
570    PKG_CHECK_MODULES(GUDEV, [ gudev-1.0 >= 147 ],
571      [ AC_DEFINE(HAVE_GUDEV, 1,
572          [Whether gudev is available for device detection])
573      ],
574      [true])
575  fi
576fi
577
578AC_SUBST(GUDEV_CFLAGS)
579AC_SUBST(GUDEV_LIBS)
580
581# Make libv4l2 non-automagic
582AC_ARG_WITH([libv4l2],
583  AS_HELP_STRING([--with-libv4l2],[support video buffer conversion using libv4l2]),
584  [],
585  [with_libv4l2=check])
586if test x$HAVE_GST_V4L2 = xyes; then
587  if test x$with_libv4l2 != xno; then
588      PKG_CHECK_MODULES(LIBV4L2, libv4l2,
589          [ have_libv4l2=yes
590            AC_DEFINE(HAVE_LIBV4L2, 1,
591	        [Whether libv4l2 is available for video buffer conversion])
592          ], [
593          have_libv4l2=no
594          ])
595  else
596    have_libv4l2=no
597  fi
598fi
599
600dnl Allow enabling v4l2 device probing
601default_v4l2_probe=no
602AS_CASE([$host],
603    [*-*linux*],
604      [AS_CASE([$host_cpu],
605        [arm*], [
606          default_v4l2_probe=yes],
607        [aarch64*], [
608          default_v4l2_probe=yes])])
609AC_ARG_ENABLE(
610  v4l2-probe,
611  AC_HELP_STRING(
612    [--enable-v4l2-probe],
613    [enable V4L2 plugin to probe devices]),
614  [], [enable_v4l2_probe=$default_v4l2_probe])
615if test "x$enable_v4l2_probe" = "xyes"; then
616  AC_DEFINE(GST_V4L2_ENABLE_PROBE, 1,
617    [Define if Video4Linux probe shall be run at plugin load])
618fi
619
620dnl Check for X11
621translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
622AG_GST_CHECK_FEATURE(X, [X libraries and plugins],
623                  [ximagesrc], [
624  PKG_CHECK_MODULES([X], [x11], [
625    HAVE_X="yes"
626    dnl check for Xfixes
627    PKG_CHECK_MODULES([XFIXES], [ xfixes ], [
628      AC_DEFINE(HAVE_XFIXES, 1, [Defined if Xfixes is available])
629    ], [ HAVE_XFIXES="no" ])
630
631    dnl check for Xdamage
632    PKG_CHECK_MODULES([XDAMAGE], [ xdamage ], [
633      AC_DEFINE(HAVE_XDAMAGE, 1, [Defined if Xdamage is available])
634    ], [ HAVE_XDAMAGE="no" ])
635
636    dnl check for X Shm
637    PKG_CHECK_MODULES([XEXT], [ xext ], [
638      AC_CHECK_LIB([Xext], [ XShmAttach ], [
639        AC_DEFINE(HAVE_XSHM, 1, [Defined if XShm is available])
640        XSHM_LIBS="$XEXT_LIBS"
641        XSHM_CFLAGS="$XEXT_CFLAGS"
642      ], [ HAVE_XEXT="no" ] , [ $X_LIBS ])
643    ])
644    AC_SUBST(XSHM_LIBS)
645    AC_SUBST(XSHM_CFLAGS)
646  ], [ HAVE_X="no" ])
647])
648
649dnl *** ext plug-ins ***
650dnl keep this list sorted alphabetically !
651
652if test "x$BUILD_EXTERNAL" = "xyes"; then
653
654echo
655AC_MSG_NOTICE([Checking libraries for plugins in ext/])
656echo
657
658dnl *** aalib ***
659translit(dnm, m, l) AM_CONDITIONAL(USE_AALIB, true)
660AG_GST_CHECK_FEATURE(AALIB, [aalib ASCII Art library], aasink, [
661  AM_PATH_AALIB(, HAVE_AALIB=yes, HAVE_AALIB=no)
662])
663
664dnl *** cairo ***
665translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true)
666AG_GST_CHECK_FEATURE(CAIRO, [Cairo graphics rendering and gobject bindings], cairo, [
667  AG_GST_PKG_CHECK_MODULES(CAIRO, cairo >= 1.10.0 cairo-gobject >= 1.10.0)
668])
669
670dnl *** FLAC ***
671translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
672AG_GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flac, [
673  AG_GST_PKG_CHECK_MODULES(FLAC, flac >= 1.1.4)
674])
675
676dnl *** GDK pixbuf ***
677translit(dnm, m, l) AM_CONDITIONAL(USE_GDK_PIXBUF, true)
678AG_GST_CHECK_FEATURE(GDK_PIXBUF, [GDK pixbuf], gdkpixbuf, [
679  AG_GST_PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= 2.8.0)
680])
681
682dnl *** gtk+ ***
683HAVE_GTK3_GL="no"
684translit(dnm, m, l) AM_CONDITIONAL(USE_GTK3, true)
685AG_GST_CHECK_FEATURE(GTK3, [Gtk+ elements], gtk, [
686  PKG_CHECK_MODULES(GTK3, gtk+-3.0, [
687    AC_DEFINE([HAVE_GTK3], 1, [Define if Gtk+ 3.0 is installed])
688    HAVE_GTK3="yes"
689  ], [
690    HAVE_GTK3="no"
691  ])
692  PKG_CHECK_MODULES(GTK3_GL, gtk+-3.0 >= 3.15.0, [
693    GDK_WINDOWING="no"
694    if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
695      PKG_CHECK_MODULES(GTK3_X11, gtk+-x11-3.0, [
696        GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_X11_CFLAGS"
697        GTK3_LIBS="$GTK3_LIBS $GTK3_X11_LIBS"
698        GDK_WINDOWING="yes"
699      ], [AC_MSG_NOTICE([Could not find Gtk X11 integration])])
700    fi
701    if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
702      PKG_CHECK_MODULES(GTK3_WAYLAND, gtk+-wayland-3.0, [
703        GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_WAYLAND_CFLAGS"
704        GTK3_LIBS="$GTK3_LIBS $GTK3_WAYLAND_LIBS"
705        GDK_WINDOWING="yes"
706      ], [AC_MSG_NOTICE([Could not find Gtk Wayland integration])])
707    fi
708    if test "x$GDK_WINDOWING" = "xyes" -a "x$HAVE_GST_GL" = "xyes"; then
709      AC_DEFINE([HAVE_GTK3_GL], 1, [Define if Gtk+ 3.0 GL is installed])
710      HAVE_GTK3_GL="yes"
711    fi
712  ], [
713      HAVE_GTK3_GL="no"
714  ])
715])
716AM_CONDITIONAL(USE_GTK3_GL, test "x$HAVE_GTK3_GL" = "xyes")
717
718dnl *** Jack ***
719translit(dnm, m, l) AM_CONDITIONAL(USE_JACK, true)
720AG_GST_CHECK_FEATURE(JACK, Jack, jack, [
721  PKG_CHECK_MODULES(JACK, jack >= 0.99.10, HAVE_JACK="yes", HAVE_JACK="no")
722  AC_SUBST(JACK_CFLAGS)
723  AC_SUBST(JACK_LIBS)
724
725  AG_GST_PKG_CHECK_MODULES(JACK_0_120_1, jack >= 0.120.1 jack < 1.0)
726  if test x$HAVE_JACK_0_120_1 = xyes; then
727    AC_DEFINE(HAVE_JACK_0_120_1, 1, [defined if jack >= 0.120.1 is available])
728  fi
729  AG_GST_PKG_CHECK_MODULES(JACK_1_9_7, jack >= 1.9.7)
730  if test x$HAVE_JACK_1_9_7 = xyes; then
731    AC_DEFINE(HAVE_JACK_1_9_7, 1, [defined if jack >= 1.9.7 is available])
732  fi
733
734])
735
736dnl *** jpeg ***
737dnl FIXME: we could use header checks here as well IMO
738translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
739AG_GST_CHECK_FEATURE(JPEG, [jpeg library], jpeg, [
740  AC_ARG_WITH(jpeg-mmx,
741    [  --with-jpeg-mmx, path to MMX'ified JPEG library])
742  OLD_LIBS="$LIBS"
743  if test x$with_jpeg_mmx != x; then
744    LIBS="$LIBS -L$with_jpeg_mmx"
745  fi
746  AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
747  JPEG_LIBS="$LIBS -ljpeg-mmx"
748  LIBS="$OLD_LIBS"
749  if test x$HAVE_JPEG != xyes; then
750    AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
751    JPEG_LIBS="-ljpeg"
752  fi
753  AC_SUBST(JPEG_LIBS)
754])
755
756dnl *** lame ***
757translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
758AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
759  AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, $LIBM, lame/lame.h,
760  [
761    HAVE_LAME="yes"
762    LAME_LIBS="-lmp3lame $LIBM"
763    dnl is lame presets available
764    LAME_CFLAGS=""
765    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lame/lame.h>]], [[ int preset = MEDIUM ]])],[LAME_CFLAGS="-DGSTLAME_PRESET"],[LAME_CFLAGS=""
766    ])
767    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lame/lame.h>]], [[
768        void *ptr = &lame_set_VBR_quality
769      ]])],[LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"],[LAME_CFLAGS="$LAME_CFLAGS"
770    ])
771  AC_SUBST(LAME_CFLAGS)
772  AC_SUBST(LAME_LIBS)
773  ])
774])
775
776dnl *** libcaca ***
777translit(dnm, m, l) AM_CONDITIONAL(USE_LIBCACA, true)
778AG_GST_CHECK_FEATURE(LIBCACA, [libcaca coloured ASCII art], cacasink, [
779  AG_GST_PKG_CHECK_MODULES(LIBCACA, caca)
780])
781
782dnl *** libdv ***
783translit(dnm, m, l) AM_CONDITIONAL(USE_LIBDV, true)
784AG_GST_CHECK_FEATURE(LIBDV, [libdv DV demuxer/decoder], dv, [
785  AG_GST_PKG_CHECK_MODULES(LIBDV, libdv >= 0.100)
786])
787
788dnl *** libpng ***
789translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
790AG_GST_CHECK_FEATURE(LIBPNG, [Portable Network Graphics library], png, [
791  AG_GST_PKG_CHECK_MODULES(LIBPNG, libpng >= 1.2)
792  if test $HAVE_LIBPNG = "yes"; then
793    PKG_CHECK_MODULES(LIBPNG_1_5, libpng >= 1.5.1, [
794        AC_DEFINE(HAVE_LIBPNG_1_5, 1, [Defined if libpng version is 1.5.1 or newer])
795      ], [true])
796  fi
797])
798
799dnl *** mpg123 ***
800translit(dnm, m, l) AM_CONDITIONAL(USE_MPG123, true)
801AG_GST_CHECK_FEATURE(MPG123, [mpg123 audio decoder], mpg123, [
802  PKG_CHECK_MODULES(MPG123, libmpg123 >= 1.13, HAVE_MPG123="yes", HAVE_MPG123="no")
803  AC_SUBST(MPG123_CFLAGS)
804  AC_SUBST(MPG123_LIBS)
805])
806
807dnl *** pulseaudio ***
808translit(dnm, m, l) AM_CONDITIONAL(USE_PULSE, true)
809AG_GST_CHECK_FEATURE(PULSE, [pulseaudio plug-in], pulseaudio, [
810
811  dnl used in ext/pulse/pulseutil.c
812  AC_CHECK_HEADERS([process.h])
813
814  AG_GST_PKG_CHECK_MODULES(PULSE, libpulse >= 2.0)
815])
816
817dnl *** dv1394 ***
818translit(dnm, m, l) AM_CONDITIONAL(USE_DV1394, true)
819AG_GST_CHECK_FEATURE(DV1394, [raw1394 and avc1394 library], 1394, [
820  dnl first test for libraw1394 >= 2.0.0
821  AG_GST_PKG_CHECK_MODULES(RAW1394, libraw1394 >= 2.0.0)
822  AG_GST_PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.0.0)
823  dnl now see how far we got
824  if test x$HAVE_RAW1394 = xyes && \
825     test x$HAVE_LIBIEC61883 = xyes; then
826       AG_GST_CHECK_LIBHEADER(AVC1394,
827        avc1394, avc1394_send_command, $RAW1394_LIBS,
828	libavc1394/avc1394.h, AVC1394_LIBS="-lavc1394")
829       AG_GST_CHECK_LIBHEADER(ROM1394,
830        rom1394, rom1394_free_directory, $RAW1394_LIBS,
831        libavc1394/rom1394.h, ROM1394_LIBS="-lrom1394")
832       if test x$HAVE_AVC1394 = xyes && \
833          test x$HAVE_AVC1394 = xyes && \
834	  test x$HAVE_ROM1394 = xyes; then
835	  HAVE_DV1394=yes
836          DV1394_LIBS="$RAW1394_LIBS $AVC1394_LIBS $ROM1394_LIBS $LIBIEC61883_LIBS"
837          DV1394_CFLAGS="$RAW1394_CFLAGS $LIBIEC61883_CFLAGS -DHAVE_LIBIEC61883"
838          AC_SUBST(DV1394_CFLAGS)
839          AC_SUBST(DV1394_LIBS)
840	fi
841  else
842       if test x$HAVE_RAW1394 = xno; then
843	  AG_GST_PKG_CHECK_MODULES(RAW1394, libraw1394 >= 1.1.0)
844	  AG_GST_CHECK_LIBHEADER(AVC1394,
845	   avc1394, avc1394_send_command, $RAW1394_LIBS,
846	   libavc1394/avc1394.h, AVC1394_LIBS="-lavc1394")
847	  AG_GST_CHECK_LIBHEADER(ROM1394,
848	   rom1394, rom1394_free_directory, $RAW1394_LIBS,
849	   libavc1394/rom1394.h, ROM1394_LIBS="-lrom1394")
850          if test x$HAVE_RAW1394 = xyes && \
851	     test x$HAVE_AVC1394 = xyes && \
852	     test x$HAVE_ROM1394 = xyes; then
853	     HAVE_DV1394=yes
854	     DV1394_LIBS="$RAW1394_LIBS $AVC1394_LIBS $ROM1394_LIBS"
855	     DV1394_CFLAGS="$RAW1394_CFLAGS"
856	     if test x$HAVE_LIBIEC61883 = xyes; then
857	       DV1394_CFLAGS="$RAW1394_CFLAGS $LIBIEC61883_CFLAGS -DHAVE_LIBIEC61883"
858	       DV1394_LIBS="$DV1394_LIBS $LIBIEC61883_LIBS"
859	     fi
860             AC_SUBST(DV1394_CFLAGS)
861             AC_SUBST(DV1394_LIBS)
862           fi
863	 fi
864  fi
865])
866AM_CONDITIONAL(USE_LIBIEC61883, [ test "x${HAVE_LIBIEC61883}" = xyes ] )
867
868dnl *** Qt ***
869translit(dnm, m, l) AM_CONDITIONAL(USE_QT, true)
870AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
871  PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Qml Qt5Quick >= 5.4.0, [
872      QT_PATH=`$PKG_CONFIG --variable=exec_prefix Qt5Core`
873      QT_HOST_PATH=`$PKG_CONFIG --variable=host_bins Qt5Core`
874      AC_ARG_WITH([moc],
875           AS_HELP_STRING([--with-moc], [Set location of qt moc tool]),
876           [MOC=$withval])
877      AC_PATH_PROGS(MOC, [moc-qt5 moc], [moc], ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
878      AC_ARG_WITH([rcc],
879           AS_HELP_STRING([--with-rcc], [Set location of qt rcc tool]),
880           [RCC=$withval])
881      AC_PATH_PROGS(RCC, [rcc-qt5 rcc], [rcc], ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
882      AC_ARG_WITH([uic],
883               AS_HELP_STRING([--with-uic], [Set location of qt uic tool]),
884               [UIC=$withval])
885      AC_PATH_PROGS(UIC, [uic-qt5 uic], [uic], ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
886      if test "x$MOC" = "x" || test "x$UIC" = "x" || test "x$RCC" = "x"; then
887        AC_MSG_WARN([One of the required qt build programs was not found])
888        HAVE_QT="no"
889      else
890        HAVE_QT="yes"
891        HAVE_QT_WINDOWING="no"
892        QT_VERSION="`$PKG_CONFIG --define-prefix --modversion Qt5Core`"
893        QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
894        AS_IF([test -f "$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [
895          QT_CFLAGS="$QT_CFLAGS -I$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH"
896          HAVE_QT_QPA_HEADER="yes"
897          AC_DEFINE([HAVE_QT_QPA_HEADER], [], [Define if the Qt QPA header is installed])
898        ], [AC_MSG_NOTICE([Cannot find QPA])])
899        if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1" || test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
900          PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
901            AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
902            QT_CFLAGS="$QT_CFLAGS $QT_X11_CFLAGS"
903            QT_LIBS="$QT_LIBS $QT_X11_LIBS"
904            HAVE_QT_WINDOWING="yes"
905          ], [AC_MSG_NOTICE([Could not find Qt X11 integration])])
906        fi
907        if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1" -a "x$HAVE_QT_QPA_HEADER" = "xyes"; then
908          PKG_CHECK_MODULES(QT_WAYLAND, Qt5WaylandClient, [
909            AC_DEFINE([HAVE_QT_WAYLAND], [],
910                [Define if Qt Wayland integration is installed])
911            QT_CFLAGS="$QT_CFLAGS $QT_WAYLAND_CFLAGS"
912            QT_LIBS="$QT_LIBS $QT_WAYLAND_LIBS"
913            HAVE_QT_WINDOWING="yes"
914          ], [AC_MSG_NOTICE([Could not find Qt Wayland integration])])
915        fi
916        if test "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
917          if test "x$GST_GL_HAVE_WINDOW_ANDROID" = "x1"; then
918            PKG_CHECK_MODULES(QT_ANDROID, Qt5AndroidExtras, [
919              # c++ on android requires a standard library and there are multiple
920              # choices.  cerbero provides a pkg-config file the describes a choice
921              # so try to use that.  Outside cerbero one has to pass these flags
922              # manually for the library one is using
923              PKG_CHECK_MODULES(GNUSTL, gnustl, [
924                QT_CFLAGS="$QT_CFLAGS $GNUSTL_CFLAGS"
925                QT_LIBS="$QT_LIBS $GNUSTL_LIBS"
926                ], [
927                AC_MSG_NOTICE([Could not find Standard C++ library])])
928              AC_DEFINE([HAVE_QT_EGLFS], [],
929                [Define if Qt eglfs integration is installed])
930              QT_CFLAGS="$QT_CFLAGS $QT_ANDROID_CFLAGS"
931              QT_LIBS="$QT_LIBS $QT_ANDROID_LIBS"
932              HAVE_QT_WINDOWING="yes"
933            ], [AC_MSG_NOTICE([Could not find Qt Android integration])])
934          else
935              AC_DEFINE([HAVE_QT_EGLFS], [],
936                [Define if Qt eglfs integration is installed])
937              HAVE_QT_WINDOWING="yes"
938          fi
939        fi
940        if test "x$GST_GL_HAVE_WINDOW_COCOA" = "x1" -a "x$GST_GL_HAVE_PLATFORM_CGL" = "x1"; then
941          PKG_CHECK_MODULES(QT_MAC, Qt5MacExtras, [
942            AC_DEFINE([HAVE_QT_MAC], [],
943                [Define if Qt Mac integration is installed])
944            QT_LIBDIR=`$PKG_CONFIG --variable=libdir Qt5Core`
945            QT_CFLAGS="$QT_CFLAGS $QT_MAC_CFLAGS -F$QT_LIBDIR -framework QtCore -framework QtGui -framework QtQuick -framework QtQml -framework QtMacExtras"
946            QT_LIBS="$QT_LIBS $QT_MAC_LIBS"
947            HAVE_QT_WINDOWING="yes"
948          ], [AC_MSG_NOTICE([Could not find Qt Mac integration])])
949        fi
950        if test "x$GST_GL_HAVE_WINDOW_EAGL" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EAGL" = "x1"; then
951          if test "x$HAVE_IOS" = "xyes"; then
952            # iOS doesn't have its own extras package so if we have the core
953            # modules we are good to go
954            AC_DEFINE([HAVE_QT_IOS], [],
955                [Define if Qt iOS integration is installed])
956            HAVE_QT_WINDOWING="yes"
957          fi
958        fi
959        if test "x$HAVE_QT_WINDOWING" = "xno"; then
960          AC_MSG_WARN([Could not find any Qt Windowing integration])
961          HAVE_QT="no"
962        fi
963        AC_SUBST([QT_CFLAGS])
964        AC_SUBST([QT_LIBS])
965      fi
966  ], [
967      HAVE_QT="no"
968  ])
969])
970
971dnl *** shout2 ***
972translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
973AG_GST_CHECK_FEATURE(SHOUT2, [Shoutcast/Icecast client library], shout2, [
974  AG_GST_PKG_CHECK_MODULES(SHOUT2, shout >= 2.0)
975])
976
977dnl *** soup ***
978translit(dnm, m, l) AM_CONDITIONAL(USE_SOUP, true)
979AG_GST_CHECK_FEATURE(SOUP, [soup http client plugin (2.4)], souphttpsrc, [
980  PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.48, [HAVE_SOUP="yes"], [HAVE_SOUP="no"])
981  AC_SUBST(SOUP_CFLAGS)
982  AC_SUBST(SOUP_LIBS)
983])
984
985dnl *** speex ***
986translit(dnm, m, l) AM_CONDITIONAL(USE_SPEEX, true)
987AG_GST_CHECK_FEATURE(SPEEX, [speex speech codec], speex, [
988  AG_GST_PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6)
989])
990
991dnl *** taglib ***
992translit(dnm, m, l) AM_CONDITIONAL(USE_TAGLIB, true)
993AG_GST_CHECK_FEATURE(TAGLIB, [taglib tagging library], taglib, [
994  AG_GST_PKG_CHECK_MODULES(TAGLIB, taglib >= 1.5)
995  if test "x$HAVE_CXX" != "xyes"; then
996    USE_TAGLIB=false
997    AC_MSG_NOTICE([Not building taglib plugin: no C++ compiler found])
998  else
999    dnl work around bug in taglib 1.5 headers, remove once there is a 1.6
1000    AS_CXX_COMPILER_FLAG([-Wno-attributes], [
1001        TAGLIB_CXXFLAGS="$TAGLIB_CFLAGS -Wno-attributes"
1002      ], [
1003        TAGLIB_CXXFLAGS="$TAGLIB_CFLAGS"
1004    ])
1005    AC_SUBST(TAGLIB_CXXFLAGS)
1006  fi
1007])
1008
1009dnl *** twolame ***
1010translit(dnm, m, l) AM_CONDITIONAL(USE_TWOLAME, true)
1011AG_GST_CHECK_FEATURE(TWOLAME, [twolame], twolame, [
1012  PKG_CHECK_MODULES(TWOLAME, twolame >= 0.3.10, [
1013      HAVE_TWOLAME="yes"], [
1014      HAVE_TWOLAME="no"
1015  ])
1016  AC_SUBST(TWOLAME_CFLAGS)
1017  AC_SUBST(TWOLAME_LIBS)
1018])
1019
1020
1021dnl *** vpx ***
1022translit(dnm, m, l) AM_CONDITIONAL(USE_VPX, vpx)
1023AG_GST_CHECK_FEATURE(VPX, [VPX decoder], vpx, [
1024  PKG_CHECK_MODULES(VPX, vpx >= 1.1.0, [HAVE_VPX="yes"], [HAVE_VPX="no"])
1025  HAVE_VP8=no
1026  HAVE_VP9=no
1027
1028  if test $HAVE_VPX = "yes"; then
1029    OLD_LIBS="$LIBS"
1030    OLD_CFLAGS="$CFLAGS"
1031    CFLAGS="$CFLAGS $VPX_CFLAGS"
1032    LIBS="$LIBS $VPX_LIBS"
1033    AC_CHECK_LIB(vpx, vpx_codec_vp8_cx_algo, [
1034      HAVE_VP8=yes
1035      AC_DEFINE(HAVE_VP8_ENCODER, 1, [Defined if the VP8 encoder is available])
1036    ])
1037    AC_CHECK_LIB(vpx, vpx_codec_vp8_dx_algo, [
1038      HAVE_VP8=yes
1039      AC_DEFINE(HAVE_VP8_DECODER, 1, [Defined if the VP8 decoder is available])
1040    ])
1041
1042    PKG_CHECK_MODULES(VPX_130, vpx >= 1.3.0, [
1043      AC_CHECK_LIB(vpx, vpx_codec_vp9_cx_algo, [
1044        HAVE_VP9=yes
1045        AC_DEFINE(HAVE_VP9_ENCODER, 1, [Defined if the VP9 encoder is available])
1046      ])
1047      AC_CHECK_LIB(vpx, vpx_codec_vp9_dx_algo, [
1048        HAVE_VP9=yes
1049        AC_DEFINE(HAVE_VP9_DECODER, 1, [Defined if the VP9 decoder is available])
1050      ])
1051    ], [true])
1052
1053    PKG_CHECK_MODULES(VPX_140, vpx >= 1.4.0, [
1054      AC_DEFINE(HAVE_VPX_1_4, 1, [Defined if the VPX library version is 1.4 or bigger])
1055    ], [true])
1056
1057    LIBS="$OLD_LIBS"
1058    CFLAGS="$OLD_CFLAGS"
1059  fi
1060  AC_SUBST(VPX_LIBS)
1061  AC_SUBST(VPX_CFLAGS)
1062])
1063
1064dnl *** wavpack ***
1065translit(dnm, m, l) AM_CONDITIONAL(USE_WAVPACK, true)
1066AG_GST_CHECK_FEATURE(WAVPACK, [wavpack plug-in], wavpack, [
1067  AG_GST_PKG_CHECK_MODULES(WAVPACK, wavpack >= 4.60.0)
1068])
1069
1070dnl *** qtdemux & matroska prefer to have zlib ***
1071translit(dnm, m, l) AM_CONDITIONAL(USE_ZLIB, true)
1072AG_GST_CHECK_FEATURE(ZLIB, [zlib support for qtdemux/matroska],, [
1073  AG_GST_CHECK_LIBHEADER(ZLIB,
1074    z, uncompress,, zlib.h, [
1075    HAVE_ZLIB="yes"
1076    ZLIB_LIBS="-lz"
1077    AC_SUBST(ZLIB_LIBS)
1078  ])
1079])
1080
1081dnl *** matroska prefers to have bz2 ***
1082translit(dnm, m, l) AM_CONDITIONAL(USE_BZ2, true)
1083AG_GST_CHECK_FEATURE(BZ2, [bz2 library for matroska ],, [
1084  save_LIBS=$LIBS
1085  LIBS="$LIBS -lbz2"
1086  AC_MSG_CHECKING([for BZ2_bzlibVersion in -lbz2])
1087  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <bzlib.h>]], [[const char *version = BZ2_bzlibVersion ();]])],[HAVE_BZ2=yes],[HAVE_BZ2=no])
1088  AC_MSG_RESULT($HAVE_BZ2)
1089  LIBS=$save_LIBS
1090  if test "x$HAVE_BZ2" = "xyes"; then
1091    BZ2_LIBS="-lbz2"
1092  fi
1093  AC_SUBST(BZ2_LIBS)
1094])
1095
1096else
1097
1098dnl not building plugins with external dependencies,
1099dnl but we still need to set the conditionals
1100AM_CONDITIONAL(USE_AALIB, false)
1101AM_CONDITIONAL(USE_BZ2, false)
1102AM_CONDITIONAL(USE_CAIRO, false)
1103AM_CONDITIONAL(USE_DIRECTSOUND, false)
1104AM_CONDITIONAL(USE_DV1394, false)
1105AM_CONDITIONAL(USE_FLAC, false)
1106AM_CONDITIONAL(USE_GDK_PIXBUF, false)
1107AM_CONDITIONAL(USE_GTK3, false)
1108AM_CONDITIONAL(USE_GTK3_GL, false)
1109AM_CONDITIONAL(USE_JACK, false)
1110AM_CONDITIONAL(USE_JPEG, false)
1111AM_CONDITIONAL(USE_LAME, false)
1112AM_CONDITIONAL(USE_LIBCACA, false)
1113AM_CONDITIONAL(USE_LIBDV, false)
1114AM_CONDITIONAL(USE_LIBIEC61883, false)
1115AM_CONDITIONAL(USE_LIBPNG, false)
1116AM_CONDITIONAL(USE_MPG123, false)
1117AM_CONDITIONAL(USE_OSS, false)
1118AM_CONDITIONAL(USE_OSS4, false)
1119AM_CONDITIONAL(USE_OSX_AUDIO, false)
1120AM_CONDITIONAL(USE_OSX_VIDEO, false)
1121AM_CONDITIONAL(USE_PULSE, false)
1122AM_CONDITIONAL(USE_QT, false)
1123AM_CONDITIONAL(USE_SHOUT2, false)
1124AM_CONDITIONAL(USE_SOUP, false)
1125AM_CONDITIONAL(USE_SPEEX, false)
1126AM_CONDITIONAL(USE_TAGLIB, false)
1127AM_CONDITIONAL(USE_TWOLAME, false)
1128AM_CONDITIONAL(USE_VPX, false)
1129AM_CONDITIONAL(USE_WAVEFORM, false)
1130AM_CONDITIONAL(USE_WAVPACK, false)
1131AM_CONDITIONAL(USE_X, false)
1132AM_CONDITIONAL(USE_ZLIB, false)
1133
1134fi dnl of EXT plugins
1135
1136dnl *** finalize CFLAGS, LDFLAGS, LIBS
1137
1138dnl Overview:
1139dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
1140dnl GST_*:              flags shared by all built objects
1141dnl GST_ALL_LDFLAGS:    linker flags shared by all
1142dnl GST_LIB_LDFLAGS:    not needed, we don't install libraries
1143dnl GST_LT_LDFLAGS:     library versioning of our libraries
1144dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
1145
1146dnl GST_OPTION_CFLAGS
1147if test "x$USE_DEBUG" = xyes; then
1148   PROFILE_CFLAGS="-g"
1149fi
1150AC_SUBST(PROFILE_CFLAGS)
1151
1152if test "x$PACKAGE_VERSION_NANO" = "x1"; then
1153  dnl Define _only_ for git (not pre-releases or releases)
1154  DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
1155else
1156  DEPRECATED_CFLAGS=""
1157fi
1158AC_SUBST(DEPRECATED_CFLAGS)
1159
1160VISIBILITY_CFLAGS=""
1161AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"])
1162AC_SUBST(VISIBILITY_CFLAGS)
1163
1164VISIBILITY_CXXFLAGS=""
1165if test "x$HAVE_CXX" = "xyes"; then
1166  AS_CXX_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CXXFLAGS="-fvisibility=hidden"])
1167fi
1168AC_SUBST(VISIBILITY_CXXFLAGS)
1169
1170dnl disable strict aliasing
1171AS_COMPILER_FLAG([-fno-strict-aliasing], [EXTRA_CFLAGS="-fno-strict-aliasing"])
1172AC_SUBST(EXTRA_CFLAGS)
1173
1174dnl every flag in GST_OPTION_CFLAGS, GST_OPTION_CXXFLAGS and GST_OPTION_OBJCFLAGS can be overridden
1175dnl at make time with e.g. make ERROR_CFLAGS=""
1176GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
1177GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
1178GST_OPTION_OBJCFLAGS="\$(WARNING_OBJCFLAGS) \$(ERROR_OBJCFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
1179AC_SUBST(GST_OPTION_CFLAGS)
1180AC_SUBST(GST_OPTION_CXXFLAGS)
1181AC_SUBST(GST_OPTION_OBJCFLAGS)
1182
1183dnl our libraries need to be versioned correctly
1184AC_SUBST(GST_LT_LDFLAGS)
1185
1186dnl FIXME: do we want to rename to GST_ALL_* ?
1187dnl prefer internal headers to already installed ones
1188dnl also add builddir include for enumtypes and marshal
1189dnl add ERROR_CFLAGS, but overridable
1190GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
1191GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs $GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(VISIBILITY_CXXFLAGS)"
1192GST_OBJCFLAGS="-I\$(top_srcdir)/gst-libs $GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_OBJCFLAGS)"
1193GST_CFLAGS="-I\$(top_srcdir)/gst-libs $GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS) \$(VISIBILITY_CFLAGS)"
1194AC_SUBST(GST_CFLAGS)
1195AC_SUBST(GST_CXXFLAGS)
1196AC_SUBST(GST_OBJCFLAGS)
1197AC_SUBST(GST_LIBS)
1198
1199dnl LDFLAGS really should only contain flags, not libs - they get added before
1200dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
1201GST_ALL_LDFLAGS="-no-undefined"
1202if test "x${enable_Bsymbolic}" = "xyes"; then
1203  GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
1204fi
1205AC_SUBST(GST_ALL_LDFLAGS)
1206
1207dnl this really should only contain flags, not libs - they get added before
1208dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
1209GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
1210AC_SUBST(GST_PLUGIN_LDFLAGS)
1211
1212dnl *** output files ***
1213
1214$MKDIR_P tests/check/orc
1215
1216dnl keep this alphabetic per directory, please
1217AC_CONFIG_FILES(
1218Makefile
1219gst/Makefile
1220gst/alpha/Makefile
1221gst/apetag/Makefile
1222gst/audiofx/Makefile
1223gst/audioparsers/Makefile
1224gst/auparse/Makefile
1225gst/autodetect/Makefile
1226gst/avi/Makefile
1227gst/cutter/Makefile
1228gst/deinterlace/Makefile
1229gst/dtmf/Makefile
1230gst/debugutils/Makefile
1231gst/effectv/Makefile
1232gst/equalizer/Makefile
1233gst/flv/Makefile
1234gst/goom/Makefile
1235gst/goom2k1/Makefile
1236gst/id3demux/Makefile
1237gst/icydemux/Makefile
1238gst/imagefreeze/Makefile
1239gst/interleave/Makefile
1240gst/isomp4/Makefile
1241gst/law/Makefile
1242gst/level/Makefile
1243gst/matroska/Makefile
1244gst/monoscope/Makefile
1245gst/multifile/Makefile
1246gst/multipart/Makefile
1247gst/replaygain/Makefile
1248gst/rtp/Makefile
1249gst/rtpmanager/Makefile
1250gst/rtsp/Makefile
1251gst/shapewipe/Makefile
1252gst/smpte/Makefile
1253gst/spectrum/Makefile
1254gst/udp/Makefile
1255gst/videobox/Makefile
1256gst/videocrop/Makefile
1257gst/videofilter/Makefile
1258gst/videomixer/Makefile
1259gst/wavenc/Makefile
1260gst/wavparse/Makefile
1261gst/flx/Makefile
1262gst/y4m/Makefile
1263ext/Makefile
1264ext/aalib/Makefile
1265ext/cairo/Makefile
1266ext/dv/Makefile
1267ext/flac/Makefile
1268ext/gdk_pixbuf/Makefile
1269ext/gtk/Makefile
1270ext/jack/Makefile
1271ext/jpeg/Makefile
1272ext/lame/Makefile
1273ext/libcaca/Makefile
1274ext/libpng/Makefile
1275ext/mpg123/Makefile
1276ext/pulse/Makefile
1277ext/qt/Makefile
1278ext/raw1394/Makefile
1279ext/shout2/Makefile
1280ext/soup/Makefile
1281ext/speex/Makefile
1282ext/taglib/Makefile
1283ext/twolame/Makefile
1284ext/vpx/Makefile
1285ext/wavpack/Makefile
1286sys/Makefile
1287sys/directsound/Makefile
1288sys/oss/Makefile
1289sys/oss4/Makefile
1290sys/osxaudio/Makefile
1291sys/osxvideo/Makefile
1292sys/v4l2/Makefile
1293sys/waveform/Makefile
1294sys/ximage/Makefile
1295po/Makefile.in
1296tests/Makefile
1297tests/check/Makefile
1298tests/examples/Makefile
1299tests/examples/audiofx/Makefile
1300tests/examples/cairo/Makefile
1301tests/examples/equalizer/Makefile
1302tests/examples/gtk/Makefile
1303tests/examples/jack/Makefile
1304tests/examples/level/Makefile
1305tests/examples/rtp/Makefile
1306tests/examples/rtsp/Makefile
1307tests/examples/shapewipe/Makefile
1308tests/examples/spectrum/Makefile
1309tests/examples/v4l2/Makefile
1310tests/files/Makefile
1311tests/icles/Makefile
1312common/Makefile
1313common/m4/Makefile
1314m4/Makefile
1315docs/Makefile
1316docs/plugins/Makefile
1317docs/version.entities
1318pkgconfig/Makefile
1319pkgconfig/gstreamer-plugins-good-uninstalled.pc
1320)
1321AC_OUTPUT
1322
1323AG_GST_OUTPUT_PLUGINS
1324ORC_OUTPUT
1325
1326