3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, cvs and prerelease does Werror too
6 AC_INIT(GStreamer Base Plug-ins, 0.10.6,
7 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
10 dnl initialize automake
13 dnl define PACKAGE_VERSION_* variables
16 dnl check if this is a release version
17 AS_NANO(GST_CVS="no", GST_CVS="yes")
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([gst/audiotestsrc/gstaudiotestsrc.c])
22 dnl define the output header for config
23 AM_CONFIG_HEADER([config.h])
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28 dnl sets host_* variables
31 dnl our libraries and install dirs use major.minor as a version
32 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
33 dnl we override it here if we need to for the release candidate of new series
35 AC_SUBST(GST_MAJORMINOR)
37 dnl CURRENT, REVISION, AGE
38 dnl - library source changed -> increment REVISION
39 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
40 dnl - interfaces added -> increment AGE
41 dnl - interfaces removed -> AGE = 0
42 dnl sets GST_LT_LDFLAGS
43 AS_LIBTOOL(GST, 4, 0, 4)
45 dnl FIXME: this macro doesn't actually work;
46 dnl the generated libtool script has no support for the listed tags.
47 dnl So this needs to be fixed first if we want to use this
52 dnl *** required versions of GStreamer stuff ***
55 dnl *** autotools stuff ****
57 dnl allow for different autotools
58 AS_AUTOTOOLS_ALTERNATE
60 dnl Add parameters for aclocal
61 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
64 dnl the version check needs to stay here because autopoint greps for it
65 AM_GNU_GETTEXT_VERSION([0.11.5])
66 AM_GNU_GETTEXT([external])
67 GST_GETTEXT([gst-plugins-base-$GST_MAJORMINOR])
69 dnl *** check for arguments to configure ***
78 GST_ARG_WITH_PKG_CONFIG_PATH
79 GST_ARG_WITH_PACKAGE_NAME
80 GST_ARG_WITH_PACKAGE_ORIGIN
82 dnl these are all the gst plug-ins, compilable without additional libs
97 AC_SUBST(GST_PLUGINS_ALL)
99 GST_PLUGINS_SELECTED=""
102 AC_HELP_STRING([--with-plugins],
103 [comma-separated list of plug-ins to compile]),
104 [for i in `echo $withval | tr , ' '`; do
105 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
107 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
109 echo "plug-in $i not recognized, ignoring..."
112 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
114 AC_SUBST(GST_PLUGINS_SELECTED)
116 dnl ext plug-ins; plug-ins that have external dependencies
117 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
118 [HAVE_EXTERNAL=yes], enabled,
120 AC_MSG_NOTICE(building external plug-ins)
123 AC_MSG_NOTICE(all plug-ins with external dependencies will not be built)
126 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
128 dnl *** checks for platform ***
130 dnl * hardware/architecture *
132 dnl common/m4/gst-arch.m4
136 dnl *** checks for programs ***
141 dnl determine c++ compiler
143 dnl determine if c++ is available on this system
144 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
146 dnl determine c++ preprocessor
147 dnl FIXME: do we need this ?
150 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
151 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
153 dnl check for documentation tools
155 AS_PATH_PYTHON([2.1])
157 dnl *** checks for libraries ***
159 dnl For interactive UNIX (a Sun thing)
160 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
163 dnl *** checks for header files ***
165 dnl check if we have ANSI C header files
168 dnl used in gst/ffmpegcolorspace/mem.c
169 dnl FIXME: could be fixed by redefining av_malloc and av_free to GLib's
170 AC_CHECK_HEADERS([malloc.h])
172 dnl used in gst/subparse/gstsubparse.c
173 AC_CHECK_HEADERS([regex.h], HAVE_REGEX_H="yes", HAVE_REGEX_H="no")
174 AM_CONDITIONAL(HAVE_REGEX_H, test "x$HAVE_REGEX_H" = "xyes")
177 AC_CHECK_HEADERS([sys/socket.h],
178 HAVE_SYS_SOCKET_H="yes", HAVE_SYS_SOCKET_H="no")
179 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
181 dnl ffmpegcolorspace includes _stdint.h
182 dnl also, Windows does not have long long
185 dnl *** checks for types/defines ***
187 dnl Check for FIONREAD ioctl declaration
191 dnl *** checks for structures ***
193 dnl *** checks for compiler characteristics ***
195 dnl make sure we can use "inline" from C code
198 dnl *** checks for library functions ***
200 dnl Check for fast float to int casting as defined in C99
201 dnl used in gst-libs/gst/floatcast/floatcast.h
205 dnl Check for a way to display the function name in debug output
208 dnl *** checks for dependancy libraries ***
211 GST_GLIB_CHECK([2.6])
213 dnl liboil is required
214 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.6, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
215 if test "x$HAVE_LIBOIL" != "xyes"
217 AC_ERROR([liboil-0.3.6 or later is required])
220 dnl checks for gstreamer
221 dnl uninstalled is selected preferentially -- see pkg-config(1)
222 GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
223 GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
224 GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ])
225 GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ])
226 GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
228 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
229 dnl check for "check", unit testing library/header
230 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
231 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
233 dnl GTK is optional and used in examples
235 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, HAVE_GTK_22=yes, HAVE_GTK_22=no)
236 if test "x$HAVE_GTK_22" = "xyes"; then
238 GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
239 AC_SUBST(GTK_VERSION)
240 GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
241 AC_SUBST(GTK_BASE_DIR)
243 PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK_20=yes, HAVE_GTK_20=no)
245 if test "x$HAVE_GTK_20" = "xyes"; then
248 GTK_CFLAGS=$GTK2_CFLAGS
253 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
255 dnl *** set variables based on configure arguments ***
257 dnl set license and copyright notice
259 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
260 AC_SUBST(GST_LICENSE)
262 dnl set location of plugin directory
265 dnl define an ERROR_CFLAGS Makefile variable
266 GST_SET_ERROR_CFLAGS($GST_CVS)
268 dnl define correct level for debugging messages
269 GST_SET_LEVEL_DEFAULT($GST_CVS)
274 dnl *** sys plug-ins ***
277 AC_MSG_NOTICE([Checking libraries for plugins in sys/])
281 translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
282 GST_CHECK_FEATURE(X, [X libraries and plugins],
285 ac_cflags_save="$CFLAGS"
286 ac_cppflags_save="$CPPFLAGS"
287 CFLAGS="$CFLAGS $X_CFLAGS"
288 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
290 dnl now try to find the HEADER
291 AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
293 if test "x$HAVE_X" = "xno"
295 AC_MSG_NOTICE([cannot find X11 development files])
297 dnl this is much more than we want
298 X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
299 dnl AC_PATH_XTRA only defines the path needed to find the X libs,
300 dnl it does not add the libs; therefore we add them here
301 X_LIBS="$X_LIBS -lX11"
306 CFLAGS="$ac_cflags_save"
307 CPPFLAGS="$ac_cppflags_save"
311 dnl Check for Xv extension
312 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
313 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions],
319 translit(dnm, m, l) AM_CONDITIONAL(USE_XSHM, true)
320 GST_CHECK_FEATURE(XSHM, [X Shared Memory extension], xshm, [
321 if test x$HAVE_X = xyes; then
322 AC_CHECK_LIB(Xext, XShmAttach,
323 HAVE_XSHM="yes", HAVE_XSHM="no",
325 if test "x$HAVE_XSHM" = "xyes"; then
328 dnl On AIX, it is in XextSam instead, but we still need -lXext
329 AC_CHECK_LIB(XextSam, XShmAttach,
330 HAVE_XSHM="yes", HAVE_XSHM="no",
332 if test "x$HAVE_XSHM" = "xyes"; then
333 XSHM_LIBS="-lXext -lXextSam"
342 dnl v4l/v4l2 checks have been moved down because they require X
344 dnl *** Video 4 Linux ***
345 dnl for information about the header/define, see sys/v4l/gstv4lelement.h
346 dnl renamed to GST_V4L in accordance with V4L2 below
347 translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L, true)
348 GST_CHECK_FEATURE(GST_V4L, [Video 4 Linux], v4lsrc v4lmjpegsrc v4lmjpegsink, [
351 if test "$HAVE_X" = "yes"
353 AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_GST_V4L="yes", HAVE_GST_V4L="no", [
354 #include <sys/types.h>
355 #define _LINUX_TIME_H
357 #include <linux/videodev.h>
362 dnl *** ext plug-ins ***
363 dnl keep this list sorted alphabetically !
365 if test "x$BUILD_EXTERNAL" = "xyes"; then
368 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
372 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
373 GST_CHECK_FEATURE(ALSA, [alsa plug-ins], gstalsa, [
374 PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
376 AC_SUBST(ALSA_CFLAGS)
379 AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
383 dnl *** CDParanoia ***
384 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
385 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
386 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
389 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
391 FOUND_CDPARANOIA="yes")
392 if test "x$FOUND_CDPARANOIA" != "xyes";
394 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
396 cdda/cdda_interface.h,
397 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
399 FOUND_CDPARANOIA="yes")
401 if test "x$HEADER_DIR" = "xyes";
403 AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
404 defined if cdda headers are in a cdda/ directory)
406 AC_SUBST(CDPARANOIA_LIBS)
408 dnl FIXME : add second check somehow if that is necessary
409 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
410 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
412 dnl *** Gnome VFS ***
413 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
414 GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
415 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS="yes", HAVE_GNOME_VFS="no")
416 AC_SUBST(GNOME_VFS_CFLAGS)
417 AC_SUBST(GNOME_VFS_LIBS)
420 dnl *** libvisual ***
421 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBVISUAL, true)
422 GST_CHECK_FEATURE(LIBVISUAL, [libvisual visualization plugins], libvisual, [
423 PKG_CHECK_MODULES(LIBVISUAL, libvisual = 0.2.0, HAVE_LIBVISUAL="yes", HAVE_LIBVISUAL="no")
424 AC_SUBST(LIBVISUAL_CFLAGS)
425 AC_SUBST(LIBVISUAL_LIBS)
429 translit(dnm, m, l) AM_CONDITIONAL(USE_OGG, true)
430 GST_CHECK_FEATURE(OGG, [ogg de/encoder], oggdemux oggmux, [
431 PKG_CHECK_MODULES(OGG, ogg >= 1.0, [
436 XIPH_PATH_OGG(HAVE_OGG="yes", HAVE_OGG="no")
437 AS_SCRUB_INCLUDE(OGG_CFLAGS)
442 translit(dnm, m, l) AM_CONDITIONAL(USE_PANGO, true)
443 GST_CHECK_FEATURE(PANGO, [pango], pango, [
444 PKG_CHECK_MODULES(PANGO, pango pangoft2,
445 HAVE_PANGO="yes", HAVE_PANGO="no")
446 AC_SUBST(PANGO_CFLAGS)
451 translit(dnm, m, l) AM_CONDITIONAL(USE_THEORA, true)
452 GST_CHECK_FEATURE(THEORA, [ogg theora codec], theoradec theoraenc, [
453 PKG_CHECK_MODULES(THEORA, theora, [
455 AC_SUBST(THEORA_LIBS)
456 AC_SUBST(THEORA_CFLAGS)
458 GST_CHECK_LIBHEADER(THEORA, theora, theora_version_string, "-logg", theora/theora.h, THEORA_LIBS="-ltheora -logg")
459 AC_SUBST(THEORA_LIBS)
464 dnl AM_PATH_VORBIS only takes two options
465 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
466 GST_CHECK_FEATURE(VORBIS, [vorbis plug-in], vorbisenc vorbisdec, [
467 PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0 vorbisenc >= 1.0, [
470 XIPH_PATH_VORBIS(HAVE_VORBIS="yes", HAVE_VORBIS="no")
471 AS_SCRUB_INCLUDE(VORBIS_CFLAGS)
474 if test "x$HAVE_VORBIS" = "xyes"; then
475 ac_cflags_save="$CFLAGS"
476 dnl FIXME: does this work on non-gcc? -- Company
477 dnl FIXME: no, it doesn't. Why is this here in the first place ? -- thomasvs
478 CFLAGS="-Wall -Werror"
481 #include <vorbis/codec.h>
485 vorbis_synthesis_restart (v);
486 ]), HAVE_VSR=yes, HAVE_VSR=no)
487 if test "x$HAVE_VSR" = "xyes"; then
488 AC_DEFINE_UNQUOTED(HAVE_VORBIS_SYNTHESIS_RESTART, 1,
489 [defined if vorbis_synthesis_restart is present])
491 CFLAGS="$ac_cflags_save"
494 fi dnl of EXT plugins
496 dnl seeking needs freetype, so check for it here
497 PKG_CHECK_MODULES(FT2, freetype2 >= 2.0.9, HAVE_FT2="yes", [
498 AC_CHECK_FT2(2.0.9, HAVE_FT2="yes", HAVE_FT2="no")
500 dnl make the HAVE_FT2 variable available to automake and Makefile.am
501 AM_CONDITIONAL(HAVE_FT2, test "x$HAVE_FT2" = "xyes")
505 dnl *** finalize CFLAGS, LDFLAGS, LIBS
508 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
509 dnl GST_*: flags shared by built objects to link against GStreamer
510 dnl GST_ALL_LDFLAGS: linker flags shared by all
511 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
512 dnl GST_LT_LDFLAGS: library versioning of our libraries
513 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
515 dnl GST_OPTION_CFLAGS
516 if test "x$USE_DEBUG" = xyes; then
519 AC_SUBST(PROFILE_CFLAGS)
521 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
522 AC_SUBST(DEPRECATED_CFLAGS)
524 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
525 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
526 AC_SUBST(GST_OPTION_CFLAGS)
528 dnl our libraries need to be versioned correctly
529 AC_SUBST(GST_LT_LDFLAGS)
531 dnl FIXME: do we want to rename to GST_ALL_* ?
532 dnl prefer internal headers to already installed ones
533 dnl also add builddir include for enumtypes and marshal
534 dnl add GST_OPTION_CFLAGS, but overridable
535 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
539 dnl LDFLAGS really should only contain flags, not libs - they get added before
540 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
541 GST_ALL_LDFLAGS="-no-undefined"
542 AC_SUBST(GST_ALL_LDFLAGS)
545 dnl linker flags shared by all libraries
546 dnl LDFLAGS modifier defining exported symbols from built libraries
547 GST_LIB_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
548 AC_SUBST(GST_LIB_LDFLAGS)
550 dnl this really should only contain flags, not libs - they get added before
551 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
552 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
553 AC_SUBST(GST_PLUGIN_LDFLAGS)
555 dnl *** output files ***
559 gst-plugins-base.spec
562 gst/audioconvert/Makefile
563 gst/audiorate/Makefile
564 gst/audioresample/Makefile
565 gst/audiotestsrc/Makefile
566 gst/ffmpegcolorspace/Makefile
567 gst/playback/Makefile
568 gst/subparse/Makefile
570 gst/typefind/Makefile
571 gst/videotestsrc/Makefile
572 gst/videorate/Makefile
573 gst/videoscale/Makefile
581 ext/cdparanoia/Makefile
582 ext/gnomevfs/Makefile
583 ext/libvisual/Makefile
589 gst-libs/gst/Makefile
590 gst-libs/gst/audio/Makefile
591 gst-libs/gst/cdda/Makefile
592 gst-libs/gst/floatcast/Makefile
593 gst-libs/gst/interfaces/Makefile
594 gst-libs/gst/netbuffer/Makefile
595 gst-libs/gst/riff/Makefile
596 gst-libs/gst/rtp/Makefile
597 gst-libs/gst/tag/Makefile
598 gst-libs/gst/video/Makefile
600 win32/common/config.h
602 pkgconfig/gstreamer-plugins-base.pc
603 pkgconfig/gstreamer-plugins-base-uninstalled.pc
606 tests/examples/Makefile
607 tests/examples/seek/Makefile
608 tests/examples/volume/Makefile
612 docs/plugins/Makefile
613 docs/version.entities