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 Perl is used in building documentation
71 AC_PATH_PROG(PERL_PATH, perl, no)
72 if test x$PERL_PATH = xno; then
73 AC_MSG_ERROR(Could not find perl)
76 dnl we require bison for building of some of the marshal files
77 dnl FIXME: check if AC_PROG_YACC is suitable here
78 AC_PATH_PROG(BISON_PATH, bison, no)
79 if test x$BISON_PATH = xno; then
80 AC_MSG_ERROR(Could not find bison)
83 dnl we require flex for building the parser
84 dnl FIXME: check if AC_PROG_LEX is suitable here
85 AC_PATH_PROG(FLEX_PATH, flex, no)
86 if test x$FLEX_PATH = xno; then
87 AC_MSG_ERROR(Could not find flex)
91 dnl We should really use AC_SYS_LARGEFILE, but the problem is
92 dnl many of the plugins don't include "config.h". To assure
93 dnl binary compatibility, it is necessary that all gstreamer
94 dnl code be compiled with the same sizeof(off_t), so we use
95 dnl the following crude hack.
99 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
101 dnl this is so we can make GST_CFLAGS for external modules available
102 dnl without mixing in internal (uninstalled) CFLAGS
105 dnl disable deprecated functions internally
106 GST_INT_CFLAGS="-DGST_DISABLE_DEPRECATED"
108 AC_MSG_CHECKING(for large file support)
110 #define _LARGEFILE_SOURCE
111 #define _FILE_OFFSET_BITS 64
112 #include <sys/types.h>
113 int main () { return !(sizeof(off_t) == 8); }
117 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
126 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
128 if test "$ac_cv_check_mcsc" == "yes"; then
129 AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, $HAVE_MAKECONTEXT,
130 [defined if we have makecontext ()])
133 dnl Check for a way to display the function name in debug output
136 dnl Check for essential libraries first:
137 dnl ====================================
140 dnl Minimum required version of GLib2
141 dnl required for compilation without warnings
146 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,HAVE_GLIB2=yes,HAVE_GLIB2=no)
147 GLIB_LIBS=$GLIB2_LIBS
148 GLIB_CFLAGS=$GLIB2_CFLAGS
150 AC_SUBST(GLIB_CFLAGS)
152 if test "x$HAVE_GLIB2" = "xno"; then
153 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
156 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
157 AC_SUBST(GST_PKG_DEPS)
160 dnl Minimum required version of libxml2
162 AC_SUBST(LIBXML2_REQ)
164 dnl check for libxml2
168 dnl FIXME: This test passes on popt 1.6.2, maybe earlier, but popt 1.6.2
169 dnl causes segfaults on gst_init. Write a working test if possible.
170 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
171 AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
172 download the latest version from
173 ftp://ftp.rpm.org/pub/rpm/dist/])
175 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
180 #ifndef POPT_TABLEEND
188 AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
189 download the latest version from
190 ftp://ftp.rpm.org/pub/rpm/dist/])
193 dnl Check for atomic.h
194 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
195 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
196 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
197 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
198 if test x$HAVE_ATOMIC_H = xyes; then
200 #include "asm/atomic.h"
201 main() {atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
204 if test x$HAVE_ATOMIC_H = xyes; then
205 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
211 dnl Check for ucontext.h
212 AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H, 1, [defined if we have ucontext.h]))
214 dnl ######################################################################
215 dnl # Check command line parameters, and set shell variables accordingly #
216 dnl ######################################################################
218 dnl FIXME: simplify all this down using a few m4 macros
220 AC_ARG_ENABLE(libmmx,
221 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
222 [case "${enableval}" in
223 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
225 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
227 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
229 AC_ARG_ENABLE(atomic,
230 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
231 [case "${enableval}" in
232 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
233 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
234 no) USE_ATOMIC_H=no;;
235 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
237 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
239 AC_ARG_ENABLE(plugin-builddir,
240 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
241 [case "${enableval}" in
242 yes) PLUGINS_USE_BUILDDIR=yes ;;
243 no) PLUGINS_USE_BUILDDIR=no ;;
244 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
246 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
250 AC_ARG_ENABLE(profiling,
251 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
252 [case "${enableval}" in
253 yes) USE_PROFILING=yes ;;
254 no) UES_PROFILING=no ;;
255 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
257 [USE_PROFILING=no]) dnl Default value
259 dnl use a cache dir for storing element registry info.
260 dnl default to building registry in the source tree if we are enabling plugin build dir
261 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
264 dnl ${localstatedir} points to PREFIX/var
265 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
267 AC_ARG_WITH(cachedir,
268 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
269 [case "${withval}" in
270 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
271 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
272 *) GST_CACHE_DIR="${withval}" ;;
274 [:]) dnl Default value
276 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
277 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
280 dnl building of tests
282 AC_HELP_STRING([--disable-tests],[disable building test apps]),
283 [case "${enableval}" in
284 yes) BUILD_TESTS=yes ;;
285 no) BUILD_TESTS=no ;;
286 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
288 [BUILD_TESTS=yes]) dnl Default value
289 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
291 dnl tests known to fail
292 AC_ARG_ENABLE(failing-tests,
293 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
294 [case "${enableval}" in
295 yes) BUILD_FAILING_TESTS=yes ;;
296 no) BUILD_FAILING_TESTS=no ;;
297 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
299 [BUILD_FAILING_TESTS=no]) dnl Default value
300 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
301 if test x$BUILD_FAILING_TESTS = xyes; then
302 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
304 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.])
307 AC_ARG_ENABLE(examples,
308 AC_HELP_STRING([--disable-examples],[disable building examples]),
309 [case "${enableval}" in
310 yes) BUILD_EXAMPLES=yes ;;
311 no) BUILD_EXAMPLES=no ;;
312 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
314 [BUILD_EXAMPLES=yes]) dnl Default value
315 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
317 dnl Next, check for the optional components:
318 dnl ========================================
320 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
321 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
322 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
323 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
324 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
325 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
326 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
327 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
328 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
329 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
330 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, true)
331 GST_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
333 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
334 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
335 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, true)
336 GST_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
337 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_INDEX, true)
338 GST_SUBSYSTEM_DISABLE(INDEX,[index])
339 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PLUGIN, true)
340 GST_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
341 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_URI, true)
342 GST_SUBSYSTEM_DISABLE(URI,[uri handlers])
344 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
346 dnl ################################################
347 dnl # Set defines according to variables set above #
348 dnl ################################################
351 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
352 dnl HAVE_ and it is likely to be easier to stick with the old name
353 if test "x$USE_LIBMMX" = xyes; then
354 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
357 if test "x$USE_ATOMIC_H" = xyes; then
358 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
361 dnl test if we have pthread_attr_setstack; if not use the older calls
362 AC_CHECK_LIB(pthread, pthread_attr_setstack,
363 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
364 [Defined if libpthread has pthread_attr_setstack ()]))
366 dnl test if we have posix_memalign; FreeBSD doesn't
367 AC_CHECK_FUNC(posix_memalign,
368 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
369 [Defined if we have posix_memalign ()]))
371 dnl test for sigaction()
372 AC_CHECK_FUNC(sigaction,
373 AC_DEFINE(HAVE_SIGACTION, 1,
374 [Defined if we have sigaction ()]))
376 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
377 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
380 if test "x$USE_DEBUG" = xyes; then
381 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
384 if test "x$USE_PROFILING" = xyes; then
385 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
386 FOMIT_FRAME_POINTER=""
388 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
392 dnl AC_SUBST(FOMIT_FRAME_POINTER)
395 dnl #############################
396 dnl # Set automake conditionals #
397 dnl #############################
399 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
400 dnl HAVE_ and it is likely to be easier to stick with the old name
401 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
403 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
404 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
406 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
409 dnl ############################
410 dnl # Set up some more defines #
411 dnl ############################
413 dnl Set location of registry dir.
414 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
415 AC_SUBST(GST_CACHE_DIR)
417 dnl Set location of plugin directory
418 if test "x${prefix}" = "xNONE"; then
419 PLUGINS_DIR=${ac_default_prefix}/lib/gstreamer-$GST_MAJORMINOR
421 PLUGINS_DIR=${prefix}/lib/gstreamer-$GST_MAJORMINOR
423 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
424 AC_SUBST(PLUGINS_DIR)
426 dnl Set location of uninstalled plugin directory
427 PLUGINS_BUILDDIR=`pwd`
428 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
429 AC_SUBST(PLUGINS_BUILDDIR)
431 dnl since glib and xml are package deps, there's no need to include their cflags
432 dnl in the pkg-config file
435 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
436 GST_PKG_LIBS=$GST_EXT_LIBS
437 AC_SUBST(GST_PKG_CFLAGS)
438 AC_SUBST(GST_PKG_LIBS)
440 dnl finalize _CFLAGS and _LIBS
441 dnl add GLIB and XML if necessary to EXT_*
442 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
443 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
445 dnl Private vars for libgst only
446 LIBGST_LIBS="$GST_LIBS"
447 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
448 AC_SUBST(LIBGST_LIBS)
449 AC_SUBST(LIBGST_CFLAGS)
451 dnl Vars for everyone else
452 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
453 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
455 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
456 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
458 GST_PLUGIN_LDFLAGS="-module -avoid-version"
459 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
461 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
463 dnl ##################################################
464 dnl # deps for examples from manual #
465 dnl ##################################################
467 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
468 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
469 AC_SUBST(LIBGNOMEUI_CFLAGS)
470 AC_SUBST(LIBGNOMEUI_LIBS)
471 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
473 dnl ##################################################
474 dnl # Prepare informative messages to display at end #
475 dnl ##################################################
479 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
480 infomessages="$infomessages
481 *** Warning: You have configured using the --enable-plugin-builddir option.
483 This option is for development purposes only: binaries built with
484 it should be used with code in the build tree only. To build an
485 installable version, use ./configure without the --enable-plugin-builddir
486 option. Note that the autogen.sh script supplies the plugin builddir
487 option automatically -- run ./autogen.sh -- --disable-plugin-builddir to make
488 an installable build.
493 dnl #########################
494 dnl # Make the output files #
495 dnl #########################
497 dnl libs/ext/Makefile
498 dnl nothing there yet !
504 gst/autoplug/Makefile
505 gst/indexers/Makefile
506 gst/elements/Makefile
508 gst/schedulers/Makefile
510 gst/registries/Makefile
513 libs/gst/bytestream/Makefile
514 libs/gst/getbits/Makefile
515 libs/gst/putbits/Makefile
516 libs/gst/control/Makefile
519 tests/bufspeed/Makefile
520 tests/memchunk/Makefile
521 tests/muxing/Makefile
522 tests/seeking/Makefile
524 tests/threadstate/Makefile
526 testsuite/bytestream/Makefile
527 testsuite/caps/Makefile
528 testsuite/cleanup/Makefile
529 testsuite/clock/Makefile
530 testsuite/dynparams/Makefile
531 testsuite/elements/Makefile
532 testsuite/indexers/Makefile
533 testsuite/parse/Makefile
534 testsuite/plugin/Makefile
535 testsuite/refcounting/Makefile
536 testsuite/threads/Makefile
538 examples/autoplug/Makefile
539 examples/cutter/Makefile
540 examples/helloworld/Makefile
541 examples/helloworld2/Makefile
542 examples/launch/Makefile
543 examples/manual/Makefile
544 examples/mixer/Makefile
545 examples/pingpong/Makefile
546 examples/plugins/Makefile
547 examples/queue/Makefile
548 examples/queue2/Makefile
549 examples/queue3/Makefile
550 examples/queue4/Makefile
551 examples/thread/Makefile
552 examples/typefind/Makefile
553 examples/xml/Makefile
556 docs/devhelp/Makefile
559 docs/gst/gstreamer.types
563 docs/plugins/Makefile
564 docs/plugins/gstreamer-plugins.types
568 pkgconfig/gstreamer.pc
569 pkgconfig/gstreamer-uninstalled.pc
570 pkgconfig/gstreamer-control.pc
571 pkgconfig/gstreamer-control-uninstalled.pc
573 echo "$infomessages", infomessages="$infomessages"