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.5.1,
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, 2, 0, 2)
47 dnl *** required versions of GStreamer stuff ***
50 dnl *** autotools stuff ****
52 dnl allow for different autotools
53 AS_AUTOTOOLS_ALTERNATE
55 dnl Add parameters for aclocal
56 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
59 dnl the version check needs to stay here because autopoint greps for it
60 AM_GNU_GETTEXT_VERSION([0.11.5])
61 AM_GNU_GETTEXT([external])
62 GST_GETTEXT([gst-plugins-base-$GST_MAJORMINOR])
64 dnl *** check for arguments to configure ***
73 GST_ARG_WITH_PKG_CONFIG_PATH
74 GST_ARG_WITH_PACKAGE_NAME
75 GST_ARG_WITH_PACKAGE_ORIGIN
77 dnl these are all the gst plug-ins, compilable without additional libs
92 AC_SUBST(GST_PLUGINS_ALL)
94 GST_PLUGINS_SELECTED=""
97 AC_HELP_STRING([--with-plugins],
98 [comma-separated list of plug-ins to compile]),
99 [for i in `echo $withval | tr , ' '`; do
100 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
102 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
104 echo "plug-in $i not recognized, ignoring..."
107 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
109 AC_SUBST(GST_PLUGINS_SELECTED)
111 dnl ext plug-ins; plug-ins that have external dependencies
112 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
113 [HAVE_EXTERNAL=yes], enabled,
115 AC_MSG_NOTICE(building external plug-ins)
118 AC_MSG_NOTICE(all plug-ins with external dependencies will not be built)
121 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
123 dnl *** checks for platform ***
125 dnl * hardware/architecture *
127 dnl common/m4/gst-arch.m4
131 dnl *** checks for programs ***
136 dnl determine c++ compiler
138 dnl determine if c++ is available on this system
139 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
141 dnl determine c++ preprocessor
142 dnl FIXME: do we need this ?
145 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
146 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
148 dnl check for documentation tools
150 AS_PATH_PYTHON([2.1])
152 dnl *** checks for libraries ***
154 dnl For interactive UNIX (a Sun thing)
155 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
158 dnl *** checks for header files ***
160 dnl check if we have ANSI C header files
163 dnl used in gst/ffmpegcolorspace/mem.c
164 dnl FIXME: could be fixed by redefining av_malloc and av_free to GLib's
165 AC_CHECK_HEADERS([malloc.h])
167 dnl used in gst/subparse/gstsubparse.c
168 AC_CHECK_HEADERS([regex.h], HAVE_REGEX_H="yes", HAVE_REGEX_H="no")
169 AM_CONDITIONAL(HAVE_REGEX_H, test "x$HAVE_REGEX_H" = "xyes")
172 AC_CHECK_HEADERS([sys/socket.h],
173 HAVE_SYS_SOCKET_H="yes", HAVE_SYS_SOCKET_H="no")
174 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
176 dnl ffmpegcolorspace includes _stdint.h
177 dnl also, Windows does not have long long
180 dnl *** checks for types/defines ***
182 dnl Check for FIONREAD ioctl declaration
186 dnl *** checks for structures ***
188 dnl *** checks for compiler characteristics ***
190 dnl make sure we can use "inline" from C code
193 dnl *** checks for library functions ***
195 dnl Check for fast float to int casting as defined in C99
196 dnl used in gst-libs/gst/floatcast/floatcast.h
200 dnl Check for a way to display the function name in debug output
203 dnl *** checks for dependancy libraries ***
206 GST_GLIB_CHECK([2.6])
208 dnl liboil is required
209 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.6, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
210 if test "x$HAVE_LIBOIL" != "xyes"
212 AC_ERROR([liboil-0.3.6 or later is required])
215 dnl checks for gstreamer
216 dnl uninstalled is selected preferentially -- see pkg-config(1)
217 GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
218 GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
219 GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ])
220 GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ])
221 GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
223 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
224 dnl check for "check", unit testing library/header
225 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
226 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
228 dnl GTK is optional and used in examples
230 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, HAVE_GTK_22=yes, HAVE_GTK_22=no)
231 if test "x$HAVE_GTK_22" = "xyes"; then
233 GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
234 AC_SUBST(GTK_VERSION)
235 GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
236 AC_SUBST(GTK_BASE_DIR)
238 PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK_20=yes, HAVE_GTK_20=no)
240 if test "x$HAVE_GTK_20" = "xyes"; then
243 GTK_CFLAGS=$GTK2_CFLAGS
248 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
250 dnl *** set variables based on configure arguments ***
252 dnl set license and copyright notice
254 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
255 AC_SUBST(GST_LICENSE)
257 dnl set location of plugin directory
260 dnl define an ERROR_CFLAGS Makefile variable
261 GST_SET_ERROR_CFLAGS($GST_CVS)
263 dnl define correct level for debugging messages
264 GST_SET_LEVEL_DEFAULT($GST_CVS)
269 dnl *** sys plug-ins ***
272 AC_MSG_NOTICE([Checking libraries for plugins in sys/])
276 translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
277 GST_CHECK_FEATURE(X, [X libraries and plugins],
280 ac_cflags_save="$CFLAGS"
281 ac_cppflags_save="$CPPFLAGS"
282 CFLAGS="$CFLAGS $X_CFLAGS"
283 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
285 dnl now try to find the HEADER
286 AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
288 if test "x$HAVE_X" = "xno"
290 AC_MSG_NOTICE([cannot find X11 development files])
292 dnl this is much more than we want
293 X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
294 dnl AC_PATH_XTRA only defines the path needed to find the X libs,
295 dnl it does not add the libs; therefore we add them here
296 X_LIBS="$X_LIBS -lX11"
301 CFLAGS="$ac_cflags_save"
302 CPPFLAGS="$ac_cppflags_save"
306 dnl Check for Xv extension
307 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
308 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions],
314 translit(dnm, m, l) AM_CONDITIONAL(USE_XSHM, true)
315 GST_CHECK_FEATURE(XSHM, [X Shared Memory extension], xshm, [
316 if test x$HAVE_X = xyes; then
317 AC_CHECK_LIB(Xext, XShmAttach,
318 HAVE_XSHM="yes", HAVE_XSHM="no",
320 if test "x$HAVE_XSHM" = "xyes"; then
323 dnl On AIX, it is in XextSam instead, but we still need -lXext
324 AC_CHECK_LIB(XextSam, XShmAttach,
325 HAVE_XSHM="yes", HAVE_XSHM="no",
327 if test "x$HAVE_XSHM" = "xyes"; then
328 XSHM_LIBS="-lXext -lXextSam"
337 dnl v4l/v4l2 checks have been moved down because they require X
339 dnl *** Video 4 Linux ***
340 dnl for information about the header/define, see sys/v4l/gstv4lelement.h
341 dnl renamed to GST_V4L in accordance with V4L2 below
342 translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L, true)
343 GST_CHECK_FEATURE(GST_V4L, [Video 4 Linux], v4lsrc v4lmjpegsrc v4lmjpegsink, [
346 if test "$HAVE_X" = "yes"
348 AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_GST_V4L="yes", HAVE_GST_V4L="no", [
349 #include <sys/types.h>
350 #define _LINUX_TIME_H
352 #include <linux/videodev.h>
357 dnl *** ext plug-ins ***
358 dnl keep this list sorted alphabetically !
360 if test "x$BUILD_EXTERNAL" = "xyes"; then
363 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
367 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
368 GST_CHECK_FEATURE(ALSA, [alsa plug-ins], gstalsa, [
369 PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
371 AC_SUBST(ALSA_CFLAGS)
374 AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
378 dnl *** CDParanoia ***
379 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
380 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
381 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
384 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
386 FOUND_CDPARANOIA="yes")
387 if test "x$FOUND_CDPARANOIA" != "xyes";
389 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
391 cdda/cdda_interface.h,
392 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
394 FOUND_CDPARANOIA="yes")
396 if test "x$HEADER_DIR" = "xyes";
398 AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
399 defined if cdda headers are in a cdda/ directory)
401 AC_SUBST(CDPARANOIA_LIBS)
403 dnl FIXME : add second check somehow if that is necessary
404 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
405 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
407 dnl *** Gnome VFS ***
408 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
409 GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
410 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS="yes", HAVE_GNOME_VFS="no")
411 AC_SUBST(GNOME_VFS_CFLAGS)
412 AC_SUBST(GNOME_VFS_LIBS)
415 dnl *** libvisual ***
416 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBVISUAL, true)
417 GST_CHECK_FEATURE(LIBVISUAL, [libvisual visualization plugins], libvisual, [
418 PKG_CHECK_MODULES(LIBVISUAL, libvisual = 0.2.0, HAVE_LIBVISUAL="yes", HAVE_LIBVISUAL="no")
419 AC_SUBST(LIBVISUAL_CFLAGS)
420 AC_SUBST(LIBVISUAL_LIBS)
424 translit(dnm, m, l) AM_CONDITIONAL(USE_OGG, true)
425 GST_CHECK_FEATURE(OGG, [ogg de/encoder], oggdemux oggmux, [
426 PKG_CHECK_MODULES(OGG, ogg >= 1.0, [
431 XIPH_PATH_OGG(HAVE_OGG="yes", HAVE_OGG="no")
432 AS_SCRUB_INCLUDE(OGG_CFLAGS)
437 translit(dnm, m, l) AM_CONDITIONAL(USE_PANGO, true)
438 GST_CHECK_FEATURE(PANGO, [pango], pango, [
439 PKG_CHECK_MODULES(PANGO, pango pangoft2,
440 HAVE_PANGO="yes", HAVE_PANGO="no")
441 AC_SUBST(PANGO_CFLAGS)
446 translit(dnm, m, l) AM_CONDITIONAL(USE_THEORA, true)
447 GST_CHECK_FEATURE(THEORA, [ogg theora codec], theoradec theoraenc, [
448 PKG_CHECK_MODULES(THEORA, theora, [
450 AC_SUBST(THEORA_LIBS)
451 AC_SUBST(THEORA_CFLAGS)
453 GST_CHECK_LIBHEADER(THEORA, theora, theora_version_string, "-logg", theora/theora.h, THEORA_LIBS="-ltheora -logg")
454 AC_SUBST(THEORA_LIBS)
459 dnl AM_PATH_VORBIS only takes two options
460 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
461 GST_CHECK_FEATURE(VORBIS, [vorbis plug-in], vorbisenc vorbisdec, [
462 PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0 vorbisenc >= 1.0, [
465 XIPH_PATH_VORBIS(HAVE_VORBIS="yes", HAVE_VORBIS="no")
466 AS_SCRUB_INCLUDE(VORBIS_CFLAGS)
469 if test "x$HAVE_VORBIS" = "xyes"; then
470 ac_cflags_save="$CFLAGS"
471 dnl FIXME: does this work on non-gcc? -- Company
472 dnl FIXME: no, it doesn't. Why is this here in the first place ? -- thomasvs
473 CFLAGS="-Wall -Werror"
476 #include <vorbis/codec.h>
480 vorbis_synthesis_restart (v);
481 ]), HAVE_VSR=yes, HAVE_VSR=no)
482 if test "x$HAVE_VSR" = "xyes"; then
483 AC_DEFINE_UNQUOTED(HAVE_VORBIS_SYNTHESIS_RESTART, 1,
484 [defined if vorbis_synthesis_restart is present])
486 CFLAGS="$ac_cflags_save"
489 fi dnl of EXT plugins
491 dnl seeking needs freetype, so check for it here
492 PKG_CHECK_MODULES(FT2, freetype2 >= 2.0.9, HAVE_FT2="yes", [
493 AC_CHECK_FT2(2.0.9, HAVE_FT2="yes", HAVE_FT2="no")
495 dnl make the HAVE_FT2 variable available to automake and Makefile.am
496 AM_CONDITIONAL(HAVE_FT2, test "x$HAVE_FT2" = "xyes")
500 dnl *** finalize CFLAGS, LDFLAGS, LIBS
503 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
504 dnl GST_*: flags shared by built objects to link against GStreamer
505 dnl GST_ALL_LDFLAGS: linker flags shared by all
506 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
507 dnl GST_LT_LDFLAGS: library versioning of our libraries
508 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
510 dnl GST_OPTION_CFLAGS
511 if test "x$USE_DEBUG" = xyes; then
514 AC_SUBST(PROFILE_CFLAGS)
516 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
517 AC_SUBST(DEPRECATED_CFLAGS)
519 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
520 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
521 AC_SUBST(GST_OPTION_CFLAGS)
523 dnl our libraries need to be versioned correctly
524 AC_SUBST(GST_LT_LDFLAGS)
526 dnl FIXME: do we want to rename to GST_ALL_* ?
527 dnl prefer internal headers to already installed ones
528 dnl also add builddir include for enumtypes and marshal
529 dnl add GST_OPTION_CFLAGS, but overridable
530 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
534 dnl LDFLAGS really should only contain flags, not libs - they get added before
535 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
536 GST_ALL_LDFLAGS="-no-undefined"
537 AC_SUBST(GST_ALL_LDFLAGS)
540 dnl linker flags shared by all libraries
541 dnl LDFLAGS modifier defining exported symbols from built libraries
542 GST_LIB_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
543 AC_SUBST(GST_LIB_LDFLAGS)
545 dnl this really should only contain flags, not libs - they get added before
546 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
547 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
548 AC_SUBST(GST_PLUGIN_LDFLAGS)
550 dnl *** output files ***
554 gst-plugins-base.spec
557 gst/audioconvert/Makefile
558 gst/audiorate/Makefile
559 gst/audioresample/Makefile
560 gst/audiotestsrc/Makefile
561 gst/ffmpegcolorspace/Makefile
562 gst/playback/Makefile
563 gst/subparse/Makefile
565 gst/typefind/Makefile
566 gst/videotestsrc/Makefile
567 gst/videorate/Makefile
568 gst/videoscale/Makefile
576 ext/cdparanoia/Makefile
577 ext/gnomevfs/Makefile
578 ext/libvisual/Makefile
584 gst-libs/gst/Makefile
585 gst-libs/gst/audio/Makefile
586 gst-libs/gst/cdda/Makefile
587 gst-libs/gst/floatcast/Makefile
588 gst-libs/gst/interfaces/Makefile
589 gst-libs/gst/netbuffer/Makefile
590 gst-libs/gst/riff/Makefile
591 gst-libs/gst/rtp/Makefile
592 gst-libs/gst/tag/Makefile
593 gst-libs/gst/video/Makefile
595 win32/common/config.h
597 pkgconfig/gstreamer-plugins-base.pc
598 pkgconfig/gstreamer-plugins-base-uninstalled.pc
601 tests/examples/Makefile
602 tests/examples/seek/Makefile
603 tests/examples/volume/Makefile
607 docs/plugins/Makefile
608 docs/version.entities