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
40 if test "x$COMPILER" = "xforte"; then
43 if test "x$GST_CVS"="xyes"; then
44 GST_ERROR="-Wall -Werror"
50 dnl We disable static building for development, for time savings
51 dnl *NOTE*: dnl this line before release, so release does static too
57 dnl ##############################
58 dnl # Do automated configuration #
59 dnl ##############################
64 dnl allow for different autotools
65 AS_AUTOTOOLS_ALTERNATE()
67 dnl modify pkg-config path
68 AC_ARG_WITH(pkg-config-path,
69 AC_HELP_STRING([--with-pkg-config-path],
70 [colon-separated list of pkg-config(1) dirs]),
71 [export PKG_CONFIG_PATH=${withval}])
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 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
169 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
170 download the latest version from
171 ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
173 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
178 #ifndef POPT_TABLEEND
186 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
187 download the latest version from
188 ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
191 dnl Check for atomic.h
192 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
193 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
194 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
195 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
196 if test x$HAVE_ATOMIC_H = xyes; then
198 #include "asm/atomic.h"
199 main() {atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
202 if test x$HAVE_ATOMIC_H = xyes; then
203 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
209 dnl Check for ucontext.h
210 AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H, 1, [defined if we have ucontext.h]))
212 dnl ######################################################################
213 dnl # Check command line parameters, and set shell variables accordingly #
214 dnl ######################################################################
216 dnl FIXME: simplify all this down using a few m4 macros
218 AC_ARG_ENABLE(libmmx,
219 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
220 [case "${enableval}" in
221 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
223 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
225 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
227 AC_ARG_ENABLE(atomic,
228 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
229 [case "${enableval}" in
230 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
231 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
232 no) USE_ATOMIC_H=no;;
233 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
235 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
237 AC_ARG_ENABLE(plugin-builddir,
238 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
239 [case "${enableval}" in
240 yes) PLUGINS_USE_BUILDDIR=yes ;;
241 no) PLUGINS_USE_BUILDDIR=no ;;
242 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
244 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
248 AC_ARG_ENABLE(profiling,
249 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
250 [case "${enableval}" in
251 yes) USE_PROFILING=yes ;;
252 no) UES_PROFILING=no ;;
253 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
255 [USE_PROFILING=no]) dnl Default value
257 dnl use a cache dir for storing element registry info.
258 dnl default to building registry in the source tree if we are enabling plugin build dir
259 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
262 dnl ${localstatedir} points to PREFIX/var
263 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
265 AC_ARG_WITH(cachedir,
266 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
267 [case "${withval}" in
268 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
269 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
270 *) GST_CACHE_DIR="${withval}" ;;
272 [:]) dnl Default value
274 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
275 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
278 dnl building of tests
280 AC_HELP_STRING([--disable-tests],[disable building test apps]),
281 [case "${enableval}" in
282 yes) BUILD_TESTS=yes ;;
283 no) BUILD_TESTS=no ;;
284 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
286 [BUILD_TESTS=yes]) dnl Default value
287 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
289 dnl tests known to fail
290 AC_ARG_ENABLE(failing-tests,
291 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
292 [case "${enableval}" in
293 yes) BUILD_FAILING_TESTS=yes ;;
294 no) BUILD_FAILING_TESTS=no ;;
295 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
297 [BUILD_FAILING_TESTS=no]) dnl Default value
298 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
299 if test x$BUILD_FAILING_TESTS = xyes; then
300 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
302 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.])
305 AC_ARG_ENABLE(examples,
306 AC_HELP_STRING([--disable-examples],[disable building examples]),
307 [case "${enableval}" in
308 yes) BUILD_EXAMPLES=yes ;;
309 no) BUILD_EXAMPLES=no ;;
310 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
312 [BUILD_EXAMPLES=yes]) dnl Default value
313 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
315 dnl Next, check for the optional components:
316 dnl ========================================
318 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
319 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
320 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
321 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
322 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
323 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
324 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
325 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
326 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
327 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
328 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
329 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
330 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, true)
331 GST_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
332 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_INDEX, true)
333 GST_SUBSYSTEM_DISABLE(INDEX,[index])
334 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PLUGIN, true)
335 GST_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
336 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_URI, true)
337 GST_SUBSYSTEM_DISABLE(URI,[uri handlers])
339 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
341 dnl ################################################
342 dnl # Set defines according to variables set above #
343 dnl ################################################
346 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
347 dnl HAVE_ and it is likely to be easier to stick with the old name
348 if test "x$USE_LIBMMX" = xyes; then
349 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
352 if test "x$USE_ATOMIC_H" = xyes; then
353 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
356 dnl test if we have pthread_attr_setstack; if not use the older calls
357 AC_CHECK_LIB(pthread, pthread_attr_setstack,
358 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
359 [Defined if libpthread has pthread_attr_setstack ()]))
361 dnl test if we have posix_memalign; FreeBSD doesn't
362 AC_CHECK_FUNC(posix_memalign,
363 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
364 [Defined if we have posix_memalign ()]))
366 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
367 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
370 if test "x$USE_DEBUG" = xyes; then
371 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
374 if test "x$USE_PROFILING" = xyes; then
375 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
376 FOMIT_FRAME_POINTER=""
378 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
382 dnl AC_SUBST(FOMIT_FRAME_POINTER)
385 dnl #############################
386 dnl # Set automake conditionals #
387 dnl #############################
389 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
390 dnl HAVE_ and it is likely to be easier to stick with the old name
391 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
393 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
394 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
396 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
399 dnl ############################
400 dnl # Set up some more defines #
401 dnl ############################
403 dnl Set location of registry dir.
404 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
405 AC_SUBST(GST_CACHE_DIR)
407 dnl Set location of plugin directory
408 if test "x${prefix}" = "xNONE"; then
409 PLUGINS_DIR=${ac_default_prefix}/lib/gstreamer-$GST_MAJORMINOR
411 PLUGINS_DIR=${prefix}/lib/gstreamer-$GST_MAJORMINOR
413 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
414 AC_SUBST(PLUGINS_DIR)
416 dnl Set location of uninstalled plugin directory
417 PLUGINS_BUILDDIR=`pwd`
418 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
419 AC_SUBST(PLUGINS_BUILDDIR)
421 dnl since glib and xml are package deps, there's no need to include their cflags
422 dnl in the pkg-config file
425 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
426 GST_PKG_LIBS=$GST_EXT_LIBS
427 AC_SUBST(GST_PKG_CFLAGS)
428 AC_SUBST(GST_PKG_LIBS)
430 dnl finalize _CFLAGS and _LIBS
431 dnl add GLIB and XML if necessary to EXT_*
432 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
433 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
435 dnl Private vars for libgst only
436 LIBGST_LIBS="$GST_LIBS"
437 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
438 AC_SUBST(LIBGST_LIBS)
439 AC_SUBST(LIBGST_CFLAGS)
441 dnl Vars for everyone else
442 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
443 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
445 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
446 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
448 GST_PLUGIN_LDFLAGS="-module -avoid-version"
449 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
451 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
453 dnl ##################################################
454 dnl # deps for examples from manual #
455 dnl ##################################################
457 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
458 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
459 AC_SUBST(LIBGNOMEUI_CFLAGS)
460 AC_SUBST(LIBGNOMEUI_LIBS)
461 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
463 dnl ##################################################
464 dnl # Prepare informative messages to display at end #
465 dnl ##################################################
469 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
470 infomessages="$infomessages
471 *** Warning: You have configured using the --enable-plugin-builddir option.
473 This option is for development purposes only: binaries built with
474 it should be used with code in the build tree only. To build an
475 installable version, use ./configure without the --enable-plugin-builddir
476 option. Note that the autogen.sh script supplies the plugin builddir
477 option automatically -- run ./autogen.sh -- --disable-plugin-builddir to make
478 an installable build.
483 dnl #########################
484 dnl # Make the output files #
485 dnl #########################
487 dnl libs/ext/Makefile
488 dnl nothing there yet !
494 gst/autoplug/Makefile
495 gst/indexers/Makefile
496 gst/elements/Makefile
498 gst/schedulers/Makefile
500 gst/registries/Makefile
503 libs/gst/bytestream/Makefile
504 libs/gst/getbits/Makefile
505 libs/gst/putbits/Makefile
506 libs/gst/control/Makefile
509 tests/bufspeed/Makefile
510 tests/memchunk/Makefile
511 tests/muxing/Makefile
512 tests/seeking/Makefile
514 tests/threadstate/Makefile
516 testsuite/bytestream/Makefile
517 testsuite/caps/Makefile
518 testsuite/cleanup/Makefile
519 testsuite/clock/Makefile
520 testsuite/dynparams/Makefile
521 testsuite/elements/Makefile
522 testsuite/indexers/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 gstreamer-uninstalled.pc
559 echo "$infomessages", infomessages="$infomessages"