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, 5, 1, 1, GST_ERROR="-Wall", GST_ERROR="-Wall -Werror")
7 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
9 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
11 dnl our libraries and install dirs use major.minor as a version
12 GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
13 AC_SUBST(GST_MAJORMINOR)
15 dnl CURRENT, REVISION, AGE
16 dnl - library source changed -> increment REVISION
17 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
18 dnl - interfaces added -> increment AGE
19 dnl - interfaces removed -> AGE = 0
20 AS_LIBTOOL(GST, 2, 0, 0)
22 AC_CONFIG_SRCDIR([gst/gst.c])
23 AM_CONFIG_HEADER(config.h)
25 dnl Add parameters for aclocal
26 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
27 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
30 dnl For interactive UNIX (a Sun thing)
36 dnl We disable static building for development, for time savings
37 dnl *NOTE*: dnl this line before release, so release does static too
43 dnl ##############################
44 dnl # Do automated configuration #
45 dnl ##############################
50 dnl allow for different autotools
51 AS_AUTOTOOLS_ALTERNATE()
53 dnl modify pkg-config path
54 AC_ARG_WITH(pkg-config-path,
55 AC_HELP_STRING([--with-pkg-config-path],
56 [colon-separated list of pkg-config(1) dirs]),
57 [export PKG_CONFIG_PATH=${withval}])
62 dnl we require bison for building of some of the marshal files
63 dnl FIXME: check if AC_PROG_YACC is suitable here
64 AC_PATH_PROG(BISON_PATH, bison, no)
65 if test x$BISON_PATH = xno; then
66 AC_MSG_ERROR(Could not find bison)
69 dnl we require flex for building the parser
70 dnl FIXME: check if AC_PROG_LEX is suitable here
71 AC_PATH_PROG(FLEX_PATH, flex, no)
72 if test x$FLEX_PATH = xno; then
73 AC_MSG_ERROR(Could not find flex)
77 dnl We should really use AC_SYS_LARGEFILE, but the problem is
78 dnl many of the plugins don't include "config.h". To assure
79 dnl binary compatibility, it is necessary that all gstreamer
80 dnl code be compiled with the same sizeof(off_t), so we use
81 dnl the following crude hack.
85 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
87 dnl this is so we can make GST_CFLAGS for external modules available
88 dnl without mixing in internal (uninstalled) CFLAGS
91 dnl disable deprecated functions internally
92 GST_INT_CFLAGS="-DGST_DISABLE_DEPRECATED"
94 AC_MSG_CHECKING(for large file support)
96 #define _LARGEFILE_SOURCE
97 #define _FILE_OFFSET_BITS 64
98 #include <sys/types.h>
99 int main () { return !(sizeof(off_t) == 8); }
103 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
112 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
114 if test "$ac_cv_check_mcsc" == "yes"; then
115 AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, $HAVE_MAKECONTEXT,
116 [defined if we have makecontext ()])
119 dnl Check for a way to display the function name in debug output
122 dnl Check for essential libraries first:
123 dnl ====================================
126 dnl Minimum required version of GLib2
127 dnl required for compilation without warnings
132 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,HAVE_GLIB2=yes,HAVE_GLIB2=no)
133 GLIB_LIBS=$GLIB2_LIBS
134 GLIB_CFLAGS=$GLIB2_CFLAGS
136 AC_SUBST(GLIB_CFLAGS)
138 if test "x$HAVE_GLIB2" = "xno"; then
139 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
142 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
143 AC_SUBST(GST_PKG_DEPS)
146 dnl Minimum required version of libxml2
148 AC_SUBST(LIBXML2_REQ)
150 dnl check for libxml2
154 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
155 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
156 download the latest version from
157 ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
159 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
164 #ifndef POPT_TABLEEND
172 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
173 download the latest version from
174 ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
177 dnl Check for atomic.h
178 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
179 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
180 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
181 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
182 if test x$HAVE_ATOMIC_H = xyes; then
184 #include "asm/atomic.h"
185 main() {atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
188 if test x$HAVE_ATOMIC_H = xyes; then
189 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
195 dnl ######################################################################
196 dnl # Check command line parameters, and set shell variables accordingly #
197 dnl ######################################################################
199 dnl FIXME: simplify all this down using a few m4 macros
201 AC_ARG_ENABLE(libmmx,
202 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
203 [case "${enableval}" in
204 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
206 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
208 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
210 AC_ARG_ENABLE(atomic,
211 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
212 [case "${enableval}" in
213 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
214 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
215 no) USE_ATOMIC_H=no;;
216 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
218 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
220 AC_ARG_ENABLE(plugin-builddir,
221 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
222 [case "${enableval}" in
223 yes) PLUGINS_USE_BUILDDIR=yes ;;
224 no) PLUGINS_USE_BUILDDIR=no ;;
225 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
227 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
231 AC_ARG_ENABLE(profiling,
232 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
233 [case "${enableval}" in
234 yes) USE_PROFILING=yes ;;
235 no) UES_PROFILING=no ;;
236 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
238 [USE_PROFILING=no]) dnl Default value
240 dnl use a cache dir for storing element registry info.
241 dnl default to building registry in the source tree if we are enabling plugin build dir
242 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
245 dnl ${localstatedir} points to PREFIX/var
246 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
248 AC_ARG_WITH(cachedir,
249 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
250 [case "${withval}" in
251 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
252 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
253 *) GST_CACHE_DIR="${withval}" ;;
255 [:]) dnl Default value
257 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
258 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
261 dnl building of tests
263 AC_HELP_STRING([--disable-tests],[disable building test apps]),
264 [case "${enableval}" in
265 yes) BUILD_TESTS=yes ;;
266 no) BUILD_TESTS=no ;;
267 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
269 [BUILD_TESTS=yes]) dnl Default value
270 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
272 dnl tests known to fail
273 AC_ARG_ENABLE(failing-tests,
274 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
275 [case "${enableval}" in
276 yes) BUILD_FAILING_TESTS=yes ;;
277 no) BUILD_FAILING_TESTS=no ;;
278 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
280 [BUILD_FAILING_TESTS=no]) dnl Default value
281 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
282 if test x$BUILD_FAILING_TESTS = xyes; then
283 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
285 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.])
288 AC_ARG_ENABLE(examples,
289 AC_HELP_STRING([--disable-examples],[disable building examples]),
290 [case "${enableval}" in
291 yes) BUILD_EXAMPLES=yes ;;
292 no) BUILD_EXAMPLES=no ;;
293 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
295 [BUILD_EXAMPLES=yes]) dnl Default value
296 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
298 dnl Next, check for the optional components:
299 dnl ========================================
301 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
302 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
303 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
304 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
305 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
306 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
307 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
308 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
309 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
310 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
311 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
312 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
314 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
316 dnl ################################################
317 dnl # Set defines according to variables set above #
318 dnl ################################################
321 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
322 dnl HAVE_ and it is likely to be easier to stick with the old name
323 if test "x$USE_LIBMMX" = xyes; then
324 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
327 if test "x$USE_ATOMIC_H" = xyes; then
328 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
331 dnl test if we have pthread_attr_setstack; if not use the older calls
332 AC_CHECK_LIB(pthread, pthread_attr_setstack,
333 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
334 [Defined if libpthread has pthread_attr_setstack ()]))
336 dnl test if we have posix_memalign; FreeBSD doesn't
337 AC_CHECK_FUNC(posix_memalign,
338 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
339 [Defined if we have posix_memalign ()]))
341 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
342 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
345 if test "x$USE_DEBUG" = xyes; then
346 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
349 if test "x$USE_PROFILING" = xyes; then
350 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
351 FOMIT_FRAME_POINTER=""
353 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
357 dnl AC_SUBST(FOMIT_FRAME_POINTER)
360 dnl #############################
361 dnl # Set automake conditionals #
362 dnl #############################
364 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
365 dnl HAVE_ and it is likely to be easier to stick with the old name
366 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
368 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
369 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
371 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
374 dnl ############################
375 dnl # Set up some more defines #
376 dnl ############################
378 dnl Set location of registry dir.
379 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
380 AC_SUBST(GST_CACHE_DIR)
382 dnl Set location of plugin directory
383 if test "x${prefix}" = "xNONE"; then
384 PLUGINS_DIR=${ac_default_prefix}/lib/gstreamer-$GST_MAJORMINOR
386 PLUGINS_DIR=${prefix}/lib/gstreamer-$GST_MAJORMINOR
388 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
389 AC_SUBST(PLUGINS_DIR)
391 dnl Set location of uninstalled plugin directory
392 PLUGINS_BUILDDIR=`pwd`
393 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
394 AC_SUBST(PLUGINS_BUILDDIR)
396 dnl since glib and xml are package deps, there's no need to include their cflags
397 dnl in the pkg-config file
400 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
401 GST_PKG_LIBS=$GST_EXT_LIBS
402 AC_SUBST(GST_PKG_CFLAGS)
403 AC_SUBST(GST_PKG_LIBS)
405 dnl finalize _CFLAGS and _LIBS
406 dnl add GLIB and XML if necessary to EXT_*
407 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
408 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
410 dnl Private vars for libgst only
411 LIBGST_LIBS="$GST_LIBS"
412 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
413 AC_SUBST(LIBGST_LIBS)
414 AC_SUBST(LIBGST_CFLAGS)
416 dnl Vars for everyone else
417 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
418 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
420 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
421 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
423 GST_PLUGIN_LDFLAGS='-module -avoid-version'
424 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
426 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
428 dnl ##################################################
429 dnl # deps for examples from manual #
430 dnl ##################################################
432 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
433 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
434 AC_SUBST(LIBGNOMEUI_CFLAGS)
435 AC_SUBST(LIBGNOMEUI_LIBS)
436 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
438 dnl ##################################################
439 dnl # Prepare informative messages to display at end #
440 dnl ##################################################
444 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
445 infomessages="$infomessages
446 *** Warning: You have configured using the --enable-plugin-builddir option.
448 This option is for development purposes only: binaries built with
449 it should be used with code in the build tree only. To build an
450 installable version, use ./configure without the --enable-plugin-builddir
451 option. Note that the autogen.sh script supplies the plugin builddir
452 option automatically -- run ./autogen.sh -- --disable-plugin-builddir to make
453 an installable build.
458 dnl #########################
459 dnl # Make the output files #
460 dnl #########################
462 dnl libs/ext/Makefile
463 dnl nothing there yet !
469 gst/autoplug/Makefile
470 gst/indexers/Makefile
471 gst/elements/Makefile
473 gst/schedulers/Makefile
475 gst/registries/Makefile
478 libs/gst/bytestream/Makefile
479 libs/gst/getbits/Makefile
480 libs/gst/putbits/Makefile
481 libs/gst/control/Makefile
484 tests/bufspeed/Makefile
485 tests/memchunk/Makefile
486 tests/muxing/Makefile
487 tests/seeking/Makefile
489 tests/threadstate/Makefile
491 testsuite/bytestream/Makefile
492 testsuite/caps/Makefile
493 testsuite/cleanup/Makefile
494 testsuite/clock/Makefile
495 testsuite/dynparams/Makefile
496 testsuite/elements/Makefile
497 testsuite/indexers/Makefile
498 testsuite/plugin/Makefile
499 testsuite/refcounting/Makefile
500 testsuite/threads/Makefile
502 examples/autoplug/Makefile
503 examples/cutter/Makefile
504 examples/helloworld/Makefile
505 examples/helloworld2/Makefile
506 examples/launch/Makefile
507 examples/manual/Makefile
508 examples/mixer/Makefile
509 examples/pingpong/Makefile
510 examples/plugins/Makefile
511 examples/queue/Makefile
512 examples/queue2/Makefile
513 examples/queue3/Makefile
514 examples/queue4/Makefile
515 examples/thread/Makefile
516 examples/typefind/Makefile
517 examples/xml/Makefile
520 docs/devhelp/Makefile
523 docs/gst/gstreamer.types
527 docs/plugins/Makefile
528 docs/plugins/gstreamer-plugins.types
532 gstreamer-uninstalled.pc
534 echo "$infomessages", infomessages="$infomessages"