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, 4, 2, 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)
10 AS_LIBTOOL(GST, 0, 0, 0, yes)
12 AC_CONFIG_SRCDIR([gst/gst.c])
13 AM_CONFIG_HEADER(config.h)
15 dnl Add parameters for aclocal
16 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
17 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
25 dnl We disable static building for development, for time savings
26 dnl *NOTE*: dnl this line before release, so release does static too
32 dnl ##############################
33 dnl # Do automated configuration #
34 dnl ##############################
39 dnl allow for different autotools
40 AS_AUTOTOOLS_ALTERNATE()
42 dnl modify pkg-config path
43 AC_ARG_WITH(pkg-config-path,
44 AC_HELP_STRING([--with-pkg-config-path],
45 [colon-separated list of pkg-config(1) dirs]),
46 [export PKG_CONFIG_PATH=${withval}])
51 dnl we require bison for building of some of the marshal files
52 dnl FIXME: check if AC_PROG_YACC is suitable here
53 AC_PATH_PROG(BISON_PATH, bison, no)
54 if test x$BISON_PATH = xno; then
55 AC_MSG_ERROR(Could not find bison)
58 dnl we require flex for building the parser
59 dnl FIXME: check if AC_PROG_LEX is suitable here
60 AC_PATH_PROG(FLEX_PATH, flex, no)
61 if test x$FLEX_PATH = xno; then
62 AC_MSG_ERROR(Could not find flex)
66 dnl We should really use AC_SYS_LARGEFILE, but the problem is
67 dnl many of the plugins don't include "config.h". To assure
68 dnl binary compatibility, it is necessary that all gstreamer
69 dnl code be compiled with the same sizeof(off_t), so we use
70 dnl the following crude hack.
74 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
76 dnl this is so we can make GST_CFLAGS for external modules available
77 dnl without mixing in internal (uninstalled) CFLAGS
80 AC_MSG_CHECKING(for large file support)
82 #define _LARGEFILE_SOURCE
83 #define _FILE_OFFSET_BITS 64
84 #include <sys/types.h>
85 int main () { return !(sizeof(off_t) == 8); }
89 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
98 dnl Check for essential libraries first:
99 dnl ====================================
102 dnl Minimum required version of GLib2
103 dnl required for compilation without warnings
108 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
109 HAVE_GLIB2=yes,HAVE_GLIB2=no)
110 GLIB_LIBS=$GLIB2_LIBS
111 GLIB_CFLAGS=$GLIB2_CFLAGS
113 AC_SUBST(GLIB_CFLAGS)
115 if test "x$HAVE_GLIB2" = "xno"; then
116 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
119 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
120 AC_SUBST(GST_PKG_DEPS)
123 dnl Minimum required version of libxml2
125 AC_SUBST(LIBXML2_REQ)
127 dnl check for libxml2
131 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
132 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
133 download the latest version from
134 ftp://people.redhat.com/sopwith/popt/])
136 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
141 #ifndef POPT_TABLEEND
149 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
150 download the latest version from
151 ftp://people.redhat.com/sopwith/popt/])
154 dnl Check for atomic.h
155 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
156 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
157 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
158 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
159 if test x$HAVE_ATOMIC_H = xyes; then
161 #include "asm/atomic.h"
162 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
165 if test x$HAVE_ATOMIC_H = xyes; then
166 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
172 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
176 dnl ######################################################################
177 dnl # Check command line parameters, and set shell variables accordingly #
178 dnl ######################################################################
180 dnl FIXME: simplify all this down using a few m4 macros
182 AC_ARG_ENABLE(libmmx,
183 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
184 [case "${enableval}" in
185 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
187 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
189 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
191 AC_ARG_ENABLE(atomic,
192 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
193 [case "${enableval}" in
194 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
195 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
196 no) USE_ATOMIC_H=no;;
197 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
199 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
201 AC_ARG_ENABLE(plugin-builddir,
202 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
203 [case "${enableval}" in
204 yes) PLUGINS_USE_BUILDDIR=yes ;;
205 no) PLUGINS_USE_BUILDDIR=no ;;
206 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
208 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
212 AC_ARG_ENABLE(profiling,
213 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
214 [case "${enableval}" in
215 yes) USE_PROFILING=yes ;;
216 no) UES_PROFILING=no ;;
217 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
219 [USE_PROFILING=no]) dnl Default value
221 dnl set up a configuration dir
222 GST_CONFIG_DIR=${sysconfdir}/gstreamer
223 AC_ARG_WITH(configdir,
224 AC_HELP_STRING([--with-configdir],[specify path to use for configuration files]),
225 [case "${withval}" in
226 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
227 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
228 *) GST_CONFIG_DIR="${withval}" ;;
230 [:]) dnl Default value
232 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
233 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
236 dnl use a cache dir for storing element registry info.
237 dnl default to building registry in the source tree if we are enabling plugin build dir
238 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
241 dnl ${localstatedir} points to PREFIX/var
242 GST_CACHE_DIR=${localstatedir}/cache/gstreamer
244 AC_ARG_WITH(cachedir,
245 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
246 [case "${withval}" in
247 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
248 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
249 *) GST_CACHE_DIR="${withval}" ;;
251 [:]) dnl Default value
253 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
254 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
257 dnl building of tests
259 AC_HELP_STRING([--disable-tests],[disable building test apps]),
260 [case "${enableval}" in
261 yes) BUILD_TESTS=yes ;;
262 no) BUILD_TESTS=no ;;
263 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
265 [BUILD_TESTS=yes]) dnl Default value
266 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
268 dnl tests known to fail
269 AC_ARG_ENABLE(failing-tests,
270 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
271 [case "${enableval}" in
272 yes) BUILD_FAILING_TESTS=yes ;;
273 no) BUILD_FAILING_TESTS=no ;;
274 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
276 [BUILD_FAILING_TESTS=no]) dnl Default value
277 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
278 if test x$BUILD_FAILING_TESTS = xyes; then
279 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
281 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.])
284 AC_ARG_ENABLE(examples,
285 AC_HELP_STRING([--disable-examples],[disable building examples]),
286 [case "${enableval}" in
287 yes) BUILD_EXAMPLES=yes ;;
288 no) BUILD_EXAMPLES=no ;;
289 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
291 [BUILD_EXAMPLES=yes]) dnl Default value
292 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
294 dnl Next, check for the optional components:
295 dnl ========================================
297 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
298 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
299 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
300 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
301 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
302 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
303 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
304 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
305 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
306 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
307 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
308 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
310 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
312 dnl ################################################
313 dnl # Set defines according to variables set above #
314 dnl ################################################
317 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
318 dnl HAVE_ and it is likely to be easier to stick with the old name
319 if test "x$USE_LIBMMX" = xyes; then
320 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
323 if test "x$USE_ATOMIC_H" = xyes; then
324 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
327 dnl test if we have pthread_attr_setstack; if not use the older calls
328 AC_CHECK_LIB(pthread, pthread_attr_setstack,
329 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
330 [Defined if libpthread has pthread_attr_setstack ()]))
332 dnl test if we have posix_memalign; FreeBSD doesn't
333 AC_CHECK_FUNC(posix_memalign,
334 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
335 [Defined if we have posix_memalign ()]))
337 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
338 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
341 if test "x$USE_DEBUG" = xyes; then
342 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
345 if test "x$USE_PROFILING" = xyes; then
346 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
347 FOMIT_FRAME_POINTER=""
349 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
353 dnl AC_SUBST(FOMIT_FRAME_POINTER)
356 dnl #############################
357 dnl # Set automake conditionals #
358 dnl #############################
360 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
361 dnl HAVE_ and it is likely to be easier to stick with the old name
362 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
364 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
365 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
367 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
370 dnl ############################
371 dnl # Set up some more defines #
372 dnl ############################
374 dnl Set location of configuration dir.
375 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
376 AC_SUBST(GST_CONFIG_DIR)
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/gst
386 PLUGINS_DIR=${prefix}/lib/gst
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.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)
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-buildddir to make
453 an installable build.
458 dnl #########################
459 dnl # Make the output files #
460 dnl #########################
462 dnl libs/ext/Makefile
468 gst/autoplug/Makefile
470 gst/elements/Makefile
472 gst/schedulers/Makefile
474 gst/registries/Makefile
477 libs/gst/bytestream/Makefile
478 libs/gst/getbits/Makefile
479 libs/gst/putbits/Makefile
480 libs/gst/control/Makefile
483 tests/bufspeed/Makefile
484 tests/memchunk/Makefile
485 tests/muxing/Makefile
486 tests/seeking/Makefile
488 tests/threadstate/Makefile
490 testsuite/bytestream/Makefile
491 testsuite/caps/Makefile
492 testsuite/cleanup/Makefile
493 testsuite/clock/Makefile
494 testsuite/dynparams/Makefile
495 testsuite/elements/Makefile
496 testsuite/plugin/Makefile
497 testsuite/refcounting/Makefile
498 testsuite/threads/Makefile
500 examples/autoplug/Makefile
501 examples/cutter/Makefile
502 examples/helloworld/Makefile
503 examples/helloworld2/Makefile
504 examples/launch/Makefile
505 examples/manual/Makefile
506 examples/mixer/Makefile
507 examples/pingpong/Makefile
508 examples/plugins/Makefile
509 examples/queue/Makefile
510 examples/queue2/Makefile
511 examples/queue3/Makefile
512 examples/queue4/Makefile
513 examples/thread/Makefile
514 examples/typefind/Makefile
515 examples/xml/Makefile
518 docs/devhelp/Makefile
519 docs/devhelp/html2xml.py
522 docs/gst/gstreamer.types
526 docs/plugins/Makefile
527 docs/plugins/gstreamer-plugins.types
531 gstreamer-uninstalled.pc
533 echo "$infomessages", infomessages="$infomessages"