3 dnl please read gstreamer/docs/random/autotools before changing this file
5 dnl initialize autoconf
6 dnl releases only do -Wall, cvs and prerelease does -Werror too
7 dnl use a three digit version number for releases, and four for cvs/prerelease
8 AC_INIT(GStreamer Base Plug-ins, 0.10.11.1,
9 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
12 dnl initialize automake
15 dnl define PACKAGE_VERSION_* variables
18 dnl check if this is a release version
19 AS_NANO(GST_CVS="no", GST_CVS="yes")
21 dnl can autoconf find the source ?
22 AC_CONFIG_SRCDIR([gst/audiotestsrc/gstaudiotestsrc.c])
24 dnl define the output header for config
25 AM_CONFIG_HEADER([config.h])
27 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
30 dnl sets host_* variables
33 dnl our libraries and install dirs use major.minor as a version
34 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
35 dnl we override it here if we need to for the release candidate of new series
37 AC_SUBST(GST_MAJORMINOR)
39 dnl CURRENT, REVISION, AGE
40 dnl - library source changed -> increment REVISION
41 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
42 dnl - interfaces added -> increment AGE
43 dnl - interfaces removed -> AGE = 0
44 dnl sets GST_LT_LDFLAGS
45 AS_LIBTOOL(GST, 8, 0, 8)
47 dnl FIXME: this macro doesn't actually work;
48 dnl the generated libtool script has no support for the listed tags.
49 dnl So this needs to be fixed first if we want to use this
54 dnl *** required versions of GStreamer stuff ***
57 dnl *** autotools stuff ****
59 dnl allow for different autotools
60 AS_AUTOTOOLS_ALTERNATE
62 dnl Add parameters for aclocal
63 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
66 dnl the version check needs to stay here because autopoint greps for it
67 AM_GNU_GETTEXT_VERSION([0.11.5])
68 AM_GNU_GETTEXT([external])
69 GST_GETTEXT([gst-plugins-base-$GST_MAJORMINOR])
71 dnl *** check for arguments to configure ***
80 GST_ARG_WITH_PKG_CONFIG_PATH
81 GST_ARG_WITH_PACKAGE_NAME
82 GST_ARG_WITH_PACKAGE_ORIGIN
84 dnl these are all the gst plug-ins, compilable without additional libs
100 AC_SUBST(GST_PLUGINS_ALL)
102 GST_PLUGINS_SELECTED=""
105 AC_HELP_STRING([--with-plugins],
106 [comma-separated list of plug-ins to compile]),
107 [for i in `echo $withval | tr , ' '`; do
108 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
110 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
112 echo "plug-in $i not recognized, ignoring..."
115 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
117 AC_SUBST(GST_PLUGINS_SELECTED)
119 dnl ext plug-ins; plug-ins that have external dependencies
120 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
121 [HAVE_EXTERNAL=yes], enabled,
123 AC_MSG_NOTICE(building external plug-ins)
126 AC_MSG_NOTICE(all plug-ins with external dependencies will not be built)
129 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
131 dnl *** checks for platform ***
133 dnl * hardware/architecture *
135 dnl common/m4/gst-arch.m4
139 dnl *** checks for programs ***
144 dnl determine c++ compiler
146 dnl determine if c++ is available on this system
147 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
149 dnl determine c++ preprocessor
150 dnl FIXME: do we need this ?
153 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
154 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
156 dnl check for documentation tools
158 AS_PATH_PYTHON([2.1])
159 GST_PLUGIN_DOCS([1.3],[2.1])
161 dnl *** checks for libraries ***
163 dnl For interactive UNIX (a Sun thing)
164 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
167 dnl *** checks for header files ***
169 dnl check if we have ANSI C header files
172 dnl used in gst/ffmpegcolorspace/mem.c
173 dnl FIXME: could be fixed by redefining av_malloc and av_free to GLib's
174 AC_CHECK_HEADERS([malloc.h])
176 dnl used in gst/subparse/gstsubparse.c
177 AC_CHECK_HEADERS([regex.h], HAVE_REGEX_H="yes", HAVE_REGEX_H="no")
178 AM_CONDITIONAL(HAVE_REGEX_H, test "x$HAVE_REGEX_H" = "xyes")
181 AC_CHECK_HEADERS([sys/socket.h],
182 HAVE_SYS_SOCKET_H="yes", HAVE_SYS_SOCKET_H="no")
183 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
185 dnl used in gst-libs/gst/utils
186 AC_CHECK_HEADERS([process.h])
188 dnl ffmpegcolorspace includes _stdint.h
189 dnl also, Windows does not have long long
192 dnl *** checks for functions ***
193 AC_CHECK_FUNCS([localtime_r])
195 dnl *** checks for types/defines ***
197 dnl Check for FIONREAD ioctl declaration
201 dnl *** checks for structures ***
203 dnl *** checks for compiler characteristics ***
205 dnl make sure we can use "inline" from C code
208 dnl *** checks for library functions ***
210 dnl Check for fast float to int casting as defined in C99
211 dnl used in gst-libs/gst/floatcast/floatcast.h
215 dnl Check for a way to display the function name in debug output
218 dnl *** checks for dependancy libraries ***
221 GST_GLIB_CHECK([2.6])
223 dnl liboil is required
224 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.8, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
225 if test "x$HAVE_LIBOIL" != "xyes"
227 AC_ERROR([liboil-0.3.8 or later is required])
230 dnl checks for gstreamer
231 dnl uninstalled is selected preferentially -- see pkg-config(1)
232 GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
233 GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
234 GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ])
235 GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ])
236 GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
238 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
239 dnl check for "check", unit testing library/header
240 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
241 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
243 dnl GTK is optional and used in examples
245 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, HAVE_GTK_22=yes, HAVE_GTK_22=no)
246 if test "x$HAVE_GTK_22" = "xyes"; then
248 GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
249 AC_SUBST(GTK_VERSION)
250 GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
251 AC_SUBST(GTK_BASE_DIR)
253 PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK_20=yes, HAVE_GTK_20=no)
255 if test "x$HAVE_GTK_20" = "xyes"; then
258 GTK_CFLAGS=$GTK2_CFLAGS
263 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
265 dnl *** set variables based on configure arguments ***
267 dnl set license and copyright notice
269 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
270 AC_SUBST(GST_LICENSE)
272 dnl set location of plugin directory
275 dnl define an ERROR_CFLAGS Makefile variable
276 GST_SET_ERROR_CFLAGS($GST_CVS)
278 dnl define correct level for debugging messages
279 GST_SET_LEVEL_DEFAULT($GST_CVS)
284 dnl *** sys plug-ins ***
287 AC_MSG_NOTICE([Checking libraries for plugins in sys/])
291 translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
292 GST_CHECK_FEATURE(X, [X libraries and plugins],
295 ac_cflags_save="$CFLAGS"
296 ac_cppflags_save="$CPPFLAGS"
297 CFLAGS="$CFLAGS $X_CFLAGS"
298 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
300 dnl now try to find the HEADER
301 AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
303 if test "x$HAVE_X" = "xno"
305 AC_MSG_NOTICE([cannot find X11 development files])
307 dnl this is much more than we want
308 X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
309 dnl AC_PATH_XTRA only defines the path needed to find the X libs,
310 dnl it does not add the libs; therefore we add them here
311 X_LIBS="$X_LIBS -lX11"
316 CFLAGS="$ac_cflags_save"
317 CPPFLAGS="$ac_cppflags_save"
320 dnl Check for Xv extension
321 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
322 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions],
328 translit(dnm, m, l) AM_CONDITIONAL(USE_XSHM, true)
329 GST_CHECK_FEATURE(XSHM, [X Shared Memory extension], , [
330 if test x$HAVE_X = xyes; then
331 AC_CHECK_LIB(Xext, XShmAttach,
332 HAVE_XSHM="yes", HAVE_XSHM="no",
334 if test "x$HAVE_XSHM" = "xyes"; then
337 dnl On AIX, it is in XextSam instead, but we still need -lXext
338 AC_CHECK_LIB(XextSam, XShmAttach,
339 HAVE_XSHM="yes", HAVE_XSHM="no",
341 if test "x$HAVE_XSHM" = "xyes"; then
342 XSHM_LIBS="-lXext -lXextSam"
351 dnl v4l/v4l2 checks have been moved down because they require X
353 dnl *** Video 4 Linux ***
354 dnl for information about the header/define, see sys/v4l/gstv4lelement.h
355 dnl renamed to GST_V4L in accordance with V4L2 below
356 translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L, true)
357 GST_CHECK_FEATURE(GST_V4L, [Video 4 Linux], video4linux, [
358 AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_GST_V4L="yes", HAVE_GST_V4L="no", [
359 #include <sys/types.h>
360 #define _LINUX_TIME_H
362 #include <linux/videodev.h>
365 dnl we can build v4l without Xv, but then we won't have XOverlay support
366 if test "x$HAVE_GST_V4L" = "xyes" -a "x$HAVE_XVIDEO" != "xyes"
368 AC_MSG_NOTICE([NO XVIDEO FOUND, VIDEO4LINUX WILL BE BUILT])
369 AC_MSG_NOTICE([WITHOUT XOVERLAY SUPPORT])
373 dnl *** ext plug-ins ***
374 dnl keep this list sorted alphabetically !
376 if test "x$BUILD_EXTERNAL" = "xyes"; then
379 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
383 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
384 GST_CHECK_FEATURE(ALSA, [ALSA], alsa, [
385 PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
387 AC_SUBST(ALSA_CFLAGS)
390 AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
394 dnl *** CDParanoia ***
395 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
396 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
397 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
400 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
402 FOUND_CDPARANOIA="yes")
403 if test "x$FOUND_CDPARANOIA" != "xyes";
405 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
407 cdda/cdda_interface.h,
408 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
410 FOUND_CDPARANOIA="yes")
412 if test "x$HEADER_DIR" = "xyes";
414 AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
415 defined if cdda headers are in a cdda/ directory)
417 AC_SUBST(CDPARANOIA_LIBS)
419 dnl FIXME : add second check somehow if that is necessary
420 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
421 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
423 dnl *** GNOME VFS ***
424 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
425 GST_CHECK_FEATURE(GNOME_VFS, [GNOME VFS], gnomevfs, [
426 GST_PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0)
429 dnl *** libvisual ***
430 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBVISUAL, true)
431 GST_CHECK_FEATURE(LIBVISUAL, [libvisual visualization library], libvisual, [
432 GST_PKG_CHECK_MODULES(LIBVISUAL, libvisual-0.4 >= 0.4.0)
433 if test $HAVE_LIBVISUAL = no
435 GST_PKG_CHECK_MODULES(LIBVISUAL, libvisual = 0.2.0)
440 translit(dnm, m, l) AM_CONDITIONAL(USE_OGG, true)
441 GST_CHECK_FEATURE(OGG, [Xiph Ogg library], ogg, [
442 GST_PKG_CHECK_MODULES(OGG, ogg >= 1.0)
443 if test $HAVE_OGG = no
445 XIPH_PATH_OGG(HAVE_OGG="yes", HAVE_OGG="no")
446 AS_SCRUB_INCLUDE(OGG_CFLAGS)
451 translit(dnm, m, l) AM_CONDITIONAL(USE_PANGO, true)
452 GST_CHECK_FEATURE(PANGO, [Pango font rendering], pango, [
453 GST_PKG_CHECK_MODULES(PANGO, pango pangoft2)
457 translit(dnm, m, l) AM_CONDITIONAL(USE_THEORA, true)
458 GST_CHECK_FEATURE(THEORA, [Xiph Theora video codec], theora, [
459 GST_PKG_CHECK_MODULES(THEORA, theora)
460 if test $HAVE_THEORA = no
462 GST_CHECK_LIBHEADER(THEORA, theora, theora_version_string, "-logg", theora/theora.h, THEORA_LIBS="-ltheora -logg")
463 AC_SUBST(THEORA_LIBS)
468 dnl AM_PATH_VORBIS only takes two options
469 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
470 GST_CHECK_FEATURE(VORBIS, [Xiph Vorbis audio codec], vorbis, [
471 GST_PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0 vorbisenc >= 1.0)
472 if test $HAVE_VORBIS = no
474 XIPH_PATH_VORBIS(HAVE_VORBIS="yes", HAVE_VORBIS="no")
475 AS_SCRUB_INCLUDE(VORBIS_CFLAGS)
479 if test "x$HAVE_VORBIS" = "xyes"; then
480 ac_cflags_save="$CFLAGS"
481 dnl FIXME: does this work on non-gcc? -- Company
482 dnl FIXME: no, it doesn't. Why is this here in the first place ? -- thomasvs
483 CFLAGS="-Wall -Werror"
486 #include <vorbis/codec.h>
490 vorbis_synthesis_restart (v);
491 ]), HAVE_VSR=yes, HAVE_VSR=no)
492 if test "x$HAVE_VSR" = "xyes"; then
493 AC_DEFINE_UNQUOTED(HAVE_VORBIS_SYNTHESIS_RESTART, 1,
494 [defined if vorbis_synthesis_restart is present])
496 CFLAGS="$ac_cflags_save"
501 dnl not building plugins with external dependencies,
502 dnl but we still need to set the conditionals
503 AM_CONDITIONAL(USE_ALSA, false)
504 AM_CONDITIONAL(USE_CDPARANOIA, false)
505 AM_CONDITIONAL(USE_GNOME_VFS, false)
506 AM_CONDITIONAL(USE_LIBVISUAL, false)
507 AM_CONDITIONAL(USE_OGG, false)
508 AM_CONDITIONAL(USE_PANGO, false)
509 AM_CONDITIONAL(USE_THEORA, false)
510 AM_CONDITIONAL(USE_VORBIS, false)
512 fi dnl of EXT plugins
514 dnl seeking needs freetype, so check for it here
515 PKG_CHECK_MODULES(FT2, freetype2 >= 2.0.9, HAVE_FT2="yes", [
516 AC_CHECK_FT2(2.0.9, HAVE_FT2="yes", HAVE_FT2="no")
518 dnl make the HAVE_FT2 variable available to automake and Makefile.am
519 AM_CONDITIONAL(HAVE_FT2, test "x$HAVE_FT2" = "xyes")
523 dnl *** finalize CFLAGS, LDFLAGS, LIBS
526 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
527 dnl GST_*: flags shared by built objects to link against GStreamer
528 dnl GST_PLUGINS_BASE_CFLAGS: to link internally against the plugins base libs
529 dnl (compare to other modules) or for i18n
530 dnl GST_ALL_LDFLAGS: linker flags shared by all
531 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
532 dnl GST_LT_LDFLAGS: library versioning of our libraries
533 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
535 dnl GST_OPTION_CFLAGS
536 if test "x$USE_DEBUG" = xyes; then
539 AC_SUBST(PROFILE_CFLAGS)
541 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
542 AC_SUBST(DEPRECATED_CFLAGS)
544 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
545 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
546 AC_SUBST(GST_OPTION_CFLAGS)
548 dnl our libraries need to be versioned correctly
549 AC_SUBST(GST_LT_LDFLAGS)
551 dnl GST_PLUGINS_BASE_CFLAGS
552 dnl prefer internal headers to already installed ones
553 dnl also add builddir include for enumtypes and marshal
554 GST_PLUGINS_BASE_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
555 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
557 dnl FIXME: do we want to rename to GST_ALL_* ?
558 dnl add GST_OPTION_CFLAGS, but overridable
559 GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)"
561 dnl add GCOV libs because libtool strips -fprofile-arcs -ftest-coverage
562 GST_LIBS="$GST_LIBS \$(GCOV_LIBS)"
565 dnl LDFLAGS really should only contain flags, not libs - they get added before
566 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
567 GST_ALL_LDFLAGS="-no-undefined"
568 AC_SUBST(GST_ALL_LDFLAGS)
571 dnl linker flags shared by all libraries
572 dnl LDFLAGS modifier defining exported symbols from built libraries
573 GST_LIB_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
574 AC_SUBST(GST_LIB_LDFLAGS)
576 dnl this really should only contain flags, not libs - they get added before
577 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
578 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
579 AC_SUBST(GST_PLUGIN_LDFLAGS)
581 dnl *** output files ***
585 gst-plugins-base.spec
588 gst/audioconvert/Makefile
589 gst/audiorate/Makefile
590 gst/audioresample/Makefile
591 gst/audiotestsrc/Makefile
592 gst/ffmpegcolorspace/Makefile
594 gst/playback/Makefile
595 gst/subparse/Makefile
597 gst/typefind/Makefile
598 gst/videotestsrc/Makefile
599 gst/videorate/Makefile
600 gst/videoscale/Makefile
608 ext/cdparanoia/Makefile
609 ext/gnomevfs/Makefile
610 ext/libvisual/Makefile
616 gst-libs/gst/Makefile
617 gst-libs/gst/audio/Makefile
618 gst-libs/gst/cdda/Makefile
619 gst-libs/gst/floatcast/Makefile
620 gst-libs/gst/interfaces/Makefile
621 gst-libs/gst/netbuffer/Makefile
622 gst-libs/gst/riff/Makefile
623 gst-libs/gst/rtp/Makefile
624 gst-libs/gst/tag/Makefile
625 gst-libs/gst/utils/Makefile
626 gst-libs/gst/video/Makefile
628 win32/common/config.h
630 pkgconfig/gstreamer-plugins-base.pc
631 pkgconfig/gstreamer-plugins-base-uninstalled.pc
634 tests/examples/Makefile
635 tests/examples/seek/Makefile
636 tests/examples/volume/Makefile
641 docs/plugins/Makefile
642 docs/version.entities