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, 5, 1,
10 GST_CVS="no", GST_CVS="yes")
12 dnl can autoconf find the source ?
13 AC_CONFIG_SRCDIR([gst/audiotestsrc/gstaudiotestsrc.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
87 AC_SUBST(GST_PLUGINS_ALL)
89 GST_PLUGINS_SELECTED=""
92 AC_HELP_STRING([--with-plugins],
93 [comma-separated list of plug-ins to compile]),
94 [for i in `echo $withval | tr , ' '`; do
95 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
97 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
99 echo "plug-in $i not recognized, ignoring..."
102 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
104 AC_SUBST(GST_PLUGINS_SELECTED)
106 dnl ext plug-ins; plug-ins that have external dependencies
107 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
108 [HAVE_EXTERNAL=yes], enabled,
110 AC_MSG_NOTICE(building external plug-ins)
113 AC_MSG_NOTICE(all plug-ins with external dependencies will not be built)
116 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
118 dnl *** checks for platform ***
120 dnl * hardware/architecture *
122 dnl common/m4/gst-arch.m4
126 dnl *** checks for programs ***
131 dnl determine c++ compiler
133 dnl determine if c++ is available on this system
134 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
136 dnl determine c++ preprocessor
137 dnl FIXME: do we need this ?
140 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
141 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
143 dnl check for documentation tools
145 AS_PATH_PYTHON([2.1])
147 dnl *** checks for libraries ***
149 dnl For interactive UNIX (a Sun thing)
150 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
153 dnl *** checks for header files ***
155 dnl check if we have ANSI C header files
158 dnl used in gst/ffmpegcolorspace/mem.c
159 dnl FIXME: could be fixed by redefining av_malloc and av_free to GLib's
160 AC_CHECK_HEADERS([malloc.h])
162 dnl used in gst/subparse/gstsubparse.c
163 AC_CHECK_HEADERS([regex.h], HAVE_REGEX_H="yes", HAVE_REGEX_H="no")
164 AM_CONDITIONAL(HAVE_REGEX_H, test "x$HAVE_REGEX_H" = "xyes")
167 AC_CHECK_HEADERS([sys/socket.h],
168 HAVE_SYS_SOCKET_H="yes", HAVE_SYS_SOCKET_H="no")
169 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
171 dnl ffmpegcolorspace includes _stdint.h
174 dnl *** checks for types/defines ***
176 dnl Check for FIONREAD ioctl declaration
180 dnl *** checks for structures ***
182 dnl *** checks for compiler characteristics ***
184 dnl make sure we can use "inline" from C code
187 dnl *** checks for library functions ***
189 dnl Check for fast float to int casting as defined in C99
190 dnl used in gst-libs/gst/floatcast/floatcast.h
194 dnl Check for a way to display the function name in debug output
197 dnl *** checks for dependancy libraries ***
200 GST_GLIB_CHECK([2.6])
202 dnl liboil is required
203 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.2, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
204 if test "x${HAVE_LIBOIL}" != xyes ; then
205 AC_ERROR([liboil-0.3 is required])
208 dnl checks for gstreamer
209 dnl uninstalled is selected preferentially -- see pkg-config(1)
211 GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
212 GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
213 GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ])
214 GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ])
215 GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
217 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
218 dnl check for "check", unit testing library/header
219 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
220 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
222 dnl GTK is optional and used in examples
224 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, HAVE_GTK_22=yes, HAVE_GTK_22=no)
225 if test "x$HAVE_GTK_22" = "xyes"; then
227 GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
228 AC_SUBST(GTK_VERSION)
229 GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
230 AC_SUBST(GTK_BASE_DIR)
232 PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK_20=yes, HAVE_GTK_20=no)
234 if test "x$HAVE_GTK_20" = "xyes"; then
237 GTK_CFLAGS=$GTK2_CFLAGS
242 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
244 dnl *** set variables based on configure arguments ***
246 dnl set license and copyright notice
248 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
249 AC_SUBST(GST_LICENSE)
251 dnl set location of plugin directory
254 dnl define an ERROR_CFLAGS Makefile variable
255 GST_SET_ERROR_CFLAGS($GST_CVS)
257 dnl define correct level for debugging messages
258 GST_SET_LEVEL_DEFAULT($GST_CVS)
263 dnl *** sys plug-ins ***
266 AC_MSG_NOTICE([Checking libraries for plugins in sys/])
270 translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
271 GST_CHECK_FEATURE(X, [X libraries and plugins],
274 ac_cflags_save="$CFLAGS"
275 ac_cppflags_save="$CPPFLAGS"
276 CFLAGS="$CFLAGS $X_CFLAGS"
277 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
279 dnl now try to find the HEADER
280 AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
282 if test "x$HAVE_X" = "xno"
284 AC_MSG_NOTICE([cannot find X11 development files])
286 dnl this is much more than we want
287 X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
288 dnl AC_PATH_XTRA only defines the path needed to find the X libs,
289 dnl it does not add the libs; therefore we add them here
290 X_LIBS="$X_LIBS -lX11"
295 CFLAGS="$ac_cflags_save"
296 CPPFLAGS="$ac_cppflags_save"
300 dnl Look for the PIC library first, Debian requires it.
301 dnl Check debian-devel archives for gory details.
303 dnl At the moment XFree86 doesn't distribute shared libXv due
304 dnl to unstable API. On many platforms you CAN NOT link a shared
305 dnl lib to a static non-PIC lib. This is what the xvideo GStreamer
306 dnl plug-in wants to do. So Debian distributes a PIC compiled
307 dnl version of the static lib for plug-ins to link to when it is
308 dnl inappropriate to link the main application to libXv directly.
309 dnl FIXME: add check if this platform can support linking to a
310 dnl non-PIC libXv, if not then don not use Xv.
311 dnl FIXME: perhaps warn user if they have a shared libXv since
312 dnl this is an error until XFree86 starts shipping one
314 dnl Check for Xv extension
315 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
316 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions],
318 if test x$HAVE_X = xyes; then
319 AC_CHECK_LIB(Xv_pic, XvQueryExtension,
320 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
323 if test x$HAVE_XVIDEO = xyes; then
324 XVIDEO_LIBS="-lXv_pic -lXext"
325 AC_SUBST(XVIDEO_LIBS)
327 dnl try again using something else if we didn't find it first
328 if test x$HAVE_XVIDEO = xno; then
329 AC_CHECK_LIB(Xv, XvQueryExtension,
330 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
333 if test x$HAVE_XVIDEO = xyes; then
334 XVIDEO_LIBS="-lXv -lXext"
335 AC_SUBST(XVIDEO_LIBS)
343 translit(dnm, m, l) AM_CONDITIONAL(USE_XSHM, true)
344 GST_CHECK_FEATURE(XSHM, [X Shared Memory extension], xshm, [
345 if test x$HAVE_X = xyes; then
346 AC_CHECK_LIB(Xext, XShmAttach,
347 HAVE_XSHM="yes", HAVE_XSHM="no",
349 if test "x$HAVE_XSHM" = "xyes"; then
352 dnl On AIX, it is in XextSam instead, but we still need -lXext
353 AC_CHECK_LIB(XextSam, XShmAttach,
354 HAVE_XSHM="yes", HAVE_XSHM="no",
356 if test "x$HAVE_XSHM" = "xyes"; then
357 XSHM_LIBS="-lXext -lXextSam"
366 dnl v4l/v4l2 checks have been moved down because they require X
368 dnl *** Video 4 Linux ***
369 dnl for information about the header/define, see sys/v4l/gstv4lelement.h
370 dnl renamed to GST_V4L in accordance with V4L2 below
371 translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L, true)
372 GST_CHECK_FEATURE(GST_V4L, [Video 4 Linux], v4lsrc v4lmjpegsrc v4lmjpegsink, [
375 if test "$HAVE_X" = "yes"
377 AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_GST_V4L="yes", HAVE_GST_V4L="no", [
378 #include <sys/types.h>
379 #define _LINUX_TIME_H
381 #include <linux/videodev.h>
386 dnl *** ext plug-ins ***
387 dnl keep this list sorted alphabetically !
389 if test "x$BUILD_EXTERNAL" = "xyes"; then
392 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
396 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
397 GST_CHECK_FEATURE(ALSA, [alsa plug-ins], gstalsa, [
398 PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
400 AC_SUBST(ALSA_CFLAGS)
403 AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
407 dnl *** CDParanoia ***
408 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
409 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
410 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
413 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
415 FOUND_CDPARANOIA="yes")
416 if test "x$FOUND_CDPARANOIA" != "xyes";
418 GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
420 cdda/cdda_interface.h,
421 CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
423 FOUND_CDPARANOIA="yes")
425 if test "x$HEADER_DIR" = "xyes";
427 AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
428 defined if cdda headers are in a cdda/ directory)
430 AC_SUBST(CDPARANOIA_LIBS)
432 dnl FIXME : add second check somehow if that is necessary
433 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
434 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
436 dnl *** Gnome VFS ***
437 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
438 GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
439 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS="yes", HAVE_GNOME_VFS="no")
440 AC_SUBST(GNOME_VFS_CFLAGS)
441 AC_SUBST(GNOME_VFS_LIBS)
444 dnl *** libvisual ***
445 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBVISUAL, true)
446 GST_CHECK_FEATURE(LIBVISUAL, [libvisual visualization plugins], libvisual, [
447 PKG_CHECK_MODULES(LIBVISUAL, libvisual = 0.2.0, HAVE_LIBVISUAL="yes", HAVE_LIBVISUAL="no")
448 AC_SUBST(LIBVISUAL_CFLAGS)
449 AC_SUBST(LIBVISUAL_LIBS)
453 translit(dnm, m, l) AM_CONDITIONAL(USE_OGG, true)
454 GST_CHECK_FEATURE(OGG, [ogg de/encoder], oggdemux oggmux, [
455 PKG_CHECK_MODULES(OGG, ogg >= 1.0, [
460 XIPH_PATH_OGG(HAVE_OGG="yes", HAVE_OGG="no")
461 AS_SCRUB_INCLUDE(OGG_CFLAGS)
466 translit(dnm, m, l) AM_CONDITIONAL(USE_THEORA, true)
467 GST_CHECK_FEATURE(THEORA, [ogg theora codec], theoradec theoraenc, [
468 PKG_CHECK_MODULES(THEORA, theora, [
470 AC_SUBST(THEORA_LIBS)
471 AC_SUBST(THEORA_CFLAGS)
473 GST_CHECK_LIBHEADER(THEORA, theora, theora_version_string, "-logg", theora/theora.h, THEORA_LIBS="-ltheora -logg")
474 AC_SUBST(THEORA_LIBS)
479 dnl AM_PATH_VORBIS only takes two options
480 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
481 GST_CHECK_FEATURE(VORBIS, [vorbis plug-in], vorbisenc vorbisdec, [
482 PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0 vorbisenc >= 1.0, [
485 XIPH_PATH_VORBIS(HAVE_VORBIS="yes", HAVE_VORBIS="no")
486 AS_SCRUB_INCLUDE(VORBIS_CFLAGS)
489 if test "x$HAVE_VORBIS" = "xyes"; then
490 ac_cflags_save="$CFLAGS"
491 dnl FIXME: does this work on non-gcc? -- Company
492 dnl FIXME: no, it doesn't. Why is this here in the first place ? -- thomasvs
493 CFLAGS="-Wall -Werror"
496 #include <vorbis/codec.h>
500 vorbis_synthesis_restart (v);
501 ]), HAVE_VSR=yes, HAVE_VSR=no)
502 if test "x$HAVE_VSR" = "xyes"; then
503 AC_DEFINE_UNQUOTED(HAVE_VORBIS_SYNTHESIS_RESTART, 1,
504 [defined if vorbis_synthesis_restart is present])
506 CFLAGS="$ac_cflags_save"
509 fi dnl of EXT plugins
511 dnl seeking needs freetype, so check for it here
512 PKG_CHECK_MODULES(FT2, freetype2 >= 2.0.9, HAVE_FT2="yes", [
513 AC_CHECK_FT2(2.0.9, HAVE_FT2="yes", HAVE_FT2="no")
515 dnl make the HAVE_FT2 variable available to automake and Makefile.am
516 AM_CONDITIONAL(HAVE_FT2, test "x$HAVE_FT2" = "xyes")
520 dnl *** finalize CFLAGS, LDFLAGS, LIBS
523 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
524 dnl GST_*: flags shared by all built objects
525 dnl GST_LT_LDFLAGS: library versioning of our libraries
526 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
528 dnl GST_OPTION_CFLAGS
529 if test "x$USE_DEBUG" = xyes; then
532 AC_SUBST(PROFILE_CFLAGS)
534 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
535 AC_SUBST(DEPRECATED_CFLAGS)
537 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
538 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
539 AC_SUBST(GST_OPTION_CFLAGS)
541 dnl our libraries need to be versioned correctly
542 AC_SUBST(GST_LT_LDFLAGS)
544 dnl FIXME: do we want to rename to GST_ALL_* ?
545 dnl prefer internal headers to already installed ones
546 dnl also add builddir include for enumtypes and marshal
547 dnl add ERROR_CFLAGS, but overridable
548 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
552 dnl this really should only contain flags, not libs - they get added before
553 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
554 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' -no-undefined"
555 AC_SUBST(GST_PLUGIN_LDFLAGS)
557 dnl *** output files ***
561 gst-plugins-base.spec
564 gst/audioconvert/Makefile
565 gst/audiorate/Makefile
566 gst/audioresample/Makefile
567 gst/audiotestsrc/Makefile
568 gst/ffmpegcolorspace/Makefile
569 gst/playback/Makefile
570 gst/subparse/Makefile
572 gst/typefind/Makefile
573 gst/videotestsrc/Makefile
574 gst/videorate/Makefile
575 gst/videoscale/Makefile
583 ext/cdparanoia/Makefile
584 ext/gnomevfs/Makefile
585 ext/libvisual/Makefile
590 gst-libs/gst/Makefile
591 gst-libs/gst/audio/Makefile
592 gst-libs/gst/floatcast/Makefile
593 gst-libs/gst/interfaces/Makefile
594 gst-libs/gst/net/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
599 gst-libs/ext/Makefile
600 examples/seeking/Makefile
604 pkgconfig/gstreamer-plugins-base.pc
605 pkgconfig/gstreamer-plugins-base-uninstalled.pc
609 docs/plugins/Makefile
610 docs/version.entities
618 echo "configure: *** Core plug-ins, always built:"
619 ( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort
621 echo -n "configure: *** Plug-ins relying on libraries that will be built:"
622 echo -e "$GST_PLUGINS_YES" | sort
624 echo -n "configure: *** Plug-ins relying on libraries that will NOT be built:"
625 echo -e "$GST_PLUGINS_NO" | sort
627 if test "x$BUILD_EXTERNAL" = "xno"; then
628 echo "configure: *** No external plug-ins will be built"