configure.ac 75.2 KB
Newer Older
1
AC_PREREQ([2.69])
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
2

3 4
dnl initialize autoconf
dnl when going to/from release please set the nano (fourth number) right !
5
dnl releases only do Wall, git and prerelease does Werror too
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
6
AC_INIT([GStreamer Bad Plug-ins],[1.17.0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-bad])
7

8 9
AG_GST_INIT

10
dnl initialize automake
11
AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
12 13 14 15 16

dnl define PACKAGE_VERSION_* variables
AS_VERSION

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([gst/aiff/aiff.c])
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 29
dnl sets host_* variables
AC_CANONICAL_HOST
30

31 32 33 34 35
dnl use pretty build output with automake >= 1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
  [AM_DEFAULT_VERBOSITY=1
   AC_SUBST(AM_DEFAULT_VERBOSITY)])

36 37 38
dnl PKG_CONFIG_SYSROOT_DIR is a valid environment variable
m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)

Sebastian Dröge's avatar
Sebastian Dröge committed
39 40 41 42 43 44
dnl our libraries and install dirs use GST_API_VERSION in the filename
dnl to allow side-by-side installation of different API versions
GST_API_VERSION=1.0
AC_SUBST(GST_API_VERSION)
AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
  [GStreamer API Version])
45

46 47
AG_GST_LIBTOOL_PREPARE

48 49 50 51 52 53
dnl CURRENT, REVISION, AGE
dnl - library source changed -> increment REVISION
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
dnl sets GST_LT_LDFLAGS
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
54
AS_LIBTOOL(GST, 1700, 0, 1700)
55

56
dnl *** required versions of GStreamer stuff ***
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
57 58
GST_REQ=1.17.0.1
GSTPB_REQ=1.17.0.1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
59

60
dnl *** autotools stuff ****
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
61

62 63 64 65 66
dnl allow for different autotools
AS_AUTOTOOLS_ALTERNATE

dnl Add parameters for aclocal
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
67

Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
68 69
dnl set up gettext
dnl the version check needs to stay here because autopoint greps for it
70
AM_GNU_GETTEXT_VERSION([0.17])
71
AM_GNU_GETTEXT([external])
Sebastian Dröge's avatar
Sebastian Dröge committed
72
AG_GST_GETTEXT([gst-plugins-bad-$GST_API_VERSION])
73

74
dnl *** check for arguments to configure ***
75

76
AG_GST_ARG_DISABLE_FATAL_WARNINGS
77
AG_GST_ARG_ENABLE_EXTRA_CHECKS
78

79 80 81 82
AG_GST_ARG_DEBUG
AG_GST_ARG_PROFILING
AG_GST_ARG_VALGRIND
AG_GST_ARG_GCOV
83

84
AG_GST_ARG_EXAMPLES
85

86 87 88
AG_GST_ARG_WITH_PKG_CONFIG_PATH
AG_GST_ARG_WITH_PACKAGE_NAME
AG_GST_ARG_WITH_PACKAGE_ORIGIN
89

90
AG_GST_ARG_WITH_PLUGINS
91

92
AG_GST_ARG_ENABLE_EXTERNAL
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
93

94
AG_GST_ARG_ENABLE_EXPERIMENTAL
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
95

96 97
AG_GST_PKG_CONFIG_PATH

98
dnl *** checks for platform ***
99
AG_GST_PLATFORM
100

101
dnl * hardware/architecture *
102

103 104
dnl common/m4/gst-arch.m4
dnl check CPU type
105
AG_GST_ARCH
106

107 108
dnl Determine endianness
AC_C_BIGENDIAN
Christian Schaller's avatar
Christian Schaller committed
109

110 111 112 113 114 115
dnl *** software ***

dnl check for large file support
dnl affected plugins must include config.h
AC_SYS_LARGEFILE

116
dnl *** checks for programs ***
Christian Schaller's avatar
Christian Schaller committed
117

118 119
dnl find a compiler
AC_PROG_CC
120
AC_PROG_CC_STDC
121

122 123 124 125 126
dnl determine c++ compiler
AC_PROG_CXX
dnl determine if c++ is available on this system
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)

127
AC_PROG_OBJC
128

129 130 131
dnl check if the compiler supports '-c' and '-o' options
AM_PROG_CC_C_O

132 133 134
dnl check if the compiler supports do while(0) macros
AG_GST_CHECK_DOWHILE_MACROS

135 136
AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
137

138 139 140
dnl check for gobject-introspection
GOBJECT_INTROSPECTION_CHECK([1.31.1])

141
dnl *** checks for libraries ***
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
142

143
dnl check for libm, for sin() etc.
144
LT_LIB_M
145 146
AC_SUBST(LIBM)

147 148
AC_FUNC_MMAP

149
dnl check for pthreads
150
AX_PTHREAD
151

152
dnl *** checks for header files ***
153

154 155 156 157 158 159 160
AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")

if test "x$HAVE_UNISTD_H" != "xyes"; then
  GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
fi

161 162
AC_CHECK_HEADERS([sys/time.h])

163 164 165
dnl used by ext/dts
AX_CREATE_STDINT_H

166 167 168
AC_CHECK_HEADERS([pthread.h], HAVE_PTHREAD_H=yes)
AM_CONDITIONAL(HAVE_PTHREAD_H, test "x$HAVE_PTHREAD_H" = "xyes")

169
dnl *** checks for types/defines ***
170

171
dnl *** checks for structures ***
172

173
dnl *** checks for compiler characteristics ***
174

175
dnl *** checks for library functions ***
176
AC_CHECK_FUNCS([gmtime_r pipe2])
Sebastian Dröge's avatar
Sebastian Dröge committed
177 178 179

dnl *** checks for headers ***
AC_CHECK_HEADERS([sys/utsname.h])
180

181
dnl *** checks for dependency libraries ***
David Schleef's avatar
David Schleef committed
182

183 184 185 186
dnl *** checks for socket and nsl libraries ***
AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])

187
dnl GLib is required
188
GLIB_REQ=2.44.0
189 190
AG_GST_GLIB_CHECK([$GLIB_REQ])

191 192 193
dnl Needed by plugins that use g_module_*() API
PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)

194 195
dnl checks for gstreamer
dnl uninstalled is selected preferentially -- see pkg-config(1)
Sebastian Dröge's avatar
Sebastian Dröge committed
196 197 198 199
AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
200
AG_GST_CHECK_GST_NET($GST_API_VERSION, [$GST_REQ], yes)
201 202 203 204 205
AG_GST_PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-[$GST_API_VERSION], [$GSTPB_REQ], yes)
AG_GST_PKG_CHECK_MODULES(GST_AUDIO, gstreamer-audio-[$GST_API_VERSION], [$GSTPB_REQ], yes)
AG_GST_PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-[$GST_API_VERSION], [$GSTPB_REQ], yes)
AG_GST_PKG_CHECK_MODULES(GST_GL, gstreamer-gl-[$GST_API_VERSION], [$GSTPB_REQ], no)
AG_GST_PKG_CHECK_MODULES(GST_SDP, gstreamer-sdp-[$GST_API_VERSION], [$GSTPB_REQ], yes)
206

207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
if test "x$HAVE_GST_GL" = "xyes"; then

  AC_MSG_CHECKING([GStreamer OpenGL window systems ...])
  GST_GL_WINSYS=`$PKG_CONFIG --variable=gl_winsys gstreamer-gl-1.0`
  AC_MSG_RESULT([$GST_GL_WINSYS])
  GST_GL_HAVE_WINDOW_X11=""
  GST_GL_HAVE_WINDOW_WAYLAND=""
  GST_GL_HAVE_WINDOW_ANDROID=""
  GST_GL_HAVE_WINDOW_COCOA=""
  GST_GL_HAVE_WINDOW_EAGL=""
  case "$GST_GL_WINSYS" in  *x11*) GST_GL_HAVE_WINDOW_X11="1" ;; esac
  case "$GST_GL_WINSYS" in  *wayland*) GST_GL_HAVE_WINDOW_WAYLAND="1" ;; esac
  case "$GST_GL_WINSYS" in  *android*) GST_GL_HAVE_WINDOW_ANDROID="1" ;; esac
  case "$GST_GL_WINSYS" in  *cocoa*) GST_GL_HAVE_WINDOW_COCOA="1" ;; esac
  case "$GST_GL_WINSYS" in  *eagl*) GST_GL_HAVE_WINDOW_EAGL="1" ;; esac

  AC_MSG_CHECKING([GStreamer OpenGL platforms ...])
  GST_GL_PLATFORMS=`$PKG_CONFIG --variable=gl_platforms gstreamer-gl-1.0`
  AC_MSG_RESULT([$GST_GL_PLATFORMS])
  GST_GL_HAVE_PLATFORM_GLX=""
  GST_GL_HAVE_PLATFORM_EGL=""
  GST_GL_HAVE_PLATFORM_CGL=""
  GST_GL_HAVE_PLATFORM_EAGL=""
  case "$GST_GL_PLATFORMS" in  *glx*) GST_GL_HAVE_PLATFORM_GLX="1" ;; esac
  case "$GST_GL_PLATFORMS" in  *egl*) GST_GL_HAVE_PLATFORM_EGL="1" ;; esac
  case "$GST_GL_PLATFORMS" in  *cgl*) GST_GL_HAVE_PLATFORM_CGL="1" ;; esac
  case "$GST_GL_PLATFORMS" in  *eagl*) GST_GL_HAVE_PLATFORM_EAGL="1" ;; esac
234 235 236 237 238 239 240 241

  AC_MSG_CHECKING([GStreamer OpenGL apis ...])
  GST_GL_APIS=`$PKG_CONFIG --variable=gl_apis gstreamer-gl-1.0`
  AC_MSG_RESULT([$GST_GL_APIS])
  GST_GL_HAVE_API_GLES2=""
  GST_GL_HAVE_API_GL=""
  case "$GST_GL_APIS" in  *gles2*) GST_GL_HAVE_API_GLES2="1" ;; esac
  case "$GST_GL_APIS" in "gl"|"gl "*|*" gl"|*" gl "*) GST_GL_HAVE_API_GL="1" ;; esac
242
fi
Jan Schmidt's avatar
Jan Schmidt committed
243
AM_CONDITIONAL(USE_OPENGL, test "x$GST_GL_HAVE_API_GL" = "x1")
244

245 246
AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")

Sebastian Dröge's avatar
Sebastian Dröge committed
247
AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
248 249

dnl check for uninstalled plugin directories for unit tests
250
AG_GST_CHECK_UNINSTALLED_SETUP([
251 252 253
  AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [$GSTPB_REQ])
  AG_GST_CHECK_GST_PLUGINS_UGLY($GST_API_VERSION, [$GSTPB_REQ])
  AG_GST_CHECK_GST_PLUGINS_LIBAV($GST_API_VERSION, [$GSTPB_REQ])
254
])
255

256 257
dnl Check for documentation xrefs
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
Sebastian Dröge's avatar
Sebastian Dröge committed
258 259
GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
260 261 262 263
AC_SUBST(GLIB_PREFIX)
AC_SUBST(GST_PREFIX)
AC_SUBST(GSTPB_PREFIX)

264 265
dnl GTK is optional and used in examples
HAVE_GTK=NO
266 267
GTK2_REQ=2.14.0
GTK3_REQ=2.91.3
268 269 270
if test "x$BUILD_EXAMPLES" = "xyes"; then
  AC_MSG_CHECKING([which gtk+ version to compile examples against (optional)])
  AC_ARG_WITH([gtk],
271
    AS_HELP_STRING([--with-gtk=3.0|2.0],[which gtk+ version to compile against (default: 2.0)]),
272
    [case "$with_gtk" in
273 274
        2.0) GTK_REQ=$GTK2_REQ ;;
        3.0) GTK_REQ=$GTK3_REQ ;;
275 276
        *) AC_MSG_ERROR([invalid gtk+ version specified]);;
    esac],
277 278 279 280 281 282
    [with_gtk=2.0
     GTK_REQ=$GTK2_REQ])
  AC_MSG_RESULT([$with_gtk (>= $GTK_REQ)])
  PKG_CHECK_MODULES(GTK, gtk+-x11-$with_gtk >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
  AC_SUBST(GTK_LIBS)
  AC_SUBST(GTK_CFLAGS)
283
fi
284
AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
285

286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
dnl Check for -Bsymbolic-functions linker flag used to avoid
dnl intra-library PLT jumps, if available.
AC_ARG_ENABLE(Bsymbolic,
              [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
              [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
               AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
               LDFLAGS=-Wl,-Bsymbolic-functions
               LIBS=
               AC_TRY_LINK([], [return 0],
                           AC_MSG_RESULT(yes)
                           enable_Bsymbolic=yes,
                           AC_MSG_RESULT(no)
                           enable_Bsymbolic=no)
               LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])

dnl *** set variables based on configure arguments ***
302

Matthew Waters's avatar
Matthew Waters committed
303 304
dnl GTK is optional and used in examples
HAVE_GTK3=NO
305
HAVE_GTK3_WAYLAND=""
Matthew Waters's avatar
Matthew Waters committed
306 307 308 309 310 311 312 313
if test "x$BUILD_EXAMPLES" = "xyes"; then
  PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.4, HAVE_GTK3=yes, HAVE_GTK3=no)
  if test "x$HAVE_GTK3" = "xyes"; then
    HAVE_GTK=yes
    GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
    AC_SUBST(GTK_VERSION)
    GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
    AC_SUBST(GTK_BASE_DIR)
314 315
    GTK3_TARGETS=`$PKG_CONFIG --variable=targets gtk+-3.0`
    case "$GTK3_TARGETS" in  *wayland*) HAVE_GTK3_WAYLAND="1" ;; esac
Matthew Waters's avatar
Matthew Waters committed
316 317 318 319 320 321
  fi
fi
AC_SUBST(GTK3_LIBS)
AC_SUBST(GTK3_CFLAGS)
AC_SUBST(HAVE_GTK3)
AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
322
AM_CONDITIONAL(HAVE_GTK3_WAYLAND, test "x$HAVE_GTK3_WAYLAND" = "x1")
Matthew Waters's avatar
Matthew Waters committed
323

324
dnl x11 is optional for librfb
Thijs Vermeir's avatar
Thijs Vermeir committed
325 326 327 328 329 330 331 332 333 334
HAVE_X11=NO
PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no)
AC_SUBST(X11_LIBS)
AC_SUBST(X11_CFLAGS)
AC_SUBST(HAVE_X11)
AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "xyes")
if test "x$HAVE_X11" = "xyes"; then
  AC_DEFINE(HAVE_X11, 1, [Define if you have X11 library])
fi

335 336 337 338 339 340
dnl exif (used on jifmux tests) ****
PKG_CHECK_MODULES(EXIF, libexif >= 0.6.16, HAVE_EXIF="yes", HAVE_EXIF="no")
AC_SUBST(EXIF_LIBS)
AC_SUBST(EXIF_CFLAGS)
AM_CONDITIONAL(USE_EXIF, test "x$HAVE_EXIF" = "xyes")

341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
AG_GST_CHECK_FEATURE(IQA, [iqa], iqa , [
  PKG_CHECK_MODULES(DSSIM, dssim, [
    HAVE_DSSIM="yes"
    HAVE_IQA="yes"
  ], [
    HAVE_DSSIM="no"
    HAVE_IQA="no"
  ])

  if test "x$HAVE_DSSIM" = "xyes"; then
    AC_DEFINE(HAVE_DSSIM, 1, [Define if you have dssim library])
  fi
  AC_SUBST(DSSIM_LIBS)
  AC_SUBST(DSSIM_CFLAGS)
])
356
AM_CONDITIONAL(HAVE_DSSIM, test "x$HAVE_DSSIM" = "xyes")
357

David Schleef's avatar
David Schleef committed
358
dnl Orc
359
ORC_CHECK([0.4.17])
David Schleef's avatar
David Schleef committed
360

361 362 363 364
dnl set license and copyright notice
GST_LICENSE="LGPL"
AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
AC_SUBST(GST_LICENSE)
365

366 367 368 369
dnl define LIBDIR so we can inform people where we live
AS_AC_EXPAND(LIBDIR, $libdir)
AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])

370
dnl set location of plugin directory
371
AG_GST_SET_PLUGINDIR
372

373 374 375 376 377
dnl set release date/time
AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
  ["${srcdir}/gst-plugins-bad.doap"],
  [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])

378 379 380 381 382 383
dnl If only building static libraries, define GST_STATIC_COMPILATION. This is
dnl needed only on Windows, but it doesn't hurt to have it everywhere.
if test x$enable_static = xyes -a x$enable_shared = xno; then
  GST_STATIC_CFLAGS="-DGST_STATIC_COMPILATION"
fi

384 385 386 387 388 389 390 391 392 393 394
AC_ARG_WITH([player-tests],
  AS_HELP_STRING([--with-player-tests],[Enable GstPlayer tests that need network access (default: no)]))
if test x$with_player_tests = xyes; then
  AC_PATH_PROG([WGET], [wget], no)
  if test x$WGET = xno; then
    AC_MSG_WARN([wget required for GstPlayer tests but not found - disabling])
    with_player_tests=no
  fi
fi
AM_CONDITIONAL(WITH_GST_PLAYER_TESTS, test "x$with_player_tests" = "xyes")

395 396 397 398 399
# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
dnl make sure it doesn't complain about unused variables if debugging is disabled
NO_WARNINGS=""
AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])

400
dnl define an ERROR_CFLAGS Makefile variable
Benjamin Otte's avatar
Benjamin Otte committed
401
dnl -Waggregate-return - libexif returns aggregates
Benjamin Otte's avatar
Benjamin Otte committed
402
dnl -Wundef - Windows headers check _MSC_VER unconditionally
403 404 405 406 407
AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
    -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
    -Wwrite-strings -Wformat-security -Wold-style-definition
    -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
    -Wnested-externs $NO_WARNINGS])
408

409
dnl define an ERROR_CXXFLAGS Makefile variable
410
AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
411
    -Wmissing-declarations -Wredundant-decls
Benjamin Otte's avatar
Benjamin Otte committed
412
    -Wwrite-strings -Wformat-nonliteral -Wformat-security
413
    -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar $NO_WARNINGS])
414

415 416 417 418 419 420
dnl define an ERROR_OBJCFLAGS Makefile variable
AG_GST_SET_ERROR_OBJCFLAGS($FATAL_WARNINGS, [
    -Wmissing-declarations -Wredundant-decls
    -Wwrite-strings -Wformat-nonliteral -Wformat-security
    -Winit-self -Wmissing-include-dirs -Wno-multichar $NO_WARNINGS])

421
dnl define correct level for debugging messages
422
AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
423

424 425 426
dnl used in examples
AG_GST_DEFAULT_ELEMENTS

427 428 429
dnl *** plug-ins to include ***

dnl these are all the gst plug-ins, compilable without additional libs
430
AG_GST_CHECK_PLUGIN(accurip)
431
AG_GST_CHECK_PLUGIN(adpcmdec)
432
AG_GST_CHECK_PLUGIN(adpcmenc)
433
AG_GST_CHECK_PLUGIN(aiff)
434
AG_GST_CHECK_PLUGIN(videoframe_audiolevel)
435
AG_GST_CHECK_PLUGIN(asfmux)
436
AG_GST_CHECK_PLUGIN(audiobuffersplit)
437
AG_GST_CHECK_PLUGIN(audiofxbad)
438
AG_GST_CHECK_PLUGIN(audiolatency)
439
AG_GST_CHECK_PLUGIN(audiomixmatrix)
440
AG_GST_CHECK_PLUGIN(audiovisualizers)
441
AG_GST_CHECK_PLUGIN(autoconvert)
442
AG_GST_CHECK_PLUGIN(bayer)
443
AG_GST_CHECK_PLUGIN(camerabin2)
444
AG_GST_CHECK_PLUGIN(coloreffects)
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)
Stefan Sauer's avatar
Stefan Sauer committed
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(id3tag)
457
AG_GST_CHECK_PLUGIN(inter)
David Schleef's avatar
David Schleef committed
458
AG_GST_CHECK_PLUGIN(interlace)
459
AG_GST_CHECK_PLUGIN(ivfparse)
460
AG_GST_CHECK_PLUGIN(ivtc)
461
AG_GST_CHECK_PLUGIN(jp2kdecimator)
462
AG_GST_CHECK_PLUGIN(jpegformat)
463
AG_GST_CHECK_PLUGIN(librfb)
464
AG_GST_CHECK_PLUGIN(midi)
465
AG_GST_CHECK_PLUGIN(mpegdemux)
466
AG_GST_CHECK_PLUGIN(mpegtsdemux)
467
AG_GST_CHECK_PLUGIN(mpegtsmux)
Lin Yang's avatar
Lin Yang committed
468
AG_GST_CHECK_PLUGIN(mpegpsmux)
469
AG_GST_CHECK_PLUGIN(mxf)
Stian Selnes's avatar
Stian Selnes committed
470
AG_GST_CHECK_PLUGIN(netsim)
471
AG_GST_CHECK_PLUGIN(onvif)
472
AG_GST_CHECK_PLUGIN(pcapparse)
473
AG_GST_CHECK_PLUGIN(pnm)
474
AG_GST_CHECK_PLUGIN(proxy)
475
AG_GST_CHECK_PLUGIN(rawparse)
476
AG_GST_CHECK_PLUGIN(removesilence)
477
AG_GST_CHECK_PLUGIN(rist)
478
AG_GST_CHECK_PLUGIN(rtp)
479
AG_GST_CHECK_PLUGIN(sdp)
480
AG_GST_CHECK_PLUGIN(segmentclip)
481
AG_GST_CHECK_PLUGIN(siren)
Stefan Sauer's avatar
Stefan Sauer committed
482
AG_GST_CHECK_PLUGIN(smooth)
483
AG_GST_CHECK_PLUGIN(speed)
484
AG_GST_CHECK_PLUGIN(subenc)
485
AG_GST_CHECK_PLUGIN(timecode)
David Schleef's avatar
David Schleef committed
486
AG_GST_CHECK_PLUGIN(videofilters)
487
AG_GST_CHECK_PLUGIN(videoparsers)
488 489
AG_GST_CHECK_PLUGIN(videosignal)
AG_GST_CHECK_PLUGIN(vmnc)
David Schleef's avatar
David Schleef committed
490
AG_GST_CHECK_PLUGIN(y4m)
491
AG_GST_CHECK_PLUGIN(yadif)
492

493 494
dnl *** plug-ins to exclude ***

495
AC_CHECK_HEADER(AVFoundation/AVFoundation.h, HAVE_AVFOUNDATION="yes", HAVE_AVFOUNDATION="no", [-])
496
AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])
497
AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h, HAVE_VIDEOTOOLBOX="yes", HAVE_VIDEOTOOLBOX="no", [-])
498

499 500 501 502 503 504 505 506 507 508
if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
  old_LIBS=$LIBS
  LIBS="$LIBS -framework VideoToolbox"
  AC_CHECK_FUNC(VTCompressionSessionPrepareToEncodeFrames, [
    AC_DEFINE(HAVE_VIDEOTOOLBOX_10_9_6, 1, [Define if building with VideoToolbox >= 10.9.6])
  ], [
  ])
  LIBS=$old_LIBS
fi

509 510 511 512 513
AM_CONDITIONAL(HAVE_AVFOUNDATION, test "x$HAVE_AVFOUNDATION" = "xyes")
if test "x$HAVE_AVFOUNDATION" = "xyes"; then
  AC_DEFINE(HAVE_AVFOUNDATION, 1, [Define if building with AVFoundation])
fi

514 515 516 517 518
AM_CONDITIONAL(HAVE_IOS, test "x$HAVE_IOS" = "xyes")
if test "x$HAVE_IOS" = "xyes"; then
  AC_DEFINE(HAVE_IOS, 1, [Define if building for Apple iOS])
fi

519
AM_CONDITIONAL(HAVE_VIDEOTOOLBOX, test "x$HAVE_VIDEOTOOLBOX" = "xyes")
520 521 522 523
if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
  AC_DEFINE(HAVE_VIDEOTOOLBOX, 1, [Define if building with VideoToolbox])
fi

524
dnl disable gst plugins we might not be able to build on this
Aleix Conchillo Flaque's avatar
Aleix Conchillo Flaque committed
525
dnl platform: (ugly but minimally invasive)
526 527 528 529
dnl FIXME: maybe move to sys, or make work with winsock2
AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)

530
if test "x$HAVE_WINSOCK2_H" = "xyes"; then
531 532
  WINSOCK2_LIBS="-lws2_32"
  AC_SUBST(WINSOCK2_LIBS)
LRN's avatar
LRN committed
533 534
fi

535
dnl *** sys plug-ins ***
536

537 538
dnl DirectSound
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
539 540 541 542 543 544 545
AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], directsoundsrc, [
  HAVE_DIRECTSOUND="no"
  save_CFLAGS="$CFLAGS"
  save_LDFLAGS="$LDFLAGS"
  save_LIBS="$LIBS"
  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
546
  LIBS="$LIBS -lwinmm -ldsound -ldxerr9 -luser32"
547
  AC_MSG_CHECKING(for DirectSound LDFLAGS)
548
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
549 550 551
#include <windows.h>
#include <dxerr9.h>
#include <dsound.h>
552
#include <mmsystem.h>
553
]], [[
554 555
  DXGetErrorString9 (0);
  DirectSoundCreate(NULL, NULL, NULL);
556
]])],
557 558 559 560 561 562 563 564 565
    [HAVE_DIRECTSOUND="yes"],
    [HAVE_DIRECTSOUND="no"])
  AC_MSG_RESULT($HAVE_DIRECTSOUND)
  CFLAGS=$save_CFLAGS
  LDFLAGS=$save_LDFLAGS
  LIBS=$save_LIBS

  if test "x$HAVE_DIRECTSOUND" = "xyes";  then
    dnl this is much more than we want
566
    DIRECTSOUND_LIBS="-lwinmm -ldsound -ldxerr9 -luser32"
567 568 569 570 571 572
    AC_SUBST(DIRECTX_CFLAGS)
    AC_SUBST(DIRECTX_LDFLAGS)
    AC_SUBST(DIRECTSOUND_LIBS)
  fi
  AC_SUBST(HAVE_DIRECTSOUND)
])
573

574 575 576 577 578 579 580 581 582 583 584
dnl WASAPI
translit(dnm, m, l) AM_CONDITIONAL(USE_WASAPI, true)
AG_GST_CHECK_FEATURE(WASAPI, [WASAPI plug-in], wasapi, [
  HAVE_WASAPI="no"
  save_CFLAGS="$CFLAGS"
  save_LDFLAGS="$LDFLAGS"
  save_LIBS="$LIBS"
  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
  LIBS="$LIBS -lole32 -lwinmm -lksuser"
  AC_MSG_CHECKING(for WASAPI LDFLAGS)
585
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
586 587 588 589
#include <windows.h>
#include <stdio.h>
#include <mmsystem.h>
#include <mmdeviceapi.h>
590
]], [[
591 592 593 594 595 596 597 598 599 600 601 602
int main ()
{
    HRESULT hr = S_OK;

    hr = CoInitialize(NULL);
    if (FAILED(hr)) {
        printf("CoInitialize failed: hr = 0x%08x", hr);
        return __LINE__;
    }

	int result = 0;
    // result = do_everything(argc, argv);
Thijs Vermeir's avatar
Thijs Vermeir committed
603

604 605 606
    CoUninitialize();
    return result;
}
607
]])],
608 609 610 611 612 613 614 615 616 617 618 619 620 621
    [HAVE_WASAPI="yes"],
    [HAVE_WASAPI="no"])
  AC_MSG_RESULT($HAVE_WASAPI)
  CFLAGS=$save_CFLAGS
  LDFLAGS=$save_LDFLAGS
  LIBS=$save_LIBS

  if test "x$HAVE_WASAPI" = "xyes";  then
    WASAPI_LIBS="-lole32 -lwinmm -lksuser"
    AC_SUBST(WASAPI_LIBS)
  fi
  AC_SUBST(HAVE_WASAPI)
])

David Schleef's avatar
David Schleef committed
622 623 624 625 626 627 628 629 630
dnl Direct3D
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECT3D, true)
AG_GST_CHECK_FEATURE(DIRECT3D, [Direct3D plug-in], direct3dsink, [
  HAVE_DIRECT3D="no"
  save_CFLAGS="$CFLAGS"
  save_LDFLAGS="$LDFLAGS"
  save_LIBS="$LIBS"
  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
631
  LIBS="$LIBS -ld3d9 -lgdi32"
David Schleef's avatar
David Schleef committed
632
  AC_MSG_CHECKING(for Direct3D LDFLAGS)
633
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
David Schleef's avatar
David Schleef committed
634
#include <windows.h>
635
#include <d3d9.h>
636
]], [[
637
  Direct3DCreate9(D3D_SDK_VERSION);
638
]])],
David Schleef's avatar
David Schleef committed
639 640 641 642 643 644 645 646
    [HAVE_DIRECT3D="yes"],
    [HAVE_DIRECT3D="no"])
  AC_MSG_RESULT($HAVE_DIRECT3D)
  CFLAGS=$save_CFLAGS
  LDFLAGS=$save_LDFLAGS
  LIBS=$save_LIBS

  if test "x$HAVE_DIRECT3D" = "xyes";  then
Sebastian Dröge's avatar
Sebastian Dröge committed
647
    DIRECT3D_LIBS="-ld3d9 -lgdi32"
David Schleef's avatar
David Schleef committed
648 649 650 651 652
    AC_SUBST(DIRECT3D_LIBS)
  fi
  AC_SUBST(HAVE_DIRECT3D)
])

653 654 655 656
dnl winscreencap
translit(dnm, m, l) AM_CONDITIONAL(USE_WINSCREENCAP, true)
AG_GST_CHECK_FEATURE(WINSCREENCAP, [winscreencap plug-in], winscreencap, [
  HAVE_WINSCREENCAP="no"
657 658
  save_CFLAGS="$CFLAGS"
  save_LDFLAGS="$LDFLAGS"
659
  save_LIBS="$LIBS"
660 661
  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
662
  LIBS="$LIBS -ld3d9 -lgdi32"
663
  AC_MSG_CHECKING(for Direct3D LDFLAGS)
664
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
665 666
#include <windows.h>
#include <d3d9.h>
667
]], [[
668
  Direct3DCreate9(D3D_SDK_VERSION);
669
]])],
670 671 672
    [HAVE_WINSCREENCAP="yes"],
    [HAVE_WINSCREENCAP="no"])
  AC_MSG_RESULT($HAVE_WINSCREENCAP)
673 674
  CFLAGS=$save_CFLAGS
  LDFLAGS=$save_LDFLAGS
675 676
  LIBS=$save_LIBS

677 678 679
  if test "x$HAVE_WINSCREENCAP" = "xyes";  then
    WINSCREENCAP_LIBS="-ld3d9 -lgdi32"
    AC_SUBST(WINSCREENCAP_LIBS)
680
  fi
681
  AC_SUBST(HAVE_WINSCREENCAP)
682 683
])

684 685 686 687
dnl winks
translit(dnm, m, l) AM_CONDITIONAL(USE_WINKS, true)
AG_GST_CHECK_FEATURE(WINKS, [Winks plug-in], winks, [
  HAVE_WINKS="no"
688 689 690 691 692 693
  save_CFLAGS="$CFLAGS"
  save_LDFLAGS="$LDFLAGS"
  save_LIBS="$LIBS"
  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
  LIBS="$LIBS -lole32 -luuid -lstrmiids"
694
  AC_MSG_CHECKING(for Winks LDFLAGS)
695
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
696 697 698
#include <windows.h>
#include <strmif.h>
#include <uuids.h>
LRN's avatar
LRN committed
699
]], [[
700 701 702
int main () {
  IGraphBuilder *pGraph = NULL;
  HRESULT hr = CoInitialize(NULL);
Thijs Vermeir's avatar
Thijs Vermeir committed
703
  hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
704 705 706 707
                        &IID_IGraphBuilder, (void **)&pGraph);

  return 0;
}
708
]])],
709 710 711
    [HAVE_WINKS="yes"],
    [HAVE_WINKS="no"])
  AC_MSG_RESULT($HAVE_WINKS)
712 713 714 715
  CFLAGS=$save_CFLAGS
  LDFLAGS=$save_LDFLAGS
  LIBS=$save_LIBS

716
  if test "x$HAVE_WINKS" = "xyes";  then
717
    dnl this is much more than we want
718
    WINKS_LIBS="-ldxguid -lole32 -luuid -lstrmiids -lksuser -lsetupapi"
719 720
    AC_SUBST(DIRECTX_CFLAGS)
    AC_SUBST(DIRECTX_LDFLAGS)
721
    AC_SUBST(WINKS_LIBS)
722
  fi
723
  AC_SUBST(HAVE_WINKS)
724 725
])

726 727 728 729 730 731 732 733 734 735 736
dnl *** Android Media ***
translit(dnm, m, l) AM_CONDITIONAL(USE_ANDROID_MEDIA, true)
HAVE_ANDROID_MEDIA="no"
AG_GST_CHECK_FEATURE(ANDROID_MEDIA, [Android Media], androidmedia, [
  case "$host" in
    *android*)
      AC_CHECK_HEADER(jni.h, HAVE_ANDROID_MEDIA="yes", HAVE_ANDROID_MEDIA="no")
      ;;
    *)
      HAVE_ANDROID_MEDIA="no"
      ;;
737
  esac
738 739
])

740 741 742 743 744 745
dnl *** AppleMedia (OS X and iOS) ***
translit(dnm, m, l) AM_CONDITIONAL(USE_APPLE_MEDIA, true)
HAVE_APPLE_MEDIA="no"
dnl SystemConfiguration.h is common to OS X and iOS, so we check for that
AG_GST_CHECK_FEATURE(APPLE_MEDIA, [Apple video], applemedia, [
  AC_CHECK_HEADER(SystemConfiguration/SystemConfiguration.h, HAVE_APPLE_MEDIA="yes", HAVE_APPLE_MEDIA="no")
746 747 748 749
  dnl OSX 10.7 and earlier lack VideoToolbox/VideoToolbox.h
  if test "x$HAVE_IOS" = "xno"; then
    AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h,, HAVE_APPLE_MEDIA="no")
  fi
750
])
751

752 753 754 755 756 757 758 759
dnl in case header SystemConfiguration/SystemConfiguration.h is found on other platforms
case "$host" in
  *-*darwin*)
    ;;
  *)
    HAVE_APPLE_MEDIA="no"
    ;;
esac
760

761 762 763
dnl *** bluez ***
translit(dnm, m, l) AM_CONDITIONAL(USE_BLUEZ, true)
AG_GST_CHECK_FEATURE(BLUEZ, [Bluez], bluez, [
764 765 766 767 768
  PKG_CHECK_MODULES([BLUEZ5], [bluez >= 5.0], [
    PKG_CHECK_MODULES([GIO_UNIX], gio-unix-2.0 > 2.24, [
      AC_CHECK_PROG([GDBUS_CODEGEN],[gdbus-codegen],[gdbus-codegen])
      HAVE_BLUEZ=yes
      AC_DEFINE(HAVE_BLUEZ5,[1],[Bluez5 detected])
769 770 771
    ], [
      HAVE_BLUEZ=no
    ])
772 773
  ], [
    HAVE_BLUEZ=no
774
  ])
775 776
])

777 778 779 780
dnl *** OS/X AVCVideoServices ***
translit(dnm, m, l) AM_CONDITIONAL(USE_AVC, true)
HAVE_AVC="no"
AG_GST_CHECK_FEATURE(AVC, [AVC Video Services], avcsrc, [
David Schleef's avatar
David Schleef committed
781 782 783 784 785
  AC_LANG_PUSH([C++])
  save_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS -framework AVCVideoServices -framework CoreFoundation"
  save_LIBS="$LIBS"
  LIBS="$LIBS -framework AVCVideoServices -framework CoreFoundation"
786
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[HAVE_AVC=yes],[HAVE_AVC=no])
David Schleef's avatar
David Schleef committed
787 788 789
  LIBS=$save_LIBS
  CPPFLAGS=$save_CPPFLAGS
  AC_LANG_POP([C++])
790 791 792 793 794 795 796 797 798 799
])
dnl in case header AVCVideoServices/AVCVideoServices.h is found on other platforms
case "$host" in
  *-*darwin*)
    ;;
  *)
    HAVE_AVC="no"
    ;;
esac

800 801 802
dnl check for shm_open (for shm plugin)
translit(dnm, m, l) AM_CONDITIONAL(USE_SHM, true)
AG_GST_CHECK_FEATURE(SHM, [POSIX shared memory source and sink], shm, [
803 804 805 806 807 808
    if test "x$HAVE_SYS_SOCKET_H" = "xyes"; then
        case $host in
        *-darwin* | *-macos10*)
            AC_DEFINE(HAVE_OSX,[1],[Apple Mac OS X operating system detected])
            HAVE_SHM=yes
            ;;
809 810 811
        *-*-OpenBSD*)
            HAVE_SHM=yes
            ;;
812 813 814 815 816 817
        *)
            AC_CHECK_LIB([rt], [shm_open],
                AC_CHECK_DECL([MSG_NOSIGNAL], HAVE_SHM=yes, HAVE_SHM=no, [
                #include <sys/socket.h>
  	            ]),
                HAVE_SHM=no)
818
            AC_SUBST(SHM_LIBS, "-lrt")
819 820 821 822 823
            ;;
        esac
    else
        HAVE_SHM=no
    fi
824 825
])

826 827 828 829 830 831 832 833 834 835 836 837 838 839
dnl check for unix sockets (ipcpipeline plugin)
translit(dnm, m, l) AM_CONDITIONAL(USE_IPCPIPELINE, true)
AG_GST_CHECK_FEATURE(IPCPIPELINE, [Unix sockets], ipcpipeline, [
    if test "x$HAVE_SYS_SOCKET_H" = "xyes"; then
        AC_CHECK_FUNC(pipe, [
          AC_CHECK_FUNC(socketpair, [HAVE_IPCPIPELINE=yes], [HAVE_IPCPIPELINE=no])
          ], [
          HAVE_IPCPIPELINE=no
        ])
    else
        HAVE_IPCPIPELINE=no
    fi
])

840 841 842
dnl check for OpenSL ES
translit(dnm, m, l) AM_CONDITIONAL(USE_OPENSLES, true)
AG_GST_CHECK_FEATURE(OPENSLES, [OpenSL ES], opensl, [
843
  AC_CHECK_HEADER(SLES/OpenSLES.h, HAVE_OPENSLES="yes", HAVE_OPENSLES="no")
844
])
Youness Alaoui's avatar
Youness Alaoui committed
845 846 847 848

dnl *** UVC H264 ***
translit(dnm, m, l) AM_CONDITIONAL(USE_UVCH264, true)
AG_GST_CHECK_FEATURE(UVCH264, [UVC H264], uvch264, [
849
  AC_CHECK_HEADER(linux/uvcvideo.h, HAVE_UVCVIDEO_H=yes, HAVE_UVCVIDEO_H=no)
Youness Alaoui's avatar
Youness Alaoui committed
850 851 852 853 854 855 856 857
  PKG_CHECK_MODULES(G_UDEV, gudev-1.0 , [
          AC_DEFINE([HAVE_GUDEV], 1, [Define if gudev is installed])
          HAVE_GUDEV="yes" ],
          [HAVE_GUDEV="no"])
  PKG_CHECK_MODULES(LIBUSB, libusb-1.0 , [
          AC_DEFINE([HAVE_LIBUSB], 1, [Define if libusb 1.x is installed])
          HAVE_LIBUSB="yes" ],
          [HAVE_LIBUSB="no"])
858 859 860
  if test "x$HAVE_UVCVIDEO_H" = "xyes" && \
     test "x$HAVE_GUDEV" = "xyes" && \
     test "x$HAVE_LIBUSB" = "xyes"; then
861 862 863 864
    HAVE_UVCH264=yes
  else
    HAVE_UVCH264=no
  fi
Youness Alaoui's avatar
Youness Alaoui committed
865 866 867 868 869 870
])
AC_SUBST(LIBUDEV_CFLAGS)
AC_SUBST(LIBUDEV_LIBS)
AC_SUBST(LIBUSB_CFLAGS)
AC_SUBST(LIBUSB_LIBS)

871 872 873
dnl *** USE_NVCODEC ***
translit(dnm, m, l) AM_CONDITIONAL(USE_NVCODEC, true)
AG_GST_CHECK_FEATURE(NVCODEC, [NVIDIA Codec plugin], nvcodec, [
874 875 876 877 878 879
  HAVE_NVCODEC="yes"
  USE_NVCODEC_GST_GL="no"

  if test "x$GST_GL_HAVE_API_GL" = "x1"; then
    USE_NVCODEC_GST_GL="yes"
    AC_DEFINE(HAVE_NVCODEC_GST_GL, [1], [NVCODEC GStreamer OpenGL support available])
880 881
  fi
])
882
AM_CONDITIONAL(USE_NVCODEC_GST_GL, test "x$USE_NVCODEC_GST_GL" = "xyes")
Youness Alaoui's avatar
Youness Alaoui committed
883

884 885 886 887 888 889
dnl check for tinyalsa
translit(dnm, m, l) AM_CONDITIONAL(USE_TINYALSA, true)
AG_GST_CHECK_FEATURE(TINYALSA, [tinyalsa], tinyalsa, [
  AC_CHECK_HEADER(tinyalsa/asoundlib.h, HAVE_TINYALSA="yes", HAVE_TINYALSA="no")
])

D Scott Phillips's avatar
D Scott Phillips committed
890 891 892
dnl check for intel mediasdk
translit(dnm, m, l) AM_CONDITIONAL(USE_MSDK, true)
AG_GST_CHECK_FEATURE(MSDK, [Intel MediaSDK], msdk, [
893
  AG_GST_PKG_CHECK_MODULES(GST_ALLOCATORS, gstreamer-allocators-1.0)
894 895 896 897
  PKG_CHECK_MODULES(G_UDEV, gudev-1.0 , [
          AC_DEFINE([HAVE_GUDEV], 1, [Define if gudev is installed])
          HAVE_GUDEV="yes" ],
          [HAVE_GUDEV="no"])
898 899 900 901
  PKG_CHECK_MODULES(LIBMFX, libmfx,
  [
    AC_DEFINE(HAVE_LIBMFX, 1, [Define if mfx_dispatcher is available])
    HAVE_MSDK="yes"
902 903 904 905 906
    dnl external msdk dispatchers sometimes install headers into prefix/mfx/
    save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$LIBMFX_CFLAGS $save_CPPFLAGS"
    AC_CHECK_HEADER(mfx/mfxdefs.h, [HAVE_MFX_MFXDEFS_H=1], [HAVE_MFX_MFXDEFS_H=0])
    if test $HAVE_MFX_MFXDEFS_H -eq 1; then
907 908 909
      MFX_INCDIR="`$PKG_CONFIG --variable=includedir libmfx`"
      MSDK_CFLAGS="-I$MFX_INCDIR/mfx"
      AC_SUBST(MSDK_CFLAGS)
910 911
    fi
    CPPFLAGS="$save_CPPFLAGS"
912 913 914 915 916 917 918 919 920
  ], [
    AC_ARG_WITH([msdk-prefix],
            AS_HELP_STRING([--with-msdk-prefix],
            [Use the provided prefix for detecting the Intel MediaSDK]),
            [AS_IF([test "x$with_msdk_prefix" != "x"],
                   [MSDK_PREFIX="$with_msdk_prefix"])],
            [AS_IF([test "x$MFX_HOME" != "x"],
                   [MSDK_PREFIX="$MFX_HOME"],
                   [MSDK_PREFIX="/opt/intel/media"])])
921
    MSDK_CFLAGS="-I$MSDK_PREFIX/include -I$MSDK_PREFIX/include/mfx"
922
    MSDK_LIBS="-L$MSDK_PREFIX/lib/lin_x64 -L$MSDK_PREFIX/lib/x64 -L$MSDK_PREFIX/lib64 -L$MSDK_PREFIX/lib -lmfx -ldl"
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944
    AC_SUBST(MSDK_CFLAGS)
    AC_SUBST(MSDK_LIBS)

    save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$MSDK_CFLAGS $save_CPPFLAGS"
    AC_CHECK_HEADER(mfxdefs.h, HAVE_MFXDEFS_H="yes", HAVE_MFXDEFS_H="no")
    CPPFLAGS="$save_CPPFLAGS"

    save_LIBS="$LIBS"
    LIBS="$MSDK_LIBS $LIBS"
    AC_LANG_PUSH([C++])
    AC_CHECK_LIB(mfx,MFXInit,HAVE_MFX_LIB="yes",HAVE_MFX_LIB="no")
    AC_LANG_POP([C++])
    LIBS="$save_LIBS"

    if test "x$HAVE_MFXDEFS_H" = "xyes" \
        -a "x$HAVE_MFX_LIB" = "xyes"; then
      HAVE_MSDK="yes"
    else
      HAVE_MSDK="no"
    fi
  ])
D Scott Phillips's avatar
D Scott Phillips committed
945 946 947

  PKG_CHECK_MODULES(LIBVA_DRM, libva-drm, HAVE_LIBVA_DRM="yes", HAVE_LIBVA_DRM="no")

948 949 950
  if test "x$HAVE_GUDEV" = "xyes" \
     -a  "x$HAVE_MSDK" = "xyes" \
     -a "x$HAVE_LIBVA_DRM" = "xyes"; then
D Scott Phillips's avatar
D Scott Phillips committed
951 952 953 954
    HAVE_MSDK="yes"
  else
    HAVE_MSDK="no"
  fi
955 956 957 958 959 960 961 962 963 964
], [], [
  dnl check the availability of vp9 apis
  USE_MSDK_VP9_DEC=0
  save_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$LIBMFX_CFLAGS $MSDK_CFLAGS $save_CPPFLAGS"
  AC_CHECK_HEADER(mfxvp9.h, [HAVE_MFXVP9_H=1], [HAVE_MFXVP9_H=0],
  [
    #include <mfxplugin.h>
  ])

965
  if test $HAVE_MFXVP9_H -eq 1; then
966 967 968
      USE_MSDK_VP9_DEC=1
      AC_DEFINE(USE_MSDK_VP9_DEC, 1, [Define if MediaSDK VP9 decoder api is available])
  fi
969
], [USE_MSDK_VP9_DEC=0])
D Scott Phillips's avatar
D Scott Phillips committed
970 971
AM_CONDITIONAL(USE_MSDK_LIBVA,
    test "x$HAVE_MSDK" = "xyes" -a "x$HAVE_LIBVA_DRM" = "xyes")
972 973
AM_CONDITIONAL([USE_MSDK_VP9_DEC],
    [test $USE_MSDK_VP9_DEC -eq 1])
D Scott Phillips's avatar
D Scott Phillips committed
974

975 976 977 978
dnl *** ext plug-ins ***
dnl keep this list sorted alphabetically !

if test "x$BUILD_EXTERNAL" = "xyes"; then
979

980 981 982
dnl *** assrender ***
translit(dnm, m, l) AM_CONDITIONAL(USE_ASSRENDER, true)
AG_GST_CHECK_FEATURE(ASSRENDER, [ASS/SSA renderer], assrender, [
983
  PKG_CHECK_MODULES(ASSRENDER, libass >= 0.10.2, [
984
    HAVE_ASSRENDER="yes" ], [
985 986 987 988 989 990
    HAVE_ASSRENDER="no"
  ])
])
AC_SUBST(ASSRENDER_CFLAGS)
AC_SUBST(ASSRENDER_LIBS)

991 992 993 994 995 996
dnl *** AOM ***
translit(dnm, m, l) AM_CONDITIONAL(USE_AOM, true)
AG_GST_CHECK_FEATURE(AOM, [AV1 encoder/decoder], aom, [
  AG_GST_PKG_CHECK_MODULES(AOM, aom)
])

997 998 999 1000 1001 1002
dnl *** avtp ***
translit(dnm, m, l) AM_CONDITIONAL(USE_AVTP, true)
AG_GST_CHECK_FEATURE(AVTP, [Audio/Video Transport Protocol], avtp, [
  AG_GST_PKG_CHECK_MODULES(AVTP, avtp)
])

1003 1004 1005 1006
dnl *** vo-amrwbenc ***
translit(dnm, m, l) AM_CONDITIONAL(USE_VOAMRWBENC, true)
AG_GST_CHECK_FEATURE(VOAMRWBENC, [vo-amrwbenc library], vo-amrwbenc, [
  AG_GST_PKG_CHECK_MODULES(VOAMRWBENC, vo-amrwbenc >= 0.1.0)
1007 1008
])

1009
dnl *** vo-aacenc ***
1010 1011 1012
translit(dnm, m, l) AM_CONDITIONAL(USE_VOAACENC, true)
AG_GST_CHECK_FEATURE(VOAACENC, [vo-aacenc library], vo-aacenc, [
  AG_GST_PKG_CHECK_MODULES(VOAACENC, vo-aacenc >= 0.1.0)
1013 1014
])

1015 1016 1017 1018 1019 1020 1021 1022 1023 1024
dnl *** bs2b ***
translit(dnm, m, l) AM_CONDITIONAL(USE_BS2B, true)
AG_GST_CHECK_FEATURE(BS2B, [bs2b], bs2b, [
  PKG_CHECK_MODULES(BS2B, libbs2b >= 3.1.0, HAVE_BS2B="yes", [
    HAVE_BS2B="no"
  ])
  AC_SUBST(BS2B_CFLAGS)
  AC_SUBST(BS2B_LIBS)
])

Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
1025
dnl *** BZ2 ***
Jan Schmidt's avatar
Jan Schmidt committed
1026
translit(dnm, m, l) AM_CONDITIONAL(USE_BZ2, true)
1027
AG_GST_CHECK_FEATURE(BZ2, [bz2 library], bz2, [
1028 1029 1030 1031 1032 1033
  save_LIBS=$LIBS
  LIBS="$LIBS -lbz2"
  AC_MSG_CHECKING([for BZ2_bzlibVersion in -lbz2])
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <bzlib.h>]], [[const char *version = BZ2_bzlibVersion ();]])],[HAVE_BZ2=yes],[HAVE_BZ2=no])
  AC_MSG_RESULT($HAVE_BZ2)
  LIBS=$save_LIBS
1034 1035 1036
  if test "x$HAVE_BZ2" = "xyes"; then
    BZ2_LIBS="-lbz2"
  fi
1037
  AC_SUBST(BZ2_LIBS)
1038

Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
1039 1040
])

1041 1042
#dnl *** cairo ***
#translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true)
1043
#AG_GST_CHECK_FEATURE(CAIRO, [cairo plug-in], cairo, [
1044 1045 1046
#  PKG_CHECK_MODULES(CAIRO, cairo >= 1.0 glitz-glx, HAVE_CAIRO=yes, [
#    HAVE_CAIRO=no
#  ])
1047 1048 1049 1050
#  AC_SUBST(CAIRO_CFLAGS)
#  AC_SUBST(CAIRO_LIBS)
#])

1051 1052 1053 1054 1055 1056 1057 1058 1059 1060
dnl *** chromaprint ***
translit(dnm, m, l) AM_CONDITIONAL(USE_CHROMAPRINT, true)
AG_GST_CHECK_FEATURE(CHROMAPRINT, [chromaprint], chromaprint, [
  PKG_CHECK_MODULES(CHROMAPRINT, libchromaprint, HAVE_CHROMAPRINT="yes", [
    HAVE_CHROMAPRINT="no"
  ])
  AC_SUBST(CHROMAPRINT_CFLAGS)
  AC_SUBST(CHROMAPRINT_LIBS)
])

1061 1062 1063
dnl *** Curl ***
translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true)
AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
1064
  PKG_CHECK_MODULES(CURL, libcurl >= 7.35.0, [
1065
    HAVE_CURL="yes"
1066
    AC_CHECK_HEADERS([unistd.h sys/socket.h sys/types.h netinet/in.h netinet/tcp.h fcntl.h], [ ], [
LRN's avatar
LRN committed
1067 1068
      AC_CHECK_HEADERS([unistd.h sys/types.h winsock2.h ws2tcpip.h fcntl.h], [ ], [HAVE_CURL="no"])
    ])
1069 1070 1071 1072 1073 1074 1075 1076
    AC_CHECK_HEADERS([netinet/ip.h], [], [HAVE_CURL="no"],
    [[#ifdef HAVE_SYS_TYPES_H
     # include <sys/types.h>
     #endif
     #ifdef HAVE_NETINET_IN_H
     # include <netinet/in.h>
     #endif
    ]])
1077 1078 1079
    AC_MSG_CHECKING([for socket support needed by curlsink])
    AC_MSG_RESULT($HAVE_CURL)
  ], [
1080 1081 1082 1083
    HAVE_CURL="no"
  ])
  AC_SUBST(CURL_CFLAGS)
  AC_SUBST(CURL_LIBS)
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
  PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
    HAVE_SSH2="yes"
    AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
  ], [
    HAVE_SSH2="no"
  ])
  AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes")
  AC_SUBST(SSH2_CFLAGS)
  AC_SUBST(SSH2_LIBS)
],,,[AM_CONDITIONAL(USE_SSH2, false)])
1094

1095 1096 1097
dnl **** DASH ****
translit(dnm, m, l) AM_CONDITIONAL(USE_DASH, true)
AG_GST_CHECK_FEATURE(DASH, [DASH plug-in], dash, [
1098
  PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.8, [HAVE_LIBXML2="yes"
1099 1100 1101 1102 1103 1104
    HAVE_DASH="yes"], [HAVE_LIBXML2="no"
    HAVE_DASH="no"])
  AC_SUBST(LIBXML2_CFLAGS)
  AC_SUBST(LIBXML2_LIBS)
])

Eric Jonas's avatar
Eric Jonas committed
1105 1106 1107
dnl *** dc1394  ***
translit(dnm, m, l) AM_CONDITIONAL(USE_DC1394, true)
AG_GST_CHECK_FEATURE(DC1394, [libdc1394], dc1394, [
1108
   PKG_CHECK_MODULES(LIBDC1394, libdc1394-2 >= 2.0.0, [
1109
   	if test -z "`$PKG_CONFIG --modversion libdc1394-2 | grep 2.0.0-rc`"; then
1110 1111 1112 1113 1114
		HAVE_DC1394="yes"
	else
		HAVE_DC1394="no"
	fi
   ], [
Eric Jonas's avatar
Eric Jonas committed
1115 1116 1117 1118 1119 1120 1121
        HAVE_DC1394="no"
	AC_MSG_RESULT(no)
   ])
   AC_SUBST(LIBDC1394_CFLAGS)
   AC_SUBST(LIBDC1394_LIBS)
])

1122 1123 1124
dnl *** decklink  ***
translit(dnm, m, l) AM_CONDITIONAL(USE_DECKLINK, true)
AG_GST_CHECK_FEATURE(DECKLINK, [decklink], decklink, [
1125
   HAVE_DECKLINK=no
1126
   case "$host" in
1127 1128 1129
     *android*)
       HAVE_DECKLINK=no
       ;;
1130
     *-*linux*)
1131 1132 1133 1134 1135 1136 1137 1138
       if test "x$HAVE_PTHREAD_H" = "xyes"; then
         AC_CHECK_LIB(dl, dlopen,
           [
            HAVE_DECKLINK=yes
            DECKLINK_CXXFLAGS=
            DECKLINK_LIBS="-lpthread -ldl"
           ])
       fi
1139
       ;;
1140 1141 1142 1143 1144 1145 1146
     *-*darwin*)
       if test "x$HAVE_PTHREAD_H" = "xyes"; then
         AC_CHECK_LIB(dl, dlopen,
           [
            HAVE_DECKLINK=yes
            DECKLINK_CXXFLAGS=
            DECKLINK_LIBS="-lpthread -ldl"
1147
            HAVE_DECKLINK_OSX=yes
1148 1149 1150
           ])
       fi
       ;;
1151 1152 1153
     *-mingw*)
       HAVE_DECKLINK=yes
       DECKLINK_CXXFLAGS=
1154
       DECKLINK_LIBS="-lole32 -loleaut32"
1155 1156
       HAVE_DECKLINK_WIN=yes
       ;;
1157 1158 1159 1160
     *)
       HAVE_DECKLINK=no
       ;;
   esac
1161

1162 1163 1164
   AC_SUBST(DECKLINK_CXXFLAGS)
   AC_SUBST(DECKLINK_LIBS)
])
1165
AM_CONDITIONAL(DECKLINK_OSX, test "x$HAVE_DECKLINK_OSX" = xyes)
1166
AM_CONDITIONAL(DECKLINK_WIN, test "x$HAVE_DECKLINK_WIN" = xyes)
Eric Jonas's avatar
Eric Jonas committed
1167

1168 1169
dnl **** DirectFB ****
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTFB, true)
1170
AG_GST_CHECK_FEATURE(DIRECTFB, [directfb], dfbvideosink , [
1171
  PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.24, HAVE_DIRECTFB="yes", [
1172 1173 1174 1175
    HAVE_DIRECTFB="no"
  ])
])

1176 1177
dnl **** Wayland ****
translit(dnm, m, l) AM_CONDITIONAL(USE_WAYLAND, true)
1178
AC_PATH_PROG([wayland_scanner], [wayland-scanner])
1179
AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland , [
1180
  PKG_CHECK_MODULES(WAYLAND, wayland-client >= 1.11.0 libdrm >= 2.4.55 wayland-protocols >= 1.15, [
1181 1182 1183 1184 1185 1186 1187 1188 1189
    if test "x$wayland_scanner" != "x"; then
      HAVE_WAYLAND="yes"
      AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
    else
      AC_MSG_RESULT([wayland-scanner is required to build the wayland plugin])
      HAVE_WAYLAND="no"
    fi
    ],
    [ HAVE_WAYLAND="no"
1190 1191 1192
  ])
])

1193 1194 1195 1196 1197 1198 1199 1200 1201 1202
dnl **** WebP ****
translit(dnm, m, l) AM_CONDITIONAL(USE_WEBP, true)
AG_GST_CHECK_FEATURE(WEBP, [WebP], webp , [
  PKG_CHECK_MODULES(WEBP, libwebp >= 0.2.1, [
    HAVE_WEBP="yes" ], [ HAVE_WEBP="no"
  ])
  AC_SUBST(WEBP_CFLAGS)
  AC_SUBST(WEBP_LIBS)
])

Edgard Gusmão Lima's avatar
Edgard Gusmão Lima committed
1203 1204
dnl *** DTS ***
translit(dnm, m, l) AM_CONDITIONAL(USE_DTS, true)
1205
AG_GST_CHECK_FEATURE(DTS, [dts library], dtsdec, [
1206
  HAVE_DTS="yes"
1207 1208
  AG_GST_CHECK_LIBHEADER(DTS, dca, dca_init, $LIBM, dca.h,
    DTS_LIBS="-ldca $LIBM", HAVE_DTS="no")
1209
  if test $HAVE_DTS = "no"; then
1210 1211
    AG_GST_CHECK_LIBHEADER(DTS, dts_pic, dts_init, $LIBM, dts.h,
      [ DTS_LIBS="-ldts_pic $LIBM"
1212 1213
        AC_DEFINE(DTS_OLD, 1, [Define if an old libdts is used])
      ])
1214
  fi
Edgard Gusmão Lima's avatar
Edgard Gusmão Lima committed
1215 1216 1217
  AC_SUBST(DTS_LIBS)
])

1218 1219 1220 1221 1222
dnl *** resindvd ***
translit(dnm, m, l) AM_CONDITIONAL(USE_RESINDVD, true)
AG_GST_CHECK_FEATURE(RESINDVD, [resindvd plugin], resindvd, [
  PKG_CHECK_MODULES(DVDNAV, dvdnav >= 4.1.2 dvdread >= 4.1.2, HAVE_RESINDVD="yes", [
    HAVE_RESINDVD="no"
Thiago Santos's avatar
Thiago Santos committed
1223 1224 1225
  ])
])

1226 1227
dnl **** Free AAC Encoder (FAAC) ****
translit(dnm, m, l) AM_CONDITIONAL(USE_FAAC, true)