3 dnl initialize autoconf
4 dnl we don't specify PACKAGE and VERSION because AS_VERSION puts it together
7 dnl when going to/from release please set the nano (fourth number) right !
8 dnl releases only do Wall, cvs and prerelease does Werror too
9 AS_VERSION(gst-plugins-base, GST_PLUGINS_BASE_VERSION, 0, 9, 4, 1,
10 GST_CVS="no", GST_CVS="yes")
12 dnl can autoconf find the source ?
13 AC_CONFIG_SRCDIR([gst/sine/gstsinesrc.c])
15 dnl define the output header for config
16 AM_CONFIG_HEADER([config.h])
18 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
21 dnl sets host_* variables
24 dnl initialize automake
25 dnl FIXME: this is deprecated use, we should move PACKAGE and VERSION to
26 dnl AC_INIT, but then we need to parse the version to pass to AS_VERSION
27 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
29 dnl our libraries and install dirs use major.minor as a version
30 GST_MAJORMINOR=$GST_PLUGINS_BASE_VERSION_MAJOR.$GST_PLUGINS_BASE_VERSION_MINOR
31 dnl we override it here if we need to for the release candidate of new series
33 AC_SUBST(GST_MAJORMINOR)
35 dnl CURRENT, REVISION, AGE
36 dnl - library source changed -> increment REVISION
37 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
38 dnl - interfaces added -> increment AGE
39 dnl - interfaces removed -> AGE = 0
40 dnl sets GST_LT_LDFLAGS
41 AS_LIBTOOL(GST, 2, 0, 0)
45 dnl *** autotools stuff ****
47 dnl allow for different autotools
48 AS_AUTOTOOLS_ALTERNATE
50 dnl Add parameters for aclocal
51 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
54 dnl the version check needs to stay here because autopoint greps for it
55 AM_GNU_GETTEXT_VERSION([0.11.5])
56 AM_GNU_GETTEXT([external])
57 GST_GETTEXT([gst-plugins-base-$GST_MAJORMINOR])
59 dnl *** check for arguments to configure ***
68 GST_ARG_WITH_PKG_CONFIG_PATH
69 GST_ARG_WITH_PACKAGE_NAME([GStreamer Base Plug-ins])
70 GST_ARG_WITH_PACKAGE_ORIGIN
72 dnl these are all the gst plug-ins, compilable without additional libs
89 AC_SUBST(GST_PLUGINS_ALL)
91 GST_PLUGINS_SELECTED=""
94 AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
95 [for i in `echo $withval | tr , ' '`; do
96 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
98 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
100 echo "plug-in $i not recognized, ignoring..."
103 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
105 AC_SUBST(GST_PLUGINS_SELECTED)
108 dnl ext plug-ins; plug-ins that have external dependencies
109 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
110 [HAVE_EXTERNAL=yes], enabled,
112 AC_MSG_NOTICE(building external plug-ins)
115 AC_MSG_NOTICE(all plug-ins with external dependencies will not be built)
118 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
120 dnl *** checks for platform ***
122 dnl * hardware/architecture *
124 dnl common/m4/gst-arch.m4
128 dnl *** checks for programs ***
133 dnl determine c++ compiler
135 dnl determine if c++ is available on this system
136 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
138 dnl determine c++ preprocessor
139 dnl FIXME: do we need this ?
142 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
143 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
145 dnl check for documentation tools
147 AS_PATH_PYTHON([2.1])
149 dnl *** checks for libraries ***
151 dnl For interactive UNIX (a Sun thing)
152 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
155 dnl *** checks for header files ***
157 dnl check if we have ANSI C header files
160 dnl used in gst/ffmpegcolorspace/mem.c
161 dnl FIXME: could be fixed by redefining av_malloc and av_free to GLib's
162 AC_CHECK_HEADERS([malloc.h])
164 dnl used in gst/subparse/gstsubparse.c
165 AC_CHECK_HEADERS([regex.h], HAVE_REGEX_H="yes", HAVE_REGEX_H="no")
166 AM_CONDITIONAL(HAVE_REGEX_H, test "x$HAVE_REGEX_H" = "xyes")
168 dnl ffmpegcolorspace includes _stdint.h
171 dnl *** checks for types/defines ***
173 dnl Check for FIONREAD ioctl declaration
177 dnl *** checks for structures ***
179 dnl *** checks for compiler characteristics ***
181 dnl make sure we can use "inline" from C code
184 dnl *** checks for library functions ***
186 dnl Check for fast float to int casting as defined in C99
187 dnl used in gst-libs/gst/floatcast/floatcast.h
191 dnl Check for a way to display the function name in debug output
194 dnl *** checks for dependancy libraries ***
197 GST_GLIB_CHECK([2.6])
199 dnl liboil is required
200 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.2, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
201 if test "x${HAVE_LIBOIL}" != xyes ; then
202 AC_ERROR([liboil-0.3 is required])
205 dnl checks for gstreamer
206 dnl uninstalled is selected preferentially -- see pkg-config(1)
208 GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
209 GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
210 GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ])
211 GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ])
212 GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
214 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
215 dnl check for "check", unit testing library/header
216 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
217 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
220 dnl GTK is optional and used in examples
222 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, HAVE_GTK_22=yes, HAVE_GTK_22=no)
223 if test "x$HAVE_GTK_22" = "xyes"; then
225 GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
226 AC_SUBST(GTK_VERSION)
227 GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
228 AC_SUBST(GTK_BASE_DIR)
230 PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK_20=yes, HAVE_GTK_20=no)
232 if test "x$HAVE_GTK_20" = "xyes"; then
235 GTK_CFLAGS=$GTK2_CFLAGS
240 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
242 dnl *** set variables based on configure arguments ***
244 dnl set license and copyright notice
246 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
247 AC_SUBST(GST_LICENSE)
249 dnl set location of plugin directory
252 dnl define an ERROR_CFLAGS Makefile variable
253 GST_SET_ERROR_CFLAGS($GST_CVS)
255 dnl define correct level for debugging messages
256 GST_SET_LEVEL_DEFAULT($GST_CVS)
258 dnl decide on default elements
259 dnl FIXME: provide configure-time options for this
260 dnl FIXME: describe where exactly this gets used
261 dnl FIXME: decide if it's a problem that this could point to sinks from
262 dnl depending plugin modules
263 DEFAULT_AUDIOSINK="alsasink"
264 DEFAULT_VIDEOSINK="xvimagesink"
265 DEFAULT_AUDIOSRC="alsasrc"
266 DEFAULT_VIDEOSRC="v4lsrc"
267 DEFAULT_VISUALIZER="goom"
269 *-sun-* | *pc-solaris* )
270 DEFAULT_AUDIOSINK="sunaudiosink"
271 DEFAULT_VIDEOSINK="ximagesink"
272 DEFAULT_AUDIOSRC="sunaudiosrc"
275 DEFAULT_AUDIOSINK="osxaudiosink"
276 DEFAULT_AUDIOSRC="osxaudiosrc"
277 DEFAULT_VIDEOSINK="osxvideosink"
281 AC_SUBST(DEFAULT_AUDIOSINK)
282 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK, "$DEFAULT_AUDIOSINK",
283 [Default audio sink])
284 AC_SUBST(DEFAULT_AUDIOSRC)
285 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC, "$DEFAULT_AUDIOSRC",
286 [Default audio source])
287 AC_SUBST(DEFAULT_VIDEOSINK)
288 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK, "$DEFAULT_VIDEOSINK",
289 [Default video sink])
290 AC_SUBST(DEFAULT_VIDEOSRC)
291 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC, "$DEFAULT_VIDEOSRC",
292 [Default video source])
293 AC_SUBST(DEFAULT_VISUALIZER)
294 AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER, "$DEFAULT_VISUALIZER",
295 [Default visualizer])
297 dnl *** sys plug-ins ***
300 AC_MSG_NOTICE([Checking libraries for plugins in sys/])
304 translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
305 GST_CHECK_FEATURE(X, [X libraries and plugins],
308 ac_cflags_save="$CFLAGS"
309 ac_cppflags_save="$CPPFLAGS"
310 CFLAGS="$CFLAGS $X_CFLAGS"
311 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
313 dnl now try to find the HEADER
314 AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
316 if test "x$HAVE_X" = "xno"
318 AC_MSG_NOTICE([cannot find X11 development files])
320 dnl this is much more than we want
321 X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
322 dnl AC_PATH_XTRA only defines the path needed to find the X libs,
323 dnl it does not add the libs; therefore we add them here
324 X_LIBS="$X_LIBS -lX11"
329 CFLAGS="$ac_cflags_save"
330 CPPFLAGS="$ac_cppflags_save"
334 dnl Look for the PIC library first, Debian requires it.
335 dnl Check debian-devel archives for gory details.
337 dnl At the moment XFree86 doesn't distribute shared libXv due
338 dnl to unstable API. On many platforms you CAN NOT link a shared
339 dnl lib to a static non-PIC lib. This is what the xvideo GStreamer
340 dnl plug-in wants to do. So Debian distributes a PIC compiled
341 dnl version of the static lib for plug-ins to link to when it is
342 dnl inappropriate to link the main application to libXv directly.
343 dnl FIXME: add check if this platform can support linking to a
344 dnl non-PIC libXv, if not then don not use Xv.
345 dnl FIXME: perhaps warn user if they have a shared libXv since
346 dnl this is an error until XFree86 starts shipping one
348 dnl Check for Xv extension
349 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
350 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions],
352 if test x$HAVE_X = xyes; then
353 AC_CHECK_LIB(Xv_pic, XvQueryExtension,
354 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
357 if test x$HAVE_XVIDEO = xyes; then
358 XVIDEO_LIBS="-lXv_pic -lXext"
359 AC_SUBST(XVIDEO_LIBS)
361 dnl try again using something else if we didn't find it first
362 if test x$HAVE_XVIDEO = xno; then
363 AC_CHECK_LIB(Xv, XvQueryExtension,
364 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
367 if test x$HAVE_XVIDEO = xyes; then
368 XVIDEO_LIBS="-lXv -lXext"
369 AC_SUBST(XVIDEO_LIBS)
377 translit(dnm, m, l) AM_CONDITIONAL(USE_XSHM, true)
378 GST_CHECK_FEATURE(XSHM, [X Shared Memory extension], xshm, [
379 if test x$HAVE_X = xyes; then
380 AC_CHECK_LIB(Xext, XShmAttach,
381 HAVE_XSHM="yes", HAVE_XSHM="no",
383 if test "x$HAVE_XSHM" = "xyes"; then
386 dnl On AIX, it is in XextSam instead, but we still need -lXext
387 AC_CHECK_LIB(XextSam, XShmAttach,
388 HAVE_XSHM="yes", HAVE_XSHM="no",
390 if test "x$HAVE_XSHM" = "xyes"; then
391 XSHM_LIBS="-lXext -lXextSam"
400 dnl v4l/v4l2 checks have been moved down because they require X
402 dnl *** Video 4 Linux ***
403 dnl for information about the header/define, see sys/v4l/gstv4lelement.h
404 dnl renamed to GST_V4L in accordance with V4L2 below
405 translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L, true)
406 GST_CHECK_FEATURE(GST_V4L, [Video 4 Linux], v4lsrc v4lmjpegsrc v4lmjpegsink, [
409 if test "$HAVE_X" = "yes"
411 AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_GST_V4L="yes", HAVE_GST_V4L="no", [
412 #include <sys/types.h>
413 #define _LINUX_TIME_H
415 #include <linux/videodev.h>
420 dnl *** ext plug-ins ***
421 dnl keep this list sorted alphabetically !
423 if test "x$BUILD_EXTERNAL" = "xyes"; then
426 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
430 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
431 GST_CHECK_FEATURE(ALSA, [alsa plug-ins], gstalsa, [
432 PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
434 AC_SUBST(ALSA_CFLAGS)
437 AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
441 dnl *** CDParanoia ***
442 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
443 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
444 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
447 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
449 FOUND_CDPARANOIA="yes")
450 if test "x$FOUND_CDPARANOIA" != "xyes";
452 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
454 cdda/cdda_interface.h,
455 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
457 FOUND_CDPARANOIA="yes")
459 if test "x$HEADER_DIR" = "xyes";
461 AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
462 defined if cdda headers are in a cdda/ directory)
464 AC_SUBST(CDPARANOIA_LIBS)
466 dnl FIXME : add second check somehow if that is necessary
467 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
468 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
470 dnl *** Gnome VFS ***
471 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
472 GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
473 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS="yes", HAVE_GNOME_VFS="no")
474 AC_SUBST(GNOME_VFS_CFLAGS)
475 AC_SUBST(GNOME_VFS_LIBS)
478 dnl *** libvisual ***
479 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBVISUAL, true)
480 GST_CHECK_FEATURE(LIBVISUAL, [libvisual visualization plugins], libvisual, [
481 PKG_CHECK_MODULES(LIBVISUAL, libvisual = 0.2.0, HAVE_LIBVISUAL="yes", HAVE_LIBVISUAL="no")
482 AC_SUBST(LIBVISUAL_CFLAGS)
483 AC_SUBST(LIBVISUAL_LIBS)
487 translit(dnm, m, l) AM_CONDITIONAL(USE_OGG, true)
488 GST_CHECK_FEATURE(OGG, [ogg de/encoder], oggdemux oggmux, [
489 PKG_CHECK_MODULES(OGG, ogg >= 1.0, [
494 XIPH_PATH_OGG(HAVE_OGG="yes", HAVE_OGG="no")
495 AS_SCRUB_INCLUDE(OGG_CFLAGS)
500 translit(dnm, m, l) AM_CONDITIONAL(USE_THEORA, true)
501 GST_CHECK_FEATURE(THEORA, [ogg theora codec], theoradec theoraenc, [
502 PKG_CHECK_MODULES(THEORA, theora, [
504 AC_SUBST(THEORA_LIBS)
505 AC_SUBST(THEORA_CFLAGS)
507 GST_CHECK_LIBHEADER(THEORA, theora, theora_version_string, "-logg", theora/theora.h, THEORA_LIBS="-ltheora -logg")
508 AC_SUBST(THEORA_LIBS)
513 dnl AM_PATH_VORBIS only takes two options
514 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
515 GST_CHECK_FEATURE(VORBIS, [vorbis plug-in], vorbisenc vorbisdec, [
516 PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0 vorbisenc >= 1.0, [
519 XIPH_PATH_VORBIS(HAVE_VORBIS="yes", HAVE_VORBIS="no")
520 AS_SCRUB_INCLUDE(VORBIS_CFLAGS)
523 if test "x$HAVE_VORBIS" = "xyes"; then
524 ac_cflags_save="$CFLAGS"
525 dnl FIXME: does this work on non-gcc? -- Company
526 dnl FIXME: no, it doesn't. Why is this here in the first place ? -- thomasvs
527 CFLAGS="-Wall -Werror"
530 #include <vorbis/codec.h>
534 vorbis_synthesis_restart (v);
535 ]), HAVE_VSR=yes, HAVE_VSR=no)
536 if test "x$HAVE_VSR" = "xyes"; then
537 AC_DEFINE_UNQUOTED(HAVE_VORBIS_SYNTHESIS_RESTART, 1,
538 [defined if vorbis_synthesis_restart is present])
540 CFLAGS="$ac_cflags_save"
543 fi dnl of EXT plugins
545 dnl ######################################################################
546 dnl # Check command line parameters, and set shell variables accordingly #
547 dnl ######################################################################
549 dnl seeking needs freetype, so check for it here
550 PKG_CHECK_MODULES(FT2, freetype2 >= 2.0.9, HAVE_FT2="yes", [
551 AC_CHECK_FT2(2.0.9, HAVE_FT2="yes", HAVE_FT2="no")
553 dnl make the HAVE_FT2 variable available to automake and Makefile.am
554 AM_CONDITIONAL(HAVE_FT2, test "x$HAVE_FT2" = "xyes")
558 dnl *** finalize CFLAGS, LDFLAGS, LIBS
561 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
562 dnl GST_*: flags shared by all built objects
563 dnl GST_LT_LDFLAGS: library versioning of our libraries
564 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
566 dnl GST_OPTION_CFLAGS
567 if test "x$USE_DEBUG" = xyes; then
570 AC_SUBST(PROFILE_CFLAGS)
572 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
573 AC_SUBST(DEPRECATED_CFLAGS)
575 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
576 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
577 AC_SUBST(GST_OPTION_CFLAGS)
579 dnl our libraries need to be versioned correctly
580 AC_SUBST(GST_LT_LDFLAGS)
582 dnl FIXME: do we want to rename to GST_ALL_* ?
583 dnl prefer internal headers to already installed ones
584 dnl also add builddir include for enumtypes and marshal
585 dnl add ERROR_CFLAGS, but overridable
586 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
590 dnl this really should only contain flags, not libs - they get added before
591 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
592 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' -no-undefined"
593 AC_SUBST(GST_PLUGIN_LDFLAGS)
595 dnl *** output files ***
599 gst-plugins-base.spec
602 gst/audioconvert/Makefile
603 gst/audiorate/Makefile
604 gst/audioresample/Makefile
605 gst/audiotestsrc/Makefile
606 gst/ffmpegcolorspace/Makefile
607 gst/playback/Makefile
609 gst/subparse/Makefile
611 gst/typefind/Makefile
612 gst/videotestsrc/Makefile
613 gst/videorate/Makefile
614 gst/videoscale/Makefile
622 ext/cdparanoia/Makefile
623 ext/gnomevfs/Makefile
624 ext/libvisual/Makefile
629 gst-libs/gst/Makefile
630 gst-libs/gst/audio/Makefile
631 gst-libs/gst/floatcast/Makefile
632 gst-libs/gst/interfaces/Makefile
633 gst-libs/gst/net/Makefile
634 gst-libs/gst/riff/Makefile
635 gst-libs/gst/rtp/Makefile
636 gst-libs/gst/tag/Makefile
637 gst-libs/gst/video/Makefile
638 gst-libs/ext/Makefile
639 examples/seeking/Makefile
643 pkgconfig/gstreamer-plugins-base.pc
644 pkgconfig/gstreamer-plugins-base-uninstalled.pc
648 docs/plugins/Makefile
649 docs/version.entities
657 echo "configure: *** Core plug-ins, always built:"
658 ( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort
660 echo -n "configure: *** Plug-ins relying on libraries that will be built:"
661 echo -e "$GST_PLUGINS_YES" | sort
663 echo -n "configure: *** Plug-ins relying on libraries that will NOT be built:"
664 echo -e "$GST_PLUGINS_NO" | sort
666 if test "x$BUILD_EXTERNAL" = "xno"; then
667 echo "configure: *** No external plug-ins will be built"