2 AC_CANONICAL_TARGET([])
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 AS_VERSION(gstreamer, GST_VERSION, 0, 7, 0, 1, GST_CVS="no", GST_CVS="yes")
8 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
10 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
12 dnl our libraries and install dirs use major.minor as a version
13 GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
14 AC_SUBST(GST_MAJORMINOR)
17 dnl For interactive UNIX (a Sun thing)
20 dnl CURRENT, REVISION, AGE
21 dnl - library source changed -> increment REVISION
22 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
23 dnl - interfaces added -> increment AGE
24 dnl - interfaces removed -> AGE = 0
25 AS_LIBTOOL(GST, 3, 0, 0)
27 AC_CONFIG_SRCDIR([gst/gst.c])
28 AM_CONFIG_HEADER(config.h)
30 dnl Add parameters for aclocal
31 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
32 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
38 dnl decide on error flags
39 AS_COMPILER_FLAG(-Wall,GST_ERROR="$GST_ERROR -Wall",)
40 if test "x$GST_CVS"="xyes"; then
41 AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",)
44 dnl We disable static building for development, for time savings
45 dnl *NOTE*: dnl this line before release, so release does static too
51 dnl ##############################
52 dnl # Do automated configuration #
53 dnl ##############################
58 dnl allow for different autotools
59 AS_AUTOTOOLS_ALTERNATE()
61 dnl modify pkg-config path
62 AC_ARG_WITH(pkg-config-path,
63 AC_HELP_STRING([--with-pkg-config-path],
64 [colon-separated list of pkg-config(1) dirs]),
65 [export PKG_CONFIG_PATH=${withval}])
70 dnl we require bison for building of some of the marshal files
71 dnl FIXME: check if AC_PROG_YACC is suitable here
72 AC_PATH_PROG(BISON_PATH, bison, no)
73 if test x$BISON_PATH = xno; then
74 AC_MSG_ERROR(Could not find bison)
77 dnl we require flex for building the parser
78 dnl FIXME: check if AC_PROG_LEX is suitable here
79 AC_PATH_PROG(FLEX_PATH, flex, no)
80 if test x$FLEX_PATH = xno; then
81 AC_MSG_ERROR(Could not find flex)
85 dnl We should really use AC_SYS_LARGEFILE, but the problem is
86 dnl many of the plugins don't include "config.h". To assure
87 dnl binary compatibility, it is necessary that all gstreamer
88 dnl code be compiled with the same sizeof(off_t), so we use
89 dnl the following crude hack.
93 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
95 dnl this is so we can make GST_CFLAGS for external modules available
96 dnl without mixing in internal (uninstalled) CFLAGS
99 dnl disable deprecated functions internally
100 GST_INT_CFLAGS="-DGST_DISABLE_DEPRECATED"
102 AC_MSG_CHECKING(for large file support)
104 #define _LARGEFILE_SOURCE
105 #define _FILE_OFFSET_BITS 64
106 #include <sys/types.h>
107 int main () { return !(sizeof(off_t) == 8); }
111 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
120 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
122 if test "$ac_cv_check_mcsc" == "yes"; then
123 AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, $HAVE_MAKECONTEXT,
124 [defined if we have makecontext ()])
127 dnl Check for a way to display the function name in debug output
130 dnl Check for essential libraries first:
131 dnl ====================================
134 dnl Minimum required version of GLib2
135 dnl required for compilation without warnings
140 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,HAVE_GLIB2=yes,HAVE_GLIB2=no)
141 GLIB_LIBS=$GLIB2_LIBS
142 GLIB_CFLAGS=$GLIB2_CFLAGS
144 AC_SUBST(GLIB_CFLAGS)
146 if test "x$HAVE_GLIB2" = "xno"; then
147 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
150 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
151 AC_SUBST(GST_PKG_DEPS)
154 dnl Minimum required version of libxml2
156 AC_SUBST(LIBXML2_REQ)
158 dnl check for libxml2
162 dnl FIXME: This test passes on popt 1.6.2, maybe earlier, but popt 1.6.2
163 dnl causes segfaults on gst_init. Write a working test if possible.
164 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
165 AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
166 download the latest version from
167 ftp://ftp.rpm.org/pub/rpm/dist/])
169 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
174 #ifndef POPT_TABLEEND
182 AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
183 download the latest version from
184 ftp://ftp.rpm.org/pub/rpm/dist/])
187 dnl Check for atomic.h
188 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
189 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
190 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
191 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
192 if test x$HAVE_ATOMIC_H = xyes; then
194 #include "asm/atomic.h"
195 main() {atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
198 if test x$HAVE_ATOMIC_H = xyes; then
199 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
205 dnl Check for ucontext.h
206 AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H, 1, [defined if we have ucontext.h]))
208 dnl ######################################################################
209 dnl # Check command line parameters, and set shell variables accordingly #
210 dnl ######################################################################
212 dnl FIXME: simplify all this down using a few m4 macros
214 AC_ARG_ENABLE(libmmx,
215 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
216 [case "${enableval}" in
217 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
219 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
221 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
223 AC_ARG_ENABLE(atomic,
224 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
225 [case "${enableval}" in
226 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
227 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
228 no) USE_ATOMIC_H=no;;
229 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
231 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
233 AC_ARG_ENABLE(plugin-builddir,
234 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
235 [case "${enableval}" in
236 yes) PLUGINS_USE_BUILDDIR=yes ;;
237 no) PLUGINS_USE_BUILDDIR=no ;;
238 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
240 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
244 AC_ARG_ENABLE(profiling,
245 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
246 [case "${enableval}" in
247 yes) USE_PROFILING=yes ;;
248 no) UES_PROFILING=no ;;
249 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
251 [USE_PROFILING=no]) dnl Default value
253 dnl use a cache dir for storing element registry info.
254 dnl default to building registry in the source tree if we are enabling plugin build dir
255 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
258 dnl ${localstatedir} points to PREFIX/var
259 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
261 AC_ARG_WITH(cachedir,
262 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
263 [case "${withval}" in
264 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
265 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
266 *) GST_CACHE_DIR="${withval}" ;;
268 [:]) dnl Default value
270 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
271 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
274 dnl building of tests
276 AC_HELP_STRING([--disable-tests],[disable building test apps]),
277 [case "${enableval}" in
278 yes) BUILD_TESTS=yes ;;
279 no) BUILD_TESTS=no ;;
280 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
282 [BUILD_TESTS=yes]) dnl Default value
283 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
285 dnl tests known to fail
286 AC_ARG_ENABLE(failing-tests,
287 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
288 [case "${enableval}" in
289 yes) BUILD_FAILING_TESTS=yes ;;
290 no) BUILD_FAILING_TESTS=no ;;
291 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
293 [BUILD_FAILING_TESTS=no]) dnl Default value
294 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
295 if test x$BUILD_FAILING_TESTS = xyes; then
296 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
298 AC_MSG_WARN([Sissy ! By asking to not build the tests known to fail, you hereby waive your right to customer support. If you do not agree with this EULA, please press Ctrl-C before the next line is printed. By allowing the next line to be printed, you expressly acknowledge your acceptance of this EULA.])
301 AC_ARG_ENABLE(examples,
302 AC_HELP_STRING([--disable-examples],[disable building examples]),
303 [case "${enableval}" in
304 yes) BUILD_EXAMPLES=yes ;;
305 no) BUILD_EXAMPLES=no ;;
306 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
308 [BUILD_EXAMPLES=yes]) dnl Default value
309 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
311 dnl Next, check for the optional components:
312 dnl ========================================
314 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
315 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
316 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
317 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
318 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
319 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
320 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
321 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
322 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
323 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
324 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, true)
325 GST_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
327 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
328 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
329 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, true)
330 GST_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
331 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_INDEX, true)
332 GST_SUBSYSTEM_DISABLE(INDEX,[index])
333 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PLUGIN, true)
334 GST_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
335 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_URI, true)
336 GST_SUBSYSTEM_DISABLE(URI,[uri handlers])
338 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
340 dnl ################################################
341 dnl # Set defines according to variables set above #
342 dnl ################################################
345 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
346 dnl HAVE_ and it is likely to be easier to stick with the old name
347 if test "x$USE_LIBMMX" = xyes; then
348 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
351 if test "x$USE_ATOMIC_H" = xyes; then
352 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
355 dnl test if we have pthread_attr_setstack; if not use the older calls
356 AC_CHECK_LIB(pthread, pthread_attr_setstack,
357 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
358 [Defined if libpthread has pthread_attr_setstack ()]))
360 dnl test if we have posix_memalign; FreeBSD doesn't
361 AC_CHECK_FUNC(posix_memalign,
362 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
363 [Defined if we have posix_memalign ()]))
365 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
366 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
369 if test "x$USE_DEBUG" = xyes; then
370 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
373 if test "x$USE_PROFILING" = xyes; then
374 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
375 FOMIT_FRAME_POINTER=""
377 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
381 dnl AC_SUBST(FOMIT_FRAME_POINTER)
384 dnl #############################
385 dnl # Set automake conditionals #
386 dnl #############################
388 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
389 dnl HAVE_ and it is likely to be easier to stick with the old name
390 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
392 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
393 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
395 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
398 dnl ############################
399 dnl # Set up some more defines #
400 dnl ############################
402 dnl Set location of registry dir.
403 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
404 AC_SUBST(GST_CACHE_DIR)
406 dnl Set location of plugin directory
407 if test "x${prefix}" = "xNONE"; then
408 PLUGINS_DIR=${ac_default_prefix}/lib/gstreamer-$GST_MAJORMINOR
410 PLUGINS_DIR=${prefix}/lib/gstreamer-$GST_MAJORMINOR
412 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
413 AC_SUBST(PLUGINS_DIR)
415 dnl Set location of uninstalled plugin directory
416 PLUGINS_BUILDDIR=`pwd`
417 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
418 AC_SUBST(PLUGINS_BUILDDIR)
420 dnl since glib and xml are package deps, there's no need to include their cflags
421 dnl in the pkg-config file
424 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
425 GST_PKG_LIBS=$GST_EXT_LIBS
426 AC_SUBST(GST_PKG_CFLAGS)
427 AC_SUBST(GST_PKG_LIBS)
429 dnl finalize _CFLAGS and _LIBS
430 dnl add GLIB and XML if necessary to EXT_*
431 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
432 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
434 dnl Private vars for libgst only
435 LIBGST_LIBS="$GST_LIBS"
436 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
437 AC_SUBST(LIBGST_LIBS)
438 AC_SUBST(LIBGST_CFLAGS)
440 dnl Vars for everyone else
441 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
442 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
444 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
445 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
447 GST_PLUGIN_LDFLAGS="-module -avoid-version"
448 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
450 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
452 dnl ##################################################
453 dnl # deps for examples from manual #
454 dnl ##################################################
456 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
457 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
458 AC_SUBST(LIBGNOMEUI_CFLAGS)
459 AC_SUBST(LIBGNOMEUI_LIBS)
460 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
462 dnl ##################################################
463 dnl # Prepare informative messages to display at end #
464 dnl ##################################################
468 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
469 infomessages="$infomessages
470 *** Warning: You have configured using the --enable-plugin-builddir option.
472 This option is for development purposes only: binaries built with
473 it should be used with code in the build tree only. To build an
474 installable version, use ./configure without the --enable-plugin-builddir
475 option. Note that the autogen.sh script supplies the plugin builddir
476 option automatically -- run ./autogen.sh -- --disable-plugin-builddir to make
477 an installable build.
482 dnl #########################
483 dnl # Make the output files #
484 dnl #########################
486 dnl libs/ext/Makefile
487 dnl nothing there yet !
493 gst/autoplug/Makefile
494 gst/indexers/Makefile
495 gst/elements/Makefile
497 gst/schedulers/Makefile
499 gst/registries/Makefile
502 libs/gst/bytestream/Makefile
503 libs/gst/getbits/Makefile
504 libs/gst/putbits/Makefile
505 libs/gst/control/Makefile
508 tests/bufspeed/Makefile
509 tests/memchunk/Makefile
510 tests/muxing/Makefile
511 tests/seeking/Makefile
513 tests/threadstate/Makefile
515 testsuite/bytestream/Makefile
516 testsuite/caps/Makefile
517 testsuite/cleanup/Makefile
518 testsuite/clock/Makefile
519 testsuite/dynparams/Makefile
520 testsuite/elements/Makefile
521 testsuite/indexers/Makefile
522 testsuite/parse/Makefile
523 testsuite/plugin/Makefile
524 testsuite/refcounting/Makefile
525 testsuite/threads/Makefile
527 examples/autoplug/Makefile
528 examples/cutter/Makefile
529 examples/helloworld/Makefile
530 examples/helloworld2/Makefile
531 examples/launch/Makefile
532 examples/manual/Makefile
533 examples/mixer/Makefile
534 examples/pingpong/Makefile
535 examples/plugins/Makefile
536 examples/queue/Makefile
537 examples/queue2/Makefile
538 examples/queue3/Makefile
539 examples/queue4/Makefile
540 examples/thread/Makefile
541 examples/typefind/Makefile
542 examples/xml/Makefile
545 docs/devhelp/Makefile
548 docs/gst/gstreamer.types
552 docs/plugins/Makefile
553 docs/plugins/gstreamer-plugins.types
557 pkgconfig/gstreamer.pc
558 pkgconfig/gstreamer-uninstalled.pc
559 pkgconfig/gstreamer-control.pc
560 pkgconfig/gstreamer-control-uninstalled.pc
562 echo "$infomessages", infomessages="$infomessages"